mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: check root privilege for log commands
This commit is contained in:
committed by
Cuong Manh Le
parent
4df470b869
commit
e9e63b0983
@@ -37,6 +37,9 @@ func initLogCmd() *cobra.Command {
|
||||
Use: "send",
|
||||
Short: "Send runtime debug logs to ControlD",
|
||||
Args: cobra.NoArgs,
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
checkHasElevatedPrivilege()
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
dir, err := socketDir()
|
||||
if err != nil {
|
||||
@@ -74,6 +77,9 @@ func initLogCmd() *cobra.Command {
|
||||
Use: "view",
|
||||
Short: "View current runtime debug logs",
|
||||
Args: cobra.NoArgs,
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
checkHasElevatedPrivilege()
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
dir, err := socketDir()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user