[svlug] apache file permission wierdness

Tim Pepper tpepper at vato.org
Thu Mar 15 19:32:02 PST 2001


I'm having some trouble with apache (running as nobody user and group)
when it comes to executing some cgi scripts and I'm really stumped as to why
this would be.  I'd really appreciate if anybody might have some insight as to
what is happening...

It's a bit convoluted scenario.

My user is in the group foogroup.  I (tpepper) own a file test.cgi whose
ownership is tpepper.foogroup and permissions 750.  The nobody account has
been added to foogroup under the expectation that it gain access to run the
file via the group permission.  This does not work though...the script is not
executed.

The web server is able to execute scripts...same file same directory with
tpepper.tpepper ownership and mode o+rx set executes as expected.  A simple
perl script outputting $< $> $( and $) shows that when the web server runs the
script:

	uid = nobody
	euid = nobody
	gid = nobody foogroup nobody
	egid = nobody foogroup nobody

The strange thing for me is that the script CAN be made to execute with the
desired user and group ownership and mode 751 instead of 751.  That is: iff
and only if all three g+rx and o+x bits are set.  Mode 705 will not run...

Toggling though the three bits I see the following errors in the log/browser

741:
	(13)Permission denied: exec of /home/tpepper/www/test.cgi failed
	Premature end of script headers: /home/tpepper/www/test.cgi

	(yields "Internal Server Error" in browser)

751:
	runs fine

750:
	file permissions deny server execution: /home/tpepper/www/test.cgi

	(yields "Forbidden" in browser)

754:
	file permissions deny server execution: /home/tpepper/www/test.cgi

	(yields "Forbidden" in browser)

714:
	file permissions deny server execution: /home/tpepper/www/test.cgi

	(yields "Forbidden" in browser)

715:
	Can't open perl script "/home/tpepper/www/test.cgi": Permission denied
	Premature end of script headers: /home/tpepper/www/test.cgi

	(yields "Internal Server Error" in browser)

705:
	(13)Permission denied: exec of /home/tpepper/www/test.cgi failed
	Premature end of script headers: /home/tpepper/www/test.cgi

	(yields "Internal Server Error" in browser)

745:
	(13)Permission denied: exec of /home/tpepper/www/test.cgi failed
	Premature end of script headers: /home/tpepper/www/test.cgi

	(yields "Internal Server Error" in browser)

755:
	runs fine



Does anybody on the list know anything about how apache determines if it has
sufficient permissions to execute a script or why this might be happening?

I'm stumped.

Tim

--
*********************************************************
*  tpepper at vato dot org             * Venimus, Vidimus, *
*  http://www.vato.org/~tpepper     * Dolavimus         *
*********************************************************





More information about the svlug mailing list