Nice *big* patch from metze.
authorAndrew Bartlett <abartlet@samba.org>
Sat, 12 Oct 2002 03:38:07 +0000 (03:38 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 Oct 2002 03:38:07 +0000 (03:38 +0000)
commit4ac9ccfde4d36e3b6065c65c92dd02dddb78b4f2
tree3a4d155eebb79435dc1b6b9493028a259bc13a30
parent4920d2192206b6e0072d078cfba08f91bb03651d
Nice *big* patch from metze.

The actual design change is relitivly small however:

It all goes back to jerry's 'BOOL store', added to many of the elements in a
SAM_ACCOUNT.  This ensured that smb.conf defaults did not get 'fixed' into
ldap.  This was a great win for admins, and this patch follows in the same way.

This patch extends the concept - we don't store values back into LDAP unless
they have been changed.  So if we read a value, but don't update it, or we
read a value, find it's not there and use a default, we will not update
ldap with that value.  This reduced clutter in our LDAP DB, and makes it
easier to change defaults later on.

Metze's particular problem was that when we 'write back' an unchanged value,
we would clear any muliple values in that feild.  Now he can still have his
mulitivalued 'uid' feild, without Samba changing it for *every* other
operation.

This also applies to many other attributes, and helps to eliminate a nasty
race condition.  (Time between get and set)

This patch is big, and needs more testing, but metze has tested usrmgr, and
I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly
flawed ;-).

The same system will be introduced into the SAM code shortly, but this fixes
bugs that people were coming across in production uses of Samba 3.0/HEAD, hence
it's inclusion here.

Andrew Bartlett
(This used to be commit 7f237bde212eb188df84a5d8adb598a93fba8155)
20 files changed:
source3/auth/auth_unix.c
source3/auth/auth_util.c
source3/include/passdb.h
source3/include/smb.h
source3/lib/bitmap.c
source3/passdb/passdb.c
source3/passdb/pdb_compat.c
source3/passdb/pdb_get_set.c
source3/passdb/pdb_ldap.c
source3/passdb/pdb_nisplus.c
source3/passdb/pdb_smbpasswd.c
source3/passdb/pdb_tdb.c
source3/rpc_parse/parse_samr.c
source3/rpc_server/srv_netlog_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_samr_util.c
source3/smbd/chgpasswd.c
source3/smbd/password.c
source3/utils/net_rpc_samsync.c
source3/utils/pdbedit.c