diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-02-08 11:05:34 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2004-02-08 11:05:34 +0000 |
commit | 46975eb92feb34ea64fb31448672b81bd2febea0 (patch) | |
tree | 5bcac6e841c5c9336ec2f84af165a8c9ad6dea8c /source3/passdb | |
parent | b401888b6be6f3cd9cdd8187dc74521eb3207f9c (diff) | |
download | samba-46975eb92feb34ea64fb31448672b81bd2febea0.tar.gz samba-46975eb92feb34ea64fb31448672b81bd2febea0.tar.bz2 samba-46975eb92feb34ea64fb31448672b81bd2febea0.zip |
When we set a domain sid, force get_global_sam_sid() to do it's work again.
This should ensure that the value it returns is always consistant.
Andrew Bartlett
(This used to be commit a4392ede33019b7584bf6a2d8445adb5191e640f)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/machine_sid.c | 7 | ||||
-rw-r--r-- | source3/passdb/secrets.c | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c index 4e7476781c..1fb3569f76 100644 --- a/source3/passdb/machine_sid.c +++ b/source3/passdb/machine_sid.c @@ -198,3 +198,10 @@ DOM_SID *get_global_sam_sid(void) return global_sam_sid; } +/** + * Force get_global_sam_sid to requery the backends + */ +void reset_global_sam_sid() +{ + SAFE_FREE(global_sam_sid); +} diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 1b545488cd..308f95f395 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -99,10 +99,16 @@ BOOL secrets_delete(const char *key) BOOL secrets_store_domain_sid(const char *domain, const DOM_SID *sid) { fstring key; + BOOL ret; slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_SID, domain); strupper_m(key); - return secrets_store(key, sid, sizeof(DOM_SID)); + ret = secrets_store(key, sid, sizeof(DOM_SID)); + + /* Force a re-query, in case we modified our domain */ + if (ret) + reset_global_sam_sid(); + return ret; } BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid) |