mirror of
https://github.com/samba-team/samba.git
synced 2025-01-17 02:05:21 +03:00
debugging the srvsvc Net Share Enum. some padding issues; some string length
issues. it works!
This commit is contained in:
parent
0a191ee504
commit
80523a3e83
@ -865,9 +865,11 @@ typedef struct share_info_ctr
|
||||
{
|
||||
uint32 num_entries_read; /* EntriesRead */
|
||||
uint32 ptr_share_info; /* Buffer */
|
||||
uint32 num_entries_read2; /* EntriesRead */
|
||||
SH_INFO_1 info_1 [MAX_SHARE_ENTRIES]; /* share entry pointers */
|
||||
SH_INFO_1_STR info_1_str[MAX_SHARE_ENTRIES]; /* share entry strings */
|
||||
uint32 num_entries_read2; /* EntriesRead2 */
|
||||
uint32 num_entries_read3; /* EntriesRead2 */
|
||||
uint32 padding; /* padding */
|
||||
|
||||
} SHARE_INFO_1_CTR;
|
||||
|
||||
|
@ -37,8 +37,8 @@ static void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *r
|
||||
|
||||
DEBUG(5,("make_srv_share_info1_str: %s %s\n", net_name, remark));
|
||||
|
||||
make_unistr2(&(sh1->uni_netname), net_name, strlen(net_name));
|
||||
make_unistr2(&(sh1->uni_remark ), remark , strlen(remark ));
|
||||
make_unistr2(&(sh1->uni_netname), net_name, strlen(net_name)+1);
|
||||
make_unistr2(&(sh1->uni_remark ), remark , strlen(remark )+1);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@ -103,8 +103,10 @@ static void make_srv_share_1_ctr(SHARE_INFO_1_CTR *ctr)
|
||||
}
|
||||
|
||||
ctr->num_entries_read = num_entries;
|
||||
ctr->ptr_share_info = num_entries > 0 ? 1 : 0;
|
||||
ctr->ptr_share_info = num_entries > 0 ? 1 : 0;
|
||||
ctr->num_entries_read2 = num_entries;
|
||||
ctr->num_entries_read3 = num_entries;
|
||||
ctr->padding = 0;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
|
@ -85,6 +85,8 @@ char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, in
|
||||
num_entries = MAX_SHARE_ENTRIES; /* report this! */
|
||||
}
|
||||
|
||||
DBG_RW_IVAL("num_entries_read2", depth, base, io, q, ctr->num_entries_read2); q += 4;
|
||||
|
||||
for (i = 0; i < num_entries; i++)
|
||||
{
|
||||
q = srv_io_share_info1(io, &(ctr->info_1[i]), q, base, align, depth);
|
||||
@ -95,7 +97,9 @@ char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, in
|
||||
q = srv_io_share_info1_str(io, &(ctr->info_1_str[i]), q, base, align, depth);
|
||||
}
|
||||
|
||||
DBG_RW_IVAL("num_entries_read2", depth, base, io, q, ctr->num_entries_read); q += 4;
|
||||
q = align_offset(q, base, align);
|
||||
DBG_RW_IVAL("num_entries_read3", depth, base, io, q, ctr->num_entries_read3); q += 4;
|
||||
DBG_RW_IVAL("padding ", depth, base, io, q, ctr->padding); q += 4;
|
||||
}
|
||||
|
||||
return q;
|
||||
|
Loading…
x
Reference in New Issue
Block a user