svn commit: samba r11947 - branches/SAMBA_3_0/source/passdb trunk/source/passdb

vlendec at samba.org vlendec at samba.org
Mon Nov 28 20:42:19 GMT 2005


Author: vlendec
Date: 2005-11-28 20:42:18 +0000 (Mon, 28 Nov 2005)
New Revision: 11947

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11947

Log:
Back out passdb:expand_explicit until we find consensus. I'll file this as a
bugzilla entry.

Volker

Modified:
   branches/SAMBA_3_0/source/passdb/passdb.c
   branches/SAMBA_3_0/source/passdb/pdb_ldap.c
   trunk/source/passdb/passdb.c
   trunk/source/passdb/pdb_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/passdb.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/passdb.c	2005-11-28 20:14:09 UTC (rev 11946)
+++ branches/SAMBA_3_0/source/passdb/passdb.c	2005-11-28 20:42:18 UTC (rev 11947)
@@ -1751,8 +1751,6 @@
 	uint32 pwHistLen = 0;
 	BOOL ret = True;
 	fstring tmpstring;
-	BOOL expand_explicit = lp_parm_bool(-1, "passdb", "expand_explicit",
-					    False);
 	
 	if(sampass == NULL || buf == NULL) {
 		DEBUG(0, ("init_sam_from_buffer_v2: NULL parameters found!\n"));
@@ -1817,10 +1815,7 @@
 
 	if (homedir) {
 		fstrcpy( tmpstring, homedir );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_homedir(sampass, tmpstring, PDB_SET);
 	}
 	else {
@@ -1836,10 +1831,7 @@
 
 	if (logon_script) {
 		fstrcpy( tmpstring, logon_script );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_logon_script(sampass, tmpstring, PDB_SET);
 	}
 	else {
@@ -1850,10 +1842,7 @@
 	
 	if (profile_path) {	
 		fstrcpy( tmpstring, profile_path );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_profile_path(sampass, tmpstring, PDB_SET);
 	} 
 	else {

Modified: branches/SAMBA_3_0/source/passdb/pdb_ldap.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_ldap.c	2005-11-28 20:14:09 UTC (rev 11946)
+++ branches/SAMBA_3_0/source/passdb/pdb_ldap.c	2005-11-28 20:42:18 UTC (rev 11947)
@@ -604,8 +604,6 @@
 	LOGIN_CACHE	*cache_entry = NULL;
 	uint32 		pwHistLen;
 	pstring		tmpstring;
-	BOOL expand_explicit = lp_parm_bool(-1, "passdb", "expand_explicit",
-					    False);
 
 	/*
 	 * do a little initialization
@@ -778,10 +776,7 @@
 			PDB_DEFAULT );
 	} else {
 		pstrcpy( tmpstring, homedir );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_homedir(sampass, tmpstring, PDB_SET);
 	}
 
@@ -793,10 +788,7 @@
 			PDB_DEFAULT );
 	} else {
 		pstrcpy( tmpstring, logon_script );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_logon_script(sampass, tmpstring, PDB_SET);
 	}
 
@@ -808,10 +800,7 @@
 			PDB_DEFAULT );
 	} else {
 		pstrcpy( tmpstring, profile_path );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_profile_path(sampass, tmpstring, PDB_SET);
 	}
 

Modified: trunk/source/passdb/passdb.c
===================================================================
--- trunk/source/passdb/passdb.c	2005-11-28 20:14:09 UTC (rev 11946)
+++ trunk/source/passdb/passdb.c	2005-11-28 20:42:18 UTC (rev 11947)
@@ -874,11 +874,13 @@
 	
 	become_root();
 	if (pdb_getsampwnam(sam_account, user)) {
+		uint16 acct;
 		const DOM_SID *user_sid;
 
 		unbecome_root();
 
 		user_sid = pdb_get_user_sid(sam_account);
+		acct = pdb_get_acct_ctrl(sam_account);
 
 		if (!sid_check_is_in_our_domain(user_sid)) {
 			DEBUG(0, ("User %s with invalid SID %s in passdb\n",
@@ -887,7 +889,13 @@
 		}
 
 		sid_peek_rid(user_sid, rid);
-		*type = SID_NAME_USER;
+
+		if (acct & (ACB_DOMTRUST|ACB_WSTRUST|ACB_SRVTRUST)) {
+			/* We need to filter out these in lsa_lookupnames. */
+			*type = SID_NAME_COMPUTER;
+		} else {
+			*type = SID_NAME_USER;
+		}
 		pdb_free_sam(&sam_account);
 		return True;
 	}
@@ -1766,8 +1774,6 @@
 	uint32 pwHistLen = 0;
 	BOOL ret = True;
 	fstring tmpstring;
-	BOOL expand_explicit = lp_parm_bool(-1, "passdb", "expand_explicit",
-					    False);
 	
 	if(sampass == NULL || buf == NULL) {
 		DEBUG(0, ("init_sam_from_buffer_v2: NULL parameters found!\n"));
@@ -1832,10 +1838,7 @@
 
 	if (homedir) {
 		fstrcpy( tmpstring, homedir );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_homedir(sampass, tmpstring, PDB_SET);
 	}
 	else {
@@ -1851,10 +1854,7 @@
 
 	if (logon_script) {
 		fstrcpy( tmpstring, logon_script );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_logon_script(sampass, tmpstring, PDB_SET);
 	}
 	else {
@@ -1865,10 +1865,7 @@
 	
 	if (profile_path) {	
 		fstrcpy( tmpstring, profile_path );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_profile_path(sampass, tmpstring, PDB_SET);
 	} 
 	else {

Modified: trunk/source/passdb/pdb_ldap.c
===================================================================
--- trunk/source/passdb/pdb_ldap.c	2005-11-28 20:14:09 UTC (rev 11946)
+++ trunk/source/passdb/pdb_ldap.c	2005-11-28 20:42:18 UTC (rev 11947)
@@ -604,8 +604,6 @@
 	LOGIN_CACHE	*cache_entry = NULL;
 	uint32 		pwHistLen;
 	pstring		tmpstring;
-	BOOL expand_explicit = lp_parm_bool(-1, "passdb", "expand_explicit",
-					    False);
 
 	/*
 	 * do a little initialization
@@ -778,10 +776,7 @@
 			PDB_DEFAULT );
 	} else {
 		pstrcpy( tmpstring, homedir );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_homedir(sampass, tmpstring, PDB_SET);
 	}
 
@@ -793,10 +788,7 @@
 			PDB_DEFAULT );
 	} else {
 		pstrcpy( tmpstring, logon_script );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_logon_script(sampass, tmpstring, PDB_SET);
 	}
 
@@ -808,10 +800,7 @@
 			PDB_DEFAULT );
 	} else {
 		pstrcpy( tmpstring, profile_path );
-		if (expand_explicit) {
-			standard_sub_basic( username, tmpstring,
-					    sizeof(tmpstring) );
-		}
+		standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
 		pdb_set_profile_path(sampass, tmpstring, PDB_SET);
 	}
 



More information about the samba-cvs mailing list