1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/source4/auth
Tim Beale 2fa2f132ae dsdb: Avoid calculating the PSO multiple times
In a typical user login query, the code tries to work out the PSO 2-3
times - once for the msDS-ResultantPSO attribute, and then again for the
msDS-User-Account-Control-Computed & msDS-UserPasswordExpiryTimeComputed
constructed attributes.

The PSO calculation is reasonably expensive, mostly due to the nested
groups calculation. If we've already constructed the msDS-ResultantPSO
attribute, then we can save ourselves extra work by just re-fetching the
result directly, rather than expanding the nested groups again from
scratch.

The previous patch improves efficiency when there are no PSOs in the
system. This should improve the case where there are PSOs that apply to
the users. (Unfortunately, it won't help where there are some PSOs in
the system, but no PSO applies to the user being queried).

Also updated sam.c so the msDS-ResultantPSO gets calculated first,
before the other constructed attributes.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed May 23 10:09:11 CEST 2018 on sn-devel-144
2018-05-23 10:09:10 +02:00
..
gensec s4:auth: Add FALL_THROUGH statements in gensec_krb5.c 2018-03-01 04:37:43 +01:00
kerberos auth: keytab invalidation fix 2018-05-15 15:45:08 +02:00
ntlm auth: Use DBGC_AUTH as DBGC_CLASS for AD DC NTLM auth code. 2018-05-21 23:48:18 +02:00
tests auth: keytab invalidation test 2018-05-15 12:41:55 +02:00
auth.h s4:auth: add authsam_update_user_info_dc() that implements SID expanding for the local domain 2018-03-19 20:30:51 +01:00
pyauth.c s4/auth: Additionally accept unicode as string param in Py2 2018-04-30 15:43:19 +02:00
pyauth.h pytalloc: Use consistent prefix for functions, add ABI file. 2011-08-10 15:36:21 +02:00
sam.c dsdb: Avoid calculating the PSO multiple times 2018-05-23 10:09:10 +02:00
samba_server_gensec.c s4:auth: use talloc_reparent() in samba_server_gensec_krb5_start() 2017-05-30 08:06:07 +02:00
session.c auth: Use DBGC_AUTH as DBGC_CLASS for AD DC auth session code. 2018-05-22 02:42:32 +02:00
session.h Fix public header not to include private (not installed) ones. 2011-03-14 17:01:20 +01:00
system_session.c auth: Use DBGC_AUTH as DBGC_CLASS for AD DC auth session code. 2018-05-22 02:42:32 +02:00
unix_token.c auth: Use DBGC_AUTH as DBGC_CLASS for AD DC auth session code. 2018-05-22 02:42:32 +02:00
wscript_build auth: keytab invalidation test 2018-05-15 12:41:55 +02:00
wscript_configure s4:auth/gensec: remove unused and untested cyrus_sasl module 2015-06-23 22:12:08 +02:00