idmap_tdb_common: fix a debug message in idmap_tdb_common_unixid_to_sid()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
idmap_tdb_common: fix a debug message in idmap_tdb_common_set_mapping()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
idmap_tdb_common: remove legacy comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
idmap_rid: remove a legacy comment from sid_to_id

With the introduction of the ID_TYPE_BOTH mapping
to idmap_rid, it is not a deficiency but a
virtue of the rid backend that it does not
care about the existence or type of the
sid to be mapped.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: remove a legacy comment from sid_to_id

With the introduction of the ID_TYPE_BOTH mapping
to idmap_autorid, it is not a deficiency but a
virtue of the autorid backend that it does not
care about the existence or type of the
sid to be mapped.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: improve wording in a debug message

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: add debug messages to idmap_autorid_get_domainrange()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: improve a debug message in idmap_autorid_map_sid_to_id()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: fix uninitialized return code for successful autorid.tdb creation/opening

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: fix discard-const warning in idmap_autorid_init_hwm()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: factor idmap_autorid_get_alloc_range() out of idmap_autorid_allocate_id()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: rename idmap_autorid_map_id_to_sid() -> idmap_autorid_id_to_sid_alloc()

for consistency. This is the function that maps id to sid
for the alloc range.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: rename idmap_autorid_map_sid_to_id() -> idmap_autorid_sid_to_id_alloc()

for consistency. this is the sid->id function for the alloc range.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: rename idmap_autorid_sid_to_id() -> idmap_autorid_sid_to_id_rid()

For consistency. This is the function that does the calculation
if the sid is treated by a rid range.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: more explicitly and reasonably set map->state in idmap_autorid_sid_to_id_alloc

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: explicitly return NTSTATUS_OK in idmap_autorid_sid_to_id_alloc().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: make the checks for bumping num_mapped identical for alloc and rid case

in idmap_autorid_sids_to_unixids()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: factor idmap_autorid_sid_to_id() out of idmap_autorid_sids_to_unixids()

- reduces indentation
- unifies error code paths and bumping counters
- makes the code more easy to read

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: introduce idmap_autorid_domsid_is_for_alloc()

Currently, this checks if the sid is a wellknown domain sid.
But the code reads more nicely and more domains might be added
in the future.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
autorid: reverse order of arguments of idmap_autorid_sid_to_id_alloc()

for consistency

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>