]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fixed <Limit> inside <Location> (STR #4575)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 5 May 2015 19:52:13 +0000 (19:52 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 5 May 2015 19:52:13 +0000 (19:52 +0000)
Need to copy length when copying location.  Also strip trailing / and query
string when doing path comparison.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12600 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-2.0.txt
scheduler/auth.c

index 3fe3d59e95d6f29b3a192ea05c7324d3c3155a22..6422d712a0cc4039ac7bc325f3994866b5d6a17b 100644 (file)
@@ -8,6 +8,7 @@ CHANGES IN CUPS V2.0.3
        - Fixed potential buffer overflows in raster code and filters
          (STR #4598, STR #4599, STR #4600, STR #4601)
        - Fixed a gzip processing bug (#4602)
+       - Fixed <Limit> inside <Location> (STR #4575)
        - Added Russian translation (STR #4577)
 
 
index 23fe843a0c68e6994958e133e4250be57c22ffbf..fa8ddc44c545228d193fd2cf7ce567d92bcf5094 100644 (file)
@@ -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))
     {