]> git.pld-linux.org Git - packages/perl.git/blob - perl-syslog.patch
- fix: make possible compilation with threads
[packages/perl.git] / perl-syslog.patch
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 @@
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 @@ -2758,6 +2761,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(CopFILEGV(PL_curcop))),
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 %"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);
32                     (void)PerlProc_pclose(PL_rsfp);
33                 }
34 +#endif
35                 Perl_croak(aTHX_ "Permission denied\n");
36             }
37             if (
This page took 0.038168 seconds and 4 git commands to generate.