From: Ulrich Drepper Date: Fri, 1 Sep 2000 02:28:03 +0000 (+0000) Subject: (__getdate_r): Add extra access check. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=407d349509f5e082ea1411cd3817579ce8968941;p=thirdparty%2Fglibc.git (__getdate_r): Add extra access check. --- diff --git a/time/getdate.c b/time/getdate.c index 626fb49d7a2..99ee31cb2e1 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)