1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/source3
Andrew Bartlett 4168d61fb2 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
(This used to be commit 9c595c8c23)
2003-07-04 13:29:42 +00:00
..
aparser
auth Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
bin Ignore t_stringoverflow binary. 2003-05-26 23:52:48 +00:00
client Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
codepages
groupdb Fix memleak in groupdb. Spotted by Metze 2003-07-04 09:56:50 +00:00
include This patch cleans up some of our ldap code, for better behaviour: 2003-07-04 13:29:42 +00:00
intl Merge from HEAD - make Samba compile with -Wwrite-strings without additional 2003-01-03 08:28:12 +00:00
lib This patch cleans up some of our ldap code, for better behaviour: 2003-07-04 13:29:42 +00:00
libads Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
libsmb Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
locking More fixes for debug log to catch logic error. 2003-05-22 18:56:51 +00:00
modules Found out a good number of NT_STATUS_IS_ERR used the wrong way. 2003-06-22 10:09:52 +00:00
msdfs Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
nmbd Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
nsswitch Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
pam_smbpass Found out a good number of NT_STATUS_IS_ERR used the wrong way. 2003-06-22 10:09:52 +00:00
param Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
passdb This patch cleans up some of our ldap code, for better behaviour: 2003-07-04 13:29:42 +00:00
po
popt
printing Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
profile
python Delete outdated file. 2003-06-13 00:07:59 +00:00
registry Fix broken regexp in cvsignore for *.po{,32} files. 2003-04-14 05:38:48 +00:00
rpc_client Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
rpc_parse Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
rpc_server Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
rpcclient Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. 2003-07-03 19:11:31 +00:00
sam This patch cleans up some of our ldap code, for better behaviour: 2003-07-04 13:29:42 +00:00
script merge of the netsamlogon caching code from APPLIANCE_HEAD 2003-06-21 04:05:01 +00:00
smbd This patch cleans up some of our ldap code, for better behaviour: 2003-07-04 13:29:42 +00:00
smbwrapper Patch from Guenther Deschner to fix build with gcc 3.2 2003-04-24 03:55:22 +00:00
stf Add pythoncheck to make check target. 2003-05-13 04:38:09 +00:00
tdb Different fix for memleak just committed. This belongs into 2003-07-01 13:04:50 +00:00
tests
torture Move up intialisation of logging, so we catch errors in handling 'preload modules' 2003-06-26 17:29:09 +00:00
ubiqx Merge from HEAD - make Samba compile with -Wwrite-strings without additional 2003-01-03 08:28:12 +00:00
utils This patch cleans up some of our ldap code, for better behaviour: 2003-07-04 13:29:42 +00:00
web Metze's patches: 2003-05-26 16:54:39 +00:00
wrepld Reverse previous patch from Stefan and me after comments by Andrew Bartlett 2003-05-10 11:49:51 +00:00
.cvsignore syncup with head 2003-04-02 06:00:22 +00:00
.dmallocrc
aclocal.m4 Remove the MODULES_CLEAN variable. It's no longer necessary since 2003-06-26 17:33:58 +00:00
autogen.sh Merge of head(1) portability patch. 2003-05-22 00:49:24 +00:00
change-log Remove reference to obsolete samba-bugs address. 2003-02-19 00:13:23 +00:00
config.guess Syncup with version of config.guess from HEAD. 2003-04-14 02:12:02 +00:00
config.sub Update config.guess, config.sub to the versions from the GNU autotools 2003-02-17 23:49:01 +00:00
configure.developer Use "$@" to preserve shell quoting in case somebody passes an escaped 2003-03-10 03:05:20 +00:00
configure.in Display libraries detected by configure but before configure 2003-07-04 03:03:47 +00:00
Doxyfile Remove reference to "mainpage.dox" and CodingStandards, which have 2003-02-28 04:02:16 +00:00
dynconfig.c merge from HEAD - enable dynamic RPC modules 2003-02-14 00:48:28 +00:00
install-sh
mainpage.dox Remove reference to "mainpage.dox" and CodingStandards, which have 2003-02-28 03:59:47 +00:00
Makefile.in removing nisplussam 2003-07-01 18:08:11 +00:00
smbadduser small merges from SAMBA_3_0; mostly typos, renames, etc... 2003-01-15 18:31:46 +00:00