]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/tls-darwin.c
Sandboxed applications were not able to get the default printer (Issue #5676)
[thirdparty/cups.git] / cups / tls-darwin.c
index e8c4fb713f885825f68f48d4f4b45054bf72d43b..b3bd50bf819e1d7e5a0422ae543371fce87ec8cb 100644 (file)
@@ -2002,7 +2002,8 @@ static const char *                       /* O - Keychain path */
 http_cdsa_default_path(char   *buffer, /* I - Path buffer */
                        size_t bufsize) /* I - Size of buffer */
 {
-  const char *home = getenv("HOME");   /* HOME environment variable */
+  _cups_globals_t      *cg = _cupsGlobals();
+                                       /* Pointer to library globals */
 
 
  /*
@@ -2011,8 +2012,8 @@ http_cdsa_default_path(char   *buffer,    /* I - Path buffer */
   * 10.11.4 (!), so we need to create our own keychain just for CUPS.
   */
 
-  if (getuid() && home)
-    snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", home);
+  if (cg->home)
+    snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", cg->home);
   else
     strlcpy(buffer, "/etc/cups/ssl.keychain", bufsize);