1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

42 Commits

Author SHA1 Message Date
Volker Lendecke
c0f12170e8 idmap_rfc2307: Don't stop after 30 entries
We start over again and again, so we need to search in the whole list.
This is a quick hack generating a bad O(n^2). The real fix is to
call idmap_rfc2307_find_map with "maps" starting at the right offset,
but that's an optimization for later when it's restructured

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12757

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2017-05-08 21:08:23 +02:00
Michael Adam
c21976d4b1 idmap: don't generally forbid id==0 from idmap_unix_id_is_in_range()
If the range allows it, then id==0 should not be forbidden.
This seems to have been taken in from idmap_ldap when the
function was originally created.

See 634cd2e045 .
The other backends don't seem to have had that
extra check for id == 0.

The reasoning for this change is that the range check should
apply to all cases. If the range includes the 0, then it
should be possible to get it as result. In particular,
this way, the function becomes applicable also to the
passdb backend case, e.g. in a samba4-ad-dc setup where
the Admin gets uid == 0.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12155

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-08-16 21:27:22 +02:00
Volker Lendecke
fa8f09766e winbind: Remove unused idmap_[ug]id_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-30 14:27:23 +02:00
Volker Lendecke
50aef48e18 winbind: Introduce id_map_ptrs_init
This simplifies _wbint_Sids2UnixIDs a bit and will be re-used in _wbint_UnixIDs2Sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-30 14:27:23 +02:00
Volker Lendecke
5a2c305643 idmap: Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-01-13 07:48:30 +01:00
Volker Lendecke
2f4dad52c7 idmap: Remove "domname" from idmap_gid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:12 +02:00
Volker Lendecke
0f8c9b8d7f idmap: Remove "domname" from idmap_uid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
ac4cc24377 idmap: Remove "domname" from idmap_backends_unixid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
0a2910152a idmap: Store negative cache entries if the backend fails
This changes the behaviour for out-of-range queries: The tdb backend
(probably all backends) returns NT_STATUS_NONE_MAPPED and does not set the
map.status value to ID_UNMAPPED. This means that we did an early error
exit, not setting a negative cache value. This makes smbd ask winbind
over and over again for out-of-range gids, which can be a performance
problem in certain scenarios.

The new code makes us fall through to the code setting the negative
cache entry in all cases.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May  3 14:48:35 CEST 2013 on sn-devel-104
2013-05-03 14:48:35 +02:00
Volker Lendecke
1966e28d15 idmap: Print error from idmap_backends_unixid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-05-03 12:58:35 +02:00
Christof Schmitt
c07c167edb s3-winbindd: Move idmap_fetch_secret to idmap_utils.c for reuse
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Christof Schmitt
86d09ce779 s3-winbindd: Move common code for LDAP id mapping to idmap_utils
idmap_ad and idmap_ldap use the same helper functions and the same
maximum query size. Move the code to idmap_utils so that it can be
shared by every module issuing LDAP queries.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Michael Adam
c408126b47 s3:winbindd: remove unused idmap_sid_to_gid()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03 08:48:27 +01:00
Michael Adam
5f7a372003 s3:winbindd: remove unused idmap_sid_to_uid()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03 08:48:27 +01:00
Andrew Bartlett
c844f65779 s3-idmap: convert most idmap_cache callers to unixid API
This will eventually allow the struct unixid to be passed all the way up
and down the stack.

Andrew Bartlett

Signed-off-by: Michael Adam <obnox@samba.org>
2012-05-02 13:18:03 +02:00
Andreas Schneider
2fe5cd20b4 s3-winbind: Make sure the map is clean. 2011-11-15 14:22:00 +01:00
Michael Adam
55f7a0417f s3:winbindd/idmap_util.c: add my C 2011-01-03 08:34:04 +01:00
Christian Ambach
650c96725e s3:winbind correct a copy&paste error
negative results of sid->gid lookups should be stored with
idmap_cache_set_sid2gid instead of idmap_cache_set_sid2uid

