diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2014-05-22 13:16:25 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2014-05-22 13:16:25 +0000 |
commit | cf3d4dd6dc3e66f48c6d6453843ffa3eebe7a499 (patch) | |
tree | 94ee765a040bcde5363a2799c1be1ed554f9b454 /backend/ipp.c | |
parent | e639770bd4ca9a58b59601ad662713a22db14143 (diff) | |
download | cups-cf3d4dd6dc3e66f48c6d6453843ffa3eebe7a499.tar.gz |
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
Diffstat (limited to 'backend/ipp.c')
-rw-r--r-- | backend/ipp.c | 30 |
1 files changed, 18 insertions, 12 deletions
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) |