]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/auth.c
Update all references to OS X to macOS.
[thirdparty/cups.git] / cups / auth.c
index f002ea00140c5857c7a3a6d62b1b0510edf2f37f..f9187ffa86667941cc9a0b5a9d8c9c26e12b6acc 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * "$Id$"
- *
  * Authentication functions for CUPS.
  *
  * Copyright 2007-2014 by Apple Inc.
@@ -104,7 +102,7 @@ static int  cups_local_auth(http_t *http);
  * This function should be called in response to a @code HTTP_STATUS_UNAUTHORIZED@
  * status, prior to resubmitting your request.
  *
- * @since CUPS 1.1.20/OS X 10.4@
+ * @since CUPS 1.1.20/macOS 10.4@
  */
 
 int                                    /* O - 0 on success, -1 on error */
@@ -122,8 +120,7 @@ cupsDoAuthentication(
   _cups_globals_t *cg;                 /* Global data */
 
 
-  DEBUG_printf(("cupsDoAuthentication(http=%p, method=\"%s\", resource=\"%s\")",
-                http, method, resource));
+  DEBUG_printf(("cupsDoAuthentication(http=%p, method=\"%s\", resource=\"%s\")", (void *)http, method, resource));
 
   if (!http)
     http = _cupsConnect();
@@ -261,7 +258,6 @@ cupsDoAuthentication(
     char       encode[33],             /* MD5 buffer */
                digest[1024];           /* Digest auth data */
 
-
     httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
     httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
 
@@ -312,7 +308,7 @@ _cupsSetNegotiateAuthString(
   * to use it...
   */
 
-  if (gss_init_sec_context == NULL)
+  if (&gss_init_sec_context == NULL)
   {
     DEBUG_puts("1_cupsSetNegotiateAuthString: Weak-linked GSSAPI/Kerberos "
                "framework is not present");
@@ -454,7 +450,7 @@ _cupsSetNegotiateAuthString(
       authsize         = sizeof(http->_authstring);
     }
 
-    strlcpy(http->authstring, "Negotiate ", authsize);
+    strlcpy(http->authstring, "Negotiate ", (size_t)authsize);
     httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value,
                   (int)output_token.length);
 
@@ -669,8 +665,7 @@ cups_local_auth(http_t *http)               /* I - HTTP connection to server */
 #  endif /* HAVE_AUTHORIZATION_H */
 
 
-  DEBUG_printf(("7cups_local_auth(http=%p) hostaddr=%s, hostname=\"%s\"",
-                http, httpAddrString(http->hostaddr, filename, sizeof(filename)), http->hostname));
+  DEBUG_printf(("7cups_local_auth(http=%p) hostaddr=%s, hostname=\"%s\"", (void *)http, httpAddrString(http->hostaddr, filename, sizeof(filename)), http->hostname));
 
  /*
   * See if we are accessing localhost...
@@ -762,7 +757,7 @@ cups_local_auth(http_t *http)               /* I - HTTP connection to server */
 
   if (
 #    ifdef HAVE_GSSAPI
-      strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
+      _cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
 #    endif /* HAVE_GSSAPI */
 #    ifdef HAVE_AUTHORIZATION_H
       !httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
@@ -809,7 +804,7 @@ cups_local_auth(http_t *http)               /* I - HTTP connection to server */
                   filename, strerror(errno)));
 
 #  ifdef HAVE_GSSAPI
-    if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
+    if (!_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
     {
      /*
       * Kerberos required, don't try the root certificate...
@@ -874,8 +869,3 @@ cups_local_auth(http_t *http)               /* I - HTTP connection to server */
   return (1);
 #endif /* WIN32 || __EMX__ */
 }
-
-
-/*
- * End of "$Id$".
- */