diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-02-27 17:03:19 -0500 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-02-27 17:03:19 -0500 |
commit | 18dfe3cbe7fc6730921365d424685c674fba9513 (patch) | |
tree | 8aff91e903d7bc0c710841699ea813011efa9b2a /cups/ppd-util.c | |
parent | 30df0a0309ef8f5adc2cb0739d18708b2937c207 (diff) | |
download | cups-18dfe3cbe7fc6730921365d424685c674fba9513.tar.gz |
Use a writability test for TMPDIR on macOS...
Diffstat (limited to 'cups/ppd-util.c')
-rw-r--r-- | cups/ppd-util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cups/ppd-util.c b/cups/ppd-util.c index 07d91d463..5641c79a9 100644 --- a/cups/ppd-util.c +++ b/cups/ppd-util.c @@ -222,13 +222,12 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL * 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. */ char tmppath[1024]; /* Temporary directory */ - if ((tmpdir = getenv("TMPDIR")) != NULL && !strncmp(tmpdir, "/Users/", 7)) + if ((tmpdir = getenv("TMPDIR")) != NULL && access(tmpdir, W_OK)) tmpdir = NULL; if (!tmpdir) |