]>
Commit | Line | Data |
---|---|---|
1da7e984 | 1 | --- perl/perl.c.syslog Sat Mar 27 12:49:17 1999 |
2 | +++ perl/perl.c Mon Aug 7 11:01:24 2000 | |
3 | @@ -20,6 +20,9 @@ | |
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) | |
11 | char *getenv _((char *)); /* Usually in <stdlib.h> */ | |
12 | #endif | |
13 | @@ -2220,6 +2223,16 @@ | |
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" | |
24 | + " gid %ld.", SvPVX(GvSV(PL_curcop->cop_filegv)), | |
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, | |
29 | "User %ld tried to run dev %ld ino %ld in place of dev %ld ino %ld!\n\ | |
30 | @@ -2230,6 +2243,7 @@ | |
31 | (long)PL_statbuf.st_uid, (long)PL_statbuf.st_gid); | |
32 | (void)PerlProc_pclose(PL_rsfp); | |
33 | } | |
34 | +#endif | |
35 | croak("Permission denied\n"); | |
36 | } | |
37 | if ( |