diff options
author | Elia Geretto <elia.f.geretto@gmail.com> | 2022-03-11 19:32:30 +0100 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-03-17 09:14:56 +0000 |
commit | 34771e1931587807d0395c7ac7f4be18654997f4 (patch) | |
tree | eb9e5dd0a575f874e5cd5dce36b81d3d8ee942fe | |
parent | bf8f8c592b0395562a7bd296505c24ec09f65e4b (diff) | |
download | samba-34771e1931587807d0395c7ac7f4be18654997f4.tar.gz |
s3:libsmb: Fix errno for failed authentication in SMBC_server_internal()
In SMBC_server_internal(), when authentication fails, the errno value is
currently hard-coded to EPERM, while it should be EACCES instead. Use the
NT_STATUS map to set the appropriate value.
This bug was found because it breaks listing printers protected by
authentication in GNOME Control Panel.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14983
Signed-off-by: Elia Geretto <elia.f.geretto@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 16 19:44:18 UTC 2022 on sn-devel-184
(cherry picked from commit 70b9977a46e5242174b4461a7f49d5f640c1db62)
-rw-r--r-- | source3/libsmb/libsmb_server.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index b92477c88fe..09d27868c0e 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -572,7 +572,7 @@ SMBC_server_internal(TALLOC_CTX *ctx, !NT_STATUS_IS_OK(cli_session_setup_anon(c))) { cli_shutdown(c); - errno = EPERM; + errno = map_errno_from_nt_status(status); return NULL; } } |