]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
IPP queues using hardcoded credentials would ask for credentials (STR #4371)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 22 May 2014 13:16:25 +0000 (13:16 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 22 May 2014 13:16:25 +0000 (13:16 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11888 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
backend/ipp.c

index 37d85f0853eaef996ef1ac6d255e75fc7fd450af..9a1fef02bc7e9c0a3bd1fb6018a9b400665fa049 100644 (file)
@@ -24,6 +24,8 @@ CHANGES IN CUPS V1.7.3
        - cupsGetDestMediaCount did not work for CUPS_MEDIA_FLAGS DEFAULT
          (STR #4414)
        - Auto-typing of PWG Raster files did not work (STR #4417)
+       - IPP queues using hardcoded credentials would ask for credentials
+         (STR #4371)
 
 
 CHANGES IN CUPS V1.7.2
index 602082a6ae35e8c6e5099880d02e92e8ca85384b..778ab873cdfd62cf88c46b9ada876ceb62b8e56a 100644 (file)
@@ -91,8 +91,10 @@ static const char * const jattrs[] = /* Job attributes we want */
   "job-state",
   "job-state-reasons"
 };
-static int             job_canceled = 0;
+static int             job_canceled = 0,
                                        /* Job cancelled? */
+                       uri_credentials = 0;
+                                       /* Credentials supplied in URI? */
 static char            username[256] = "",
                                        /* Username for device URI */
                        *password = NULL;
@@ -630,6 +632,7 @@ main(int  argc,                             /* I - Number of command-line args */
       *password++ = '\0';
 
     cupsSetUser(username);
+    uri_credentials = 1;
   }
   else
   {
@@ -3028,20 +3031,23 @@ password_cb(const char *prompt,         /* I - Prompt (not used) */
   (void)method;
   (void)resource;
 
- /*
-  * Remember that we need to authenticate...
-  */
+  if (!uri_credentials)
+  {
+   /*
+    * Remember that we need to authenticate...
+    */
 
-  auth_info_required = "username,password";
+    auth_info_required = "username,password";
 
-  if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
-                      def_username))
-  {
-    char       quoted[HTTP_MAX_VALUE * 2 + 4];
-                                       /* Quoted string */
+    if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
+                       def_username))
+    {
+      char     quoted[HTTP_MAX_VALUE * 2 + 4];
+                                         /* Quoted string */
 
-    fprintf(stderr, "ATTR: auth-info-default=%s,\n",
-            quote_string(def_username, quoted, sizeof(quoted)));
+      fprintf(stderr, "ATTR: auth-info-default=%s,\n",
+             quote_string(def_username, quoted, sizeof(quoted)));
+    }
   }
 
   if (password && *password && *password_tries < 3)