1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-29 11:21:54 +03:00
samba-mirror/source3
Stefan Metzmacher 93bac5f122 winbindd_pam: add NT4 DC handling into winbind_samlogon_retry_loop()
Handle the case where a NT4 DC does not fill in the acct_flags in
the samlogon reply info3. Yes, in 2021, there are still admins
arround with real NT4 DCs.

NT4 DCs reject authentication with workstation accounts with
NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT, even if
MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT is specified.

We no longer call dcerpc_samr_QueryUserInfo(level=16)
to get the acct_flags, as we only ever got
ACB_NORMAL back (maybe with ACB_PWNOEXP in addition),
which is easy to calculate on our own.
This was removed in commit (for 4.15.0rc1):

  commit 73528f26ee
  Author:     Ralph Boehme <slow@samba.org>
  AuthorDate: Mon Jan 11 14:59:46 2021 +0100
  Commit:     Jeremy Allison <jra@samba.org>
  CommitDate: Thu Jan 21 22:56:20 2021 +0000

      winbind: remove legacy flags fallback

      Some very old NT4 DCs might have not returned the account flags filled in. This
      shouldn't be a problem anymore. Additionally, on a typical domain member server,
      this request is (and can only be) send to the primary domain, so this will not
      work with accounts from trusted domains.

      Signed-off-by: Ralph Boehme <slow@samba.org>
      Reviewed-by: Jeremy Allison <jra@samba.org>

      Autobuild-User(master): Jeremy Allison <jra@samba.org>
      Autobuild-Date(master): Thu Jan 21 22:56:20 UTC 2021 on sn-devel-184

It means one more caller of the problematic cm_connect_sam()
function is removed! SAMR connections may not be allowed for
machine accounts with modern AD DCs.

For network logons NT4 DCs also skip the
account_name, so we have to fallback to the
one given by the client. We have code to cope
with that deeply hidden inside of netsamlogon_cache_store().

Up to Samba 4.7 netsamlogon_cache_store() operated on the
info3 structure that was passed to the caller of winbind_dual_SamLogon()
and pass propagated up to auth_winbind in smbd.

But for Samba 4.8 the following commit:

  commit f153c95176
  Author: Ralph Boehme <slow@samba.org>
  Date:   Mon Dec 11 16:25:35 2017 +0100

      winbindd: let winbind_dual_SamLogon return validation

      Signed-off-by: Ralph Boehme <slow@samba.org>
      Reviewed-by: Stefan Metzmacher <metze@samba.org>

actually changed the situation and only a temporary info3 structure
was passed into netsamlogon_cache_store(), which means
account_name was NULL and get propagated as "" into auth_winbind
in smbd, where getpwnam() is no longer possible and every
smb access gets NT_STATUS_LOGON_FAILURE.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14772

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug  3 11:10:27 UTC 2021 on sn-devel-184
2021-08-03 11:10:27 +00:00
..
auth s3:auth: Check return code of cli_credentials_set_conf() 2021-06-29 02:19:35 +00:00
build
client s3:client: Use samba_popt_get_context() 2021-05-20 02:58:36 +00:00
exports
groupdb lib: relicense smb_strtoul(l) under LGPLv3 2020-08-03 22:21:02 +00:00
include s3:smbstatus: pretty print the use of new signing/encryption algorithms 2021-07-15 00:06:31 +00:00
intl
lib s3:smbstatus: pretty print the use of new signing/encryption algorithms 2021-07-15 00:06:31 +00:00
libads s3-libnet_join: return account rid in libnet_JoinCtx 2021-07-14 16:49:30 +00:00
libgpo/gpext
libnet s3-libnet_join: always check config correctness while joining offline 2021-07-14 16:49:30 +00:00
librpc s3-libnetapi: add NetRequestOfflineDomainJoin to IDL 2021-07-14 16:49:30 +00:00
libsmb libcli/smb: actually make use of "client/server smb3 signing algorithms" 2021-07-15 00:06:31 +00:00
locale pam_winbind/ro.po: fix error from previous patch merge 2020-10-29 20:49:16 +00:00
locking smbd: Simplify share_mode_entry_do() 2021-06-04 16:47:34 +00:00
modules s3: VFS: default. In vfswrap_getxattrat_do_async() always use the pathref fsp. 2021-07-15 05:48:04 +00:00
nmbd nmbd: Reduce the wait interface loop sleep time 2021-05-14 20:52:47 +00:00
param docs-xml: add "client/server smb3 signing algorithms" options 2021-07-15 00:06:31 +00:00
passdb s3:passdb: Check return code of cli_credentials_set_conf() 2021-06-29 02:19:35 +00:00
printing samba-bgqd: Fix samba-bgqd with "clustering=yes"/"include=registry" 2021-07-31 16:58:41 +00:00
profile
registry registry: Fix a typo 2021-04-19 18:18:31 +00:00
rpc_client s3-rpc_client: add copy_netr_DsRGetDCNameInfo() helper 2021-07-14 16:49:30 +00:00
rpc_server netlogon:schannel: If weak crypto is disabled, do not announce RC4 support. 2021-08-03 09:28:38 +00:00
rpcclient s3:rpcclient: Document command of witness protocol 2021-05-25 00:23:37 +00:00
script s3:tests: Add smbclient kerberos tests for ad_dc and ad_dc_fips 2021-07-21 07:19:00 +00:00
selftest s3:selftests: Pass env variables to fips tests 2021-07-28 06:23:37 +00:00
services
smbd smbd: only open full fd for directories if needed 2021-08-02 18:05:04 +00:00
torture s3-torture: give torture test binaries their own wscript_build 2021-07-21 12:52:34 +00:00
utils s3:utils: Use better error message for smbtree 2021-07-16 03:45:19 +00:00
web
winbindd winbindd_pam: add NT4 DC handling into winbind_samlogon_retry_loop() 2021-08-03 11:10:27 +00:00
.clang_complete
.dmallocrc
.indent.pro
Doxyfile
mainpage.dox
smbadduser.in
wscript s3: expect fstatat() and dirfd() 2021-07-14 08:09:31 +00:00
wscript_build s3-torture: give torture test binaries their own wscript_build 2021-07-21 12:52:34 +00:00
wscript_configure_system_ncurses