1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

1203 Commits

Author SHA1 Message Date
Michael Adam
3f3cff9127 s3:idmap_tdb2: use idmap_rw_new_mapping in idmap_tdb2_new_mapping 2010-08-14 02:10:57 +02:00
Michael Adam
e82ef14008 s3:idmap_tdb2: add rw_ops to idmap_tdb2_context and initialize in idmap_tdb2_db_init 2010-08-14 02:10:56 +02:00
Michael Adam
307e5b239a s3:idmap: add abstract idmap_rw new_mapping mechanism without registering backends 2010-08-14 02:10:56 +02:00
Michael Adam
9897647584 s3:idmap_ad: untangle two assignments from checks 2010-08-14 02:10:56 +02:00
Michael Adam
264910b06f s3:idmap_ad: remove unused filter_low_id and filter_high_id from idmap_ad_context
The filter range from the idmap_domain is used now.
2010-08-14 02:10:56 +02:00
Michael Adam
d515d7fe49 s3:idmap_ad: use range from idmap_domain in idmap_ad_sids_to_unixids() 2010-08-14 02:10:56 +02:00
Michael Adam
96607d9543 s3:idmap_ad: use range from idmap_domain in idmap_ad_unixids_to_sids() 2010-08-14 02:10:55 +02:00
Michael Adam
f07049495d s3:idmap_rid: remove a comment that does not apply in that place.
Probably got copied from a different location.
2010-08-14 02:10:55 +02:00
Michael Adam
a758228367 s3:idmap_rid: remove unused domain_name from the idmap_rid_context. 2010-08-14 02:10:55 +02:00
Michael Adam
2916b302f3 s3:idmap_rid: remove range from idmap_rid_context()
Now, the idmap_domain range that is centrally parsed is used.
2010-08-14 02:10:55 +02:00
Michael Adam
ac63c50684 s3:idmap_rid: use range from idmap_domain in idmap_rid_sid_to_id() 2010-08-14 02:10:55 +02:00
Michael Adam
cda44b9e8e s3:idmap_rid: use ranges from idmap_domain struct in idmap_rid_id_to_sid() 2010-08-14 02:10:55 +02:00
Michael Adam
a6f58b76cc s3:idmap_rid: remove unused talloc context var from idmap_rid_sids_to_unixids() 2010-08-14 02:10:55 +02:00
Michael Adam
376e2bcc6e s3:idmap_rid: remove unused talloc context arg from idmap_rid_sid_to_id() 2010-08-14 02:10:54 +02:00
Michael Adam
597292a819 s3:idmap_rid: remove unused talloc context var from idmap_rid_unixids_to_sids() 2010-08-14 02:10:54 +02:00
Michael Adam
62833871bc s3:idmap_rid: remove unused talloc ctx argument from idmap_rid_id_to_sid() 2010-08-14 02:10:54 +02:00
Michael Adam
622bda8a67 s3:idmap_rid: untangle assignment from check in idmap_rid_initialize() 2010-08-14 02:10:54 +02:00
Michael Adam
a896ba07bb s3:idmap_ldap: add my (C) 2010-08-14 02:10:54 +02:00
Michael Adam
58cb5163f2 s3:idmap_ldap: create mappings for unmapped sids in idmap_ldap_sids_to_unixids() 2010-08-14 02:10:54 +02:00
Michael Adam
26c82596d9 s3:idmap_ldap: add a idmap_ldap_new_mapping().
High level function to create a new mapping for an unmapped sid.
This builds logic that used to reside in the top level idmap code
in the backend.
2010-08-14 02:10:54 +02:00
Michael Adam
4ed6f315d9 s3:idmap_ldap: add idmap_ldap_get_new_id() to allocate a new id given a domain
Currently this only works with the default domain, calling out
to idmap_ldap_allocate_id(). In the future this will be extended
to also work for non-default domains.
2010-08-14 02:10:54 +02:00
Michael Adam
5f77570bb6 s3:idmap_ldap: move idmap_ldap_set_mapping() further up. 2010-08-14 02:10:53 +02:00
Michael Adam
3e71eaeca0 s3:idmap_ldap: make idmap_ldap_alloc_context a member of idmap_ldap_context
this hides this beneath the idmap structure and removes a global variable
2010-08-14 02:10:53 +02:00
Michael Adam
523b94f180 s3:idmap_ldap: call idmap_ldap_alloc_init from idmap_ldap_init.
The alloc subsystem is now subordinate to the idmap system.
2010-08-14 02:10:53 +02:00
Michael Adam
c854261867 s3:idmap_ldap: remove the (now unused) range from idmap_ldap_alloc_context 2010-08-14 02:10:53 +02:00
Michael Adam
3f39921e7e s3:idmap_ldap: use ranges from idmap domain in idmap_ldap_allocate_id()
Second step in removing the idmap range from the idmap_ldap_alloc_context.
2010-08-14 02:10:53 +02:00
Michael Adam
5518bcb840 s3:idmap_ldap: add idmap_domain arg to idmap_ldap_alloc_init and verify_idpool
First step in removing idmap ranges from the idmap_ldap_alloc_context.
The range from the domain is to be used now.
2010-08-14 02:10:53 +02:00
Michael Adam
1cf27374ab s3:idmap_ldap: remove unused filter range from struct idmap_ldap_context 2010-08-14 02:10:53 +02:00
Michael Adam
5bb4a94c6c s3:idmap_ldap: don't load ranges - they have been loaded into struct idmap_domain 2010-08-14 02:10:52 +02:00
Michael Adam
634cd2e045 s3:idmap_ldap: use filter range from idmap domain, not idmap_ldap_context 2010-08-14 02:10:52 +02:00
Michael Adam
3a5f86216b s3:idmap_ldap: re-implement allocate_id in idmap methods. 2010-08-14 02:10:52 +02:00
Michael Adam
5bb5b69b0f s3:idmap_tdb: add my (C) 2010-08-14 02:10:52 +02:00
Michael Adam
78979c6420 s3:idmap_tdb: properly initialize the idmap_tdb context with zero 2010-08-14 02:10:52 +02:00
Michael Adam
9c3d4dff82 s3:idmap_tdb: prevent opening the idmap db more than once. 2010-08-14 02:10:52 +02:00
Michael Adam
66a38d8612 s3:idmap_tdb: rewrite sids_to_unixids to create mappings for unmapped sids. 2010-08-14 02:10:52 +02:00
Michael Adam
4f2bb1a259 s3:idmap_tdb: add a idmap_tdb_new_mapping().
High level function to create a new mapping for an unmapped sid.
This builds logic that used to reside in the top level idmap code
in the backend. To be called inside a transaction to guarantee
atomicity of the operation.
2010-08-14 02:10:51 +02:00
Michael Adam
47387b3ebb s3:idmap_tdb: move the set_mapping code up 2010-08-14 02:10:51 +02:00
Michael Adam
2b2a8f9b3b s3:idmap_tdb: use transaction wrapper for idmap_tdb_set_mapping(). 2010-08-14 02:10:51 +02:00
Michael Adam
b0615e4757 s3:idmap_tdb: remove unused struct idmap_tdb_state. 2010-08-14 02:10:51 +02:00
Michael Adam
28535349bd s3:idmap_tdb: remove unused idmap_alloc_db 2010-08-14 02:10:51 +02:00
Michael Adam
9010194972 s3:idmap_tdb: remove unused idmap_tdb_alloc_close(). 2010-08-14 02:10:51 +02:00
Michael Adam
2e4a0382f5 s3:idmap_tdb: give idmap_domain arg to idmap_tdb_allocate_id and use ctx->db
instead of alloc_db
2010-08-14 02:10:50 +02:00
Michael Adam
4301a81c99 s3:idmap_tdb: call idmap_tdb_init_hwm() from idmap_tdb_open_db(). 2010-08-14 02:10:50 +02:00
Michael Adam
1039506493 s3:idmap_tdb: move idmap_tdb_init_hwm up. 2010-08-14 02:10:50 +02:00
Michael Adam
f739ccb1b9 s3:idmap_tdb: remove unused idmap_tdb_load_ranges()
The idmap_tdb_state (which should actually be called idmap_tdb_alloc_context)
is being removed since the alloc part is combined with the id mapping part.
2010-08-14 02:10:50 +02:00
Michael Adam
b1285a5cb3 s3:idmap_tdb: have idmap_tdb_open_db take an idmap_domain struct as argument
the other arguments are not needed any more and are removed.
2010-08-14 02:10:49 +02:00
Michael Adam
53856fc8b0 s3:idmap_tdb: rename idmap_tdb_alloc_init->idmap_tdb_init_hwm and use db from idmap_tdb_context
instead of the special idmap_alloc_db
2010-08-14 02:10:49 +02:00
Michael Adam
384e35f8a7 s3:idmap_tdb: move definition of struct idmap_tdb_context up. 2010-08-14 02:10:47 +02:00
Michael Adam
db38972583 s3:idmap_tdb: remove filter_low_id,filter_high_id from idmap_tdb_context
These are now taken from the idmap_domain struct.
2010-08-14 02:10:47 +02:00
Michael Adam
3315f2cf9b s3:idmap_tdb: add idmap domain arg to idmap_tdb_upgrade and use domain range 2010-08-14 02:10:47 +02:00
Michael Adam
6d66018187 s3:idmap_tdb: use filter from idmap_domain rather than from idmap_tdb_context 2010-08-14 02:10:47 +02:00
Michael Adam
053e4510cd s3:idmap_tdb: give idmap domain argument to idmap_tdb_sid_to_id
instead of idmap_tdb_context. This is in preparation of using the
filter from the idmap_domain struct.
2010-08-14 02:10:47 +02:00
Michael Adam
f7a5f0987c s3:idmap_tdb: give idmap domain argument to idmap_tdb_id_to_sid
instead of idmap_tdb_context. This is in preparation of using the
filter from the idmap_domain struct.
2010-08-14 02:10:47 +02:00
Michael Adam
0f248169d9 s3:idmap_tdb: implement allocate_id in idmap methods for tdb backend 2010-08-14 02:10:46 +02:00
Michael Adam
2b9ad09ae7 s3:idmap_tdb: add idmap_tdb_get_new_id() to allocate a new id given a domain
Currently this only works with the default domain, calling out
to idmap_tdb_allocate_id(). In the future this will be extended
to also work for non-default domains.
2010-08-14 02:10:46 +02:00
Michael Adam
9e8df7403a s3:idmap_tdb: convert idmap_tdb_allocate_id() to use transaction wrappers 2010-08-14 02:10:46 +02:00
Michael Adam
85e9b35993 s3:idmap_tdb: remove an extra blank line 2010-08-14 02:10:46 +02:00
Michael Adam
aad8756dae s3:idmap_tdb2: add my (C) 2010-08-14 02:10:46 +02:00
Michael Adam
dac9f73ccd s3:idmap_tdb2: move idmap_tdb2_new_mapping() up. spare a prototype. 2010-08-14 02:10:46 +02:00
Michael Adam
627b9aa4b7 s3:idmap_tdb2: get rid of an extra variable in idmap_tdb2_db_init(). 2010-08-14 02:10:46 +02:00
Michael Adam
d27992e708 s3:idmap_tdb2: move idmap_tdb2_set_mapping() up to its _action callback. 2010-08-14 02:10:45 +02:00
Michael Adam
3bc40a0979 s3:idmap_tdb2: use the right talloc context for db_open in idmap_tdb2_open_db() 2010-08-14 02:10:45 +02:00
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
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
212627e9c0 s3:idmap: don't check range for passdb idmap domain 2010-08-14 02:10:42 +02:00
Michael Adam
24ff45ff4d s3:idmap: parse ranges and "read only" in idmap_init_domain(). 2010-08-14 02:10:42 +02:00
Michael Adam
3a2487e66b s3:idmap: remove idmap_alloc_context from idmap.c
The registering of alloc backends is being removed.
The idmap backends are responsible for initializing
their alloc code on their own if necessary.

