From: mike Date: Fri, 14 Dec 2012 18:41:13 +0000 (+0000) Subject: Don't allow /private/tmp or /tmp for TempDir on OS X. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=281aef536401357537e1a5075223a4efde82508d;p=thirdparty%2Fcups.git Don't allow /private/tmp or /tmp for TempDir on OS X. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10770 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/scheduler/conf.c b/scheduler/conf.c index 1d741d041f..6283ea0c54 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1141,11 +1141,21 @@ cupsdReadConfiguration(void) * Update TempDir to the default if it hasn't been set already... */ +#ifdef __APPLE__ + if (TempDir && + (!strncmp(TempDir, "/private/tmp", 12) || !strncmp(TempDir, "/tmp", 4))) + { + cupsdLogMessage(CUPSD_LOG_ERROR, "Cannot use %s for TempDir.", TempDir); + cupsdClearString(&TempDir); + } + else +#endif /* __APPLE__ */ + if (!TempDir) { #ifdef __APPLE__ if ((tmpdir = getenv("TMPDIR")) != NULL && - strncmp(tmpdir, "/private/tmp", 12)) + strncmp(tmpdir, "/private/tmp", 12) && strncmp(tmpdir, "/tmp", 4)) #else if ((tmpdir = getenv("TMPDIR")) != NULL) #endif /* __APPLE__ */