[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3269-gb763399

Günther Deschner gd at samba.org
Thu Jul 17 08:33:59 GMT 2008


The branch, v3-3-test has been updated
       via  b7633998ed76c7bb2faa803841fafe9126a39847 (commit)
      from  6aca163e898bfeeff824725bb27b2ef4f7b729f9 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit b7633998ed76c7bb2faa803841fafe9126a39847
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jul 16 15:22:04 2008 +0200

    netapi: add ConvertSidToStringSid() for convenience of the callers.
    
    Guenther

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

Summary of changes:
 source/Makefile.in                                 |    3 +-
 source/lib/netapi/netapi.h                         |   15 ++++++
 .../{libnet/libnet_keytab.h => lib/netapi/sid.c}   |   54 ++++++++++++--------
 3 files changed, 49 insertions(+), 23 deletions(-)
 copy source/{libnet/libnet_keytab.h => lib/netapi/sid.c} (57%)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 85837a8..72aa9a5 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -1829,7 +1829,8 @@ LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
 		 lib/netapi/user.o \
 		 lib/netapi/group.o \
 		 lib/netapi/localgroup.o \
-		 lib/netapi/samr.o
+		 lib/netapi/samr.o \
+		 lib/netapi/sid.o
 
 LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
 		 $(LIBSMBCONF_OBJ) \
diff --git a/source/lib/netapi/netapi.h b/source/lib/netapi/netapi.h
index 323b0c8..e7f3527 100644
--- a/source/lib/netapi/netapi.h
+++ b/source/lib/netapi/netapi.h
@@ -257,6 +257,21 @@ NET_API_STATUS NetApiBufferFree(void *buffer);
 
 /************************************************************//**
  *
+ * ConvertSidToStringSid
+ *
+ * @brief Convert a domain sid into a string
+ *
+ * @param[in] sid A pointer to a sid structure
+ * @param[in] sid_string A pointer that holds a pointer to a sid string. Caller
+ * needs to free with free(3)
+ * @return bool
+ ***************************************************************/
+
+int  ConvertSidToStringSid(const struct domsid *sid,
+			   char **sid_string);
+
+/************************************************************//**
+ *
  * NetJoinDomain
  *
  * @brief Join a computer to a domain or workgroup
diff --git a/source/libnet/libnet_keytab.h b/source/lib/netapi/sid.c
similarity index 57%
copy from source/libnet/libnet_keytab.h
copy to source/lib/netapi/sid.c
index 30f2f8d..869bd0f 100644
--- a/source/libnet/libnet_keytab.h
+++ b/source/lib/netapi/sid.c
@@ -1,6 +1,6 @@
 /*
  *  Unix SMB/CIFS implementation.
- *  libnet Support
+ *  NetApi Support
  *  Copyright (C) Guenther Deschner 2008
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -17,24 +17,34 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_KRB5
-
-struct libnet_keytab_entry {
-	const char *name;
-	const char *principal;
-	DATA_BLOB password;
-	uint32_t kvno;
-};
-
-struct libnet_keytab_context {
-	krb5_context context;
-	krb5_keytab keytab;
-	const char *keytab_name;
-	ADS_STRUCT *ads;
-	const char *dns_domain_name;
-	uint8_t zero_buf[16];
-	uint32_t count;
-	struct libnet_keytab_entry *entries;
-};
-
-#endif /* HAVE_KRB5 */
+#include "includes.h"
+
+#include "librpc/gen_ndr/libnetapi.h"
+
+/****************************************************************
+****************************************************************/
+
+bool ConvertSidToStringSid(const struct domsid *sid,
+			   char **sid_string)
+{
+	char *ret;
+
+	if (!sid || !sid_string) {
+		return false;
+	}
+
+	ret = sid_string_talloc(NULL, (const struct dom_sid *)sid);
+	if (!ret) {
+		return false;
+	}
+
+	*sid_string = SMB_STRDUP(ret);
+
+	TALLOC_FREE(ret);
+
+	if (!*sid_string) {
+		return false;
+	}
+
+	return true;
+}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list