No list of alloc backends is maintained any more in the top level.
2010-08-14 02:10:40 +02:00
Michael Adam
12a0ab3c96 s3:idmap: remove the alloc methods list from idmap.c
The registering of alloc backends is being removed.
The idmap backends are responsible for initializing
their alloc code on their own if necessary.

No list of alloc backends is maintained any more in the top level.
2010-08-14 02:10:39 +02:00
Michael Adam
a423f5151d s3:idmap: remove unused get_alloc_methods(). 2010-08-14 02:10:39 +02:00
Michael Adam
75a6c24459 s3:idmap: remove unused smb_register_idmap_alloc().
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:39 +02:00
Michael Adam
f96575d6db s3:idmap_ldap: remove unused idmap_ldap_alloc_methods. 2010-08-14 02:10:39 +02:00
Michael Adam
0369eb5555 s3:idmap_ldap: remoce unused idmap_alloc_ldap_init 2010-08-14 02:10:39 +02:00
Michael Adam
0dfe400d64 s3:idmap_ldap: don't call idmap_alloc_ldap_init in idmap_ldap_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:39 +02:00
Michael Adam
bc59660fc1 s3:idmap_tdb: remove unused idmap_alloc_methods 2010-08-14 02:10:39 +02:00
Michael Adam
5e317beadb s3:idmap_tdb: remove unused idmap_alloc_tdb_init() 2010-08-14 02:10:38 +02:00
Michael Adam
dd4adc1721 s3:idmap_tdb: don't call idmap_alloc_tdb_init in idmap_tdb_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
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