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

62 Commits

Author SHA1 Message Date
Michael Adam
39079acc57 s3:idmap_tdb2: don't check whether sid is already mapped in idmap_tdb2_new_mapping().
idmap_tdb2_new_mapping() is called from inside a transaction only
with sids, that have been verified not to be mapped directly before
that in the same transaction.
2010-08-14 02:10:45 +02:00
Michael Adam
1a52e0d25b s3:idmap_tdb2: add the db_context to the idmap_tdb2_context
this removes the idmap_tdb2 global variable
2010-08-14 02:10:45 +02:00
Michael Adam
83ad3cdf69 s3:idmap_tdb2: talloc_zero (instead of talloc) the idmap_tdb2_context 2010-08-14 02:10:45 +02:00
Michael Adam
c08a45ebd9 s3:idmap_tdb2: rename idmap_tdb2_alloc_load -> idmap_tdb2_init_hwm 2010-08-14 02:10:45 +02:00
Michael Adam
41cead6a31 s3:idmap_tdb2: move idmap_tdb2_alloc_load() up to reduce need for prototype 2010-08-14 02:10:45 +02:00
Michael Adam
2c549be359 s3:idmap_tdb2: remove unused idmap_tdb2_state and idmap_tdb2_load_ranges 2010-08-14 02:10:44 +02:00
Michael Adam
fd81228ed8 s3:idmap_tdb2: give idmap_tdb2_alloc_load() and idmap domain arguemnt
and use the ranges from the idmap domain for checking the HWM values
2010-08-14 02:10:44 +02:00
Michael Adam
bd4cc44c7d s3:idmap_tdb2: add an idmap_domain struct argument to idmap_tdb2_open_db() 2010-08-14 02:10:44 +02:00
Michael Adam
871945ae19 s3:idmap_tdb2: remove filter_low_id and filter_high_id from idmap_tdb2_context
Now these are taken from the idmap_domain struct.
2010-08-14 02:10:44 +02:00
Michael Adam
2842389e55 s3:idmap_tdb2: don't parse config and fill filter_low_id and filter_high_id
into idmap_tdb2_context in idmap_tdb2_db_init().
Now these are taken from the idmap_domain struct instead.
2010-08-14 02:10:44 +02:00
Michael Adam
6a70e7da58 s3:idmap_tdb2: honour the "idmap read only" flag in the tdb2 module.
Note that this will not prevent the idmap script from writing its
mappings to the database, but no new unix ids will be allocated via
the allocator and hence no new mappings will be autogenerated.
2010-08-14 02:10:43 +02:00
Michael Adam
d5c3cb5a8a s3:idmap_tdb2: use range from idmap_domain in idmap_tdb2_allocate_id 2010-08-14 02:10:43 +02:00
Michael Adam
4b10036da8 s3:idmap_tdb2: use filter from idmap_domain rather than from idmap_tdb2_context 2010-08-14 02:10:43 +02:00
Michael Adam
77096b9a26 s3:idmap_tdb2: pass idmap_domain (not idmap_tdb2_context) to idmap_tdb2_sid_to_id 2010-08-14 02:10:43 +02:00
Michael Adam
863212ad0e s3:idmap_tdb2: pass idmap_domain instead of idmap_tdb2_context to idmap_tdb2_unixids_to_sids
The reason for this will become apparent later: The ranges are being moved to
the idmap_domain: They are universal.
2010-08-14 02:10:43 +02:00
Michael Adam
bb8a4415c8 s3:idmap_tdb2: also support idmap script for named domains
this can be configured via "idmap config DOMAIN : script = foobar"
2010-08-14 02:10:43 +02:00
Michael Adam
f27858548e s3:idmap_tdb2: move the idmap script from idmap_tdb2_state to idmap_tdb2_context
The state (aka idmap_tdb2_alloc_context) is being removed.
The (global) idmap script was wrong there anyways.
It belongs to the per-domain context.
2010-08-14 02:10:43 +02:00
Michael Adam
834008c2cd s3:idmap_tdb2: remove use of idmap_tdb2_state from idmap_tdb2_allocate_id
idmap_tdb2_state should actually be called idmap_tdb2_alloc_context.
This is being removed as the idmap and allocation is moved together.
We use the idmap_tdb2_context * that is sitting in dom->private_data.
This contains the same ranges as those in the state anyways.
Later, when we can also allocate for named domains, this will become
necessary anyways.
2010-08-14 02:10:43 +02:00
Michael Adam
1dfb20d029 s3:idmap_tdb2: move definition of struct idmap_tdb2_context up. 2010-08-14 02:10:42 +02:00
Michael Adam
5b264561e7 s3:idmap_tdb2: open the db after loading the ranges in idmap_tdb2_db_init(). 2010-08-14 02:10:42 +02:00
Michael Adam
8da3d7c39b s3:idmap_tdb2: add allocation of new mappings to idmap_tdb2_sids_to_unixids
This moves the new_mapping feature inside the tdb2 backend to make creations
of mappings atomic.

