Restore a number of fixes that idra removed when he merged his
authorAndrew Bartlett <abartlet@samba.org>
Tue, 13 May 2003 15:29:23 +0000 (15:29 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 13 May 2003 15:29:23 +0000 (15:29 +0000)
idmap-and-the-rest from HEAD.

These are correctness fixes that were already in 3.0, and a memory leak fix.

The pdb_ldap changes are held back at jerry's request (he is also playing
with pdb_ldap ATM).

Andrew Bartlett
(This used to be commit c7d5e336bd91514a02974044742b058be387e490)

source3/passdb/passdb.c
source3/passdb/pdb_guest.c
source3/passdb/pdb_smbpasswd.c
source3/smbd/password.c

index d3554cdbde8d65dc2353e3ea43f3d39488a98a08..d262b09520a4f52ecf8d94f1e50d19a268d9b23d 100644 (file)
@@ -35,12 +35,6 @@ const char *get_global_sam_name(void)
        return global_myname();
 }
 
-/*
- * This is set on startup - it defines the SID for this
- * machine, and therefore the SAM database for which it is
- * responsible.
- */
-
 /************************************************************
  Fill the SAM_ACCOUNT with default values.
  ***********************************************************/
@@ -183,7 +177,7 @@ NTSTATUS pdb_fill_sam_pw(SAM_ACCOUNT *sam_account, const struct passwd *pwd)
 
        pdb_set_unix_homedir(sam_account, pwd->pw_dir, PDB_SET);
 
-       pdb_set_domain (sam_account, lp_workgroup(), PDB_DEFAULT);
+       pdb_set_domain (sam_account, get_global_sam_name(), PDB_DEFAULT);
        
        /* When we get a proper uid -> SID and SID -> uid allocation
           mechinism, we should call it here.  
@@ -299,7 +293,7 @@ NTSTATUS pdb_init_sam_new(SAM_ACCOUNT **new_sam_acct, const char *username)
                        return nt_status;
                }
 
-               pdb_set_domain (*new_sam_acct, lp_workgroup(), PDB_DEFAULT);
+               pdb_set_domain (*new_sam_acct, get_global_sam_name(), PDB_DEFAULT);
 
                /* set Domain Users by default ! */
                sid_copy(&g_sid, get_global_sam_sid());
index f5cd3d996d2e7d161e705292f780464458a27d76..359e2285a3a1756179642a26ba410e9ab2ab1070 100644 (file)
@@ -54,7 +54,7 @@ static NTSTATUS guestsam_getsampwnam (struct pdb_methods *methods, SAM_ACCOUNT *
        if (!pdb_set_fullname(sam_account, guest_account, PDB_SET))
                return NT_STATUS_UNSUCCESSFUL;
        
-       if (!pdb_set_domain(sam_account, lp_workgroup(), PDB_DEFAULT))
+       if (!pdb_set_domain(sam_account, get_global_sam_name(), PDB_DEFAULT))
                return NT_STATUS_UNSUCCESSFUL;
        
        if (!pdb_set_acct_ctrl(sam_account, ACB_NORMAL, PDB_DEFAULT))
index 6a7d7c42adca07d69243f0df73ea28f2526d8c1e..1237f911a3eaf30a929c8830963e82d53996974c 100644 (file)
@@ -1220,7 +1220,7 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state,
                        */
                        pdb_set_group_sid_from_rid (sam_pass, DOMAIN_GROUP_RID_USERS, PDB_SET); 
                        pdb_set_username (sam_pass, pw_buf->smb_name, PDB_SET);
-                       pdb_set_domain (sam_pass, lp_workgroup(), PDB_DEFAULT);
+                       pdb_set_domain (sam_pass, get_global_sam_name(), PDB_DEFAULT);
                        
                } else {
                        DEBUG(0,("build_sam_account: smbpasswd database is corrupt!  username %s with uid %u is not in unix passwd database!\n", pw_buf->smb_name, pw_buf->smb_userid));
index 81849b709a20df6ee3de3b411bba175849c505e0..283eed73ef7de8a8dfd82484a1f945a28b0f3d22 100644 (file)
@@ -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);