$NetBSD: patch-ad,v 1.5 2000/01/18 22:31:47 tron 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);