[SCM] Samba Shared Repository - branch master updated - be6e21f9ead06da64f6f96c125612dd4854c0fc4

Günther Deschner gd at samba.org
Fri Oct 10 13:36:47 GMT 2008


The branch, master has been updated
       via  be6e21f9ead06da64f6f96c125612dd4854c0fc4 (commit)
       via  4464011ceaca803349052ed43217710fc3c33a9e (commit)
      from  08d3918cf8773f1a3f67a82123ebe006ea581e4e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit be6e21f9ead06da64f6f96c125612dd4854c0fc4
Author: Günther Deschner <gd at samba.org>
Date:   Thu Sep 25 01:31:12 2008 +0200

    libwbclient: add wbcAddNamedBlob.
    
    Guenther

commit 4464011ceaca803349052ed43217710fc3c33a9e
Author: Günther Deschner <gd at samba.org>
Date:   Fri Oct 10 10:54:06 2008 +0200

    libwbclient: add wbcBlob and wbcNamedBlob.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/nsswitch/libwbclient/wbc_util.c |   45 +++++++++++++++++++++++++++++++
 source3/nsswitch/libwbclient/wbclient.h |   29 +++++++++++++++++++-
 2 files changed, 73 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/nsswitch/libwbclient/wbc_util.c b/source3/nsswitch/libwbclient/wbc_util.c
index 5aea884..b486874 100644
--- a/source3/nsswitch/libwbclient/wbc_util.c
+++ b/source3/nsswitch/libwbclient/wbc_util.c
@@ -689,3 +689,48 @@ wbcErr wbcLookupDomainControllerEx(const char *domain,
 done:
 	return wbc_status;
 }
+
+/** @brief Initialize a named blob and add to list of blobs
+ *
+ * @param[in,out] num_blobs     Pointer to the number of blobs
+ * @param[in,out] blobs         Pointer to an array of blobs
+ * @param[in]     name          Name of the new named blob
+ * @param[in]     flags         Flags of the new named blob
+ * @param[in]     data          Blob data of new blob
+ * @param[in]     length        Blob data length of new blob
+ *
+ * @return #wbcErr
+ *
+ **/
+
+wbcErr wbcAddNamedBlob(size_t *num_blobs,
+		       struct wbcNamedBlob **blobs,
+		       const char *name,
+		       uint32_t flags,
+		       uint8_t *data,
+		       size_t length)
+{
+	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
+	struct wbcNamedBlob blob;
+
+	*blobs = talloc_realloc(NULL, *blobs, struct wbcNamedBlob,
+				*(num_blobs)+1);
+	BAIL_ON_PTR_ERROR(*blobs, wbc_status);
+
+	blob.name		= talloc_strdup(*blobs, name);
+	BAIL_ON_PTR_ERROR(blob.name, wbc_status);
+	blob.flags		= flags;
+	blob.blob.length	= length;
+	blob.blob.data		= (uint8_t *)talloc_memdup(*blobs, data, length);
+	BAIL_ON_PTR_ERROR(blob.blob.data, wbc_status);
+
+	(*(blobs))[*num_blobs] = blob;
+	*(num_blobs) += 1;
+
+	wbc_status = WBC_ERR_SUCCESS;
+done:
+	if (!WBC_ERROR_IS_OK(wbc_status) && blobs) {
+		wbcFreeMemory(*blobs);
+	}
+	return wbc_status;
+}
diff --git a/source3/nsswitch/libwbclient/wbclient.h b/source3/nsswitch/libwbclient/wbclient.h
index 327dafd..5c184eb 100644
--- a/source3/nsswitch/libwbclient/wbclient.h
+++ b/source3/nsswitch/libwbclient/wbclient.h
@@ -219,6 +219,25 @@ struct wbcAuthUserParams {
 };
 
 /**
+ * @brief Generic Blob
+ **/
+
+struct wbcBlob {
+	uint8_t *data;
+	size_t length;
+};
+
+/**
+ * @brief Named Blob
+ **/
+
+struct wbcNamedBlob {
+	const char *name;
+	uint32_t flags;
+	struct wbcBlob blob;
+};
+
+/**
  * @brief ChangePassword Parameters
  **/
 
@@ -608,6 +627,14 @@ wbcErr wbcResolveWinsByIP(const char *ip, char **name);
  */
 wbcErr wbcCheckTrustCredentials(const char *domain,
 				struct wbcAuthErrorInfo **error);
-
+/*
+ * Helper functions
+ */
+wbcErr wbcAddNamedBlob(size_t *num_blobs,
+		       struct wbcNamedBlob **blobs,
+		       const char *name,
+		       uint32_t flags,
+		       uint8_t *data,
+		       size_t length);
 
 #endif      /* _WBCLIENT_H */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list