idmap_nss: Add a parameter to use UPNs instead of plain names
authorSamuel Cabrero <scabrero@suse.de>
Mon, 27 Nov 2023 07:05:29 +0000 (08:05 +0100)
committerSamuel Cabrero <scabrero@samba.org>
Wed, 13 Dec 2023 15:07:38 +0000 (15:07 +0000)
commita7a4d8e53332f8cae68462afab7dec86c991d96f
treeae14cb98a5e08ad61ca59f4bd5a070534a75d96c
parentc8e4777a921132082ee6421b2b456c82028fed46
idmap_nss: Add a parameter to use UPNs instead of plain names

idmap config <DOMAIN> : backend = nss
idmap config <DOMAIN> : use_upn = yes|no

When translating a Unix ID to a SID the module calls get[pwu|grg]id() but the
name returned by some NSS modules might be a UPN instead of a plain name. If
the new parameter is enabled the returned name will be parsed and correctly
handled.

On the other hand, when translating a SID to a Unix ID the module first
resolves the SID to a domain + name, and then calls get[pw|gr]name() with the
plain name, or the UPN if the new parameter is enabled.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
docs-xml/manpages/idmap_nss.8.xml
source3/winbindd/idmap_nss.c