CVS update: samba/source/smbd

abartlet at samba.org abartlet at samba.org
Fri Jul 4 23:29:41 EST 2003


Date:	Fri Jul  4 13:29:41 2003
Author:	abartlet

Update of /home/cvs/samba/source/smbd
In directory dp.samba.org:/tmp/cvs-serv8054/source/smbd

Modified Files:
      Tag: SAMBA_3_0
	server.c 
Log Message:
This patch cleans up some of our ldap code, for better behaviour:

We now always read the Domain SID out of LDAP.  If the local secrets.tdb
is ever different to LDAP, it is overwritten out of LDAP.   We also
store the 'algorithmic rid base' into LDAP, and assert if it changes. 
(This ensures cross-host synchronisation, and allows for possible
integration with idmap).  If we fail to read/add the domain entry, we just
fallback to the old behaviour.

We always use an existing DN when adding IDMAP entries to LDAP, unless
no suitable entry is available.  This means that a user's posixAccount
will have a SID added to it, or a user's sambaSamAccount will have a UID
added.  Where we cannot us an existing DN, we use
'sambaSid=S-x-y-z,....' as the DN. 

The code now allows modifications to the ID mapping in many cases.

Likewise, we now check more carefully when adding new user entires to LDAP,
to not duplicate SIDs (for users, at this stage), and to add the sambaSamAccount
onto the idmap entry for that user, if it is already established (ensuring
we do not duplicate sambaSid entries in the directory).

The allocated UID code has been expanded to take into account the space
between '1000 - algorithmic rid base'.  This much better fits into what
an NT4 does - allocating in the bottom part of the RID range.  

On the code cleanup side of things, we now share as much code as
possible between idmap_ldap and pdb_ldap.

We also no longer use the race-prone 'enumerate all users' method for
finding the next RID to allocate.  Instead, we just start at the bottom
of the range, and increment again if the user already exists.  The first
time this is run, it may well take a long time, but next time will just
be able to use the next Rid.

Thanks to metze and AB for double-checking parts of this. 

Andrew Bartlett


Revisions:
server.c		1.372.2.28 => 1.372.2.29
	http://www.samba.org/cgi-bin/cvsweb/samba/source/smbd/server.c.diff?r1=1.372.2.28&r2=1.372.2.29



More information about the samba-cvs mailing list