mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:client: The smbspool krb5 wrapper needs negotiate for authentication
If you create a new printer it doesn't have AuthInfoRequired set and so cups calls the backend with: AUTH_INFO_REQUIRED=none In this case we need to return: ATTR: auth-info-required=negotiate and return an error that we require authentication. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12886 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jul 15 06:43:47 CEST 2017 on sn-devel-144
This commit is contained in:
parent
5fe76a5474
commit
4cced4da4c
@ -95,17 +95,26 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* If not set, then just call smbspool. */
|
||||
if (env == NULL) {
|
||||
CUPS_SMB_ERROR("AUTH_INFO_REQUIRED is not set");
|
||||
goto smbspool;
|
||||
CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED is not set - "
|
||||
"execute smbspool");
|
||||
goto smbspool;
|
||||
} else {
|
||||
CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
|
||||
cmp = strcmp(env, "negotiate");
|
||||
/* If AUTH_INFO_REQUIRED != "negotiate" then call smbspool. */
|
||||
if (cmp != 0) {
|
||||
CUPS_SMB_ERROR(
|
||||
"AUTH_INFO_REQUIRED is not set to negotiate");
|
||||
goto smbspool;
|
||||
}
|
||||
CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
|
||||
|
||||
cmp = strcmp(env, "username,password");
|
||||
if (cmp == 0) {
|
||||
CUPS_SMB_DEBUG("Authenticate using username/password - "
|
||||
"execute smbspool");
|
||||
goto smbspool;
|
||||
}
|
||||
|
||||
/* if AUTH_INFO_REQUIRED=none */
|
||||
cmp = strcmp(env, "negotiate");
|
||||
if (cmp != 0) {
|
||||
CUPS_SMB_ERROR("Authentication unsupported");
|
||||
fprintf(stderr, "ATTR: auth-info-required=negotiate\n");
|
||||
return CUPS_BACKEND_AUTH_REQUIRED;
|
||||
}
|
||||
}
|
||||
|
||||
uid = getuid();
|
||||
|
Loading…
Reference in New Issue
Block a user