]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__getdate_r): Add extra access check.
authorUlrich Drepper <drepper@redhat.com>
Fri, 1 Sep 2000 02:28:03 +0000 (02:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 1 Sep 2000 02:28:03 +0000 (02:28 +0000)
time/getdate.c

index 626fb49d7a22c498ae4c3bdbcfcbba1a9cd58e0a..99ee31cb2e14bb7c22cf1cc0ad3c3b5fcf89ed22 100644 (file)
@@ -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
@@ -123,6 +124,9 @@ __getdate_r (const char *string, struct tm *tp)
   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)