s4-dsdb Add flag to set DSDB_BYPASS_PASSWORD_HASH control
authorAndrew Bartlett <abartlet@samba.org>
Thu, 11 Aug 2011 06:14:36 +0000 (16:14 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 13 Aug 2011 02:30:48 +0000 (12:30 +1000)
source4/dsdb/common/util.c
source4/dsdb/common/util.h

index 3b287e36354d959fd227d20f7f3695f55bbc1179..22f092c127da864bfd1b9ab1ec86ca34222042e2 100644 (file)
@@ -3658,6 +3658,14 @@ int dsdb_request_add_controls(struct ldb_request *req, uint32_t dsdb_flags)
                }
        }
 
+       /* This is a special control to bypass the password_hash module for use in pdb_samba4 for Samba3 upgrades */
+       if (dsdb_flags & DSDB_BYPASS_PASSWORD_HASH) {
+               ret = ldb_request_add_control(req, DSDB_CONTROL_BYPASS_PASSWORD_HASH_OID, true, NULL);
+               if (ret != LDB_SUCCESS) {
+                       return ret;
+               }
+       }
+
        return LDB_SUCCESS;
 }
 
index afcb3dc7e7b98aaa5595e6fb9cb6b2657257d389..0140f2956e6a892130c93a7791fea968a5ac777c 100644 (file)
@@ -35,6 +35,7 @@
 #define DSDB_SEARCH_ONE_ONLY                 0x0200 /* give an error unless 1 record */
 #define DSDB_SEARCH_SHOW_RECYCLED            0x0400
 #define DSDB_PROVISION                       0x0800
+#define DSDB_BYPASS_PASSWORD_HASH            0x1000
 
 bool is_attr_in_list(const char * const * attrs, const char *attr);