diff options
Diffstat (limited to 'source3/passdb/secrets.c')
-rw-r--r-- | source3/passdb/secrets.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 8a146f0d68..a5a2c29a8b 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -128,39 +128,38 @@ BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid) return True; } -BOOL secrets_store_domain_guid(const char *domain, GUID *guid) +BOOL secrets_store_domain_guid(const char *domain, struct uuid *guid) { fstring key; slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain); strupper_m(key); - return secrets_store(key, guid, sizeof(GUID)); + return secrets_store(key, guid, sizeof(struct uuid)); } -BOOL secrets_fetch_domain_guid(const char *domain, GUID *guid) +BOOL secrets_fetch_domain_guid(const char *domain, struct uuid *guid) { - GUID *dyn_guid; + struct uuid *dyn_guid; fstring key; size_t size; - GUID new_guid; + struct uuid new_guid; slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain); strupper_m(key); - dyn_guid = (GUID *)secrets_fetch(key, &size); + dyn_guid = (struct uuid *)secrets_fetch(key, &size); - DEBUG(6,("key is %s, size is %d\n", key, (int)size)); - - if ((NULL == dyn_guid) && (ROLE_DOMAIN_PDC == lp_server_role())) { + if ((!dyn_guid) && (lp_server_role() == ROLE_DOMAIN_PDC)) { smb_uuid_generate_random(&new_guid); if (!secrets_store_domain_guid(domain, &new_guid)) return False; - dyn_guid = (GUID *)secrets_fetch(key, &size); + dyn_guid = (struct uuid *)secrets_fetch(key, &size); if (dyn_guid == NULL) return False; } - if (size != sizeof(GUID)) + if (size != sizeof(struct uuid)) { + DEBUG(1,("UUID size %d is wrong!\n", (int)size)); SAFE_FREE(dyn_guid); return False; } |