summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-12-31 06:19:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:49 -0500
commitccbfe7b61db1948b552e0629856385a2eb4def10 (patch)
tree91137a5d8bf8ca8ff2a8b8378f26248a694968fe /source4/torture
parente046e9dd733adf61d3d9d950a2e764fbe606b896 (diff)
downloadsamba-ccbfe7b61db1948b552e0629856385a2eb4def10.tar.gz
samba-ccbfe7b61db1948b552e0629856385a2eb4def10.tar.bz2
samba-ccbfe7b61db1948b552e0629856385a2eb4def10.zip
r4434: - fix some NetShare* idl functions
- add torture test for NetShareCheck() metze (This used to be commit 96000a2261ed56fda613a45e3aa460eb3c87082a)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/srvsvc.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c
index 4ddbbc7289..4cc7dc6291 100644
--- a/source4/torture/rpc/srvsvc.c
+++ b/source4/torture/rpc/srvsvc.c
@@ -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;
+ }
}
}
}