From 8edf6e0d7e556fa80415ebd35da70ccf594b6373 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 1 Sep 2000 02:26:05 +0000 Subject: Update. * inet/rcmd.c: Use *stat64 instead of *stat internally. * inet/ruserpass.c: Likewise. * intl/loadmsgcat.c: Likewise. * io/getdirname.c: Likewise. * locale/loadlocale.c: Likewise. * misc/getusershell.c: Likewise. * stdlib/canonicalize.c: Likewise. * sysdeps/posix/euidaccess.c: Likewise. * sysdeps/posix/isfdtype.c: Likewise. * sysdeps/posix/posix_fallocate.c: Likewise. * sysdeps/posix/tempname.c: Likewise. * sysdeps/unix/grantpt.c: Likewise. * sysdeps/unix/opendir.c: Likewise. * sysdeps/unix/sysv/linux/fstatvfs.c: Likewise. * sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise. * sysdeps/unix/sysv/linux/ptsname.c: Likewise. * sysdeps/unix/sysv/linux/statvfs.c: Likewise. * sysdeps/unix/sysv/linux/ttyname.c: Likewise. * sysdeps/unix/sysv/linux/ttyname_r.c: Likewise. * sysvipc/ftok.c: Likewise. * time/getdate.c: Likewise. * time/getdate.c: Add extra access test. 2000-08-31 Ulrich Drepper --- ChangeLog | 26 ++++++++++++++++++++++++++ inet/rcmd.c | 6 +++--- inet/ruserpass.c | 6 +++--- intl/loadmsgcat.c | 4 ++-- io/getdirname.c | 14 +++++++------- locale/loadlocale.c | 6 +++--- misc/getusershell.c | 4 ++-- stdlib/canonicalize.c | 6 +++--- sysdeps/posix/euidaccess.c | 6 +++--- sysdeps/posix/isfdtype.c | 6 +++--- sysdeps/posix/posix_fallocate.c | 4 ++-- sysdeps/posix/tempname.c | 10 +++++----- sysdeps/unix/grantpt.c | 4 ++-- sysdeps/unix/opendir.c | 8 ++++---- sysdeps/unix/sysv/linux/fstatvfs.c | 4 ++-- sysdeps/unix/sysv/linux/internal_statvfs.c | 4 ++-- sysdeps/unix/sysv/linux/ptsname.c | 10 +++++----- sysdeps/unix/sysv/linux/statvfs.c | 4 ++-- sysdeps/unix/sysv/linux/ttyname.c | 16 ++++++++-------- sysdeps/unix/sysv/linux/ttyname_r.c | 16 ++++++++-------- sysvipc/ftok.c | 6 +++--- time/getdate.c | 8 ++++++-- 22 files changed, 104 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9256048055..c13ce187fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2000-08-31 Ulrich Drepper + + * inet/rcmd.c: Use *stat64 instead of *stat internally. + * inet/ruserpass.c: Likewise. + * intl/loadmsgcat.c: Likewise. + * io/getdirname.c: Likewise. + * locale/loadlocale.c: Likewise. + * misc/getusershell.c: Likewise. + * stdlib/canonicalize.c: Likewise. + * sysdeps/posix/euidaccess.c: Likewise. + * sysdeps/posix/isfdtype.c: Likewise. + * sysdeps/posix/posix_fallocate.c: Likewise. + * sysdeps/posix/tempname.c: Likewise. + * sysdeps/unix/grantpt.c: Likewise. + * sysdeps/unix/opendir.c: Likewise. + * sysdeps/unix/sysv/linux/fstatvfs.c: Likewise. + * sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise. + * sysdeps/unix/sysv/linux/ptsname.c: Likewise. + * sysdeps/unix/sysv/linux/statvfs.c: Likewise. + * sysdeps/unix/sysv/linux/ttyname.c: Likewise. + * sysdeps/unix/sysv/linux/ttyname_r.c: Likewise. + * sysvipc/ftok.c: Likewise. + * time/getdate.c: Likewise. + + * time/getdate.c: Add extra access test. + 2000-08-31 Ulrich Drepper * version.h (VERSION): Bump to 2.1.93. diff --git a/inet/rcmd.c b/inet/rcmd.c index 16ad02b438..1ddf4729da 100644 --- a/inet/rcmd.c +++ b/inet/rcmd.c @@ -401,7 +401,7 @@ ruserok(rhost, superuser, ruser, luser) static FILE * iruserfopen (const char *file, uid_t okuser) { - struct stat st; + struct stat64 st; char *cp = NULL; FILE *res = NULL; @@ -409,7 +409,7 @@ iruserfopen (const char *file, uid_t okuser) root, if writeable by anyone but the owner, or if hardlinked anywhere, quit. */ cp = NULL; - if (__lxstat (_STAT_VER, file, &st)) + if (__lxstat64 (_STAT_VER, file, &st)) cp = _("lstat failed"); else if (!S_ISREG (st.st_mode)) cp = _("not regular file"); @@ -418,7 +418,7 @@ iruserfopen (const char *file, uid_t okuser) res = fopen (file, "r"); if (!res) cp = _("cannot open"); - else if (__fxstat (_STAT_VER, fileno (res), &st) < 0) + else if (__fxstat64 (_STAT_VER, fileno (res), &st) < 0) cp = _("fstat failed"); else if (st.st_uid && st.st_uid != okuser) cp = _("bad owner"); diff --git a/inet/ruserpass.c b/inet/ruserpass.c index 18d8e1462a..3b66c3040e 100644 --- a/inet/ruserpass.c +++ b/inet/ruserpass.c @@ -99,7 +99,7 @@ ruserpass(host, aname, apass) char *hdir, *buf, *tmp; char myname[1024], *mydomain; int t, usedefault = 0; - struct stat stb; + struct stat64 stb; hdir = __secure_getenv("HOME"); if (hdir == NULL) { @@ -176,7 +176,7 @@ next: break; case PASSWD: if (strcmp(*aname, "anonymous") && - fstat(fileno(cfile), &stb) >= 0 && + fstat64(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { warnx(_("Error: .netrc file is readable by others.")); warnx(_("Remove password or make file unreadable by others.")); @@ -195,7 +195,7 @@ next: break; case ACCOUNT: #if 0 - if (fstat(fileno(cfile), &stb) >= 0 + if (fstat64(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { warnx("Error: .netrc file is readable by others."); warnx("Remove account or make file unreadable by others."); diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 2b6262ea38..aad6dfe5db 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -121,7 +121,7 @@ _nl_load_domain (domain_file) { int fd; size_t size; - struct stat st; + struct stat64 st; struct mo_file_header *data = (struct mo_file_header *) -1; int use_mmap = 0; struct loaded_domain *domain; @@ -143,7 +143,7 @@ _nl_load_domain (domain_file) return; /* We must know about the size of the file. */ - if (__builtin_expect (fstat (fd, &st) != 0, 0) + if (__builtin_expect (fstat64 (fd, &st) != 0, 0) || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) || __builtin_expect (size < sizeof (struct mo_file_header), 0)) { diff --git a/io/getdirname.c b/io/getdirname.c index f6c9bfff21..1a654beac3 100644 --- a/io/getdirname.c +++ b/io/getdirname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,14 +29,14 @@ char * get_current_dir_name (void) { char *pwd; - struct stat dotstat, pwdstat; + struct stat64 dotstat, pwdstat; pwd = getenv ("PWD"); - if (pwd != NULL && - stat (".", &dotstat) == 0 && - stat (pwd, &pwdstat) == 0 && - pwdstat.st_dev == dotstat.st_dev && - pwdstat.st_ino == dotstat.st_ino) + if (pwd != NULL + && stat64 (".", &dotstat) == 0 + && stat64 (pwd, &pwdstat) == 0 + && pwdstat.st_dev == dotstat.st_dev + && pwdstat.st_ino == dotstat.st_ino) /* The PWD value is correct. Use it. */ return __strdup (pwd); diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 34f762388f..4aacbc9d26 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -69,7 +69,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) unsigned int nstrings; unsigned int strindex[0]; } *filedata; - struct stat st; + struct stat64 st; struct locale_data *newdata; int save_err; int mmaped = 1; @@ -83,7 +83,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) /* Cannot open the file. */ return; - if (__builtin_expect (__fstat (fd, &st), 0) < 0) + if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0) goto puntfd; if (__builtin_expect (S_ISDIR (st.st_mode), 0)) { @@ -106,7 +106,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) if (__builtin_expect (fd, 0) < 0) return; - if (__builtin_expect (__fstat (fd, &st), 0) < 0) + if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0) goto puntfd; } diff --git a/misc/getusershell.c b/misc/getusershell.c index 5fe1ab3eff..9e22125133 100644 --- a/misc/getusershell.c +++ b/misc/getusershell.c @@ -91,7 +91,7 @@ initshells() { register char **sp, *cp; register FILE *fp; - struct stat statb; + struct stat64 statb; int flen; if (shells != NULL) @@ -102,7 +102,7 @@ initshells() strings = NULL; if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return (okshells); - if (fstat(fileno(fp), &statb) == -1) { + if (fstat64(fileno(fp), &statb) == -1) { (void)fclose(fp); return (okshells); } diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c index e555b021cd..987ecf5b85 100644 --- a/stdlib/canonicalize.c +++ b/stdlib/canonicalize.c @@ -1,5 +1,5 @@ /* Return the canonical absolute name of a given file. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -91,7 +91,7 @@ canonicalize (const char *name, char *resolved) for (start = end = name; *start; start = end) { - struct stat st; + struct stat64 st; int n; /* Skip sequence of multiple path-separators. */ @@ -147,7 +147,7 @@ canonicalize (const char *name, char *resolved) dest = __mempcpy (dest, start, end - start); *dest = '\0'; - if (__lxstat (_STAT_VER, rpath, &st) < 0) + if (__lxstat64 (_STAT_VER, rpath, &st) < 0) goto error; if (S_ISLNK (st.st_mode)) diff --git a/sysdeps/posix/euidaccess.c b/sysdeps/posix/euidaccess.c index e2205861a8..7f228b5643 100644 --- a/sysdeps/posix/euidaccess.c +++ b/sysdeps/posix/euidaccess.c @@ -1,5 +1,5 @@ /* Check if effective user id can access file - Copyright (C) 1990, 91, 95, 96, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1990,91,95,96,97,98,99,2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -133,7 +133,7 @@ euidaccess (path, mode) const char *path; int mode; { - struct stat stats; + struct stat64 stats; int granted; #ifdef _LIBC @@ -155,7 +155,7 @@ euidaccess (path, mode) return access (path, mode); #endif - if (stat (path, &stats)) + if (stat64 (path, &stats)) return -1; mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */ diff --git a/sysdeps/posix/isfdtype.c b/sysdeps/posix/isfdtype.c index ec4568e460..dc19d99861 100644 --- a/sysdeps/posix/isfdtype.c +++ b/sysdeps/posix/isfdtype.c @@ -1,5 +1,5 @@ /* Determine whether descriptor has given property. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,12 +25,12 @@ int isfdtype (int fildes, int fdtype) { - struct stat st; + struct stat64 st; int result; { int save_error = errno; - result = fstat (fildes, &st); + result = fstat64 (fildes, &st); __set_errno (save_error); } diff --git a/sysdeps/posix/posix_fallocate.c b/sysdeps/posix/posix_fallocate.c index 46ce06f10d..add1b3bf46 100644 --- a/sysdeps/posix/posix_fallocate.c +++ b/sysdeps/posix/posix_fallocate.c @@ -27,7 +27,7 @@ int posix_fallocate (int fd, __off_t offset, size_t len) { - struct stat st; + struct stat64 st; struct statfs f; size_t step; @@ -40,7 +40,7 @@ posix_fallocate (int fd, __off_t offset, size_t len) /* First thing we have to make sure is that this is really a regular file. */ - if (__fxstat (_STAT_VER, fd, &st) != 0) + if (__fxstat64 (_STAT_VER, fd, &st) != 0) return EBADF; if (S_ISFIFO (st.st_mode)) return ESPIPE; diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c index 536225e957..fe386020a3 100644 --- a/sysdeps/posix/tempname.c +++ b/sysdeps/posix/tempname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,8 +33,8 @@ static int direxists (const char *dir) { - struct stat buf; - return __xstat (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode); + struct stat64 buf; + return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode); } /* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is @@ -127,7 +127,7 @@ __gen_tempname (char *tmpl, int kind) struct timeval tv; int count, fd = -1; int save_errno = errno; - struct stat st; + struct stat64 st; len = strlen (tmpl); if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) @@ -179,7 +179,7 @@ __gen_tempname (char *tmpl, int kind) succeeds if __xstat fails because the name does not exist. Note the continue to bypass the common logic at the bottom of the loop. */ - if (__xstat (_STAT_VER, tmpl, &st) < 0) + if (__xstat64 (_STAT_VER, tmpl, &st) < 0) { if (errno == ENOENT) { diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c index 1ac542f609..71f73bfefc 100644 --- a/sysdeps/unix/grantpt.c +++ b/sysdeps/unix/grantpt.c @@ -97,7 +97,7 @@ grantpt (int fd) char _buf[512]; #endif char *buf = _buf; - struct stat st; + struct stat64 st; char *grtmpbuf; struct group grbuf; size_t grbuflen = __sysconf (_SC_GETGR_R_SIZE_MAX); @@ -109,7 +109,7 @@ grantpt (int fd) if (pts_name (fd, &buf, sizeof (_buf))) return -1; - if (__xstat (_STAT_VER, buf, &st) < 0) + if (__xstat64 (_STAT_VER, buf, &st) < 0) goto cleanup; /* Make sure that we own the device. */ diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c index 9798e52850..cf030e02f4 100644 --- a/sysdeps/unix/opendir.c +++ b/sysdeps/unix/opendir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 93, 94, 95, 96, 98 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,94,95,96,98,2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -71,7 +71,7 @@ DIR * __opendir (const char *name) { DIR *dirp; - struct stat statbuf; + struct stat64 statbuf; int fd; size_t allocation; int save_errno; @@ -96,7 +96,7 @@ __opendir (const char *name) /* We first have to check whether the name is for a directory. We cannot do this after the open() call since the open/close operation performed on, say, a tape device might have undesirable effects. */ - if (__xstat (_STAT_VER, name, &statbuf) < 0) + if (__xstat64 (_STAT_VER, name, &statbuf) < 0) return NULL; if (! S_ISDIR (statbuf.st_mode)) { @@ -111,7 +111,7 @@ __opendir (const char *name) /* Now make sure this really is a directory and nothing changed since the `stat' call. */ - if (__fstat (fd, &statbuf) < 0) + if (__fxstat64 (_STAT_VER, fd, &statbuf) < 0) goto lose; if (! S_ISDIR (statbuf.st_mode)) { diff --git a/sysdeps/unix/sysv/linux/fstatvfs.c b/sysdeps/unix/sysv/linux/fstatvfs.c index b69bf77cb6..1fecc64eea 100644 --- a/sysdeps/unix/sysv/linux/fstatvfs.c +++ b/sysdeps/unix/sysv/linux/fstatvfs.c @@ -31,13 +31,13 @@ int fstatvfs (int fd, struct statvfs *buf) { struct statfs fsbuf; - struct stat st; + struct stat64 st; /* Get as much information as possible from the system. */ if (__fstatfs (fd, &fsbuf) < 0) return -1; -#define STAT(st) fstat (fd, st) +#define STAT(st) fstat64 (fd, st) #include "internal_statvfs.c" /* We signal success if the statfs call succeeded. */ diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c index a6aec7d0f4..ef982e9a7c 100644 --- a/sysdeps/unix/sysv/linux/internal_statvfs.c +++ b/sysdeps/unix/sysv/linux/internal_statvfs.c @@ -56,10 +56,10 @@ while (__getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) { - struct stat fsst; + struct stat64 fsst; /* Find out about the device the current entry is for. */ - if (stat (mntbuf.mnt_dir, &fsst) >= 0 + if (stat64 (mntbuf.mnt_dir, &fsst) >= 0 && st.st_dev == fsst.st_dev) { /* Bingo, we found the entry for the device FD is on. diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c index 10365792dd..3c178a88a4 100644 --- a/sysdeps/unix/sysv/linux/ptsname.c +++ b/sysdeps/unix/sysv/linux/ptsname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg , 1998. @@ -45,7 +45,7 @@ terminal devices. As of Linux 2.1.115 these are no longer supported. They have been replaced by major numbers 2 (masters) and 3 (slaves). */ - + /* Directory where we can find the slave pty nodes. */ #define _PATH_DEVPTS "/dev/pts/" @@ -74,7 +74,7 @@ int __ptsname_r (int fd, char *buf, size_t buflen) { int save_errno = errno; - struct stat st; + struct stat64 st; int ptyno; if (buf == NULL) @@ -121,7 +121,7 @@ __ptsname_r (int fd, char *buf, size_t buflen) return ERANGE; } - if (__fstat (fd, &st) < 0) + if (__fxstat64 (_STAT_VER, fd, &st) < 0) return errno; /* Check if FD really is a master pseudo terminal. */ @@ -149,7 +149,7 @@ __ptsname_r (int fd, char *buf, size_t buflen) p[2] = '\0'; } - if (__xstat (_STAT_VER, buf, &st) < 0) + if (__xstat64 (_STAT_VER, buf, &st) < 0) return errno; /* Check if the name we're about to return really corresponds to a diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c index 7f85c9b726..41335469c1 100644 --- a/sysdeps/unix/sysv/linux/statvfs.c +++ b/sysdeps/unix/sysv/linux/statvfs.c @@ -31,13 +31,13 @@ int statvfs (const char *file, struct statvfs *buf) { struct statfs fsbuf; - struct stat st; + struct stat64 st; /* Get as much information as possible from the system. */ if (__statfs (file, &fsbuf) < 0) return -1; -#define STAT(st) stat (file, st) +#define STAT(st) stat64 (file, st) #include "internal_statvfs.c" /* We signal success if the statfs call succeeded. */ diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c index 81149ff390..9a5009932a 100644 --- a/sysdeps/unix/sysv/linux/ttyname.c +++ b/sysdeps/unix/sysv/linux/ttyname.c @@ -31,7 +31,7 @@ char *__ttyname; static char *getttyname (const char *dev, dev_t mydev, - ino_t myino, int save, int *dostat) + ino64_t myino, int save, int *dostat) internal_function; @@ -39,10 +39,10 @@ static char *getttyname_name; static char * internal_function -getttyname (const char *dev, dev_t mydev, ino_t myino, int save, int *dostat) +getttyname (const char *dev, dev_t mydev, ino64_t myino, int save, int *dostat) { static size_t namelen; - struct stat st; + struct stat64 st; DIR *dirstream; struct dirent *d; size_t devlen = strlen (dev) + 1; @@ -76,11 +76,11 @@ getttyname (const char *dev, dev_t mydev, ino_t myino, int save, int *dostat) *((char *) __mempcpy (getttyname_name, dev, devlen - 1)) = '/'; } memcpy (&getttyname_name[devlen], d->d_name, dlen); - if (__xstat (_STAT_VER, getttyname_name, &st) == 0 + if (__xstat64 (_STAT_VER, getttyname_name, &st) == 0 #ifdef _STATBUF_ST_RDEV && S_ISCHR (st.st_mode) && st.st_rdev == mydev #else - && (ino_t) d->d_fileno == myino && st.st_dev == mydev + && (ino64_t) d->d_fileno == myino && st.st_dev == mydev #endif ) { @@ -108,7 +108,7 @@ ttyname (int fd) { static size_t buflen; char procname[30]; - struct stat st, st1; + struct stat64 st, st1; int dostat = 0; char *name; int save = errno; @@ -143,10 +143,10 @@ ttyname (int fd) return ttyname_buf; } - if (__fxstat (_STAT_VER, fd, &st) < 0) + if (__fxstat64 (_STAT_VER, fd, &st) < 0) return NULL; - if (__xstat (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode)) + if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode)) { #ifdef _STATBUF_ST_RDEV name = getttyname ("/dev/pts", st.st_rdev, st.st_ino, save, &dostat); diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c index 16fb7a0972..87dadc1dd7 100644 --- a/sysdeps/unix/sysv/linux/ttyname_r.c +++ b/sysdeps/unix/sysv/linux/ttyname_r.c @@ -29,15 +29,15 @@ #include static int getttyname_r (char *buf, size_t buflen, - dev_t mydev, ino_t myino, int save, + dev_t mydev, ino64_t myino, int save, int *dostat) internal_function; static int internal_function -getttyname_r (char *buf, size_t buflen, dev_t mydev, ino_t myino, +getttyname_r (char *buf, size_t buflen, dev_t mydev, ino64_t myino, int save, int *dostat) { - struct stat st; + struct stat64 st; DIR *dirstream; struct dirent *d; size_t devlen = strlen (buf); @@ -69,11 +69,11 @@ getttyname_r (char *buf, size_t buflen, dev_t mydev, ino_t myino, cp = __stpncpy (buf + devlen, d->d_name, needed); cp[0] = '\0'; - if (__xstat (_STAT_VER, buf, &st) == 0 + if (__xstat64 (_STAT_VER, buf, &st) == 0 #ifdef _STATBUF_ST_RDEV && S_ISCHR (st.st_mode) && st.st_rdev == mydev #else - && (ino_t) d->d_fileno == myino && st.st_dev == mydev + && (ino64_t) d->d_fileno == myino && st.st_dev == mydev #endif ) { @@ -96,7 +96,7 @@ int __ttyname_r (int fd, char *buf, size_t buflen) { char procname[30]; - struct stat st, st1; + struct stat64 st, st1; int dostat = 0; int save = errno; int ret; @@ -136,14 +136,14 @@ __ttyname_r (int fd, char *buf, size_t buflen) return ERANGE; } - if (__fxstat (_STAT_VER, fd, &st) < 0) + if (__fxstat64 (_STAT_VER, fd, &st) < 0) return errno; /* Prepare the result buffer. */ memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/")); buflen -= sizeof ("/dev/pts/") - 1; - if (__xstat (_STAT_VER, buf, &st1) == 0 && S_ISDIR (st1.st_mode)) + if (__xstat64 (_STAT_VER, buf, &st1) == 0 && S_ISDIR (st1.st_mode)) { #ifdef _STATBUF_ST_RDEV ret = getttyname_r (buf, buflen, st.st_rdev, st.st_ino, save, diff --git a/sysvipc/ftok.c b/sysvipc/ftok.c index b0199acda6..05f8c76abc 100644 --- a/sysvipc/ftok.c +++ b/sysvipc/ftok.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -25,10 +25,10 @@ ftok (pathname, proj_id) const char *pathname; int proj_id; { - struct stat st; + struct stat64 st; key_t key; - if (__xstat (_STAT_VER, pathname, &st) < 0) + if (__xstat64 (_STAT_VER, pathname, &st) < 0) return (key_t) -1; key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) diff --git a/time/getdate.c b/time/getdate.c index 626fb49d7a..dfd627a832 100644 --- a/time/getdate.c +++ b/time/getdate.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #define TM_YEAR_BASE 1900 @@ -110,19 +111,22 @@ __getdate_r (const char *string, struct tm *tp) char *result = NULL; time_t timer; struct tm tm; - struct stat st; + struct stat64 st; int mday_ok = 0; datemsk = getenv ("DATEMSK"); if (datemsk == NULL || *datemsk == '\0') return 1; - if (stat (datemsk, &st) < 0) + if (stat64 (datemsk, &st) < 0) return 3; if (!S_ISREG (st.st_mode)) return 4; + if (__access (datemsk, R_OK) < 0) + return 2; + /* Open the template file. */ fp = fopen (datemsk, "r"); if (fp == NULL) -- cgit 1.4.1