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

53 Commits

Author SHA1 Message Date
Christian Ambach
088436dff3 s3:winbindd:autorid check that transaction start did work
this fixes Coverity #700172 CHECKED_RETURN

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed May  9 00:27:08 CEST 2012 on sn-devel-104
2012-05-09 00:27:08 +02:00
Christian Ambach
0bedec7abe s3:winbindd/autorid add ignore builtin parameter
BUILTIN should be handled by passdb, however if passdb does not know
about a SID, autorid creates a range for BUILTIN and does deterministic mapping

make it possible to turn off this behavior
2012-05-08 09:26:07 +02:00
Christian Ambach
2997f2fe80 s3:winbindd/autorid add support for read-only mode
make it possible to set read-only = yes for the backend
so users can replicate an autorid.tdb to another server
to use the same mappings without risking that updates
are done on both sides
2012-05-08 09:26:07 +02:00
Christian Ambach
920e3e301d s3:winbindd/autorid preallocate well-known SIDs
preallocate the list of well-known SIDs that Win2008R2 reports
to be groups and that are on the list in KB243330
This will allow for deterministic mapping of these SIDs, even if they
are stored in the allocation pool as this is the first thing that autorid
will allocate from the pool during module initialization
2012-05-08 09:26:07 +02:00
Christian Ambach
e7576e85c9 s3:winbindd/autorid use idmap_tdb_common code in autorid
- use common logic for the allocation pool
- add a idmap_tdb style 1on1 mapping for non-domain SIDs
  like Everyone (S-1-1-0)
2012-05-01 09:32:11 +02:00
Volker Lendecke
45e61fcf61 s3: Add a "lock_order" argument to db_open
This will be used to enforce a lock hierarchy between the databases. We have
seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb.
These should be fixed by refusing a dbwrap_fetch_locked that does not follow a
defined lock hierarchy.
2012-01-18 14:48:04 +01:00
Christian Ambach
75b8a24a42 s3:idmap_autorid: use less transactions
reduce the amount of transactions that are mostly unnecessary because no
updates were done, only reads

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Fri Dec 16 20:18:37 CET 2011 on sn-devel-104
2011-12-16 20:18:37 +01:00
Jelmer Vernooij
05bc4de083 Revert making public of the samba-module library.
This library was tiny - containing just two public functions than were
themselves trivial. The amount of overhead this causes isn't really worth the
benefits of sharing the code with other projects like OpenChange. In addition, this code
isn't really generically useful anyway, as it can only load from the module path
set for Samba at configure time.

Adding a new library was breaking the API/ABI anyway, so OpenChange had to be
updated to cope with the new situation one way or another. I've added a simpler
(compatible) routine for loading modules to OpenChange, which is less than 100 lines of code.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec  3 08:36:33 CET 2011 on sn-devel-104
2011-12-03 08:36:30 +01:00
Andrew Bartlett
b256799eaf lib/util Rename samba_init_module -> samba_module_init
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Christian Ambach
ed45a558ae s3:idmap_autorid: add an allocation range to autorid
this is needed to allocate gids for BUILTIN\Users and
BUILTIN\Administrators and for local users/group that
admins might want to create

autorid will now allocate one range for this purpose
and can so give out as many uids and gids as the
configured rangesize allows
2011-10-21 16:30:56 +02:00
Christian Ambach
0a85d1c891 s3:idmap_autorid: move HWM initialization into a function
we will need some more HWM soon, so move out initialization and
optimize the logic using the new interface of dbwrap_fetch_uint32
2011-10-21 16:30:56 +02:00
Christian Ambach
8d9aea2a66 s3:idmap_autorid: use strings as parameter for range allocator
this prepares for allocation of non-domain ranges that cannot be
expressed by a SID (e.g. an allocation pool)
2011-10-21 16:30:56 +02:00
Christian Ambach
a4d245b3e8 s3:winbindd/idmap make idmap modules loadable again
commit 355b5e3a83 changed the module system to
expect 'samba_init_module' as fixed initializer function
2011-10-21 16:30:56 +02:00
Christian Ambach
bfe1385e31 Revert "s3:idmap/autorid add a small alloc pool to autorid"
This reverts commit 0aa558718a.

just having 500 uid/gids values is not good enough for
users using local users and groups in the order of thousands

better solution which will use a complete range for allocated
uids/gids will come next.
2011-10-21 16:30:56 +02:00
Michael Adam
658f72128f s3:dbwrap: change dbwrap_fetch_uint32() to NTSTATUS return type (instead of bool)
for consistency and better error propagation
2011-10-11 14:17:58 +02:00
Michael Adam
603c3e1bcb s3:dbwrap: convert dbwrap_fetch_int32() to NTSTATUS return code
Return the int32 value retrieved from the db by reference.
Before this, return value "-1" was used as a error indication,
but it could also be a valid value from the database.
2011-10-11 14:17:58 +02:00
Michael Adam
f8cad3a768 s3:idmap_autorid: make a debug message more precise 2011-10-11 14:17:58 +02:00
Michael Adam
b4e528ab54 s3:idmap_autorid: untangle function from check and log status in idmap_autorid_db_init() 2011-10-11 14:17:58 +02:00
Michael Adam
0e28448a78 s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and dbwrap_fetch_bystring_upper() to NTSTATUS 2011-10-11 14:17:56 +02:00
Christian Ambach
0aa558718a s3:idmap/autorid add a small alloc pool to autorid
this is needed to allocate gids for BUILTIN\Users and
BUILTIN\Administrators

