summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_autorid_tdb.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-21idmap_autorid: fix traversal of ranges to correctly exclude mapping records.Michael Adam1-0/+8
When listing all ranges with "net idmap get ranges", the database records of the form "S-1-5-10" --> "GID 100016" were treated here as rangee mapings, resulting in an faulty printout like this: "RANGE 541346119: S-1-5-10". This patch fixes this by adding a filter that checks the size of the value datablob. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 21 19:48:40 CEST 2013 on sn-devel-104
2013-10-02idmap_autorid: allow iterate functions to operate on all domain rangesMichael Adam1-4/+2
by allowing handed in domsid to be NULL Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_delete_domain_ranges()Michael Adam1-0/+82
This uses the new idmap_autorid_iterate_domain_ranges() function. Based on earlier patch by Atul Kulkarni <atul.kulkarni@in.ibm.com>. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_iterate_domain_ranges[_read]()Michael Adam1-0/+185
Functions to perform an action on all domain range mappings for a given domain, specified by the domain sid. Inspired by a previous patch by Atul Kulkarni <atul.kulkarni@in.ibm.com>. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_delete_range_by_num()Michael Adam1-0/+119
query and delete a mapping specified by the range number. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_delete_range_by_sid()Michael Adam1-0/+119
Delete a range mapping as specified by domain SID and range index. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_build_keystr_talloc()Michael Adam1-0/+17
talloc version of idmap_autorid_build_keystr() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: extend idmap_autorid_addrange to allow to set mappings below ↵Michael Adam1-21/+40
the HWM Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: improve clarity of idmap_autorid_addrange_action() by adding ↵Michael Adam1-7/+8
mem_ctx. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_saveconfigstr()Michael Adam1-0/+16
Store a configuration as provided by a config string after parsing and validating the string. Based on similar patch by Atul Kulkarni <atul.kulkarni@in.ibm.com>. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: Don't use db as a temporary talloc context.Michael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: improve two debug messages by printing NT error codesMichael Adam1-3/+3
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: fix a debug message in idmap_autorid_addrange()Michael Adam1-2/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: for clarity, add a wrapper idmap_autorid_acquire_range() to ↵Michael Adam1-1/+7
idmap_autorid_addrange() This one calls into the HWM bumping acquire code path. Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add new function idmap_autorid_setrange()Michael Adam1-0/+17
This allows to directly set a range for a domsid#index pair. It fails if a stored range is found which is different from the requested one. Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: factor out domain range adding code into a separate functionMichael Adam1-23/+117
This also adds a new mode to the new idmap_autorid_addrange() function that allows to set a provided range if the range is available, instead of the original only mode of automatically allocating a new range by incrementing the HWM counter. Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: add idmap_autorid_getrange()Michael Adam1-0/+31
Wrapper to idmap_autorid_getrange_int(). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: improve a debug message in idmap_autorid_getrange_int()Michael Adam1-1/+2
Add output of status code. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: factor out domain range fetching part from ↵Atul Kulkarni1-20/+38
idmap_autorid_get_domainrange() Fatored out read-only function idmap_autorid_getrange() will be used elsewhere. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: Use fstr_sprintf in idmap_autorid_build_keystr()Volker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-02idmap_autorid: factor building of the keystr into a functionMichael Adam1-12/+20
to avoid code duplication. Pair-Programmed-with: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: remove fstring keystr from autorid_range_configAtul Kulkarni1-7/+16
This is just used to change the behaviour of the function. Making it more suitable to be used at other places. Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: remove autorid_global_config member from autorid_range_configAtul Kulkarni1-3/+17
global config is not part of range config. By removing this, autorid_range_config becomes more suitable for using it elsewhere. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: improve idmap_autorid_saveconfig() by adding a talloc stackframeMichael Adam1-9/+8
Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02idmap_autorid: move the checks from idmap_autorid_initialize to ↵Atul Kulkarni1-2/+61
idmap_autorid_saveconfig() Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-01idmap_autorid: change idmap_autorid_loadconfig() to return NTSTATUSMichael Adam1-7/+13
for better error propagation. Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-01idmap_autorid: refactor idmap_autorid_parse_configstr() out of ↵Michael Adam1-11/+25
idmap_autorid_loadconfig() This will be used for other purposes as well. Pair-Programmed-with: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-01idmap_autorid: rename TALLOC_CTX argument of idmap_autorid_loadconfig() to ↵Michael Adam1-3/+3
mem_ctx Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-01idmap_autorid: refactor idmap_autorid_loadconfig to use ↵Michael Adam1-6/+3
idmap_config_getconfigstr Pair-Programmed-with: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-01idmap_autorid_tdb: add idmap_autorid_getconfigstr()Michael Adam1-0/+54
Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-01idmap_autorid: extract common code to separate fileAtul Kulkarni1-0/+276
This is in preparation of adding "net idmap autorid" functionality. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>