1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:smbspool_krb5_wrapper: Map AUTH_INFO_REQUIRED=none to anonymous

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Andreas Schneider 2019-10-28 09:38:08 +01:00 committed by Günther Deschner
parent 1b42ccfc23
commit 6201b30421
3 changed files with 17 additions and 12 deletions

View File

@ -1845,6 +1845,9 @@ sub provision_ad_dc($$$$$$)
copy = print1
[print3]
copy = print1
[print4]
copy = print1
guest ok = yes
[lp]
copy = print1
";

View File

@ -156,10 +156,12 @@ int main(int argc, char *argv[])
} else {
CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
snprintf(auth_info_required,
sizeof(auth_info_required),
"%s",
env);
cmp = strcmp(env, "none");
if (cmp == 0) {
CUPS_SMB_DEBUG("Authenticate using none (anonymous) - "
"execute smbspool");
goto smbspool;
}
cmp = strcmp(env, "username,password");
if (cmp == 0) {
@ -168,13 +170,17 @@ int main(int argc, char *argv[])
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;
}
snprintf(auth_info_required,
sizeof(auth_info_required),
"%s",
env);
}
uid = getuid();

View File

@ -48,7 +48,7 @@ test_smbspool_noargs()
test_smbspool_authinforequired_none()
{
cmd='$samba_smbspool_krb5 smb://$SERVER_IP/print1 200 $USERNAME "Testprint" 1 "options" $SRCDIR/testdata/printing/example.ps 2>&1'
cmd='$samba_smbspool_krb5 smb://$SERVER_IP/print4 200 $USERNAME "Testprint" 1 "options" $SRCDIR/testdata/printing/example.ps 2>&1'
AUTH_INFO_REQUIRED="none"
export AUTH_INFO_REQUIRED
@ -60,14 +60,10 @@ test_smbspool_authinforequired_none()
if [ $ret != 0 ]; then
echo "$out"
echo "failed to execute $smbspool_krb5"
fi
echo "$out" | grep 'ATTR: auth-info-required=negotiate'
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
return 1
fi
return 0
}
#