diff options
author | Aaron Haslett <aaronhaslett@catalyst.net.nz> | 2018-05-01 15:51:10 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-05-12 09:15:07 +0200 |
commit | 8b72d4c7bbb8462232d685e17612b06b4cca57f2 (patch) | |
tree | 26f6ce7c993e2c3a5635b36dc9cfc3bc3dbf00e8 /source4 | |
parent | 6a09162df6bd38098253b50a7ac32bfdc8dbf9d4 (diff) | |
download | samba-8b72d4c7bbb8462232d685e17612b06b4cca57f2.tar.gz |
samdb rid: clear cache to prevent old ntds_guid
During the new samba-tool domain backup restore the NTDS GUID changes
as the server is taken over by the new DC record.
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/ridalloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c index abfe14a5a80..b436b9b5435 100644 --- a/source4/dsdb/samdb/ldb_modules/ridalloc.c +++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c @@ -443,6 +443,12 @@ int ridalloc_create_own_rid_set(struct ldb_module *module, TALLOC_CTX *mem_ctx, return ldb_operr(ldb_module_get_ctx(module)); } + /* clear the cache so we don't get an old ntds_guid */ + if (ldb_set_opaque(ldb, "cache.ntds_guid", NULL) != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return ldb_operr(ldb_module_get_ctx(module)); + } + our_ntds_guid = samdb_ntds_objectGUID(ldb_module_get_ctx(module)); if (!our_ntds_guid) { talloc_free(tmp_ctx); |