On Wed, 20 Jul 2005 10:21:57 +0300 Thanos Tsouanas <[EMAIL PROTECTED]> wrote:
> On Wed, Jul 20, 2005 at 12:55:23AM +0200, knitti wrote: > > On 7/20/05, Thanos Tsouanas <[EMAIL PROTECTED]> wrote: > > > I've added > > > User foo > > > on a VirtualHost apache directive, > > > > > > but when I try to exec the cgi script I want, these appear in the error > > > logs: > > > (9)Bad file descriptor: getpwuid: invalid userid 2050 > > > 2050 being the correct userid for the User supplied at the httpd.conf > > > > > > wrapper seems to work: > > > [1:11:[EMAIL PROTECTED] ~> httpd -l | grep su > > > suexec: enabled; valid wrapper /usr/sbin/suexec > > > > > > Why is this userid invalid? Any ideas? I get the feeling I'm missing > > > something obvious here... > > > > do you have a user database inside the chroot? > > I had forgot the .db files, and put them as well, as chaton suggested, > and the "invalid userid" error is now gone. > Actually, I just said it would fix your error but I don't think that it is a good idea to copy these files in the chroot area. At least, you should rebuild a fake user database with blank passwords and remove any account that is not supposed to run CGI scripts from them. As far as suexec is concerned, it requires the uid, gid and username if i recall correctly. see pwd_mkdb(8) > The problem is, > Premature end of script headers > > The script runs fine without the User/Group directives, and also runs > fine if I su to the user and run it by hand. > > Any ideas? > Yup, you should check /var/www/logs/error_log. Usual winners are: - missing perl module within the chroot; - missing c library within the chroot; When it's perl, the name of the module is clearly written in the log file, when it's c, you'll have to figure out by yourself the dependencies using ldd. see ldd(1)

