summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2021-05-11 15:22:12 +0200
committerGünther Deschner <gd@samba.org>2021-07-14 16:49:30 +0000
commit793277c0dddba567f25c56f1982cb0c3d0888eba (patch)
treed846efa8f26e2f261fc7f80ba9290513753c2444 /source3/libnet
parent80b8bbe48511d764cac4334182c3fb7b47fd54f7 (diff)
downloadsamba-793277c0dddba567f25c56f1982cb0c3d0888eba.tar.gz
s3-libnet_join: add libnet_odj_find_joinprov3()
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_join_offline.c51
-rw-r--r--source3/libnet/libnet_join_offline.h2
2 files changed, 53 insertions, 0 deletions
diff --git a/source3/libnet/libnet_join_offline.c b/source3/libnet/libnet_join_offline.c
index 5e08ba46deb..bb119ec8fd3 100644
--- a/source3/libnet/libnet_join_offline.c
+++ b/source3/libnet/libnet_join_offline.c
@@ -373,3 +373,54 @@ WERROR libnet_odj_find_win7blob(const struct ODJ_PROVISION_DATA *r,
return WERR_BAD_FORMAT;
}
+
+
+WERROR libnet_odj_find_joinprov3(const struct ODJ_PROVISION_DATA *r,
+ struct OP_JOINPROV3_PART *joinprov3)
+{
+ int i;
+
+ if (r == NULL) {
+ return WERR_INVALID_PARAMETER;
+ }
+
+ for (i = 0; i < r->ulcBlobs; i++) {
+
+ struct ODJ_BLOB b = r->pBlobs[i];
+
+ switch (b.ulODJFormat) {
+ case ODJ_WIN7_FORMAT:
+ continue;
+
+ case ODJ_WIN8_FORMAT: {
+ NTSTATUS status;
+ struct OP_PACKAGE_PART_COLLECTION *col;
+ struct GUID guid;
+ int k;
+
+ if (b.pBlob->op_package.p->WrappedPartCollection.w == NULL) {
+ return WERR_BAD_FORMAT;
+ }
+
+ col = b.pBlob->op_package.p->WrappedPartCollection.w->s.p;
+
+ status = GUID_from_string(ODJ_GUID_JOIN_PROVIDER3, &guid);
+ if (!NT_STATUS_IS_OK(status)) {
+ return WERR_NOT_ENOUGH_MEMORY;
+ }
+
+ for (k = 0; k < col->cParts; k++) {
+ if (GUID_equal(&guid, &col->pParts[k].PartType)) {
+ *joinprov3 = *col->pParts[k].Part->join_prov3.p;
+ return WERR_OK;
+ }
+ }
+ break;
+ }
+ default:
+ return WERR_BAD_FORMAT;
+ }
+ }
+
+ return WERR_BAD_FORMAT;
+}
diff --git a/source3/libnet/libnet_join_offline.h b/source3/libnet/libnet_join_offline.h
index 5abebcf6372..7507c583755 100644
--- a/source3/libnet/libnet_join_offline.h
+++ b/source3/libnet/libnet_join_offline.h
@@ -22,3 +22,5 @@ WERROR libnet_odj_compose_ODJ_PROVISION_DATA(TALLOC_CTX *mem_ctx,
struct ODJ_PROVISION_DATA **b_p);
WERROR libnet_odj_find_win7blob(const struct ODJ_PROVISION_DATA *r,
struct ODJ_WIN7BLOB *win7blob);
+WERROR libnet_odj_find_joinprov3(const struct ODJ_PROVISION_DATA *r,
+ struct OP_JOINPROV3_PART *joinprov3);