r11914: After talking to Jeremy, implement passdb:expand_explicit with a default of
authorVolker Lendecke <vlendec@samba.org>
Sat, 26 Nov 2005 09:50:54 +0000 (09:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:34 +0000 (11:05 -0500)
no. This changes our default behaviour.

Sorry, Ingo, this *is* a bug that needs fixing.

Jerry, you might want to put a marker into the WHATSNEW.txt when this is due.

Volker
(This used to be commit 6622db97bb575b028b3c0bc016b91f62a8c561a2)

source3/passdb/passdb.c
source3/passdb/pdb_ldap.c

index a7ff3a04f7e8939f755afc1ada7f19cce1601c17..14a5b73f16a264622c566b8fe2c09a2478807c28 100644 (file)
@@ -1756,6 +1756,8 @@ BOOL init_sam_from_buffer_v2(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
        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"));
@@ -1820,7 +1822,10 @@ BOOL init_sam_from_buffer_v2(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
 
        if (homedir) {
                fstrcpy( tmpstring, homedir );
-               standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+               if (expand_explicit) {
+                       standard_sub_basic( username, tmpstring,
+                                           sizeof(tmpstring) );
+               }
                pdb_set_homedir(sampass, tmpstring, PDB_SET);
        }
        else {
@@ -1836,7 +1841,10 @@ BOOL init_sam_from_buffer_v2(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
 
        if (logon_script) {
                fstrcpy( tmpstring, logon_script );
-               standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+               if (expand_explicit) {
+                       standard_sub_basic( username, tmpstring,
+                                           sizeof(tmpstring) );
+               }
                pdb_set_logon_script(sampass, tmpstring, PDB_SET);
        }
        else {
@@ -1847,7 +1855,10 @@ BOOL init_sam_from_buffer_v2(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
        
        if (profile_path) {     
                fstrcpy( tmpstring, profile_path );
-               standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+               if (expand_explicit) {
+                       standard_sub_basic( username, tmpstring,
+                                           sizeof(tmpstring) );
+               }
                pdb_set_profile_path(sampass, tmpstring, PDB_SET);
        } 
        else {
index 8a9730c3c8aca9fc8280f09708e58473e87cc0fe..ef9eb81fbbf25c7cf9ab3d1770ccc45e577205e1 100644 (file)
@@ -604,6 +604,8 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state,
        LOGIN_CACHE     *cache_entry = NULL;
        uint32          pwHistLen;
        pstring         tmpstring;
+       BOOL expand_explicit = lp_parm_bool(-1, "passdb", "expand_explicit",
+                                           False);
 
        /*
         * do a little initialization
@@ -776,7 +778,10 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state,
                        PDB_DEFAULT );
        } else {
                pstrcpy( tmpstring, homedir );
-               standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+               if (expand_explicit) {
+                       standard_sub_basic( username, tmpstring,
+                                           sizeof(tmpstring) );
+               }
                pdb_set_homedir(sampass, tmpstring, PDB_SET);
        }
 
@@ -788,7 +793,10 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state,
                        PDB_DEFAULT );
        } else {
                pstrcpy( tmpstring, logon_script );
-               standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+               if (expand_explicit) {
+                       standard_sub_basic( username, tmpstring,
+                                           sizeof(tmpstring) );
+               }
                pdb_set_logon_script(sampass, tmpstring, PDB_SET);
        }
 
@@ -800,7 +808,10 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state,
                        PDB_DEFAULT );
        } else {
                pstrcpy( tmpstring, profile_path );
-               standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+               if (expand_explicit) {
+                       standard_sub_basic( username, tmpstring,
+                                           sizeof(tmpstring) );
+               }
                pdb_set_profile_path(sampass, tmpstring, PDB_SET);
        }