diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-09-01 02:26:05 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-09-01 02:26:05 +0000 |
commit | 8edf6e0d7e556fa80415ebd35da70ccf594b6373 (patch) | |
tree | 9d62f8c094e8fe32758f68a18845ef90850db924 /time/getdate.c | |
parent | 3d784d830015dcb614bf2d154e726e67bd10ea32 (diff) | |
download | glibc-8edf6e0d7e556fa80415ebd35da70ccf594b6373.zip glibc-8edf6e0d7e556fa80415ebd35da70ccf594b6373.tar.gz glibc-8edf6e0d7e556fa80415ebd35da70ccf594b6373.tar.bz2 |
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 <drepper@redhat.com>
Diffstat (limited to 'time/getdate.c')
-rw-r--r-- | time/getdate.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/time/getdate.c b/time/getdate.c index 626fb49..dfd627a 100644 --- a/time/getdate.c +++ b/time/getdate.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <string.h> #include <time.h> +#include <unistd.h> #include <sys/stat.h> #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) |