]>
Commit | Line | Data |
---|---|---|
8be5f75a | 1 | --- perl-5.6.0/perl.c.orig Fri Mar 17 23:35:15 2000 |
2 | +++ perl-5.6.0/perl.c Fri Aug 11 18:22:33 2000 | |
3 | @@ -21,6 +21,9 @@ | |
1da7e984 | 4 | #include <unistd.h> |
5 | #endif | |
6 | ||
7 | +#include <syslog.h> | |
8 | +#define I_SYSLOG | |
9 | + | |
10 | #if !defined(STANDARD_C) && !defined(HAS_GETENV_PROTOTYPE) | |
8be5f75a | 11 | char *getenv (char *); /* Usually in <stdlib.h> */ |
1da7e984 | 12 | #endif |
8be5f75a | 13 | @@ -2758,6 +2761,16 @@ |
1da7e984 | 14 | if (tmpstatbuf.st_dev != PL_statbuf.st_dev || |
15 | tmpstatbuf.st_ino != PL_statbuf.st_ino) { | |
16 | (void)PerlIO_close(PL_rsfp); | |
17 | +#ifdef I_SYSLOG | |
18 | + openlog("suidperl", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_AUTHPRIV); | |
19 | + syslog(LOG_ALERT, "User %ld tried to run dev %ld ino %ld in " | |
20 | + "place of dev %ld ino %ld!", PL_uid, | |
21 | + (long)tmpstatbuf.st_dev, (long)tmpstatbuf.st_ino, | |
22 | + (long)PL_statbuf.st_dev, (long)PL_statbuf.st_ino); | |
23 | + syslog(LOG_ALERT, "Filename of setuid script was %s, uid %ld" | |
3c5dede3 | 24 | + " gid %ld.", SvPVX(GvSV(CopFILEGV(PL_curcop))), |
1da7e984 | 25 | + PL_statbuf.st_uid, PL_statbuf.st_gid); |
26 | +#else | |
27 | if (PL_rsfp = PerlProc_popen("/bin/mail root","w")) { /* heh, heh */ | |
28 | PerlIO_printf(PL_rsfp, | |
8be5f75a | 29 | "User %"Uid_t_f" tried to run dev %ld ino %ld in place of dev %ld ino %ld!\n\ |
30 | @@ -2768,6 +2781,7 @@ | |
31 | PL_statbuf.st_uid, PL_statbuf.st_gid); | |
1da7e984 | 32 | (void)PerlProc_pclose(PL_rsfp); |
33 | } | |
34 | +#endif | |
8be5f75a | 35 | Perl_croak(aTHX_ "Permission denied\n"); |
1da7e984 | 36 | } |
37 | if ( |