]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbind.idl: Add wbint_NormalizeNameMap
authorSamuel Cabrero <scabrero@samba.org>
Fri, 25 Apr 2025 14:13:10 +0000 (16:13 +0200)
committerSamuel Cabrero <scabrero@samba.org>
Thu, 22 May 2025 12:41:38 +0000 (12:41 +0000)
normalize_name_map(), depending on the idmap config, can query LDAP to map the
username to its alias, e.g., map samaccountname to posix uid.

To avoid blocking this call should be done in the idmap child.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
librpc/idl/winbind.idl
source3/winbindd/winbindd_dual_srv.c

index 29671dbd49825951ae9cb5139e286668936d662d..50b21a837d416f1f1a418a6419981572185a1d4e 100644 (file)
@@ -271,6 +271,12 @@ interface winbind
         [out,ref] DomainInfoFlags *flags
         );
 
+    NTSTATUS wbint_NormalizeNameMap(
+        [in,string,charset(UTF8)] char *domain_name,
+        [in,string,charset(UTF8)] char *name,
+        [out,string,charset(UTF8)] char **mapped_name
+    );
+
   /* Public methods available via IRPC */
 
     typedef [switch_type(uint16)] union netr_LogonLevel netr_LogonLevel;
index 780923a4b6bdf0b8402de1f0b3cf6364cd405bac..80a51d50f3ecfe1e75a195efad01018351d28d4f 100644 (file)
@@ -2152,4 +2152,19 @@ NTSTATUS _wbint_ListTrustedDomains(struct pipes_struct *p,
        return NT_STATUS_OK;
 }
 
+NTSTATUS _wbint_NormalizeNameMap(struct pipes_struct *p,
+                                struct wbint_NormalizeNameMap *r)
+{
+       char *mapped = NULL;
+       NTSTATUS status;
+
+       status = normalize_name_map(p->mem_ctx,
+                                   r->in.domain_name,
+                                   r->in.name,
+                                   &mapped);
+       *r->out.mapped_name = mapped;
+
+       return status;
+}
+
 #include "librpc/gen_ndr/ndr_winbind_scompat.c"