summaryrefslogtreecommitdiff
path: root/lang/perl5/patches/patch-ad
blob: 1fea824e9e6331f0f98a3303c83be913b2011e2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- 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);