sudo hangs when run as cgi-bin

Peter Sundling peter at
Sat May 22 18:02:21 EDT 2004


I'm trying to run sudo as a part of a cgi-bin script on a Roxen web 
server. For testing purposes I have written this short script:


/usr/bin/echo "Content-type: text/plain"
/usr/local/bin/sudo /bin/ls
/usr/bin/echo ---------

My sudoers  look like:

Cmnd_Alias      QUOTA = /usr/sbin/quota
Defaults        !requiretty

root    ALL=(ALL) ALL
roxen,peter             ALL = NOPASSWD: /bin/ls

When I run the script from a shell using su to change to the roxen users 
(su roxen -c "./test.cgi") I get the expected result without having to 
enter any password, i e a printout of the content in the current 
directory. But when I try to invoke the script from my browser, sudo 
hangs while executing the ls command:
roxen 12589  2091  0 23:21:41 ?        0:00 /bin/sh /usr/www/qck/test.cgi
root 12592 12589 32 23:21:42 ?        0:21 /usr/local/bin/sudo /bin/ls

The sudo-process hangs around and consumes all available cpu until I 
kill it. After I've killed the sudo-process the script continues 
execution and produces the dotted line as output. I can't find any 
relevant information neither in syslog nor in the web server log.

I run a lot if different cgi-bin applications, ranging from simple shell 
scripts to c-applications, on the roxen server and they have all been 
working fine for as long as I can remember. Can anyone tell me what I'm 
missing in the sudo-case?

Sudo version 1.6.7p5
Roxen 2.2.95
Solaris 8


Peter Sundling
System administrator
Linköping University

More information about the sudo-users mailing list