summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>2000-05-29 01:23:48 +0000
committerMatthew Chapman <matty@samba.org>2000-05-29 01:23:48 +0000
commitbadb7fc0d21267110e39287c897c0f956f43bb16 (patch)
treeafcd48a971495347de458b5e5a4f8b7de67c5d6b /source3/passdb
parent5b5f41d8e0e707bb4e1626f4406b2e46305a5183 (diff)
downloadsamba-badb7fc0d21267110e39287c897c0f956f43bb16.tar.gz
samba-badb7fc0d21267110e39287c897c0f956f43bb16.tar.bz2
samba-badb7fc0d21267110e39287c897c0f956f43bb16.zip
Fixed LsaQueryInformationPolicy level 3 to return primary domain info.
Domain SID is saved in secrets.tdb upon joining domain. Added "Authenticated Users" and "SYSTEM" well-known SIDs (under NT Authority). (This used to be commit 7710b4f48d3e8532df5e37f99a779758f750efdb)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/secrets.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index b0021599cc..459cc6ae36 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -88,3 +88,35 @@ BOOL secrets_delete(char *key)
kbuf.dsize = strlen(key);
return tdb_delete(tdb, kbuf) == 0;
}
+
+BOOL secrets_store_domain_sid(char *domain, DOM_SID *sid)
+{
+ fstring key;
+
+ slprintf(key, sizeof(key), "%s/%s", SECRETS_DOMAIN_SID, domain);
+ return secrets_store(key, sid, sizeof(DOM_SID));
+}
+
+BOOL secrets_fetch_domain_sid(char *domain, DOM_SID *sid)
+{
+ DOM_SID *dyn_sid;
+ fstring key;
+ int size;
+
+ slprintf(key, sizeof(key), "%s/%s", SECRETS_DOMAIN_SID, domain);
+ dyn_sid = (DOM_SID *)secrets_fetch(key, &size);
+
+ if (dyn_sid == NULL)
+ return False;
+
+ if (size != sizeof(DOM_SID))
+ {
+ free(dyn_sid);
+ return False;
+ }
+
+ *sid = *dyn_sid;
+ free(dyn_sid);
+ return True;
+}
+