mirror of
https://github.com/samba-team/samba.git
synced 2024-12-28 07:21:54 +03:00
Update secrets_fetch_domain_guid to generate and store it if it doesn't exist.
Only does it for PDCs.
(This used to be commit 3543f92c39
)
This commit is contained in:
parent
a40116204d
commit
3e5939ccd5
@ -142,13 +142,22 @@ BOOL secrets_fetch_domain_guid(char *domain, GUID *guid)
|
||||
GUID *dyn_guid;
|
||||
fstring key;
|
||||
size_t size;
|
||||
GUID new_guid;
|
||||
|
||||
slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
|
||||
strupper(key);
|
||||
dyn_guid = (GUID *)secrets_fetch(key, &size);
|
||||
|
||||
if (dyn_guid == NULL)
|
||||
return False;
|
||||
DEBUG(6,("key is %s, guid is at %x, size is %d\n", key, dyn_guid, size));
|
||||
|
||||
if ((NULL == dyn_guid) && (ROLE_DOMAIN_PDC == lp_server_role())) {
|
||||
uuid_generate_random(&new_guid);
|
||||
if (!secrets_store_domain_guid(domain, &new_guid))
|
||||
return False;
|
||||
dyn_guid = (GUID *)secrets_fetch(key, &size);
|
||||
if (dyn_guid == NULL)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (size != sizeof(GUID))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user