summaryrefslogtreecommitdiffstats
path: root/source/rpc_parse
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-15 19:21:18 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-15 19:21:18 +0000
commit2af635f8b7f346d49d778dd39acb6563156e77f1 (patch)
treeb35667ad7880dbc3965ed64f0d0231a171ff33fc /source/rpc_parse
parent7b3666f01c743ddf599d432a5bcae4408ca73865 (diff)
downloadsamba-2af635f8b7f346d49d778dd39acb6563156e77f1.tar.gz
samba-2af635f8b7f346d49d778dd39acb6563156e77f1.tar.xz
samba-2af635f8b7f346d49d778dd39acb6563156e77f1.zip
oops! srvinfo 2 command caught bug where strings in containers assumed
to exist. not good!
Diffstat (limited to 'source/rpc_parse')
-rw-r--r--source/rpc_parse/parse_srv.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/rpc_parse/parse_srv.c b/source/rpc_parse/parse_srv.c
index 9e140bcc3e0..a282da6ca31 100644
--- a/source/rpc_parse/parse_srv.c
+++ b/source/rpc_parse/parse_srv.c
@@ -56,7 +56,10 @@ static BOOL srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *
prs_align(ps);
smb_io_unistr2("", &(sh1->uni_netname), True, ps, depth);
+ prs_align(ps);
smb_io_unistr2("", &(sh1->uni_remark ), True, ps, depth);
+ prs_align(ps);
+
return True;
}
@@ -164,19 +167,23 @@ BOOL make_srv_share_info2_str(SH_INFO_2_STR *sh2,
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth)
+static BOOL srv_io_share_info2_str(char *desc, SH_INFO_2_STR *ss2, SH_INFO_2 *sh2, prs_struct *ps, int depth)
{
- if (sh2 == NULL) return False;
+ if (ss2 == NULL) return False;
prs_debug(ps, depth, desc, "srv_io_share_info2_str");
depth++;
prs_align(ps);
- smb_io_unistr2("", &(sh2->uni_netname), True, ps, depth);
- smb_io_unistr2("", &(sh2->uni_remark ), True, ps, depth);
- smb_io_unistr2("", &(sh2->uni_path ), True, ps, depth);
- smb_io_unistr2("", &(sh2->uni_passwd ), True, ps, depth);
+ smb_io_unistr2("", &(ss2->uni_netname), sh2->ptr_netname, ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("", &(ss2->uni_remark ), sh2->ptr_remark , ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("", &(ss2->uni_path ), sh2->ptr_path , ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("", &(ss2->uni_passwd ), sh2->ptr_passwd , ps, depth);
+ prs_align(ps);
return True;
}
@@ -261,13 +268,13 @@ static BOOL srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_stru
for (i = 0; i < num_entries; i++)
{
prs_grow(ps);
- srv_io_share_info2("", &(ctr->info_2[i]), ps, depth);
+ if (!srv_io_share_info2("", &(ctr->info_2[i]), ps, depth)) return False;
}
for (i = 0; i < num_entries; i++)
{
prs_grow(ps);
- srv_io_share_info2_str("", &(ctr->info_2_str[i]), ps, depth);
+ if (!srv_io_share_info2_str("", &(ctr->info_2_str[i]), &(ctr->info_2[i]), ps, depth)) return False;
}
prs_align(ps);