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:
parent
1b42ccfc23
commit
6201b30421
@ -1845,6 +1845,9 @@ sub provision_ad_dc($$$$$$)
|
|||||||
copy = print1
|
copy = print1
|
||||||
[print3]
|
[print3]
|
||||||
copy = print1
|
copy = print1
|
||||||
|
[print4]
|
||||||
|
copy = print1
|
||||||
|
guest ok = yes
|
||||||
[lp]
|
[lp]
|
||||||
copy = print1
|
copy = print1
|
||||||
";
|
";
|
||||||
|
@ -156,10 +156,12 @@ int main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
|
CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
|
||||||
|
|
||||||
snprintf(auth_info_required,
|
cmp = strcmp(env, "none");
|
||||||
sizeof(auth_info_required),
|
if (cmp == 0) {
|
||||||
"%s",
|
CUPS_SMB_DEBUG("Authenticate using none (anonymous) - "
|
||||||
env);
|
"execute smbspool");
|
||||||
|
goto smbspool;
|
||||||
|
}
|
||||||
|
|
||||||
cmp = strcmp(env, "username,password");
|
cmp = strcmp(env, "username,password");
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
@ -168,13 +170,17 @@ int main(int argc, char *argv[])
|
|||||||
goto smbspool;
|
goto smbspool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if AUTH_INFO_REQUIRED=none */
|
|
||||||
cmp = strcmp(env, "negotiate");
|
cmp = strcmp(env, "negotiate");
|
||||||
if (cmp != 0) {
|
if (cmp != 0) {
|
||||||
CUPS_SMB_ERROR("Authentication unsupported");
|
CUPS_SMB_ERROR("Authentication unsupported");
|
||||||
fprintf(stderr, "ATTR: auth-info-required=negotiate\n");
|
fprintf(stderr, "ATTR: auth-info-required=negotiate\n");
|
||||||
return CUPS_BACKEND_AUTH_REQUIRED;
|
return CUPS_BACKEND_AUTH_REQUIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(auth_info_required,
|
||||||
|
sizeof(auth_info_required),
|
||||||
|
"%s",
|
||||||
|
env);
|
||||||
}
|
}
|
||||||
|
|
||||||
uid = getuid();
|
uid = getuid();
|
||||||
|
@ -48,7 +48,7 @@ test_smbspool_noargs()
|
|||||||
|
|
||||||
test_smbspool_authinforequired_none()
|
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"
|
AUTH_INFO_REQUIRED="none"
|
||||||
export AUTH_INFO_REQUIRED
|
export AUTH_INFO_REQUIRED
|
||||||
@ -60,14 +60,10 @@ test_smbspool_authinforequired_none()
|
|||||||
if [ $ret != 0 ]; then
|
if [ $ret != 0 ]; then
|
||||||
echo "$out"
|
echo "$out"
|
||||||
echo "failed to execute $smbspool_krb5"
|
echo "failed to execute $smbspool_krb5"
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$out" | grep 'ATTR: auth-info-required=negotiate'
|
|
||||||
ret=$?
|
|
||||||
if [ $ret != 0 ] ; then
|
|
||||||
echo "$out"
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user