r9899: Be more conservative about what is sent to the remote server in ldb_map.
[samba.git] / source / scripting / libjs / upgrade.js
index 45e6884e9fd6e40795962023b277de9de535046c..07fa8f34ccbb50186e8c5c0e98a52a8927082e00 100644 (file)
@@ -541,11 +541,6 @@ function upgrade(subobj, samba3, message, paths)
        // Enable samba3sam module if original passdb backend was ldap
        if (ldapurl != undefined) {
                message("Enabling Samba3 LDAP mappings for SAM database\n");
-               var ldif = sprintf("
-dn: @MAP=samba3sam
-@MAP_URL: %s", ldapurl);
-               ok = samdb.add(ldif);
-               assert(ok);
 
                ok = samdb.modify("
 dn: @MODULES
@@ -557,6 +552,12 @@ replace: @LIST
                        message("Error enabling samba3sam module: " + samdb.errstring() + "\n");
                        ret = ret + 1;
                }
+
+               ok = samdb.add(sprintf("
+dn: @MAP=samba3sam
+@MAP_URL: %s", ldapurl));
+               assert(ok);
+
        }
 
        return ret;