diff -urN perl-5.6.1.orig/perl.c perl-5.6.1/perl.c --- perl-5.6.1.orig/perl.c Thu Mar 22 06:05:02 2001 +++ perl-5.6.1/perl.c Thu Apr 12 20:52:12 2001 @@ -21,6 +21,9 @@ #include #endif +#include +#define I_SYSLOG + #if !defined(STANDARD_C) && !defined(HAS_GETENV_PROTOTYPE) char *getenv (char *); /* Usually in */ #endif @@ -2880,6 +2883,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); +#endif Perl_croak(aTHX_ "Permission denied\n"); } if (