View Single Post

  #1 (permalink)  
Old 01-13-2004
Sean Hamilton
 
Posts: n/a
Default Running setuid CGI scripts with Apache

Hello,

I'm not running suexec, nor do I care to. I have a suid script which is
owned by a user other than the one Apache is running as. When I run this
from the shell, all is well. When I run it from Apache, it runs as the same
user as Apache. Binaries do not exhibit this problem, only scripts.

My first thought was that Apache was reading the hash-bang line and running
that program with the script as an argument, thereby using the permissions
of that binary instead of the script. I sure hope this isn't the case, as
that would be rather silly. I read through much of the relevant source and
didn't see any indications of this, but the large amount of abstraction
makes the code difficult to follow.

So, without using suidperl, and without using a binary wrapper, what's going
on here, and how do I fix it? I'm running Apache 2.0.48 on FreeBSD
5.1-RELEASE.

--
Sean Hamilton <sh@bel.bc.ca>