summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-01 21:09:24 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-01 21:09:24 +0000
commitde573ca8916bbe5d67bc1f38cf23c98f43ad0aaa (patch)
tree96113f61a94dbf1cd4d094495211532379ea9ddd /source3/lib
parent92892c014e8b5bf42e36b60b4479dbda6e20b990 (diff)
downloadsamba-de573ca8916bbe5d67bc1f38cf23c98f43ad0aaa.tar.gz
samba-de573ca8916bbe5d67bc1f38cf23c98f43ad0aaa.tar.bz2
samba-de573ca8916bbe5d67bc1f38cf23c98f43ad0aaa.zip
rewrote rpcclient enumaliases command.
(This used to be commit 492fdaaf2009e7d7e840323357a333fdf9c4d2e1)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c35
-rw-r--r--source3/lib/util_sid.c2
2 files changed, 36 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 9e13e819be..9e01f0f095 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3261,3 +3261,38 @@ BOOL add_chars_to_array(uint32 *len, char ***array, const char *name)
}
return True;
}
+
+BOOL add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid)
+{
+ if (len == NULL || array == NULL)
+ {
+ return False;
+ }
+
+ (*array) = (char**)Realloc((*array), ((*len)+1) * sizeof((*array)[0]));
+
+ if ((*array) != NULL)
+ {
+ (*array)[(*len)] = sid_dup(sid);
+ (*len)++;
+ return True;
+ }
+ return True;
+}
+
+void free_sid_array(uint32 num_entries, DOM_SID **entries)
+{
+ uint32 i;
+ if (entries != NULL)
+ {
+ for (i = 0; i < num_entries; i++)
+ {
+ if (entries[i] != NULL)
+ {
+ free(entries[i]);
+ }
+ }
+ free(entries);
+ }
+}
+
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index 3be81ce811..295fd0efac 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -231,7 +231,7 @@ int sid_size(const DOM_SID *sid)
Duplicates a sid - mallocs the target.
*****************************************************************/
-DOM_SID *sid_dup(DOM_SID *src)
+DOM_SID *sid_dup(const DOM_SID *src)
{
DOM_SID *dst;