summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-28 12:52:51 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-28 12:52:51 +0000
commit5f9112ac1b03cf3164ec6385237746a90fe0ddfd (patch)
tree000be01f6f8b8c9a56197b1ab6293e45fd89fae5 /source3/rpc_parse/parse_misc.c
parent6b84af6421a549d05ca487f12c6c521c932ffe61 (diff)
downloadsamba-5f9112ac1b03cf3164ec6385237746a90fe0ddfd.tar.gz
samba-5f9112ac1b03cf3164ec6385237746a90fe0ddfd.tar.bz2
samba-5f9112ac1b03cf3164ec6385237746a90fe0ddfd.zip
cleaned up the lsa_enum_acct_rights function and added a
lsa_add_acct_rights function. This allows us to add privileges remotely to accounts using rpcclient. (This used to be commit 2e5e659e095a94b0716d97f673f993f0af99aabe)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 9d3bd6f28a..43d26a691d 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -216,6 +216,7 @@ BOOL smb_io_dom_sid(const char *desc, DOM_SID *sid, prs_struct *ps, int depth)
if(!prs_uint8 ("sid_rev_num", ps, depth, &sid->sid_rev_num))
return False;
+
if(!prs_uint8 ("num_auths ", ps, depth, &sid->num_auths))
return False;
@@ -1043,17 +1044,45 @@ BOOL smb_io_unistr2(const char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *
}
+/*
+ initialise a UNISTR_ARRAY from a char**
+*/
+BOOL init_unistr2_array(UNISTR2_ARRAY *array,
+ uint32 count, const char **strings)
+{
+ int i;
+
+ array->count = count;
+ array->ref_id = count?1:0;
+ if (array->count == 0) {
+ return True;
+ }
+
+ array->strings = (UNISTR2_ARRAY_EL *)talloc_zero(get_talloc_ctx(), count * sizeof(UNISTR2_ARRAY_EL));
+ if (!array->strings) {
+ return False;
+ }
+
+ for (i=0;i<count;i++) {
+ init_unistr2(&array->strings[i].string, strings[i], strlen(strings[i]));
+ array->strings[i].size = array->strings[i].string.uni_max_len*2;
+ array->strings[i].length = array->strings[i].size;
+ array->strings[i].ref_id = 1;
+ }
+
+ return True;
+}
+
/*******************************************************************
- Reads or writes a UNISTR_ARRAY structure.
+ Reads or writes a UNISTR2_ARRAY structure.
********************************************************************/
-BOOL smb_io_unistr_array(const char *desc, UNISTR_ARRAY *array, prs_struct *ps, int depth)
+BOOL smb_io_unistr2_array(const char *desc, UNISTR2_ARRAY *array, prs_struct *ps, int depth)
{
int i;
+ prs_debug(ps, depth, desc, "smb_io_unistr2_array");
depth++;
- array->count = 0;
-
if(!prs_uint32("ref_id", ps, depth, &array->ref_id))
return False;
@@ -1068,7 +1097,9 @@ BOOL smb_io_unistr_array(const char *desc, UNISTR_ARRAY *array, prs_struct *ps,
return True;
}
- array->strings = talloc_zero(get_talloc_ctx(), array->count * sizeof(array->strings[0]));
+ if (UNMARSHALLING(ps)) {
+ array->strings = talloc_zero(get_talloc_ctx(), array->count * sizeof(array->strings[0]));
+ }
if (! array->strings) {
return False;
}