--- perl-5.6.0/perl.c.orig Fri Mar 17 23:35:15 2000 +++ perl-5.6.0/perl.c Fri Aug 11 18:22:33 2000 @@ -21,6 +21,9 @@ #include #endif +#include +#define I_SYSLOG + #if !defined(STANDARD_C) && !defined(HAS_GETENV_PROTOTYPE) char *getenv (char *); /* Usually in */ #endif @@ -2758,6 +2761,16 @@ if (tmpstatbuf.st_dev != PL_statbuf.st_dev || tmpstatbuf.st_ino != PL_statbuf.st_ino) { (void)PerlIO_close(PL_rsfp); +#ifdef I_SYSLOG + openlog("suidperl", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_AUTHPRIV); + syslog(LOG_ALERT, "User %ld tried to run dev %ld ino %ld in " + "place of dev %ld ino %ld!", PL_uid, + (long)tmpstatbuf.st_dev, (long)tmpstatbuf.st_ino, + (long)PL_statbuf.st_dev, (long)PL_statbuf.st_ino); + syslog(LOG_ALERT, "Filename of setuid script was %s, uid %ld" + " gid %ld.", SvPVX(GvSV(CopFILEGV(PL_curcop))), + PL_statbuf.st_uid, PL_statbuf.st_gid); +#else if (PL_rsfp = PerlProc_popen("/bin/mail root","w")) { /* heh, heh */ PerlIO_printf(PL_rsfp, "User %"Uid_t_f" tried to run dev %ld ino %ld in place of dev %ld ino %ld!\n\ @@ -2768,6 +2781,7 @@ PL_statbuf.st_uid, PL_statbuf.st_gid); (void)PerlProc_pclose(PL_rsfp); } +#endif Perl_croak(aTHX_ "Permission denied\n"); } if (