summaryrefslogtreecommitdiff
path: root/source3/smbd/password.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/password.c')
-rw-r--r--source3/smbd/password.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index c4f813b00c..8dff42471f 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -68,6 +68,7 @@ void invalidate_vuid(uint16 vuid)
SAFE_FREE(vuser->logon_script);
session_yield(vuser);
+ SAFE_FREE(vuser->session_keystr);
free_server_info(&vuser->server_info);
@@ -141,9 +142,15 @@ int register_vuid(auth_serversupplied_info *server_info, const char *smb_name)
/* the next functions should be done by a SID mapping system (SMS) as
* the new real sam db won't have reference to unix uids or gids
*/
+ if (!IS_SAM_UNIX_USER(server_info->sam_account)) {
+ DEBUG(0,("Attempted session setup with invalid user. No uid/gid in SAM_ACCOUNT\n"));
+ free(vuser);
+ free_server_info(&server_info);
+ return UID_FIELD_INVALID;
+ }
- vuser->uid = server_info->uid;
- vuser->gid = server_info->gid;
+ vuser->uid = pdb_get_uid(server_info->sam_account);
+ vuser->gid = pdb_get_gid(server_info->sam_account);
vuser->n_groups = server_info->n_groups;
if (vuser->n_groups) {