summaryrefslogtreecommitdiffstats
path: root/source4/torture/libnet
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-08-02 20:35:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:59 -0500
commitb0b881a792e540fb8660ba2b52c1c9f2537b6e3f (patch)
tree9f8bfb13c65c7621ad022f066992ebfc0eb38e4a /source4/torture/libnet
parentffbd634826186b6f7198fbd31547316c5edd75a3 (diff)
downloadsamba-b0b881a792e540fb8660ba2b52c1c9f2537b6e3f.tar.gz
samba-b0b881a792e540fb8660ba2b52c1c9f2537b6e3f.tar.xz
samba-b0b881a792e540fb8660ba2b52c1c9f2537b6e3f.zip
r8944: Get more verbose output from NET-API-LISTSHARE test.
rafal (This used to be commit b1ff59d80f942b679ae3c8dcb08361cf8a25a457)
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r--source4/torture/libnet/libnet_share.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/source4/torture/libnet/libnet_share.c b/source4/torture/libnet/libnet_share.c
index 0fd666b912d..058158226b4 100644
--- a/source4/torture/libnet/libnet_share.c
+++ b/source4/torture/libnet/libnet_share.c
@@ -27,6 +27,85 @@
#define TEST_SHARENAME "libnetsharetest"
+void test_displayshares(struct libnet_ListShares s)
+{
+ int i, j;
+
+ struct share_type {
+ enum srvsvc_ShareType type;
+ const char *desc;
+ } share_types[] = {
+ { STYPE_DISKTREE, "STYPE_DISKTREE" },
+ { STYPE_DISKTREE_TEMPORARY, "STYPE_DISKTREE_TEMPORARY" },
+ { STYPE_DISKTREE_HIDDEN, "STYPE_DISKTREE_HIDDEN" },
+ { STYPE_PRINTQ, "STYPE_PRINTQ" },
+ { STYPE_PRINTQ_TEMPORARY, "STYPE_PRINTQ_TEMPORARY" },
+ { STYPE_PRINTQ_HIDDEN, "STYPE_PRINTQ_HIDDEN" },
+ { STYPE_DEVICE, "STYPE_DEVICE" },
+ { STYPE_DEVICE_TEMPORARY, "STYPE_DEVICE_TEMPORARY" },
+ { STYPE_DEVICE_HIDDEN, "STYPE_DEVICE_HIDDEN" },
+ { STYPE_IPC, "STYPE_IPC" },
+ { STYPE_IPC_TEMPORARY, "STYPE_IPC_TEMPORARY" },
+ { STYPE_IPC_HIDDEN, "STYPE_IPC_HIDDEN" }
+ };
+
+ switch (s.in.level) {
+ case 0:
+ for (i = 0; i < s.out.ctr.ctr0->count; i++) {
+ printf("\t[%d] %s\n", i, s.out.ctr.ctr0->array[i].name);
+ }
+ break;
+
+ case 1:
+ for (i = 0; i < s.out.ctr.ctr1->count; i++) {
+ for (j = 0; j < ARRAY_SIZE(share_types); j++) {
+ if (share_types[j].type == s.out.ctr.ctr1->array[i].type) break;
+ }
+ printf("\t[%d] %s (%s)\t%s\n", i, s.out.ctr.ctr1->array[i].name,
+ s.out.ctr.ctr1->array[i].comment, share_types[j].desc);
+ }
+ break;
+
+ case 2:
+ for (i = 0; i < s.out.ctr.ctr2->count; i++) {
+ for (j = 0; j < ARRAY_SIZE(share_types); j++) {
+ if (share_types[j].type == s.out.ctr.ctr2->array[i].type) break;
+ }
+ printf("\t[%d] %s\t%s\n\t %s\n\t [perms=0x%08x, max_usr=%d, cur_usr=%d, path=%s, pass=%s]\n",
+ i, s.out.ctr.ctr2->array[i].name, share_types[j].desc, s.out.ctr.ctr2->array[i].comment,
+ s.out.ctr.ctr2->array[i].permissions, s.out.ctr.ctr2->array[i].max_users,
+ s.out.ctr.ctr2->array[i].current_users, s.out.ctr.ctr2->array[i].path,
+ s.out.ctr.ctr2->array[i].password);
+ }
+ break;
+
+ case 501:
+ for (i = 0; i < s.out.ctr.ctr501->count; i++) {
+ for (j = 0; j < ARRAY_SIZE(share_types); j++) {
+ if (share_types[j].type == s.out.ctr.ctr501->array[i].type) break;
+ }
+ printf("\t[%d] %s\t%s [csc_policy=0x%08x]\n\t %s\n", i, s.out.ctr.ctr501->array[i].name,
+ share_types[j].desc, s.out.ctr.ctr501->array[i].csc_policy,
+ s.out.ctr.ctr501->array[i].comment);
+ }
+ break;
+
+ case 502:
+ for (i = 0; i < s.out.ctr.ctr502->count; i++) {
+ for (j = 0; j < ARRAY_SIZE(share_types); j++) {
+ if (share_types[j].type == s.out.ctr.ctr502->array[i].type) break;
+ }
+ printf("\t[%d] %s\t%s\n\t %s\n\t [perms=0x%08x, max_usr=%d, cur_usr=%d, path=%s, pass=%s, unknown=0x%08x]\n",
+ i, s.out.ctr.ctr502->array[i].name, share_types[j].desc, s.out.ctr.ctr502->array[i].comment,
+ s.out.ctr.ctr502->array[i].permissions, s.out.ctr.ctr502->array[i].max_users,
+ s.out.ctr.ctr502->array[i].current_users, s.out.ctr.ctr502->array[i].path,
+ s.out.ctr.ctr502->array[i].password, s.out.ctr.ctr502->array[i].unknown);
+ }
+ break;
+ }
+}
+
+
BOOL torture_listshares(void)
{
struct libnet_ListShares share;
@@ -57,6 +136,9 @@ BOOL torture_listshares(void)
printf("libnet_ListShare level %u failed - %s\n", share.in.level, nt_errstr(status));
ret = False;
}
+
+ printf("listing shares:\n");
+ test_displayshares(share);
}
return ret;