]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror macOS web interface authentication fix from master.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 29 Jun 2018 17:45:52 +0000 (13:45 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 29 Jun 2018 17:45:52 +0000 (13:45 -0400)
CHANGES.md
cups/auth.c
scheduler/client.c

index d31c1601f71a358bbe09cd1bf56f43c5443b29a2..9574a48ca305798672913a779b27a78fe3271292 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.2.9 - 2018-06-18
+CHANGES - 2.2.9 - 2018-06-29
 ============================
 
 
@@ -14,6 +14,7 @@ Changes in CUPS v2.2.9
 - Fixed a crash bug in the Epson dot matrix driver (Issue #5323)
 - Automatic debug logging of job errors did not work with systemd (Issue #5337)
 - The web interface did not list the IPP Everywhere "driver" (Issue #5338)
+- Authentication in the web interface did not work on macOS (rdar://41444473)
 - Fixed a memory leak for some IPP (extension) syntaxes.
 
 
index 740b079891c6efdb0370a719716fbc493fe1beb3..175c53892006f8b33a6b132b2f09f479b84d9edb 100644 (file)
@@ -1121,10 +1121,6 @@ cups_local_auth(http_t *http)            /* I - HTTP connection to server */
   if (cups_auth_find(www_auth, "Negotiate"))
     return (1);
 #  endif /* HAVE_GSSAPI */
-#  ifdef HAVE_AUTHORIZATION_H
-  if (cups_auth_find(www_auth, "AuthRef"))
-    return (1);
-#  endif /* HAVE_AUTHORIZATION_H */
 
 #  if defined(SO_PEERCRED) && defined(AF_LOCAL)
  /*
@@ -1174,7 +1170,7 @@ cups_local_auth(http_t *http)             /* I - HTTP connection to server */
     * No certificate for this PID; see if we can get the root certificate...
     */
 
-    DEBUG_printf(("9cups_local_auth: Unable to open file %s: %s", filename, strerror(errno)));
+    DEBUG_printf(("9cups_local_auth: Unable to open file \"%s\": %s", filename, strerror(errno)));
 
     if (!cups_auth_param(schemedata, "trc", trc, sizeof(trc)))
     {
@@ -1186,7 +1182,8 @@ cups_local_auth(http_t *http)             /* I - HTTP connection to server */
     }
 
     snprintf(filename, sizeof(filename), "%s/certs/0", cg->cups_statedir);
-    fp = fopen(filename, "r");
+    if ((fp = fopen(filename, "r")) == NULL)
+      DEBUG_printf(("9cups_local_auth: Unable to open file \"%s\": %s", filename, strerror(errno)));
   }
 
   if (fp)
index 07197007f3fbb005ffc5191b8d299fc0361a5349..a21b909a8cd7d76c087e410504dea27a1f0f3973 100644 (file)
@@ -2413,7 +2413,7 @@ cupsdSendHeader(
 #ifdef HAVE_AUTHORIZATION_H
        if (!_cups_strncasecmp(name, "@AUTHKEY(", 9))
        {
-         snprintf(auth_key, auth_size, ", AuthRef key=\"%s\"", name + 9);
+         snprintf(auth_key, auth_size, ", AuthRef key=\"%s\", Local trc=\"y\"", name + 9);
          need_local = 0;
          /* end parenthesis is stripped in conf.c */
          break;
@@ -2424,11 +2424,10 @@ cupsdSendHeader(
        {
 #ifdef HAVE_AUTHORIZATION_H
          if (SystemGroupAuthKey)
-           snprintf(auth_key, auth_size, ", AuthRef key=\"%s\"", SystemGroupAuthKey);
+           snprintf(auth_key, auth_size, ", AuthRef key=\"%s\", Local trc=\"y\"", SystemGroupAuthKey);
           else
-#else
-         strlcpy(auth_key, ", Local trc=\"y\"", auth_size);
 #endif /* HAVE_AUTHORIZATION_H */
+         strlcpy(auth_key, ", Local trc=\"y\"", auth_size);
          need_local = 0;
          break;
        }