dsdb: Allow search before init() call in encrypted_secrets
authorAndrew Bartlett <abartlet@samba.org>
Mon, 9 Apr 2018 09:15:25 +0000 (21:15 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Apr 2018 03:15:16 +0000 (05:15 +0200)
Simply do not decrypt anything until the init call is run.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13379

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/encrypted_secrets.c

index 87ec9e4eb539167e75fca517c3a3b9203fd3a4bf..ef69bb0831c99d223460335e13d630eb03b3c695 100644 (file)
@@ -1365,7 +1365,7 @@ static int es_search_post_process(struct ldb_module *module,
        /*
         * Decrypt any encrypted secret attributes
         */
-       if (data->encrypt_secrets) {
+       if (data && data->encrypt_secrets) {
                int err = decrypt_secret_attributes(ldb, msg, data);
                if (err !=  LDB_SUCCESS) {
                        return err;