1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

r4434: - fix some NetShare* idl functions

- add torture test for NetShareCheck()

metze
This commit is contained in:
Stefan Metzmacher 2004-12-31 06:19:05 +00:00 committed by Gerald (Jerry) Carter
parent 745bbc0e17
commit 96000a2261
2 changed files with 38 additions and 7 deletions

View File

@ -518,7 +518,7 @@
/* Function: 0x11 */
WERROR srvsvc_NetShareSetInfo(
[in] unistr *server_unc,
[in] unistr *share_name,
[in] unistr share_name,
[in] uint32 level,
[in,switch_is(level)] srvsvc_NetShareInfo info,
[in,out] uint32 *parm_error
@ -528,7 +528,7 @@
/* Function: 0x12 */
WERROR srvsvc_NetShareDel(
[in] unistr *server_unc,
[in] unistr *share_name,
[in] unistr share_name,
[in] uint32 reserved
);
@ -536,7 +536,7 @@
/* Function: 0x13 */
WERROR srvsvc_NetShareDelSticky(
[in] unistr *server_unc,
[in] unistr *share_name,
[in] unistr share_name,
[in] uint32 reserved
);
@ -544,7 +544,7 @@
/* Function: 0x14 */
WERROR srvsvc_NetShareCheck(
[in] unistr *server_unc,
[in] unistr *share_name,
[in] unistr device_name,
[out] uint32 type
);

View File

@ -448,6 +448,32 @@ static BOOL test_NetShareGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
static BOOL test_NetShareCheck(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
const char *device_name)
{
NTSTATUS status;
struct srvsvc_NetShareCheck r;
BOOL ret = True;
r.in.server_unc = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
r.in.device_name = device_name;
printf("testing NetShareCheck on device '%s'\n", r.in.device_name);
status = dcerpc_srvsvc_NetShareCheck(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("dcerpc_srvsvc_NetShareCheck on device '%s' failed - %s\n",
r.in.device_name, nt_errstr(status));
ret = False;
} else if (!W_ERROR_IS_OK(r.out.result)) {
printf("NetShareCheck on device '%s' failed - %s\n",
r.in.device_name, win_errstr(r.out.result));
ret = False;
}
return ret;
}
/**************************/
/* srvsvc_NetShare */
/**************************/
@ -489,13 +515,18 @@ static BOOL test_NetShareEnumAll(struct dcerpc_pipe *p,
}
/* call srvsvc_NetShareGetInfo for each returned share */
if (r.in.level == 1) {
for (j=0;j<r.out.ctr.ctr1->count;j++) {
if (r.in.level == 2) {
for (j=0;j<r.out.ctr.ctr2->count;j++) {
const char *name;
name = r.out.ctr.ctr1->array[j].name;
const char *device;
name = r.out.ctr.ctr2->array[j].name;
if (!test_NetShareGetInfo(p, mem_ctx, name)) {
ret = False;
}
device = r.out.ctr.ctr2->array[j].path;
if (!test_NetShareCheck(p, mem_ctx, device)) {
ret = False;
}
}
}
}