1

I have to customize my Apache2 suExec module to ensure some special environment variables getting passed through suExec.

How to download the source code form Debian package apache2-suexec, modify suexec.c -> safe_env_lst, recompile and build a .deb package again to rollout on the production systems?

I tried apt-get source apache2-suexec but didn't found the suexec.c within the occurred apache2-* folder.

The altered source code should be like this:

static const char *const safe_env_lst[] =
{
    /* variable name starts with */
    "HTTP_",
    "SSL_",

    /* NEW: Perl debugging variables */
    "PERL5OPT=",
    "PERL5LIB=",
    "PERLDB_OPTS=",
    "DBGP_IDEKEY=",

    /* NEW: FCGI variables */
    "FCGI=",
    "FCGI_CONNECTION=",
    "FCGI_RUNTIME=",
    "FCGI_STARTTIME=",

draft based on: http://static.askapache.com/httpd/support/suexec.c

burnersk
  • 2,056
  • 5
  • 27
  • 39

1 Answers1

2

I tried apt-get source apache2-suexec but didn't found the suexec.c within the occurred apache2-* folder.

On my Ubuntu 12.04:

# cd apache2-2.2.22/
# find . -name 'suexec.c'
./support/suexec.c
./.pc/045_suexec_log_cloexec/support/suexec.c
./.pc/058_suexec-CVE-2007-1742/support/suexec.c

How to download the source code form Debian package apache2-suexec, modify suexec.c -> safe_env_lst, recompile and build a .deb package again to rollout on the production systems?

# apt-get build-dep apache2-suexec
# apt-get install devscripts
# debuild -i -us -uc -b
# dpkg -i ../apache2-suexec_2.2.22-1ubuntu1_amd64.deb
quanta
  • 51,413
  • 19
  • 159
  • 217
  • thanks, @quanta. I give it a try, but I already searched for the file like you did... strange (maybe spelling error or special char). – burnersk Sep 26 '12 at 07:57