From acb81fe408f0e674088f0952aaba442ddb494b0c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 1 Nov 2001 05:02:41 +0000 Subject: Various post AuthRewrite cleanups, fixups and tidyups. Zero out some of the plaintext passwords for paranoia Fix up some of the other passdb backends with the change to *uid_t rather than uid_t. Make some of the code in srv_netlog_nt.c clearer, is passing an array around, so pass its lenght in is definition, not as a seperate paramater. Use sizeof() rather than magic numbers, it makes things easier to read. Cope with a PAM authenticated user who is not in /etc/passwd - currently by saying NO_SUCH_USER, but this can change in future. Andrew Bartlett (This used to be commit 514c91b16baca639bb04638042bf9894d881172a) --- source3/passdb/pdb_ldap.c | 4 ++-- source3/passdb/pdb_nisplus.c | 4 ++-- source3/passdb/pdb_tdb.c | 12 ++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 057395a381..9502fc5fe4 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -485,8 +485,8 @@ static BOOL init_sam_from_ldap (SAM_ACCOUNT * sampass, pdb_set_hours_len(sampass, hours_len); pdb_set_logons_divs(sampass, logon_divs); - pdb_set_uid(sampass, sys_user->pw_uid); - pdb_set_gid(sampass, sys_user->pw_gid); + pdb_set_uid(sampass, &sys_user->pw_uid); + pdb_set_gid(sampass, &sys_user->pw_gid); pdb_set_user_rid(sampass, user_rid); pdb_set_group_rid(sampass, group_rid); diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c index dddab8bdee..eceb1ea546 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -315,8 +315,8 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, const nis_object *obj pdb_set_workstations(pw_buf, ENTRY_VAL(obj, NPF_WORKSTATIONS)); pdb_set_munged_dial(pw_buf, NULL); - pdb_set_uid(pw_buf, atoi(ENTRY_VAL(obj, NPF_UID))); - pdb_set_gid(pw_buf, atoi(ENTRY_VAL(obj, NPF_SMB_GRPID))); + pdb_set_uid(pw_buf, &atoi(ENTRY_VAL(obj, NPF_UID))); + pdb_set_gid(pw_buf, &atoi(ENTRY_VAL(obj, NPF_SMB_GRPID))); pdb_set_user_rid(pw_buf, atoi(ENTRY_VAL(obj, NPF_USER_RID))); pdb_set_group_rid(pw_buf, atoi(ENTRY_VAL(obj, NPF_GROUP_RID))); diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index a170ac1345..a6c40eb970 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -463,8 +463,8 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user) uid = pw->pw_uid; gid = pw->pw_gid; - pdb_set_uid (user, uid); - pdb_set_gid (user, gid); + pdb_set_uid (user, &uid); + pdb_set_gid (user, &gid); /* increment to next in line */ global_tdb_ent.key = tdb_nextkey (global_tdb_ent.passwd_tdb, global_tdb_ent.key); @@ -538,8 +538,8 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, const char *sname) uid = pw->pw_uid; gid = pw->pw_gid; - pdb_set_uid (user, uid); - pdb_set_gid (user, gid); + pdb_set_uid (user, &uid); + pdb_set_gid (user, &gid); /* cleanup */ tdb_close (pwd_tdb); @@ -722,10 +722,6 @@ static BOOL tdb_update_sam(const SAM_ACCOUNT* newpwd, BOOL override, int flag) get_private_directory(tdbfile); pstrcat (tdbfile, PASSDB_FILE_NAME); - if ( (!pdb_get_uid(newpwd)) || (!pdb_get_gid(newpwd)) ) - DEBUG (0,("tdb_update_sam: Storing a SAM_ACCOUNT for [%s] with uid %d and gid %d!\n", - pdb_get_username(newpwd), pdb_get_uid(newpwd), pdb_get_gid(newpwd))); - /* if we don't have a RID, then FAIL */ if (!pdb_get_user_rid(newpwd)) DEBUG (0,("tdb_update_sam: Failing to store a SAM_ACCOUNT for [%s] without a RID\n",pdb_get_username(newpwd))); -- cgit