Note: The new internal function idmap_tdb2_get_new_id() that is used to allocate
a new unix id is prepared to function for multiple explicitly configured idmap
domains, but currently it does only work for the default domain. The extended
allocation support requires extension of the data base format to store multiple
counters (per domain). This will be added in a later step (TODO!).
2010-08-14 02:10:42 +02:00
Michael Adam
36017ecebf s3:idmap_tdb2: re-implement allocated_id in idmap methods. 2010-08-14 02:10:42 +02:00
Michael Adam
77e41c0ad4 s3:idmap_tdb2: remove unused idmap_tdb2_alloc_init(). 2010-08-14 02:10:38 +02:00
Michael Adam
261663389b s3:idmap_tdb2: remove unused idmap_tdb2_alloc_close(). 2010-08-14 02:10:38 +02:00
Michael Adam
39fced2f33 s3:idmap_tdb2: remove unused idmap_alloc_methods. 2010-08-14 02:10:38 +02:00
Michael Adam
8a13c95931 s3:idmap_tdb2: don't call smb_register_idmap_alloc() in idmap_tdb2_init
The registering of alloc backends is being removed.
The idmap backends are responsible for initializing
their alloc code on their own if necessary.
2010-08-14 02:10:38 +02:00
Michael Adam
0d0032e744 s3:idmap: remove the set_mapping method from the idmap API 2010-08-14 02:10:36 +02:00
Michael Adam
95b840cbf1 s3:idmap: remove unused method set_id_hwm from idmap API
Michael
2010-08-14 02:10:35 +02:00
Michael Adam
3715a1687f s3:idmap: remove unused alloc method get_id_hwm from idmap API
Michael
2010-08-14 02:10:35 +02:00
Michael Adam
672ab10ee7 s3:idmap: remove unused method dump_data() from the idmap API
Michael
2010-08-14 02:10:35 +02:00
Michael Adam
0f91373156 s3:idmap: remove the remove_mapping method from API and backends
Michael
2010-08-14 02:10:34 +02:00
Michael Adam
b28371b9a4 s3:idmap_tdb2: fix a debug message 2010-08-14 02:10:29 +02:00
Michael Adam
612a333d65 s3:winbind:idmap_tdb2_set_mapping: untangle assignment from check 2010-05-20 09:18:59 +02:00
Volker Lendecke
ca860e4279 s3: range-check idmap script output
Not doing so results in the id mapping succeeding once unchecked and later on
being refused, because when reading from the tdb we do the checks.
2010-04-29 14:33:08 +02:00
Volker Lendecke
fcdba1b36f s3: Fix an uninitialized variable in idmap_tdb2_sid_to_id()
When we find an invalid record in the database, there's no point in checking
the non-existing value against the range limits.
2010-04-29 14:33:08 +02:00
Volker Lendecke
81e75bacd3 s3: Fix some nonempty blank lines 2010-04-29 14:33:07 +02:00
Günther Deschner
77a0a6e9a1 s3-idmap: fix two uninitialized variable warnings in idmap_tdb2.
Guenther
2009-08-20 15:29:16 +02:00
Michael Adam
bd34de10bc s3:winbind: use transaction in idmap_tdb2_allocate_id_action().
This uses the new dbwrap_trans_change_uint32_atomic()
instead of dbwrap_change_uint32_atomic().

Now all db write operations in idmap_tdb2.c are using
transactions.

Michael
2009-07-29 16:26:25 +02:00
Michael Adam
ded0ce8345 s3:dbwrap: change dbwrap_change_uint32_atomic() to return NTSTATUS not uint32_t.
Michael
2009-07-29 16:26:21 +02:00
Michael Adam
d916e56c4c s3:winbind: in idmap_tdb2_sid_to_id(), use transaction wrapped stores.
When a mapping is not found, then the idmap script is called (if defined).
When this gives a reply for the desired sid, this reply is stored in the db.

This patch wraps theses two store operations into a transaction by re-using
the idmap_tdb2_set_mapping_action() function previously defined
for idmap_tdb2_set_mapping().

Michael
2009-07-29 16:26:20 +02:00
Michael Adam
a9bea871c9 s3:winbind: in idmap_tdb2_id_to_sid(), use transaction wrapped stores.
When a mapping is not found, then the idmap script is called (if defined).
When this gives a reply for the desired id, this reply is stored in the db.

This patch wraps theses two store operations into a transaction by re-using
the idmap_tdb2_set_mapping_action() function previously defined
for idmap_tdb2_set_mapping().

Michael
2009-07-29 16:26:20 +02:00
Michael Adam
9e20e178b3 s3:winbind: use transaction wrapper in idmap_tdb2_allocate_id()
Michael
2009-07-29 16:26:19 +02:00
Michael Adam
ab7a7be5d4 s3:winbind: use transaction wrapper in idmap_tdb2_set_mapping()
Michael
2009-07-29 16:26:12 +02:00
Michael Adam
e12670a105 s3:idmap_tdb2: filter out of range mappings in default idmap config
This fixes bug #6416

Michael
2009-05-27 19:31:33 +02:00
Bo Yang
deb73e87b2 More fix to initialize idmap statuses 2009-03-02 15:51:55 -08:00
Michael Adam
2c1d980abe s3:idmap_tdb2: untangle assignment and check in idmap_tdb2_alloc_load()
Michael
2009-02-06 10:20:08 +01:00
Michael Adam
e0f91c8930 s3:idmap_tdb2: factor lodaing of ranges out into idmap_tdb2_load_ranges()
Michael
2009-02-06 10:20:08 +01:00
Michael Adam
2125777803 s3:idmap_tdb2: move together code that belongs together in idmap_tdb2_alloc_load
Michael
2009-02-06 10:20:08 +01:00
Michael Adam
30d08223e6 s3:idmap_tdb2: streamline idmap_tdb2_sid_to_id,
adding tmp talloc ctx and removing a variable

Michael
2009-02-06 10:20:07 +01:00
Andrew Tridgell
a93dc2c858 removed unused variables 2008-09-29 14:01:00 +02:00