Skip to content

Commit

Permalink
install_easy: do not use privileged /proc/1/exe
Browse files Browse the repository at this point in the history
  • Loading branch information
bol-van committed Nov 24, 2021
1 parent 980c05f commit 473a2c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion install_easy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ check_system()

local UNAME=$(uname)
if [ "$UNAME" = "Linux" ]; then
local INIT="$(basename $(readlink /proc/1/exe))"
# do not use 'exe' because it requires root
local INIT="$(basename $(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1))"
# some distros include systemctl without systemd
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
SYSTEM=systemd
Expand Down
3 changes: 2 additions & 1 deletion uninstall_easy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ check_system()

local UNAME=$(uname)
if [ "$UNAME" = "Linux" ]; then
local INIT="$(basename $(readlink /proc/1/exe))"
# do not use 'exe' because it requires root
local INIT="$(basename $(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1))"
# some distros include systemctl without systemd
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
SYSTEM=systemd
Expand Down

0 comments on commit 473a2c5

Please sign in to comment.