summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-16 21:14:53 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-16 21:14:53 +0000
commitcc8df5ce4955fc721e11ff08de052554894d963a (patch)
tree65cec4affde53426067ec8e70313006900df44e5 /source3/rpc_parse
parent6b56ebb7cf48b350ba4e9fd5c61a8900b805a001 (diff)
downloadsamba-cc8df5ce4955fc721e11ff08de052554894d963a.tar.gz
samba-cc8df5ce4955fc721e11ff08de052554894d963a.tar.bz2
samba-cc8df5ce4955fc721e11ff08de052554894d963a.zip
attempting to get nt5 wksta to join domain.
1) had to fix samr "create user" and "set user info" (level 23). 2) had to fix netlogon enum trust domains 3) registry key needed \\ in it not \. (This used to be commit 70b2c1ecbb4fbbb86fea676c80754485aae5ab13)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_misc.c30
-rw-r--r--source3/rpc_parse/parse_net.c30
-rw-r--r--source3/rpc_parse/parse_samr.c3
3 files changed, 40 insertions, 23 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 9f224c120b..2f2c68648a 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -672,6 +672,36 @@ BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth)
/*******************************************************************
creates a BUFFER2 structure.
********************************************************************/
+BOOL make_buffer2_multi(BUFFER2 *str, char *const* const buf, uint32 num)
+{
+ int i;
+ char *dest = (char*)str->buffer;
+ size_t max_len = sizeof(str->buffer)-1;
+
+ ZERO_STRUCTP(str);
+
+ str->buf_max_len = 0;
+ str->undoc = 0;
+
+ for (i = 0; i < num && max_len > 0; i++)
+ {
+ size_t len = buf[i] != NULL ? strlen(buf[i]) : 0;
+
+ str->buf_max_len += len * 2;
+ str->buf_len += len * 2;
+
+ ascii_to_unibuf(dest, buf[i], max_len);
+
+ dest += len * 2 + 2;
+ max_len -= len * 2 + 2;
+ }
+
+ return True;
+}
+
+/*******************************************************************
+creates a BUFFER2 structure.
+********************************************************************/
BOOL make_buffer2(BUFFER2 *str, const char *buf, int len)
{
ZERO_STRUCTP(str);
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index b21f612c8a..c6e366bbbe 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -296,28 +296,18 @@ makes an NET_R_TRUST_DOM_LIST structure.
BOOL make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t,
uint32 num_doms, char **dom_name)
{
- uint32 i = 0;
-
if (r_t == NULL) return False;
DEBUG(5,("make_r_trust_dom\n"));
- for (i = 0; i < MAX_TRUST_DOMS; i++)
- {
- r_t->uni_trust_dom_name[i].uni_str_len = 0;
- r_t->uni_trust_dom_name[i].uni_max_len = 0;
- }
- if (num_doms > MAX_TRUST_DOMS) num_doms = MAX_TRUST_DOMS;
-
- for (i = 0; i < num_doms; i++)
+ make_buffer2_multi(&r_t->uni_trust_dom_name,
+ dom_name, num_doms);
+ if (num_doms == 0)
{
- fstring domain_name;
- fstrcpy(domain_name, dom_name[i]);
- strupper(domain_name);
- make_unistr2(&(r_t->uni_trust_dom_name[i]), domain_name, strlen(domain_name)+1);
- /* the use of UNISTR2 here is non-standard. */
- r_t->uni_trust_dom_name[i].undoc = 0x1;
+ r_t->uni_trust_dom_name.buf_max_len = 0x2;
+ r_t->uni_trust_dom_name.buf_len = 0x2;
}
+ r_t->uni_trust_dom_name.undoc = 0x1;
r_t->status = 0;
@@ -329,17 +319,13 @@ reads or writes an NET_R_TRUST_DOM_LIST structure.
********************************************************************/
BOOL net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth)
{
- uint32 i;
if (r_t == NULL) return False;
prs_debug(ps, depth, desc, "net_io_r_trust_dom");
depth++;
- for (i = 0; i < MAX_TRUST_DOMS; i++)
- {
- if (r_t->uni_trust_dom_name[i].uni_str_len == 0) break;
- smb_io_unistr2("", &(r_t->uni_trust_dom_name[i]), True, ps, depth);
- }
+ smb_io_buffer2("", &r_t->uni_trust_dom_name, True, ps, depth);
+ prs_align(ps);
prs_uint32("status", ps, depth, &(r_t->status));
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 90ae3e8fee..9ea66bbf4b 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -250,7 +250,7 @@ BOOL make_samr_r_unknown_2c(SAMR_R_UNKNOWN_2C *q_u, uint32 status)
DEBUG(5,("samr_make_r_unknown_2c\n"));
- q_u->unknown_0 = 0x00160000;
+ q_u->unknown_0 = 0x00150000;
q_u->unknown_1 = 0x00000000;
q_u->status = status;
@@ -5716,6 +5716,7 @@ BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps
if (!ps->io)
{
+ /* writing */
free_samr_q_set_userinfo(q_u);
}