diff --git a/time/getdate.c b/time/getdate.c index 626fb49d7a..99ee31cb2e 100644 --- a/time/getdate.c +++ b/time/getdate.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #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)