summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-14 08:27:39 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-14 08:27:39 +0000
commit15b258051cf3bbf8592eac0fd5e3d747d7172101 (patch)
tree98583d43a86d63d311ab40fc61249256a261d871 /source4/torture
parent57529207ca1c0f2a95e6e9f85fc41bb9a27aa64c (diff)
downloadsamba-15b258051cf3bbf8592eac0fd5e3d747d7172101.tar.gz
samba-15b258051cf3bbf8592eac0fd5e3d747d7172101.tar.bz2
samba-15b258051cf3bbf8592eac0fd5e3d747d7172101.zip
* added levels 4, 200 and 300 to NetDfsEnum. 200 and 300 don't work
properly, I'm still investigating that. * changed dcerpc fault status code to NT_STATUS_NETWORK_WRITE_FAULT, which I think is a better mapping (This used to be commit 9ad28f6ddbb777de7cac11e71c392b508c81b741)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/dfs.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/source4/torture/rpc/dfs.c b/source4/torture/rpc/dfs.c
index 5c1b2f2b4e..ad496bc742 100644
--- a/source4/torture/rpc/dfs.c
+++ b/source4/torture/rpc/dfs.c
@@ -41,28 +41,26 @@ static BOOL test_Exist(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
-static BOOL test_Enum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+static BOOL test_EnumLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16 level)
{
NTSTATUS status;
struct dfs_Enum r;
uint32 total=0;
struct dfs_EnumStruct e;
- uint32 i = 0;
struct dfs_Info1 s;
- struct dfs_EnumArray1 e2;
-
- r.in.level = 3;
+ struct dfs_EnumArray1 e1;
+
+ r.in.level = level;
r.in.bufsize = (uint32)-1;
r.in.total = &total;
- r.in.unknown = NULL;
+ r.in.unknown = &total;
r.in.info = &e;
e.level = r.in.level;
- e.e.info1 = &e2;
+ e.e.info1 = &e1;
e.e.info1->count = 0;
e.e.info1->s = &s;
s.path = NULL;
-
status = dcerpc_dfs_Enum(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -70,13 +68,26 @@ static BOOL test_Enum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return False;
}
- NDR_PRINT_DEBUG(dfs_EnumStruct, r.out.info);
+ printf("Received %d records\n", r.out.total?*r.out.total:-1);
- printf("total=%d\n", r.out.total?*r.out.total:-1);
+ NDR_PRINT_DEBUG(dfs_EnumStruct, r.out.info);
return True;
}
+static BOOL test_Enum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ BOOL ret = True;
+ uint16 levels[] = {1, 2, 3, 4, 200, 300};
+ int i;
+ for (i=0;i<ARRAY_SIZE(levels);i++) {
+ if (!test_EnumLevel(p, mem_ctx, levels[i])) {
+ ret = False;
+ }
+ }
+ return ret;
+}
+
BOOL torture_rpc_dfs(int dummy)
{
NTSTATUS status;