summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-12-27 06:38:04 +0000
committerGerald Carter <jerry@samba.org>2001-12-27 06:38:04 +0000
commit04aff47c716a51a1039b44a81d6ff19eeaa09017 (patch)
treee2fc04ef3089c003baa711d55cd89310b824d44b /source3/smbd
parentb6bbc39204a4676922099ab78b6c48009266d1bb (diff)
downloadsamba-04aff47c716a51a1039b44a81d6ff19eeaa09017.tar.gz
samba-04aff47c716a51a1039b44a81d6ff19eeaa09017.tar.bz2
samba-04aff47c716a51a1039b44a81d6ff19eeaa09017.zip
moving SAM_ACCOUNT to include a bit field for initialized
members (such as uid and gid). This way we will be able to keep ourselves from writing out default smb.conf settings when the admin doesn't want to, That part is not done yet. Tested compiles with ldap/tdb/smbpasswd. Tested connection with smbpasswd backend. oh...and smbpasswd doesn'y automatically expire accounts after 21 days from the last password change either now. Just ifdef'd out that code in build_sam_account(). Will merge updates into 2.2 as they are necessary. jerry (This used to be commit f0d43791157d8f04a13a07d029f203ad4384d317)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 71837efdcb..538225e245 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -209,8 +209,8 @@ tell random client vuid's (normally zero) from valid vuids.
int register_vuid(auth_serversupplied_info *server_info, char *smb_name)
{
user_struct *vuser = NULL;
- uid_t *puid;
- gid_t *pgid;
+ uid_t uid;
+ gid_t gid;
/* Ensure no vuid gets registered in share level security. */
if(lp_security() == SEC_SHARE)
@@ -227,15 +227,15 @@ int register_vuid(auth_serversupplied_info *server_info, char *smb_name)
ZERO_STRUCTP(vuser);
- puid = pdb_get_uid(server_info->sam_account);
- pgid = pdb_get_gid(server_info->sam_account);
-
- if (!puid || !pgid) {
+ 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);
return UID_FIELD_INVALID;
}
+ uid = pdb_get_uid(server_info->sam_account);
+ gid = pdb_get_gid(server_info->sam_account);
+
/* Allocate a free vuid. Yes this is a linear search... :-) */
while( get_valid_user_struct(next_vuid) != NULL ) {
next_vuid++;
@@ -247,8 +247,8 @@ int register_vuid(auth_serversupplied_info *server_info, char *smb_name)
DEBUG(10,("register_vuid: allocated vuid = %u\n", (unsigned int)next_vuid ));
vuser->vuid = next_vuid;
- vuser->uid = *puid;
- vuser->gid = *pgid;
+ vuser->uid = uid;
+ vuser->gid = gid;
vuser->guest = server_info->guest;
fstrcpy(vuser->user.unix_name, pdb_get_username(server_info->sam_account));
fstrcpy(vuser->user.smb_name, smb_name);