From 72bf410b6e9b85f8fbff7f6175661829bef35f62 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 Jun 1998 19:45:13 +0000 Subject: De-coupled the mapping of a Windows to UNIX username from the Get_Pwnam username case conversion wrapper. It is now (very) explicit where we are mapping between an incoming Windows username, and when we are doing a UNIX password entry lookup, which may change the case of the given username. This makes things *much* clearer (IMHO:-) and will ease the adding of the 'groupname map' parameter, and the addition of the special 'jeremy' mode for Samba where unix users will not be needed. (We must think of a better name for it :-). Jeremy. (This used to be commit fb6ed81844e7cb6049749e43ac9b4adfaf4ca2de) --- source3/rpc_server/srv_lsa.c | 13 ++++++++++++- source3/rpc_server/srv_netlog.c | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c index e723b532b1..43f463a8ab 100644 --- a/source3/rpc_server/srv_lsa.c +++ b/source3/rpc_server/srv_lsa.c @@ -371,7 +371,18 @@ static void api_lsa_lookup_names( int uid, prs_struct *data, /* convert received RIDs to strings, so we can do them. */ for (i = 0; i < q_l.num_entries; i++) { - char *user_name = unistr2(q_l.lookup_name[i].str.buffer); + fstring user_name; + fstrcpy(user_name, unistr2(q_l.lookup_name[i].str.buffer)); + /* + * Map to the UNIX username. + */ + map_username(user_name); + + /* + * Do any case conversions. + */ + (void)Get_Pwnam(user_name, True); + if (!pdb_name_to_rid(user_name, &dom_rids[i], &dummy_g_rid)) { /* WHOOPS! we should really do something about this... */ diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c index 38481cd2d3..8bcf1682bc 100644 --- a/source3/rpc_server/srv_netlog.c +++ b/source3/rpc_server/srv_netlog.c @@ -641,6 +641,16 @@ static void api_net_sam_logon( int uid, DEBUG(3,("User:[%s]\n", samlogon_user)); + /* + * Convert to a UNIX username. + */ + map_username(samlogon_user); + + /* + * Do any case conversions. + */ + (void)Get_Pwnam(samlogon_user, True); + become_root(True); smb_pass = getsmbpwnam(samlogon_user); unbecome_root(True); -- cgit