summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-10-27 17:19:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-10-27 17:19:06 +0000
commitad27e871a1c17d37a6de5332709e86e420b3b750 (patch)
tree6e22184d5a011982a35c8ed5ef2047b7d2bd7d7f /perl.c
parent1ae6be1c7649fa55b3105031a58ffe146fa4f2fd (diff)
downloadperl-ad27e871a1c17d37a6de5332709e86e420b3b750.tar.gz
Regen Configure.
p4raw-id: //depot/cfgperl@4470
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/perl.c b/perl.c
index c2864468e1..c14bfee948 100644
--- a/perl.c
+++ b/perl.c
@@ -2194,10 +2194,10 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
int check_okay = 0; /* able to do all the required sys/libcalls */
int on_nosuid = 0; /* the fd is on a nosuid fs */
/*
- * Preferred order: fstatvfs(), fstatfs(), ustat()+statfs(), getmntent().
+ * Preferred order: fstatvfs(), fstatfs(), ustat()+getmnt(), getmntent().
* fstatvfs() is UNIX98.
* fstatfs() is 4.3 BSD.
- * ustat()+statfs() is pre-4.3 BSD.
+ * ustat()+getmnt() is pre-4.3 BSD.
* getmntent() is O(number-of-mounted-filesystems) and can hang on
* an irrelevant filesystem while trying to reach the right one.
*/
@@ -2208,21 +2208,26 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
on_nosuid = check_okay && (stfs.f_flag & ST_NOSUID);
# else
# ifdef PERL_MOUNT_NOSUID
-# if defined(HAS_FSTATFS) && defined(HAS_STRUCT_STATFS_F_FLAGS)
+# if defined(HAS_FSTATFS) && \
+ defined(HAS_STRUCT_STATFS) && \
+ defined(HAS_STRUCT_STATFS_F_FLAGS)
struct statfs stfs;
check_okay = fstatfs(fd, &stfs) == 0;
on_nosuid = check_okay && (stfs.f_flags & PERL_MOUNT_NOSUID);
# else
# if defined(HAS_FSTAT) && \
defined(HAS_USTAT) && \
- defined(HAS_STATFS) && \
- defined(HAS_STRUCT_FS_DATA) /* no struct statfs */
+ defined(HAS_GETMNT) && \
+ defined(HAS_STRUCT_FS_DATA) &&
+ defined(NOSTAT_ONE)
struct stat fdst;
if (fstat(fd, &fdst) == 0) {
struct ustat us;
if (ustat(fdst.st_dev, &us) == 0) {
struct fs_data fsd;
- if (statfs(PL_origfilename, &fsd) == 0) {
+ /* NOSTAT_ONE here because we're not examining fields which
+ * vary between that case and STAT_ONE. */
+ if (getmnt((int*)0, &fsd, (int)0, NOSTAT_ONE, us.f_fname) == 0) {
size_t cmplen = sizeof(us.f_fname);
if (sizeof(fsd.fd_req.path) < cmplen)
cmplen = sizeof(fsd.fd_req.path);
@@ -2235,8 +2240,8 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
}
}
}
-# endif /* fstat+ustat+statfs */
-# endif /* statfs */
+# endif /* fstat+ustat+getmnt */
+# endif /* fstatfs */
# else
# if defined(HAS_GETMNTENT) && \
defined(HAS_HASMNTOPT) && \
@@ -2260,7 +2265,7 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
}
if (mtab)
fclose(mtab);
-# endif /* getmntent */
+# endif /* getmntent+hasmntopt */
# endif /* PERL_MOUNT_NOSUID: fstatfs or fstat+ustat+statfs */
# endif /* statvfs */
@@ -3215,4 +3220,3 @@ read_e_script(pTHXo_ int idx, SV *buf_sv, int maxlen)
return 1;
}
-