Web Hosting Talk







View Full Version : /etc/group & suexec


DuncanMcLord
09-17-2002, 03:19 PM
Hi,

a script recently messed up my /etc/group file and since then all my cgi scripts stopped working. (oh, i forgot to add, that i restored the file after the incident!)
I always end up with the following error messages in apache's error_log

[Tue Sep 17 19:18:58 2002] [error] [client xxx.xxx.xxx.xxx] (2)No such file or directory: getgrgid: invalid groupid 2299
[Tue Sep 17 19:18:58 2002] [error] (2)No such file or directory: exec of /home/myaccount/public_html/cgi-bin/myscript.cgi failed
[Tue Sep 17 19:18:58 2002] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: /home/myaccount/public_html/cgi-bin/myscript.cgi


The first error seems to indicate, that the groupid 2299 doesn't exist, but in /etc/group it says
myaccount:x:2299:myaccount
...same in the other relevant files.
I even wrote a tiny perl script, which uses the "getgrgid" function and it came up with the right UID, GID & resolved name from GID with getgrgid function.
So, this is a rather weird problem, since everything seems to be fine, but apache still keeps on showing up with the above error messages for any script i try to run.

I am lost here, so any help is more than welcome!
Thanks.

DuncanMcLord
09-17-2002, 04:13 PM
Ok,

i just disabled suExec and now the cgi scripts are running fine again, but as soon as i enable it again, apache comes up with the above errors.
How can suExec think, that the GIDs don't exist, although they do?
Any other tool, based on bash, perl, php, ... says that the GIDs are ok, but suExec complains.
...weird!

So, this is a workaround, but i am still lost why suExec produces those errors. :confused:

Shyne
09-17-2002, 04:28 PM
What does your suexec_log say when you get the error? The error you provided doesn't seem to be from a suexec_log file.

DuncanMcLord
09-17-2002, 05:27 PM
Thats also a weird thing, since according to suexec_log, the scripts were executed just fine and it also shows the right UID&GUID in every line.
...as i said, i am completely lost here :confused: