summaryrefslogtreecommitdiff
path: root/source3/lib/util_sid.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-04-28 14:44:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:33 -0500
commit34e810076df8720a145f5a619ed648c384898563 (patch)
treeb8a248e9eb110109d009cf33088b0b5cdf5e60f6 /source3/lib/util_sid.c
parent2720db90c110908c3d077028b82c4a6a5f8c2c51 (diff)
downloadsamba-34e810076df8720a145f5a619ed648c384898563.tar.gz
samba-34e810076df8720a145f5a619ed648c384898563.tar.bz2
samba-34e810076df8720a145f5a619ed648c384898563.zip
r15305: Let winbind search by sid directly (or in windows terms: "bind to a
sid"); works in all AD versions I tested. Also add "net ads sid" search tool. Guenther (This used to be commit 5557ada6943b817d28a5471c613c7291febe2ad5)
Diffstat (limited to 'source3/lib/util_sid.c')
-rw-r--r--source3/lib/util_sid.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index 0710337637..307f3e3415 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -535,6 +535,24 @@ char *sid_binstring(const DOM_SID *sid)
if (!buf)
return NULL;
sid_linearize(buf, len, sid);
+ s = binary_string_rfc2254(buf, len);
+ free(buf);
+ return s;
+}
+
+/*****************************************************************
+ Return the binary string representation of a DOM_SID.
+ Caller must free.
+*****************************************************************/
+
+char *sid_binstring_hex(const DOM_SID *sid)
+{
+ char *buf, *s;
+ int len = sid_size(sid);
+ buf = SMB_MALLOC(len);
+ if (!buf)
+ return NULL;
+ sid_linearize(buf, len, sid);
s = binary_string(buf, len);
free(buf);
return s;