From: Michael R Sweet Date: Mon, 2 May 2022 15:46:28 +0000 (-0400) Subject: Set default auth-info-required='username,password' if a backend doesn't set an X-Git-Tag: v2.4.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4e8437ddf6023645297c3c6a22105045084c0c9;p=thirdparty%2Fcups.git Set default auth-info-required='username,password' if a backend doesn't set an authentication method (Issue #373) --- diff --git a/CHANGES.md b/CHANGES.md index d4af6211c0..c96e393f53 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,9 @@ Changes in CUPS v2.4.2 (TBA) IPP Everywhere queue (Issues #340, #343) - Re-added LibreSSL/OpenSSL support (Issue #362) - Updated the Solaris smf service file (Issue #368) +- Updated the scheduler to set "auth-info-required" to "username,password" if a + backend reports it needs authentication info but doesn't set a method for + authentication (Issue #373) - `cupsGetResponse` did not always set the last error. - Fixed a number of old references to the Apple CUPS web page. - Restored the default/generic printer icon file for the web interface. diff --git a/scheduler/job.c b/scheduler/job.c index 17d6d54bff..4912775314 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -3470,6 +3470,12 @@ finalize_job(cupsd_job_t *job, /* I - Job */ if (strncmp(job->reasons->values[0].string.text, "account-", 8)) ippSetString(job->attrs, &job->reasons, 0, "cups-held-for-authentication"); + + if (job->printer->num_auth_info_required == 1 && !strcmp(job->printer->auth_info_required[0], "none")) + { + // Default to "username,password" authentication if none is specified... + cupsdSetAuthInfoRequired(job->printer, "username,password", NULL); + } } break;