diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-02-15 16:30:09 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-02-15 16:30:09 +0000 |
| commit | e336171dc166407ee462e267cf3c40b1cc05b8d5 (patch) | |
| tree | f6f9a4fe6c0444343c3bdcaa1b945194d7d08a23 /gnu | |
| parent | 1140eaf3331515400e81bfb22c2dfc2913ec5d9f (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/perl/perl/doio.c | 22 | ||||
| -rw-r--r-- | gnu/usr.bin/perl/perl/eval.c | 13 | ||||
| -rw-r--r-- | gnu/usr.bin/perl/perl/perl.c | 18 | ||||
| -rw-r--r-- | gnu/usr.bin/perl/perl/perl.h | 7 | ||||
| -rw-r--r-- | gnu/usr.bin/perl/perl/tdoio.c | 23 |
5 files changed, 74 insertions, 9 deletions
diff --git a/gnu/usr.bin/perl/perl/doio.c b/gnu/usr.bin/perl/perl/doio.c index 9c0731f6099f..0ace3773f9dd 100644 --- a/gnu/usr.bin/perl/perl/doio.c +++ b/gnu/usr.bin/perl/perl/doio.c @@ -1,4 +1,4 @@ -/* $RCSfile: doio.c,v $$Revision: 1.2 $$Date: 1994/09/11 03:17:32 $ +/* $RCSfile: doio.c,v $$Revision: 1.3 $$Date: 1995/05/30 05:03:00 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: doio.c,v $ + * Revision 1.3 1995/05/30 05:03:00 rgrimes + * Remove trailing whitespace. + * * Revision 1.2 1994/09/11 03:17:32 gclarkii * Changed AF_LOCAL to AF_LOCAL_XX so as not to conflict with 4.4 socket.h * Added casts to shutup warnings in doio.c @@ -1221,8 +1224,25 @@ STR *str; len = stio->ifp->_cnt + (stio->ifp->_ptr - stio->ifp->_base); s = stio->ifp->_base; #else +#if (defined(BSD) && (BSD >= 199103)) + fstat(fileno(stio->ifp),&statcache); + if (S_ISDIR(statcache.st_mode)) /* handle NFS glitch */ + return arg->arg_type == O_FTTEXT ? &str_no : &str_yes; + + if (stio->ifp->_bf._size <= 0) { + i = getc(stio->ifp); + if (i != EOF) + (void)ungetc(i,stio->ifp); + } + + if (stio->ifp->_bf._size <= 0) + return &str_yes; + len = stio->ifp->_bf._size+(stio->ifp->_p - stio->ifp->_bf._base); + s = stio->ifp->_bf._base; +#else fatal("-T and -B not implemented on filehandles"); #endif +#endif } else { if (dowarn) diff --git a/gnu/usr.bin/perl/perl/eval.c b/gnu/usr.bin/perl/perl/eval.c index 40155f5549fc..fcb5403eebce 100644 --- a/gnu/usr.bin/perl/perl/eval.c +++ b/gnu/usr.bin/perl/perl/eval.c @@ -1,4 +1,4 @@ -/* $RCSfile: eval.c,v $$Revision: 1.1.1.1 $$Date: 1994/09/10 06:27:32 $ +/* $RCSfile: eval.c,v $$Revision: 1.2 $$Date: 1995/05/30 05:03:03 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: eval.c,v $ + * Revision 1.2 1995/05/30 05:03:03 rgrimes + * Remove trailing whitespace. + * * Revision 1.1.1.1 1994/09/10 06:27:32 gclarkii * Initial import of Perl 4.046 bmaked * @@ -2927,11 +2930,11 @@ donumset: gimme,arglast); goto array_return; case O_SPWENT: - value = (double) setpwent(); - goto donumset; + setpwent(); + goto say_yes; case O_EPWENT: - value = (double) endpwent(); - goto donumset; + endpwent(); + goto say_yes; #else case O_EPWENT: case O_SPWENT: diff --git a/gnu/usr.bin/perl/perl/perl.c b/gnu/usr.bin/perl/perl/perl.c index de956af17499..d41280bc708e 100644 --- a/gnu/usr.bin/perl/perl/perl.c +++ b/gnu/usr.bin/perl/perl/perl.c @@ -1,4 +1,4 @@ -char rcsid[] = "$RCSfile: perl.c,v $$Revision: 1.5 $$Date: 1996/06/02 19:59:24 $\nPatch level: ###\n"; +char rcsid[] = "$RCSfile: perl.c,v $$Revision: 1.7 $$Date: 1996/06/30 09:47:56 $\nPatch level: ###\n"; /* * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,11 @@ char rcsid[] = "$RCSfile: perl.c,v $$Revision: 1.5 $$Date: 1996/06/02 19:59:24 $ * License or the Artistic License, as specified in the README file. * * $Log: perl.c,v $ + * Revision 1.7 1996/06/30 09:47:56 joerg + * Back out Nate's changes from rev. 1.6; our Perl has not been + * vulnerable since it used setreuid() as opposed to Posix saved IDs. + * The change broke setuid scripts. + * * Revision 1.5 1996/06/02 19:59:24 gpalmer * Use setreuid instead of seteuid for permissions management * @@ -496,6 +501,17 @@ sed %s -e \"/^[^#]/b\" \ #ifdef DOSUID if (fstat(fileno(rsfp),&statbuf) < 0) /* normal stat is insecure */ fatal("Can't stat script \"%s\"",origfilename); +#ifdef IAMSUID + { + struct statfs stfs; + + if (fstatfs(fileno(rsfp),&stfs) < 0) + fatal("Can't statfs filesystem of script \"%s\"",origfilename); + + if (stfs.f_flags & MNT_NOSUID) + fatal("Permission denied"); + } +#endif /* IAMSUID */ if (statbuf.st_mode & (S_ISUID|S_ISGID)) { int len; diff --git a/gnu/usr.bin/perl/perl/perl.h b/gnu/usr.bin/perl/perl/perl.h index 7693aa0c8157..af5873d3a5e6 100644 --- a/gnu/usr.bin/perl/perl/perl.h +++ b/gnu/usr.bin/perl/perl/perl.h @@ -1,4 +1,4 @@ -/* $RCSfile: perl.h,v $$Revision: 1.1.1.1 $$Date: 1994/09/10 06:27:35 $ +/* $RCSfile: perl.h,v $$Revision: 1.2 $$Date: 1995/05/30 05:03:11 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: perl.h,v $ + * Revision 1.2 1995/05/30 05:03:11 rgrimes + * Remove trailing whitespace. + * * Revision 1.1.1.1 1994/09/10 06:27:35 gclarkii * Initial import of Perl 4.046 bmaked * @@ -251,6 +254,8 @@ typedef unsigned int MEM_SIZE; #endif #endif +#include <sys/mount.h> + #ifdef I_TIME # include <time.h> #endif diff --git a/gnu/usr.bin/perl/perl/tdoio.c b/gnu/usr.bin/perl/perl/tdoio.c index 1cd6269e8c70..cd5d480bcb80 100644 --- a/gnu/usr.bin/perl/perl/tdoio.c +++ b/gnu/usr.bin/perl/perl/tdoio.c @@ -1,4 +1,4 @@ -/* $RCSfile: tdoio.c,v $$Revision: 1.1.1.1 $$Date: 1994/09/10 06:27:36 $ +/* $RCSfile: tdoio.c,v $$Revision: 1.2 $$Date: 1995/05/30 05:03:23 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: tdoio.c,v $ + * Revision 1.2 1995/05/30 05:03:23 rgrimes + * Remove trailing whitespace. + * * Revision 1.1.1.1 1994/09/10 06:27:36 gclarkii * Initial import of Perl 4.046 bmaked * @@ -1214,8 +1217,26 @@ STR *str; len = stio->ifp->_cnt + (stio->ifp->_ptr - stio->ifp->_base); s = stio->ifp->_base; #else +#if (defined(BSD) && (BSD >= 199103)) + s = stio->ifp->_base; + fstat(fileno(stio->ifp),&statcache); + if (S_ISDIR(statcache.st_mode)) /* handle NFS glitch */ + return arg->arg_type == O_FTTEXT ? &str_no : &str_yes; + + if (stio->ifp->_bf._size <= 0) { + i = getc(stio->ifp); + if (i != EOF) + (void)ungetc(i,stio->ifp); + } + + if (stio->ifp->_bf._size <= 0) + return &str_yes; + len = stio->ifp->_bf._size+(stio->ifp->_p - stio->ifp->_bf._base); + s = stio->ifp->_bf._base; +#else fatal("-T and -B not implemented on filehandles"); #endif +#endif } else { if (dowarn) |
