fix: fix can't run it as expected in freebsd (#5595)

In freebsd, su -c expects a login class argument instead of a command, if -c is preceded by a username, then -c and the arguments that follow will be passed as shell arguments
This commit is contained in:
unknowndevQwQ authored and GitHub committed 2022-09-28 21:06:24 +00:00
1 parent acdbefb986
commit b6aeb4bfab
1 file changed
+1 -1
+1 -1
View File
@@ -556,7 +556,7 @@ sudo_sh_c() {
elif command_exists sudo; then
sh_c "sudo $*"
elif command_exists su; then
sh_c "su - -c '$*'"
sh_c "su root -c '$*'"
else
echoh
echoerr "This script needs to run the following command as root."