1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-18 17:57:55 +03:00

106 Commits

Author SHA1 Message Date
Volker Lendecke
9d317fb533 Don't set a mapping that is already there.
Volker
-
Jeremy Allison
1714eb6bef Merge of Volkers patch to make the logic clearer (with my mod).
Jeremy.
-
Jeremy Allison
ba112bb3fd Fix missing ret = found by Volker.
Jeremy.
-
Jeremy Allison
8f830c509a Some const correctness. Stop tdb being used as a remote backend. If an
idmap backend is specified cause smbd to ask winbindd (use winbindd if
you want a consistant remote backend solution).
Should work well enough for next beta now...
Jeremy.
-
Jeremy Allison
5b998cdc1d Add include guards around idmap.h, change ID_NOMAP to ID_QUERY_ONLY
and ID_CACHE to ID_CACHE_SAVE. Added locking around tdb writes & deletes
for multi-process access.
Jeremy.
-
Jeremy Allison
030b35ca0f As has been pointed out, ordering here doesn't matter so use normal
add.
Jeremy.
-
Jeremy Allison
a304bc5ff1 Fix immediate bug where the idmap can't tell the difference between an entry
not being present (and so allocate another) and an entry that is present but
of the wrong type. This code still has major problems...
Jeremy.
-
Jeremy Allison
dd9251e6f5 Ensure idmap backends are added in the correct order (DLIST_ADD puts
things at the *front* of the list). Add more debug. Still broken.. :-(.
Jeremy.
-
Volker Lendecke
fdcfefd7f1 Fix a warning in a DEBUG
Clean up the init a little bit, less nested if-statements.

Agreed upon with Simo.

Volker
-
Simo Sorce
e154e50fed Tought I already done.
Set back 3.0 to use only winbindd_idmap.tdb as idmap database as told on
samba-technical.
Tested and working so far.
-
Jeremy Allison
a118648d95 More debugs for this... (these should have been here already !).
Jeremy.
-
Jeremy Allison
705915d9f7 More instrumentation tracking down this bug...
Jeremy.
-
Jeremy Allison
bdffc81c9d Start to instrument this code as I try and track down a nasty bug that
causes mapping to dissapear...
Jeremy.
-
Simo Sorce
c501e84d41 Found out a good number of NT_STATUS_IS_ERR used the wrong way.
As abartlet rememberd me NT_STATUS_IS_ERR != !NT_STATUS_IS_OK

This patch will cure the problem.
Working on this one I found 16 functions where I think NT_STATUS_IS_ERR() is
used correctly, but I'm not 100% sure, coders should check the use of
NT_STATUS_IS_ERR() in samba is ok now.

Simo.
-
Andrew Bartlett
74709e159c This patch fixes some issues with idmap_tdb as raised by bug #181
The idea here is to eliminate the need to *set* the 'HWM' (High Water
Mark) in the tdb.  Instead, each caller wanting to add an item to the
TDB uses the fact that an insert will *fail* if entry already exists.

More importantly, this means that we don't need to know the value of the
idmap uid/gid values when setting arbitrary entries, which can occur on
an smb.conf without such values specified.

Then all we need to do is loop until we get an id that will insert.
This means that the HWM does not need to be accurate, and we can have
IDs allocates safely above the HWM.

Setting the HWM to an arbitrary value was racy in the past - now we
don't even do it.

This patch also adds paranoia in reading the tdb - both the entry, and
it's reverse entry must be present.  This means that we don't need to
'clean up' after an abnormal failure (which would probably fail too),
instead we rely on readers to ignore the half-completed entry.  The way
this is done will allow SIDs to then allocated an ID when things are
normal again.

Andrew Bartlett
-
Andrew Bartlett
f93167a7e1 This patch works towards to goal of common code shared between idmap_ldap
and pdb_ldap.

So far, it's just a function rename, so that the next patch can be a very
simple matter of copying functions, without worrying about what changed
in the process.

Also removes the 'static' pointers for the rebind procedures, replacing them
with a linked list of value/key lookups.  (Only needed on older LDAP client
libs)

Andrew Bartlett
-
Simo Sorce
e341e7c49f Ok, this patch removes the privilege stuff we had in, unused, for some time.
The code was nice, but put in the wrong place (group mapping) and not
supported by most of the code, thus useless.

We will put back most of the code when our infrastructure will be changed
so that privileges actually really make sense to be set.

This is a first patch of a set to enhance all our mapping code cleaness and
stability towards a sane next beta for 3.0 code base

Simo.
-
Volker Lendecke
5849053930 There's nothing particularly secret in idmap.tdb, so create it with
0644 as the other databases.

Volker
-
Volker Lendecke
2392f460ae And more other memory leaks. One new (idmap) and one ancient (groupdb).
Volker
-
Volker Lendecke
dcdb6683a7 Fix memory leak in idmap. Valgrind is soooo cool.
Volker
-
Volker Lendecke
c0575be936 Add 'net idmap restore'. This restores a broken idmap file
from the output of 'net idmap dump'.

'net idmap dump' now also prints the USER/GROUP HWM.

Volker
-
Volker Lendecke
d1eac2c758 Sorry idra for messing around with your stuff, but this was obviously not
tested.

Incrementing HWW_USER while allocating a GROUPID looked somewhat wrong.

Volker
-
Simo Sorce
df0df941d8 avoid races in getting high watermark -
Jeremy Allison
6a07d19b63 Fix for crash bug noticed by Luke Howard | PADL Software Pty Ltd | www.padl.com.
Jeremy.
-
Gerald Carter
1665926281 * break out more common code used between pdb_ldap and idmap_ldap
* remove 'winbind uid' and 'winbind gid' parameters (replaced
  by current idmap parameter)
* create the sambaUnixIdPool entries automatically in the 'ldap
  idmap suffix'
* add new 'ldap idmap suffix' and 'ldap group suffix' parametrer
* "idmap backend = ldap" now accepts 'ldap:ldap://server/' format
  (parameters are passed to idmap init() function
-
Gerald Carter
8241758544 working draft of the idmap_ldap code.
Includes sambaUnixIdPool objectclass

Still needs cleaning up wrt to name space.
More changes to come, but at least we now have a
a working distributed winbindd solution.
-
Gerald Carter
eafd53a7e7 added idmap_ldap to wrong branch. -
cvs2svn Import User
7a85a96325 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. -
Gerald Carter
69c84ad06b initial version of idmap_ldap.c; lots of updates to come -
Jeremy Allison
b6b844a1a2 function() is *NOT* a valid C proto, but C++ only.
The correct prototype in C is function(void).
Please remember this !
Jeremy.
-
Jelmer Vernooij
7e352f5c62 Add smb_register_idmap(). Based on a patch from metze -
Simo Sorce
b24c0efc4b add idmap_winbind unless I made a better way to solve SID type for domain
SIDs
-
Gerald Carter
a1326ea348 syncing LDAP schema changes with Samba_3_0 -
Gerald Carter
998586e652 *****LDAP schema changes*****
New objectclass named sambaSamAccount which uses attribute
prefaced with the phrase 'samba' to prevent future name clashes.

Change in functionality of the 'ldap filter' parameter.  This always
defaults to "(uid=%u)" now and is and'd with the approriate objectclass
depending on whether you are using ldapsam_compat or ldapsam

conversion script for migrating from sambaAccount to
sambaSamAccount will come next.
-
Jeremy Allison
e12934c67b Fix compiler warnings.
Jeremy.
-
Jeremy Allison
2a6d0c2481 Fix obvious compiler warnings.
Jeremy.
-
cvs2svn Import User
f1e5990657 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. -
Simo Sorce
921215cf4b fixes to *_util.c files
add winbindd_passdb backend
this makes it possible to have nua accounts on security = user servers to
show up in unic through nss_winbind.so

the problem is that we do not have group support, so nss group support is
not very good at this time (read: totally absent)

we NEED group support in passdb
-
Simo Sorce
21701876dc shouldn't wellknown group be well.. ..WKN_GRP ?
make a new sam_Account contain our domain by default, windows will complain
on logon otherwise.
fix stupid typo in idmap_util.c
-
Simo Sorce
7ae6162e1d fix wrong debug messages in idmap_util.c
correctly handle allocated rids in tdbsam
-
Simo Sorce
62365023db init wellknown in pdbedit too
add group mapping mappings to idmap at startup
-
Simo Sorce
568feee897 proper wellknown sids initialization at startup -
cvs2svn Import User
a1ffe2a29c This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. -
Simo Sorce
6d036761e5 *id_to_*id call reshape to return NTSTATUS errors
plus internal fixes
1st stage
-
Simo Sorce
6a7689cf74 correctly initiazlize idmap tdb when creationg new
few fixes to *id_to_*id functions, we don't set the mapping for algoritmic
RIDs, they are resolved in the classic way
eliminate getpw* calls from tdbsam
-
Simo Sorce
db571a9fd7 auto-init for utility functions -
Simo Sorce
6a6f603246 This is a nice rewrite:
SAM_ACCOUNT does not have anymore uid and gid fields
all the code that used them has been fixed to use the proper idmap calls

fix to idmap_tdb for first time idmap.tdb initialization.

auth_serversupplied_info structure has now an uid and gid field

few other fixes to make the system behave correctly with idmap

tested only with tdbsam, but smbpasswd and nisplus should be ok

have not tested ldap !
-
Simo Sorce
3c2963f8e3 forgot to add the file where things moved -
Simo Sorce
f7041ec5d7 consolidate idmap code in one place -
Simo Sorce
9d7d007443 make winbind use idmap as well.
change idmap_init call

removed ldap backend for winbind idmap, seem it had problems anyway and it
have to be reworked to work with idmap without calling winbind code.

simo
-