diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-25 23:11:25 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-25 23:11:25 +0000 |
commit | 9a0cb06b240f3d772b53a6acc4804ccd9cbc4072 (patch) | |
tree | 4f1f45b3f1bb8d1165aef9312afc8fb355ae2ec9 /source3/rpc_server | |
parent | bfc38ff872446e0ad365c22327c779e72a81bef9 (diff) | |
download | samba-9a0cb06b240f3d772b53a6acc4804ccd9cbc4072.tar.gz samba-9a0cb06b240f3d772b53a6acc4804ccd9cbc4072.tar.bz2 samba-9a0cb06b240f3d772b53a6acc4804ccd9cbc4072.zip |
fixing group database issues
(This used to be commit 591c63e3e1e3201ddcd7582585b652fb848d80ca)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_netlog.c | 22 | ||||
-rw-r--r-- | source3/rpc_server/srv_sid.c | 6 |
2 files changed, 16 insertions, 12 deletions
diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c index 9fa3ed79cc..7fbd43c38e 100644 --- a/source3/rpc_server/srv_netlog.c +++ b/source3/rpc_server/srv_netlog.c @@ -600,6 +600,7 @@ static void api_net_sam_logon( uint16 vuid, DOM_CRED srv_cred; struct smb_passwd *smb_pass = NULL; UNISTR2 *uni_samlogon_user = NULL; + fstring nt_username; user_struct *vuser = NULL; @@ -654,23 +655,23 @@ static void api_net_sam_logon( uint16 vuid, if (status == 0) { - pstrcpy(samlogon_user, unistrn2(uni_samlogon_user->buffer, - uni_samlogon_user->uni_str_len)); + pstrcpy(nt_username, unistrn2(uni_samlogon_user->buffer, + uni_samlogon_user->uni_str_len)); - DEBUG(3,("User:[%s]\n", samlogon_user)); + DEBUG(3,("User:[%s]\n", nt_username)); /* * Convert to a UNIX username. */ - map_username(samlogon_user); + map_username(nt_username); /* * Do any case conversions. */ - (void)Get_Pwnam(samlogon_user, True); + (void)Get_Pwnam(nt_username, True); become_root(True); - smb_pass = getsmbpwnam(samlogon_user); + smb_pass = getsmbpwnam(nt_username); unbecome_root(True); if (smb_pass == NULL) @@ -736,6 +737,7 @@ static void api_net_sam_logon( uint16 vuid, /* XXXX hack to get standard_sub_basic() to use sam logon username */ /* possibly a better way would be to do a become_user() call */ sam_logon_in_ssb = True; + pstrcpy(samlogon_user, nt_username); pstrcpy(logon_script, lp_logon_script()); pstrcpy(profile_path, lp_logon_path()); @@ -747,8 +749,10 @@ static void api_net_sam_logon( uint16 vuid, pstrcpy(my_name, global_myname); strupper(my_name); - status = lookup_user_rids(samlogon_user, &r_uid, &r_gid); - status = getusergroupsnam(samlogon_user, &grp_mem, &num_gids) ? 0 : 0xC0000000 | NT_STATUS_INVALID_PRIMARY_GROUP; + status = lookup_user_rids(nt_username, &r_uid, &r_gid); + status = getusergroupsnam(nt_username, &grp_mem, &num_gids) ? 0 : 0xC0000000 | NT_STATUS_INVALID_PRIMARY_GROUP; + + sam_logon_in_ssb = False; if (status == 0x0) { @@ -763,7 +767,7 @@ static void api_net_sam_logon( uint16 vuid, &dummy_time, /* pass_can_change_time */ &dummy_time, /* pass_must_change_time */ - samlogon_user , /* user_name */ + nt_username , /* user_name */ vuser->real_name, /* full_name */ logon_script , /* logon_script */ profile_path , /* profile_path */ diff --git a/source3/rpc_server/srv_sid.c b/source3/rpc_server/srv_sid.c index f112b8a9ce..a428a7f068 100644 --- a/source3/rpc_server/srv_sid.c +++ b/source3/rpc_server/srv_sid.c @@ -443,7 +443,7 @@ BOOL map_domain_name_to_sid(DOM_SID *sid, char **nt_domain) DEBUG(5,("map_domain_name_to_sid: overriding NULL name to %s\n", global_sam_name)); (*nt_domain) = strdup(global_sam_name); - *sid = global_sam_sid; + sid_copy(sid, &global_sam_sid); return True; } @@ -453,13 +453,13 @@ BOOL map_domain_name_to_sid(DOM_SID *sid, char **nt_domain) global_sam_name)); free(*nt_domain); (*nt_domain) = strdup(global_sam_name); - *sid = global_sam_sid; + sid_copy(sid, &global_sam_sid); return True; } if (strequal((*nt_domain), global_sam_name)) { - *sid = global_sam_sid; + sid_copy(sid, &global_sam_sid); return True; } |