pkgsrc/lang/perl5/patches/patch-ad
1998-08-07 11:08:53 +00:00

25 lines
837 B
Text

$NetBSD: patch-ad,v 1.3 1998/08/07 11:09:23 agc Exp $
--- perl.c.BAK Wed Nov 19 23:09:31 1997
+++ perl.c Wed Nov 19 23:10:58 1997
@@ -2036,6 +2036,20 @@
croak("Can't swap uid and euid"); /* really paranoid */
if (Stat(SvPVX(GvSV(curcop->cop_filegv)),&tmpstatbuf) < 0)
croak("Permission denied"); /* testing full pathname here */
+#if (defined(BSD) && (BSD >= 199306))
+#ifdef IAMSUID
+ {
+ struct statfs stfs;
+
+ if (fstatfs(fileno(rsfp),&stfs) < 0)
+ croak("Can't statfs filesystem of script \"%s\"",origfilename);
+
+ if (stfs.f_flags & MNT_NOSUID)
+ croak("Permission denied");
+ }
+#endif /* IAMSUID */
+#endif /* BSD */
+
if (tmpstatbuf.st_dev != statbuf.st_dev ||
tmpstatbuf.st_ino != statbuf.st_ino) {
(void)PerlIO_close(rsfp);