From e0066d2dd4d9a657d1fbcb474e66a304a64e2a31 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Thu, 6 Dec 2001 13:09:15 +0000 Subject: again an intrusive patch: - removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the definition of standard_sub_basic() to cope with that. - removed the smb.conf: 'domain admin group' and 'domain guest group' parameters ! We're not playing anymore with the user's group RIDs ! - in get_domain_user_groups(), if the user's gid is a group, put it first in the group RID list. I just have to write an HOWTO now ;-) J.F. (This used to be commit fef52c4b96c987115fb1818c00c2352c67790e50) --- source3/passdb/nispass.c | 11 +---------- source3/passdb/passdb.c | 16 ++++------------ source3/passdb/pdb_nisplus.c | 6 ------ source3/passdb/pdb_smbpasswd.c | 20 +++++--------------- source3/passdb/pdb_tdb.c | 2 -- 5 files changed, 10 insertions(+), 45 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/nispass.c b/source3/passdb/nispass.c index 3b7b90307d..2b1f6b5492 100644 --- a/source3/passdb/nispass.c +++ b/source3/passdb/nispass.c @@ -46,8 +46,6 @@ #include extern int DEBUGLEVEL; -extern pstring samlogon_user; -extern BOOL sam_logon_in_ssb; static VOLATILE sig_atomic_t gotalarm; @@ -295,12 +293,7 @@ static BOOL make_sam_from_nisp_object(struct sam_passwd *pw_buf, nis_object *obj strtol(temp, NULL, 16) : pdb_uid_to_user_rid (pw_buf->smb_userid); if (pw_buf->smb_name[strlen(pw_buf->smb_name)-1] != '$') { - - /* XXXX hack to get standard_sub_basic() to use sam logon username */ - /* possibly a better way would be to do a change_to_user() call */ - pstrcpy(samlogon_user, pw_buf->smb_name); - sam_logon_in_ssb = True; - + get_single_attribute(obj, NPF_GROUP_RID, temp, sizeof(pstring)); if (strlen(temp) > 0) @@ -332,8 +325,6 @@ static BOOL make_sam_from_nisp_object(struct sam_passwd *pw_buf, nis_object *obj #endif get_single_attribute(obj, NPF_ACCT_DESC, acct_desc, sizeof(pstring)); get_single_attribute(obj, NPF_WORKSTATIONS, workstations, sizeof(pstring)); - - sam_logon_in_ssb = False; } else { diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index f54121cf63..fa4946b093 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -121,8 +121,6 @@ BOOL pdb_init_sam_pw(SAM_ACCOUNT **new_sam_acct, const struct passwd *pwd) pstring str; GROUP_MAP map; uint32 rid; - extern BOOL sam_logon_in_ssb; - extern pstring samlogon_user; if (!pwd) { new_sam_acct = NULL; @@ -149,28 +147,22 @@ BOOL pdb_init_sam_pw(SAM_ACCOUNT **new_sam_acct, const struct passwd *pwd) rid=pdb_gid_to_group_rid(pwd->pw_gid); pdb_set_group_rid(*new_sam_acct, rid); - /* UGLY, UGLY HACK!!! */ - pstrcpy(samlogon_user, pwd->pw_name); - - sam_logon_in_ssb = True; - pstrcpy(str, lp_logon_path()); - standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, str); + standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, pwd->pw_name, str); pdb_set_profile_path(*new_sam_acct, str); pstrcpy(str, lp_logon_home()); - standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, str); + standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, pwd->pw_name, str); pdb_set_homedir(*new_sam_acct, str); pstrcpy(str, lp_logon_drive()); - standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, str); + standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, pwd->pw_name, str); pdb_set_dir_drive(*new_sam_acct, str); pstrcpy(str, lp_logon_script()); - standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, str); + standard_sub_advanced(-1, pwd->pw_name, "", pwd->pw_gid, pwd->pw_name, str); pdb_set_logon_script(*new_sam_acct, str); - sam_logon_in_ssb = False; return True; } diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c index 9fc4a0a65a..2820fa1414 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -47,8 +47,6 @@ #include extern int DEBUGLEVEL; -extern pstring samlogon_user; -extern BOOL sam_logon_in_ssb; struct nisp_enum_info { @@ -322,10 +320,6 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, const nis_object *obj /* values, must exist for user */ if( !(pdb_get_acct_ctrl(pw_buf) & ACB_WSTRUST) ) { - /* FIXME!! This doesn't belong here. - Should be set in net_sam_logon() - --jerry */ - pstrcpy(samlogon_user, pdb_get_username(pw_buf)); get_single_attribute(obj, NPF_HOME_DIR, home_dir, sizeof(pstring)); if( !(home_dir && *home_dir) ) diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index e5b1ec97f7..9cfad2540c 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -44,8 +44,6 @@ struct smb_passwd }; -extern pstring samlogon_user; -extern BOOL sam_logon_in_ssb; extern struct passdb_ops pdb_ops; /* used for maintain locks on the smbpasswd file */ @@ -1210,12 +1208,6 @@ static BOOL build_sam_account(SAM_ACCOUNT *sam_pass, const struct smb_passwd *pw pdb_set_uid (sam_pass, &pwfile->pw_uid); pdb_set_gid (sam_pass, &pwfile->pw_gid); - - /* FIXME!! This doesn't belong here. Should be set in net_sam_logon() - --jerry */ - - pstrcpy(samlogon_user, pw_buf->smb_name); - sam_logon_in_ssb = True; pdb_set_fullname(sam_pass, pwfile->pw_gecos); @@ -1251,32 +1243,30 @@ static BOOL build_sam_account(SAM_ACCOUNT *sam_pass, const struct smb_passwd *pw pdb_set_pass_must_change_time (sam_pass, pw_buf->pass_last_set_time + MAX_PASSWORD_AGE); /* check if this is a user account or a machine account */ - if (samlogon_user[strlen(samlogon_user)-1] != '$') + if (pw_buf->smb_name[strlen(pw_buf->smb_name)-1] != '$') { pstring str; pstrcpy(str, lp_logon_path()); - standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, str); + standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, pw_buf->smb_name, str); pdb_set_profile_path(sam_pass, str); pstrcpy(str, lp_logon_home()); - standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, str); + standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, pw_buf->smb_name, str); pdb_set_homedir(sam_pass, str); pstrcpy(str, lp_logon_drive()); - standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, str); + standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, pw_buf->smb_name, str); pdb_set_dir_drive(sam_pass, str); pstrcpy(str, lp_logon_script()); - standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, str); + standard_sub_advanced(-1, pwfile->pw_name, "", pwfile->pw_gid, pw_buf->smb_name, str); pdb_set_logon_script(sam_pass, str); } else { /* lkclXXXX this is OBSERVED behaviour by NT PDCs, enforced here. */ /*pdb_set_group_rid (sam_pass, DOMAIN_GROUP_RID_USERS); */ } - - sam_logon_in_ssb = False; return True; } diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index 332118425b..1f1d1ab455 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -31,8 +31,6 @@ #define RIDPREFIX "RID_" extern int DEBUGLEVEL; -extern pstring samlogon_user; -extern BOOL sam_logon_in_ssb; struct tdb_enum_info { TDB_CONTEXT *passwd_tdb; -- cgit