gids are stored at the start of the first domain
as RIDs start with values over 500, we have some room there
so we do not need to allocate a range

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Sep  7 15:15:09 CEST 2011 on sn-devel-104
2011-09-07 15:15:09 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and
make the fallbacke implementation functoins non-static and create a
dbwrap_private.h header file that contains their prototypes.
2011-07-29 12:23:13 +02:00
Michael Adam
c8cfd75674 s3:idmap_autorid: remove redundant code
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Jun 20 14:56:29 CEST 2011 on sn-devel-104
2011-06-20 14:56:29 +02:00
Michael Adam
d278eba784 s3:idmap_autorid: in initialize, don't leak storedconfig to talloc_tos() in the success case 2011-06-20 13:46:27 +02:00
Michael Adam
389eada12d s3:idmap_autorid: use "idmap config * : rangesize" instead of "autorid : rangesize" 2011-06-20 13:46:27 +02:00
Michael Adam
0f76273423 s3:idmap_autorid: fail initialization if the domain is not "*"
autorid can only be used as a backend for the default idmap configuration.
2011-06-20 13:46:27 +02:00
Michael Adam
8963e807e3 Revert "s3:idmap_autorid: add a talloc_stackframe() to idmap_autorid_initialize()"
This reverts commit 65490ea4e6.

This sequence of patches needs to be done differently.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sat Jun 11 12:55:11 CEST 2011 on sn-devel-104
2011-06-11 12:55:11 +02:00
Michael Adam
56e94c203f Revert "s3:idmap_autorid: use "idmap config <DOMAIN> : rangesize" instead of "autorid:rangesize""
This reverts commit b0b0b625b5.

This sequence of patches needs to be done differently.
2011-06-11 11:44:31 +02:00
Michael Adam
c4427f0646 Revert "s3:idmap_autorid: fail initialization if the domain is not "*""
This reverts commit cd8dc47bf1.

This sequence of patches needs to be done differently.
2011-06-11 11:44:31 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Michael Adam
cd8dc47bf1 s3:idmap_autorid: fail initialization if the domain is not "*"
autorid can only be used as a backend for the default idmap configuration.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Jun  7 19:13:18 CEST 2011 on sn-devel-104
2011-06-07 19:13:18 +02:00
Michael Adam
b0b0b625b5 s3:idmap_autorid: use "idmap config <DOMAIN> : rangesize" instead of "autorid:rangesize" 2011-06-07 15:55:08 +02:00
Michael Adam
65490ea4e6 s3:idmap_autorid: add a talloc_stackframe() to idmap_autorid_initialize() 2011-06-07 15:55:07 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Michael Adam
82853a613b s3:idmap: remove the params argument from the init function 2011-03-22 22:49:56 +01:00
Christian Ambach
8ae1f32229 s3:autorid make sure we set the mapping status correct on early exit
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Mar 18 16:30:36 CET 2011 on sn-devel-104
2011-03-18 16:30:36 +01:00
Volker Lendecke
5006dcff4e idmap-autorid: Slightly simplify idmap_autorid_get_domainrange
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:37 +01:00
Volker Lendecke
3947845041 idmap-autorid: Slightly simplify idmap_autorid_get_domainrange
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:37 +01:00
Volker Lendecke
6e9fb07958 idmap-autorid: Remove an unused variable
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:37 +01:00
Volker Lendecke
10953c60bd idmap-autorid: Use talloc_tos() in idmap_autorid_id_to_sid
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
6ba85beeec idmap-autorid: Remove an else branch
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
6ab0d8b998 idmap-autorid: Remove an unused variable
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
d1970a8da9 idmap-autorid: Remove an unused parameter
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
f0abb3f3f8 idmap-autorid: Use talloc_tos() in idmap_autorid_sids_to_unixids
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
db3f8ae2bf idmap-autorid: Not necessary to talloc domaincfg
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
a94cc222bd idmap-autorid: Not necessary to talloc domainsid
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
233c8bca3b s3: Remove close_fn from idmap_methods
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Mar  6 13:37:13 CET 2011 on sn-devel-104
2011-03-06 13:37:13 +01:00
Volker Lendecke
dfd33bcbb8 s3: Fix 64-bit errors
Casting those variables will lead to sscanf believing that it sees pointers to
unsigned longs. These might be 64 bit long, thus sscanf will overwrite memory
it should not overwrite. Assigning the vars later is okay, there we get
automatic type conversion. C can be nasty ...

Christian, please check!
2011-02-23 15:59:11 +01:00
Volker Lendecke
9671615592 s3: Fix an uninitialized variable use
The "goto error;" lead to the invalid talloc_free.

Christian, please check!
2011-02-23 15:59:11 +01:00