s3:idmap_hash: reliable return ID_TYPE_BOTH
commitd8339056eef2845805f573bd8b0f3323370ecc8f
authorStefan Metzmacher <metze@samba.org>
Fri, 23 Oct 2020 10:21:57 +0000 (23 12:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 22 Jan 2021 11:32:46 +0000 (22 11:32 +0000)
treebfaf66919267240bdbb6a9446f3a543d36483a23
parent73528f26eea24033a7093e5591b8f89ad2b8644e
s3:idmap_hash: reliable return ID_TYPE_BOTH

idmap_hash used to bounce back the requested type,
which was ID_TYPE_UID, ID_TYPE_GID or ID_TYPE_NOT_SPECIFIED
before as the winbindd parent always used a lookupsids.
When the lookupsids failed because of an unknown domain,
the idmap child weren't requested at all and the caller
sees ID_TYPE_NOT_SPECIFIED.

This module should have supported ID_TYPE_BOTH since
samba-4.1.0, similar to idmap_rid and idmap_autorid.

Now that the winbindd parent will pass ID_TYPE_BOTH in order to
indicate that the domain exists, it's better to always return
ID_TYPE_BOTH instead of a random mix of ID_TYPE_UID, ID_TYPE_GID
or ID_TYPE_BOTH. In order to request a type_hint it will return
ID_REQUIRE_TYPE for ID_TYPE_NOT_SPECIFIED, which means that
the parent at least assures that the domain sid exists.
And the caller still gets ID_TYPE_NOT_SPECIFIED if the
domain doesn't exist.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14539

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jan 22 11:32:46 UTC 2021 on sn-devel-184
source3/winbindd/idmap_hash/idmap_hash.c