summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 19:00:42 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:09:35 +0100
commit2cb7f5f632fc3c30c0afa57d1c99f506885f113a (patch)
tree480a420faf8d3dedc36164c082e893e8e0c69f59
parent43473c8dedb7302bbce9f87be5ca9ed56ce3a04c (diff)
downloadsamba-2cb7f5f632fc3c30c0afa57d1c99f506885f113a.tar.gz
samba-2cb7f5f632fc3c30c0afa57d1c99f506885f113a.tar.bz2
samba-2cb7f5f632fc3c30c0afa57d1c99f506885f113a.zip
add sid_string_talloc
(This used to be commit 9e3ef0923d71cc06b8445be2625ebd8dfed1b42d)
-rw-r--r--source3/lib/util_sid.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index f46d363895..fcbbbb44d9 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -213,11 +213,19 @@ const char *sid_string_static(const DOM_SID *sid)
return sid_str;
}
-char *sid_string_tos(const DOM_SID *sid)
+char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
{
fstring sid_str;
+ char *result;
sid_to_string(sid_str, sid);
- return talloc_strdup(talloc_tos(), sid_str);
+ result = talloc_strdup(mem_ctx, sid_str);
+ SMB_ASSERT(result != NULL);
+ return result;
+}
+
+char *sid_string_tos(const DOM_SID *sid)
+{
+ return sid_string_talloc(talloc_tos(), sid);
}
/*****************************************************************