From a94b044a5cba2d4e5d4dadbd7b3a433322748c2c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 31 Jan 2007 05:38:36 +0000 Subject: r21070: * Add the new boolean 'winbind normalize names' option as discussed on the samba-technical ml. The replacement character is hardcoded as a '_' for now. (This used to be commit bd8238417b8d692ed381a870901ff1ee4cfa80f6) --- source3/nsswitch/winbindd_rpc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source3/nsswitch/winbindd_rpc.c') diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c index 08fe129db0..6e6add2009 100644 --- a/source3/nsswitch/winbindd_rpc.c +++ b/source3/nsswitch/winbindd_rpc.c @@ -246,7 +246,7 @@ NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain, NTSTATUS result; DOM_SID *sids = NULL; enum lsa_SidType *types = NULL; - const char *full_name; + char *full_name; struct rpc_pipe_client *cli; POLICY_HND lsa_policy; @@ -262,6 +262,8 @@ NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain, return NT_STATUS_NO_MEMORY; } + ws_name_return( full_name, '_' ); + DEBUG(3,("name_to_sid [rpc] %s for domain %s\n", full_name?full_name:"", domain_name )); result = cm_connect_lsa(domain, mem_ctx, &cli, &lsa_policy); @@ -314,6 +316,9 @@ NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain, *type = (enum lsa_SidType)types[0]; *domain_name = domains[0]; *name = names[0]; + + ws_name_replace( *name, '_' ); + DEBUG(5,("Mapped sid to [%s]\\[%s]\n", domains[0], *name)); return NT_STATUS_OK; } @@ -333,6 +338,7 @@ NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain, POLICY_HND lsa_policy; DOM_SID *sids; size_t i; + char **ret_names; DEBUG(3, ("rids_to_names [rpc] for domain %s\n", domain->name )); @@ -360,10 +366,11 @@ NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain, return result; } + ret_names = *names; for (i=0; i