]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/auth.c
Import CUPS v2.0.3
[thirdparty/cups.git] / scheduler / auth.c
index 4e5ad5b9a439f0793db68f2fa23cf276e2c68aae..3f3f411be839cc14fa7db9af8c5241c0e9955f21 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: auth.c 12124 2014-08-28 15:37:22Z msweet $"
+ * "$Id: auth.c 12604 2015-05-06 01:43:05Z msweet $"
  *
  * Authorization routines for the CUPS scheduler.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * This file contains Kerberos support code, copyright 2006 by
@@ -835,7 +835,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
     * to use it...
     */
 
-    if (gss_init_sec_context == NULL)
+    if (&gss_init_sec_context == NULL)
     {
       cupsdLogMessage(CUPSD_LOG_WARN,
                       "[Client %d] GSSAPI/Kerberos authentication failed "
@@ -1375,6 +1375,7 @@ cupsdCopyLocation(
   if (loc->location)
     temp->location = _cupsStrAlloc(loc->location);
 
+  temp->length     = loc->length;
   temp->limit      = loc->limit;
   temp->order_type = loc->order_type;
   temp->type       = loc->type;
@@ -1477,6 +1478,8 @@ cupsdFindBest(const char   *path, /* I - Resource path */
                  CUPSD_AUTH_LIMIT_DELETE,
                  CUPSD_AUTH_LIMIT_TRACE,
                  CUPSD_AUTH_LIMIT_ALL,
+                 CUPSD_AUTH_LIMIT_ALL,
+                 CUPSD_AUTH_LIMIT_ALL,
                  CUPSD_AUTH_LIMIT_ALL
                };
 
@@ -1502,7 +1505,11 @@ cupsdFindBest(const char   *path,        /* I - Resource path */
       *uriptr = '\0';
   }
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindBest: uri = \"%s\"...", uri);
+  if ((uriptr = strchr(uri, '?')) != NULL)
+    *uriptr = '\0';            /* Drop trailing query string */
+
+  if ((uriptr = uri + strlen(uri) - 1) > uri && *uriptr == '/')
+    *uriptr = '\0';            /* Remove trailing '/' */
 
  /*
   * Loop through the list of locations to find a match...
@@ -1512,12 +1519,14 @@ cupsdFindBest(const char   *path,       /* I - Resource path */
   best    = NULL;
   bestlen = 0;
 
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindBest: uri = \"%s\", limit=%x...", uri, limit);
+
+
   for (loc = (cupsd_location_t *)cupsArrayFirst(Locations);
        loc;
        loc = (cupsd_location_t *)cupsArrayNext(Locations))
   {
-    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindBest: Location %s Limit %x",
-                    loc->location ? loc->location : "nil", loc->limit);
+    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindBest: Location %s(%d) Limit %x", loc->location ? loc->location : "(null)", (int)loc->length, loc->limit);
 
     if (!strncmp(uri, "/printers/", 10) || !strncmp(uri, "/classes/", 9))
     {
@@ -2327,5 +2336,5 @@ to64(char          *s,                    /* O - Output string */
 
 
 /*
- * End of "$Id: auth.c 12124 2014-08-28 15:37:22Z msweet $".
+ * End of "$Id: auth.c 12604 2015-05-06 01:43:05Z msweet $".
  */