This seems to be a copy&paste error when similar logic from the
sid2uid path was copied here in 84b88f4b.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Nov 24 16:53:01 CET 2010 on sn-devel-104
2010-11-24 16:53:01 +01:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Günther Deschner
2b41f421fd s3-idmap: only include idmap headers where needed.
Guenther
2010-08-26 00:20:29 +02:00
Michael Adam
1cd1dff756 s3:idmap: add idmap_unix_id_is_in_range() for checking an id against an idmap range 2010-08-14 02:10:42 +02:00
Michael Adam
e2968160a4 s3:idmap: add a debug message to idmap_sid_to_gid 2010-08-14 02:10:36 +02:00
Michael Adam
a08e60dd2c s3:idmap: add a debug message to idmap_sid_to_uid 2010-08-14 02:10:36 +02:00
Michael Adam
9ee3134691 s3:idmap: don't call idmap_new_mapping idmap_sid_to_gid
The setting of a new mapping is moved into the backend code
to achieve atomicity and greater flexibility.

Michael
2010-08-14 02:10:36 +02:00
Michael Adam
f301ea5977 s3:idmap: don't call idmap_new_mapping idmap_sid_to_unixid.
The setting of a new mapping is moved into the backend code
to achieve atomicity and greater flexibility.

Michael
2010-08-14 02:10:36 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Volker Lendecke
91aea36bbf Fix a typo 2009-05-16 19:22:03 +02:00
Jeremy Allison
b4c9cfb2af Fix a bunch of compiler warnings about wrong format types.
Should make Solaris 10 builds look cleaner.
Jeremy.
2009-05-11 21:56:57 -07:00
Volker Lendecke
a0a9c5d170 Fix #6167: winbindd -n should disable the winbind idmap cache 2009-03-12 10:20:08 +01:00
Michael Adam
67cc93c4a2 s3:winbindd/idmap_util: unify entering debug messages and add ouput of domain
Michael
2008-12-01 04:37:20 +01:00
Gerald W. Carter
6f46002ff6 idmap: Fix typo is gid2sid() that was caching using idmap_cache_set_sid2uid() 2008-09-25 10:46:31 -07:00
Gerald (Jerry) Carter
5571bd2913 idmap_gid_to_sid: Fix a cut-a-npaste error.
The call was looking up a uid and not gid in the cache.
(This used to be commit 25293ba150)
2008-08-22 14:54:50 -05:00
Volker Lendecke
a93d0f6f4e Do not create a new mapping if a domain with an explicit config fails
(This used to be commit 2c27de4426)
2008-08-12 11:28:29 +02:00
Volker Lendecke
340ab6a256 idmap rewrite
(This used to be commit 30a180f2fc)
2008-08-12 11:28:29 +02:00
Volker Lendecke
0c1e27abf6 Directly call backends from idmap_[ugs]_to_[ugs]id
(This used to be commit f955407042)
2008-08-12 11:28:28 +02:00
Volker Lendecke
0439d4ba61 Revert "Fix nonempty whitespace only lines"
This reverts commit cc77db2acb.
(This used to be commit ed5b516c20)
2008-07-11 17:53:25 +02:00
Volker Lendecke
ebb2d70a60 Revert "Make use of ADD_TO_ARRAY"
This reverts commit 81f334bd6d.
(This used to be commit d4d106776a)
2008-07-11 17:53:24 +02:00
Volker Lendecke
ca34287063 Make use of ADD_TO_ARRAY
(This used to be commit 81f334bd6d)
2008-07-05 12:19:13 +02:00
Volker Lendecke
e467fae948 Fix nonempty whitespace only lines
(This used to be commit cc77db2acb)
2008-07-02 15:04:46 +02:00
Jeremy Allison
4408fdaf29 Fix valgrind bug in debug statement. Don't reference uninitialized memory.
Jeremy.
(This used to be commit 25e76a19f2)
2008-05-30 17:53:16 -07:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Stefan Metzmacher
28aa4bff8d r25154: move winbindd code into winbindd/
metze
(This used to be commit 3ac7566ae1)
2007-10-10 12:30:46 -05:00