summaryrefslogtreecommitdiff
path: root/cups/tempfile.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-02-27 17:03:19 -0500
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-02-27 17:03:19 -0500
commit18dfe3cbe7fc6730921365d424685c674fba9513 (patch)
tree8aff91e903d7bc0c710841699ea813011efa9b2a /cups/tempfile.c
parent30df0a0309ef8f5adc2cb0739d18708b2937c207 (diff)
downloadcups-18dfe3cbe7fc6730921365d424685c674fba9513.tar.gz
Use a writability test for TMPDIR on macOS...
Diffstat (limited to 'cups/tempfile.c')
-rw-r--r--cups/tempfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cups/tempfile.c b/cups/tempfile.c
index 622614696..bf26a08e8 100644
--- a/cups/tempfile.c
+++ b/cups/tempfile.c
@@ -63,11 +63,10 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
* On macOS and iOS, the TMPDIR environment variable is not always the best
* location to place temporary files due to sandboxing. Instead, the confstr
* function should be called to get the proper per-user, per-process TMPDIR
- * value. Currently this only happens if TMPDIR is not set or is set to
- * "/Users/...".
+ * value.
*/
- if ((tmpdir = getenv("TMPDIR")) != NULL && !strncmp(tmpdir, "/Users/", 7))
+ if ((tmpdir = getenv("TMPDIR")) != NULL && access(tmpdir, W_OK))
tmpdir = NULL;
if (!tmpdir)