summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Schrod <jschrod@acm.org>2007-07-03 16:16:05 +0000
committerJoachim Schrod <jschrod@acm.org>2007-07-03 16:16:05 +0000
commit9347ce7eda861fbc572acfaec36e4bcfc76e053e (patch)
tree508586fb240200306f0734dccba52b44d61abc3d
parent9de7990265f589fc24482e88c46526ebfdf7bc0e (diff)
Implement TEX_HUSH option `readable'.
git-svn-id: svn://tug.org/texlive/trunk@4537 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dviljk/ChangeLog2
-rw-r--r--Build/source/texk/dviljk/dvi2xx.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/Build/source/texk/dviljk/ChangeLog b/Build/source/texk/dviljk/ChangeLog
index 218b9ff2a97..eb769644cfb 100644
--- a/Build/source/texk/dviljk/ChangeLog
+++ b/Build/source/texk/dviljk/ChangeLog
@@ -8,6 +8,8 @@
(DoSpecial): Search for include files with kpathsea, both via
DVILJINPUTS and TEXINPUTS.
+ (CopyFile, CopyHPFile): Implement TEX_HUSH option `readable.'
+
2007-07-02 Joachim Schrod <jschrod@acm.org>
* dvi2xx.c (DoSpecial): Security issue: usage of tmpnam() caused
diff --git a/Build/source/texk/dviljk/dvi2xx.c b/Build/source/texk/dviljk/dvi2xx.c
index 35581c4a442..071dbfc5788 100644
--- a/Build/source/texk/dviljk/dvi2xx.c
+++ b/Build/source/texk/dviljk/dvi2xx.c
@@ -746,7 +746,10 @@ char *str;
int todo;
if ( (spfp = BINOPEN(str)) == FPNULL ) {
- Warning("Unable to open file %s", str );
+ if ( errno != EACCES || ! kpse_tex_hush("readable") ) {
+ Warning("Unable to open file %s (errno=%d), skipping inclusion",
+ str, errno);
+ }
return;
}
qfprintf(ERR_STREAM," [%s", str);
@@ -827,7 +830,10 @@ char *str;
int count,miny,minx,num;
if ( (spfp = BINOPEN(str)) == FPNULL ) {
- Warning("Unable to open file %s", str);
+ if ( errno != EACCES || ! kpse_tex_hush("readable") ) {
+ Warning("Unable to open file %s (errno=%d), skipping inclusion",
+ str, errno);
+ }
return;
}
minx = 32767; /* Set to a high value initially */
@@ -4162,6 +4168,8 @@ int n;
Warning ("TMPDIR %s is too long, using /tmp instead", base_dir);
base_dir = "/tmp";
}
+ /* FIXME: Actually, we would need a function to sanitize base_dir here.
+ There may still be constructs like /.. or similar. [03 Jul 07 -js] */
if ( base_dir[0] == '/' && base_dir[1] == '\0' ) {
Warning ("Feeling naughty, do we? / is no temporary directory, dude");
base_dir = "/tmp";