smbspool: fix Kerberos support for CUPS 1.3.
commite788d0eebcb5289cdf886df5ab71409564c4e7ce
authorMike Sweet <msweet@apple.com>
Mon, 21 Apr 2008 16:16:01 +0000 (21 09:16 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 5 May 2008 12:20:56 +0000 (5 14:20 +0200)
tree606db47a78106fda3fc89a652a29607a1f8e5960
parent859f512a45ac2c3b7f59624e4362382f7864cbd8
smbspool: fix Kerberos support for CUPS 1.3.

To summarize the changes, the patches remove the old (probably non-
working) Kerberos support code which is unnecessary with CUPS 1.3
and adds some checks on the NT status we get back to see whether
the connection error is related to authentication.  If so, we send
the ATTR: message to tell CUPS we need a username and password and
return exit code 2 so cupsd will do the right thing.

AUTH_USERNAME, AUTH_PASSWORD, and KRB5CCNAME are set and supported
by CUPS 1.3.  The new exit code is supported by CUPS 1.2.x and 1.3,
and it treated as a general failure in CUPS 1.1.  The ATTR: message
is only supported by CUPS 1.3, while CUPS 1.2 will assume the
"username,password" value we are setting.

The current code only uses the AUTH_* env vars if they are set.
If not, we fall back to the previous behavior.

I really can't tell whether the Kerberos code that was in there
would work at all. It did not work for Mac OS X which is why
I dropped it.
(cherry picked from commit 8c12c5cea01d9b801fe80c2a87b8139c488a62a5)
source/client/smbspool.c