From 3c85fe0c7ca6ddaa15cdfbf0d0db27ae0dd9f739 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 19 Dec 2020 12:15:11 -0800 Subject: [PATCH] Use absolute path to the su command, if we have it --- web-lib-funcs.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 580073db8..6aa6e3aa4 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -10099,7 +10099,8 @@ if ($uinfo[8] ne "/bin/sh" && $uinfo[8] !~ /\/bash$/ && $env < 2) { $shellarg = " -m"; } } -my $rv = "su".($env == 1 || $env == 3 ? " -" : "").$shellarg. +my $su = &has_command("su") || "su"; +my $rv = $su.($env == 1 || $env == 3 ? " -" : "").$shellarg. " ".quotemeta($user)." -c ".quotemeta(join(" ", @args)); return $rv; }