From: msweet Date: Thu, 22 May 2014 13:16:25 +0000 (+0000) Subject: IPP queues using hardcoded credentials would ask for credentials (STR #4371) X-Git-Tag: v2.2b1~627 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf3d4dd6dc3e66f48c6d6453843ffa3eebe7a499;p=thirdparty%2Fcups.git IPP queues using hardcoded credentials would ask for credentials (STR #4371) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11888 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.7.txt b/CHANGES-1.7.txt index 37d85f085..9a1fef02b 100644 --- a/CHANGES-1.7.txt +++ b/CHANGES-1.7.txt @@ -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 diff --git a/backend/ipp.c b/backend/ipp.c index 602082a6a..778ab873c 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -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)