diff options
Diffstat (limited to 'Build/source/texk/web2c/lib/texmfmp.c')
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index c404020bd0b..329a3f9222d 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -3077,6 +3077,7 @@ void initstarttime(void) } } +#if !defined(XeTeX) char *makecstring(integer s) { static char *cstrbuf = NULL; @@ -3125,6 +3126,7 @@ char *makecfilename(integer s) *q = '\0'; return name; } +#endif /* !XeTeX */ void getcreationdate(void) { @@ -3213,6 +3215,9 @@ void getfilesize(integer s) if (file_name == NULL) { return; /* empty string */ } + if (! kpse_in_name_ok(file_name)) { + return; /* no permission */ + } recorder_record_input(file_name); /* get file status */ @@ -3251,13 +3256,15 @@ void getfiledump(integer s, int offset, int length) { FILE *f; int read, i; - poolpointer data_ptr; - poolpointer data_end; - char *file_name; #if defined(XeTeX) char *readbuffer, strbuf[3]; int j, k; -#endif +#else + poolpointer data_ptr; + poolpointer data_end; +#endif /* XeTeX */ + char *file_name; + if (length == 0) { /* empty result string */ return; @@ -3278,6 +3285,9 @@ void getfiledump(integer s, int offset, int length) if (file_name == NULL) { return; /* empty string */ } + if (! kpse_in_name_ok(file_name)) { + return; /* no permission */ + } /* read file data */ f = fopen(file_name, FOPEN_RBIN_MODE); @@ -3371,6 +3381,10 @@ void getmd5sum(strnumber s, boolean file) if (file_name == NULL) { return; /* empty string */ } + if (! kpse_in_name_ok(file_name)) { + return; /* no permission */ + } + /* in case of error the empty string is returned, no need for xfopen that aborts on error. */ |