summaryrefslogtreecommitdiff
path: root/source3/passdb/secrets.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-07-30 17:23:07 +0000
committerJim McDonough <jmcd@samba.org>2002-07-30 17:23:07 +0000
commit89d46eeb33c2d8e2b9b5a06ebe3a369675ae3657 (patch)
tree656041de18e018dd6f450856e29474c1bdee23d6 /source3/passdb/secrets.c
parent55c978d85ea9b2fbd3eeb597d4b383399c5106a7 (diff)
downloadsamba-89d46eeb33c2d8e2b9b5a06ebe3a369675ae3657.tar.gz
samba-89d46eeb33c2d8e2b9b5a06ebe3a369675ae3657.tar.bz2
samba-89d46eeb33c2d8e2b9b5a06ebe3a369675ae3657.zip
Add LSA RPC 0x2E, lsa_query_info2. Only level implemented is 0x0c, which
is netbios and dns domain info. Also add code to set/fetch the domain GUID from secrets.tdb (although set is not yet called by anyone). (This used to be commit 31d7168530ccce2c5e9e7f96464b47f4d9771a25)
Diffstat (limited to 'source3/passdb/secrets.c')
-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 f967682574..e06452d398 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -128,6 +128,38 @@ BOOL secrets_fetch_domain_sid(char *domain, DOM_SID *sid)
return True;
}
+BOOL secrets_store_domain_guid(char *domain, GUID *guid)
+{
+ fstring key;
+
+ slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
+ strupper(key);
+ return secrets_store(key, guid, sizeof(GUID));
+}
+
+BOOL secrets_fetch_domain_guid(char *domain, GUID *guid)
+{
+ GUID *dyn_guid;
+ fstring key;
+ size_t size;
+
+ 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;
+
+ if (size != sizeof(GUID))
+ {
+ SAFE_FREE(dyn_guid);
+ return False;
+ }
+
+ *guid = *dyn_guid;
+ SAFE_FREE(dyn_guid);
+ return True;
+}
/**
* Form a key for fetching the machine trust account password