summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
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
commit492fdaaf2009e7d7e840323357a333fdf9c4d2e1 (patch)
tree506e09d5ebaaffadb62733ce6b79f3696d6f7485 /source/lib/util.c
parent926fe6273a8cd9550838ecdfca276f915c92031b (diff)
downloadsamba-492fdaaf2009e7d7e840323357a333fdf9c4d2e1.tar.gz
samba-492fdaaf2009e7d7e840323357a333fdf9c4d2e1.tar.xz
samba-492fdaaf2009e7d7e840323357a333fdf9c4d2e1.zip
rewrote rpcclient enumaliases command.
Diffstat (limited to 'source/lib/util.c')
-rw-r--r--source/lib/util.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 9e13e819be3..9e01f0f0954 100644
--- a/source/lib/util.c
+++ b/source/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);
+ }
+}
+