]>
Commit | Line | Data |
---|---|---|
1 | diff -urN perl-5.6.1.orig/perl.c perl-5.6.1/perl.c | |
2 | --- perl-5.6.1.orig/perl.c Thu Mar 22 06:05:02 2001 | |
3 | +++ perl-5.6.1/perl.c Thu Apr 12 20:52:12 2001 | |
4 | @@ -21,6 +21,9 @@ | |
5 | #include <unistd.h> | |
6 | #endif | |
7 | ||
8 | +#include <syslog.h> | |
9 | +#define I_SYSLOG | |
10 | + | |
11 | #if !defined(STANDARD_C) && !defined(HAS_GETENV_PROTOTYPE) | |
12 | char *getenv (char *); /* Usually in <stdlib.h> */ | |
13 | #endif | |
14 | @@ -2880,6 +2883,16 @@ | |
15 | if (tmpstatbuf.st_dev != PL_statbuf.st_dev || | |
16 | tmpstatbuf.st_ino != PL_statbuf.st_ino) { | |
17 | (void)PerlIO_close(PL_rsfp); | |
18 | +#ifdef I_SYSLOG | |
19 | + openlog("suidperl", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_AUTHPRIV); | |
20 | + syslog(LOG_ALERT, "User %ld tried to run dev %ld ino %ld in " | |
21 | + "place of dev %ld ino %ld!", PL_uid, | |
22 | + (long)tmpstatbuf.st_dev, (long)tmpstatbuf.st_ino, | |
23 | + (long)PL_statbuf.st_dev, (long)PL_statbuf.st_ino); | |
24 | + syslog(LOG_ALERT, "Filename of setuid script was %s, uid %ld" | |
25 | + " gid %ld.", SvPVX(GvSV(CopFILEGV(PL_curcop))), | |
26 | + PL_statbuf.st_uid, PL_statbuf.st_gid); | |
27 | +#endif | |
28 | Perl_croak(aTHX_ "Permission denied\n"); | |
29 | } | |
30 | if ( |