s3: Do not kill the whole smb session if a machine pwchange failed
[kai/samba-autobuild/.git] / source3 / lib / tldap_util.c
index 73ce854651566479a32fac76e0fb7e68a0ee9203..f9f54aaf4d43f4f8f96ea7ba307b0d74c8958afa 100644 (file)
@@ -91,6 +91,17 @@ bool tldap_pull_binsid(struct tldap_message *msg, const char *attribute,
        return sid_parse((char *)val.data, val.length, sid);
 }
 
+bool tldap_pull_guid(struct tldap_message *msg, const char *attribute,
+                    struct GUID *guid)
+{
+       DATA_BLOB val;
+
+       if (!tldap_get_single_valueblob(msg, attribute, &val)) {
+               return false;
+       }
+       return NT_STATUS_IS_OK(GUID_from_data_blob(&val, guid));
+}
+
 static bool tldap_add_blob_vals(TALLOC_CTX *mem_ctx, struct tldap_mod *mod,
                                int num_newvals, DATA_BLOB *newvals)
 {