Re: How to run a cgi-script?

2004-07-02 Thread Charles M. Gerungan
Hello Michiel,

On Fri, 2 Jul 2004 10:35:02 +0200 (CEST) UTC, Michiel Boland wrote:

>> Why doesn't RunScriptsAsOwner works? What do I do with setuid scripts?

MB> As far as I know mathopd ignores the setuid bit, unless perhaps the
MB> script is a pure executable CGI program.

I have qmailadmin working fine, but that's an executable CGI program.
Haven't tested a CGI script with the setuid bit set.

Thanks.

-- 
Regards, Charles.



Re: How to run a cgi-script?

2004-07-02 Thread Charles M. Gerungan
Hello Juergen,

On Fri, 2 Jul 2004 08:50:39 +0200 UTC, Juergen Daubert wrote:

JD> Keyword: ScriptUser
JD>...
JD>The user specified by ScriptUser must be someone else than the
JD>'global' user, i.e. the user specified by the User keyword.

Oops :S. It's working fine now.

-- 
Regards, Charles.



Re: How to run a cgi-script?

2004-07-02 Thread Michiel Boland
> Why doesn't RunScriptsAsOwner works? What do I do with setuid scripts?

RunScriptsAsOwner should work, as long as the user IDs of the script's
owner and the server process are different. Setuid scripts are an
apache-hack I believe. As far as I know mathopd ignores the setuid bit,
unless perhaps the script is a pure executable CGI program.

Cheers
Michiel



Re: How to run a cgi-script?

2004-07-02 Thread Charles M. Gerungan
Juergen Daubert wrote:
GLOBAL:
User www
StayRoot On
Server::Virtual::Control {
 Alias cgi-bin
 Location /path/to/cgi-bin
 ScriptUser www
 Specials {
   CGI { * }
 }
}

Quote from config.txt:
Keyword: ScriptUser
   ...
   The user specified by ScriptUser must be someone else than the
   'global' user, i.e. the user specified by the User keyword.
Why doesn't RunScriptsAsOwner works? What do I do with setuid scripts?

--
Regards, Charles.


Re: How to run a cgi-script?

2004-07-02 Thread Juergen Daubert
On Fri, Jul 02, 2004 at 02:05:25AM +0200, Charles M. Gerungan wrote:
> I keep getting 500 errors.
> 
> mathopd is running under daemontools.
> 
> In mathopd.conf, I have:
> 
> GLOBAL:
> User www
> StayRoot On
> 
> Server::Virtual::Control {
>   Alias cgi-bin
>   Location /path/to/cgi-bin
>   ScriptUser www
>   Specials {
> CGI { * }
>   }
> }

Quote from config.txt:

Keyword: ScriptUser
   ...
   The user specified by ScriptUser must be someone else than the
   'global' user, i.e. the user specified by the User keyword.
  
Greetings
Juergen


-- 
[EMAIL PROTECTED]


How to run a cgi-script?

2004-07-01 Thread Charles M. Gerungan
I keep getting 500 errors.

mathopd is running under daemontools.

In mathopd.conf, I have:

GLOBAL:
User www
StayRoot On

Server::Virtual::Control {
  Alias cgi-bin
  Location /path/to/cgi-bin
  ScriptUser www
  Specials {
CGI { * }
  }
}

I'm trying to execute /cgi-bin/test.cgi (from apache dist - test-cgi)
which contains:

#!/bin/sh

# disable filename globbing
set -f

echo Content-type: text/plain
echo

echo CGI/1.0 test script report:
echo

echo argc is $#. argv is "$*".
echo

echo SERVER_SOFTWARE = $SERVER_SOFTWARE
[ more vars ]

# ll test.cgi
-rwxr-xr-x  1 www  www  - 757 Jul  2 01:41 test.cgi*

Here's the log:

2004-07-02 01:51:04.791306500 Fri Jul  2 01:51:04 2004 [55519] *** Mathopd/1.5p3 
starting
2004-07-02 01:51:04.792631500 Fri Jul  2 01:51:04 2004 [55519] NumConnections=64 
nfiles=7293
2004-07-02 01:51:18.168369500 Fri Jul  2 01:51:18 2004 [55519] cannot run scripts 
withouth changing identity
2004-07-02 01:51:18.168983500 500 www.mydomain.com - 11.22.33.44 10197 GET 
/cgi-bin/test.cgi - browser string

I've tried:

 * Setting the ownership of the file to root:wheel
 * Setting a ScriptUser www in Server::Virtual::Control

What am I missing?

-- 
Regards, Charles.