Skip to content

Commit

Permalink
exec: Require root privileges, address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
grembo committed Jul 24, 2022
1 parent 1514ca8 commit 4dce9a3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions share/pot/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ _exec_cmd()
local _pname _detach _env _alloc_pty _user_host _user_pot
local _cmd

_pname=$1; shift
_detach=$1; shift
_env=$1; shift
_alloc_pty=$1; shift
_user_host=$1; shift
_user_pot=$1; shift
_pname=$1
_detach=$2
_env=$3
_alloc_pty=$4
_user_host=$5
_user_pot=$6
shift 6 # $@ contains command/args now

_debug "Exec in $_pname, cmd: $*"

Expand Down Expand Up @@ -145,6 +146,10 @@ pot-exec()
${EXIT} 1
fi

if ! _is_uid0 ; then
${EXIT} 1
fi

_exec_cmd "$_pname" "$_detach" "$_env" \
"$_alloc_pty" "$_user_host" "$_user_pot" "$@"
}

0 comments on commit 4dce9a3

Please # to comment.