Re: Problem with exec, shell_exec

From: Date: Fri, 18 May 2001 13:42:06 +0000
Subject: Re: Problem with exec, shell_exec
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53407@lists.php.net to get a copy of this message
Have located ( I think ) the problem. I have been calling 'super' from the php script and when I call 'cadduser' it works perfect but when I call 'caddvsite' I get an 'Unable to setgid=0' error. Any idea why this would happen? Both executables are owned by root.root and permission of both are set to 4700. the exec() call uses the 'sh' shell on both script calls. The only differance is that one works and the other doesn't. Any ideas? Thanks, Chuck ----- Original Message ----- From: "Charles Williams (CEO)" <hosting.mailing.list.account@acnshosting.com> To: "Php-General (E-mail)" <php-general@lists.php.net> Sent: Friday, May 18, 2001 2:38 PM Subject: [PHP] Problem with exec, shell_exec > below you'll see a bit of code that is not working for me. I have tried > exec, shell_exec, passthru, system. nothing works. If I copy the echoed > copy of the command and paste it in an SSH session it works 100%. all of > the exec, and such use the 'sh' shell. So I changed to that shell to verfy > that it is working and it still works great in SSH but only halfway in the > script. The command will create the needed directories but then it quits. > It doesn't finish the job. > > $pass_string = "caddvsite -i ".$IP." -n www -d ".$domain; > if($email=="y")$pass_string .= " -e"; > if($web=="y")$pass_string .= " -w"; > $pass_string .= " -q ".$Quota." -u ".$Users; > if($cgi=="y")$pass_string .= " -c"; > if($ssi=="y")$pass_string .= " -s"; > if($frontp=="y")$pass_string .= " -x"; > if($ssl=="y")$pass_string .= " -l"; > if($apop=="y")$pass_string .= " -o"; > if($ftp=="y")$pass_string .= " -f"; > if($telnet=="y")$pass_string .= " -t"; > # $pass_string .= " &"; > echo"$pass_string"; > # system("touch /forbidden 2>&1"); > # printf("%s",system($pass_string)); > exec( EscapeShellArg($pass_string) ); > > Any ideas appreciated. > > chuck > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#53407) next »