Apache HTTPd SuExec Symlink Patch for Apache 1.3.41 This patch stops SuExec doing permission checks to symlinked files. BE AWARE: This patch violate the basic security model of SuExec! Apply it only if you know what you are doing! Mike Mueller ==================================================================================== diff -u src/support/suexec.c.orig src/support/suexec.c --- src/support/suexec.c.orig 2009-10-04 18:51:45.000000000 +0200 +++ src/support/suexec.c 2009-10-04 18:51:03.000000000 +0200 @@ -516,7 +516,7 @@ /* * Error out if we cannot stat the program. */ - if (((lstat(cmd, &prg_info)) != 0) || (S_ISLNK(prg_info.st_mode))) { + if (((lstat(cmd, &prg_info)) != 0)) { log_err("error: cannot stat program: (%s)\n", cmd); exit(117); } @@ -524,7 +524,7 @@ /* * Error out if the program is writable by others. */ - if ((prg_info.st_mode & S_IWOTH) || (prg_info.st_mode & S_IWGRP)) { + if (((prg_info.st_mode & S_IWOTH) || (prg_info.st_mode & S_IWGRP)) && !(S_ISLNK(prg_info.st_mode))) { log_err("error: file is writable by others: (%s/%s)\n", cwd, cmd); exit(118); }