Re: [Speedycgi-users] speedy and setuid scripts
Brought to you by:
samh
|
From: Sam H. <sa...@da...> - 2002-07-09 20:08:05
|
> On Tue, Jul 09, 2002 at 11:53:52AM +0200, Lars Uffmann wrote:
> > Thanx Sam, i got the suid working. Unhappily the qmail-queue wrapper
> > won't work out of the box. I will try to debug this further. Could it be
> > a problem that the qmail-queue wrapper dup's STDOUT (fd 1) and open it
> > for reading?
If it's trying to read from stdout that won't work. Speedycgi currently only
supports output from stdout, not input to stdout.
> Ok, here a some more details. All test are made on linux 2.4. I first
> tried 2.20pre2, compiled with -DIAMSUID. Aparently, pre2 doesn't work at
> all, suid or not. Are there any known problems with pre2 on linux? The
> calling process blocks on writing to the speedy_frontend.
Pre2 passes "make test" on my linux system, and I'm using it for some of
my cgi's. Also, there wasn't much changed in the frontend between pre1 and
pre2. But it is a pre-release, meaning it needs testing before the real
release.
Does it pass "make test" for you? Is there something I could run to
reproduce the problem? If there is a problem with pre2 I need
to fix it before the 2.20 release.
> I then tried 2.20pre1 which does work. Setuid works too. I then came to
> the problem i suspected in my first posting: The following code does not
> work, the while(<SOUT>) loop is never reached, but neither the open() nor
> the close() fail.
>
> >>>
> sub grab_envelope_hdrs {
> select(STDOUT); $|=1;
> open(SOUT,"<&STDOUT")||&tempfail("cannot dup fd 0 - $!");
> while (<SOUT>) {
> [...]
> }
> close(SOUT)||&tempfail("cannot close fd 1 - $!");
> <<<
I'm guessing the <SOUT> statement is coming back with an error immediately,
since the STDOUT socket has been shutdown for writes.
If you want to be able to read from stdout, you'll probably need
file-descriptor passing. That is not in the current speedycgi code - it'll
probably be coming in the next release after 2.20.
PPerl supposedly does file-descriptor passing in the current release.
I've never used it so I have no idea how well it would work. Or if
you want to try grafting file-descriptor passing into the speedycgi code,
I'll incorporate your changes as best I can.
> regards,
> --
> Lars Uffmann, <lar...@me...>, fon: +49 5246 80 1330
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Stuff, things, and much much more.
> http://thinkgeek.com/sf
> _______________________________________________
> Speedycgi-users mailing list
> Spe...@li...
> https://lists.sourceforge.net/lists/listinfo/speedycgi-users
|