diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-05-26 02:25:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:08:38 -0500 |
commit | d6ac0e7d2f22f162eaf1bbc9cca9b1e99194c97b (patch) | |
tree | bb9927ee412c5b8caee1f376597e2cb65bd64ca6 /source4/torture/libnet | |
parent | 33ffb31a498186131224ddab11291d81ec0da2a8 (diff) | |
download | samba-d6ac0e7d2f22f162eaf1bbc9cca9b1e99194c97b.tar.gz samba-d6ac0e7d2f22f162eaf1bbc9cca9b1e99194c97b.tar.bz2 samba-d6ac0e7d2f22f162eaf1bbc9cca9b1e99194c97b.zip |
r15897: switch to d_printf() in the libnet_share test, and neaten up the code
a bit using local variables. This should fix a crash on solaris.
(This used to be commit c088654e34caf99569f25899733dac9a42197990)
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r-- | source4/torture/libnet/libnet_share.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/source4/torture/libnet/libnet_share.c b/source4/torture/libnet/libnet_share.c index 65316f3f32..884c0b31c8 100644 --- a/source4/torture/libnet/libnet_share.c +++ b/source4/torture/libnet/libnet_share.c @@ -55,54 +55,59 @@ static void test_displayshares(struct libnet_ListShares s) 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); + struct srvsvc_NetShareInfo0 *info = &s.out.ctr.ctr0->array[i]; + d_printf("\t[%d] %s\n", i, info->name); } break; case 1: for (i = 0; i < s.out.ctr.ctr1->count; i++) { + struct srvsvc_NetShareInfo1 *info = &s.out.ctr.ctr1->array[i]; for (j = 0; j < ARRAY_SIZE(share_types); j++) { - if (share_types[j].type == s.out.ctr.ctr1->array[i].type) break; + if (share_types[j].type == info->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); + d_printf("\t[%d] %s (%s)\t%s\n", i, info->name, + info->comment, share_types[j].desc); } break; case 2: for (i = 0; i < s.out.ctr.ctr2->count; i++) { + struct srvsvc_NetShareInfo2 *info = &s.out.ctr.ctr2->array[i]; for (j = 0; j < ARRAY_SIZE(share_types); j++) { - if (share_types[j].type == s.out.ctr.ctr2->array[i].type) break; + if (share_types[j].type == info->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); + d_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, info->name, share_types[j].desc, info->comment, + info->permissions, info->max_users, + info->current_users, info->path, + info->password); } break; case 501: for (i = 0; i < s.out.ctr.ctr501->count; i++) { + struct srvsvc_NetShareInfo501 *info = &s.out.ctr.ctr501->array[i]; for (j = 0; j < ARRAY_SIZE(share_types); j++) { - if (share_types[j].type == s.out.ctr.ctr501->array[i].type) break; + if (share_types[j].type == info->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); + d_printf("\t[%d] %s\t%s [csc_policy=0x%08x]\n\t %s\n", i, info->name, + share_types[j].desc, info->csc_policy, + info->comment); } break; case 502: for (i = 0; i < s.out.ctr.ctr502->count; i++) { + struct srvsvc_NetShareInfo502 *info = &s.out.ctr.ctr502->array[i]; for (j = 0; j < ARRAY_SIZE(share_types); j++) { - if (share_types[j].type == s.out.ctr.ctr502->array[i].type) break; + if (share_types[j].type == info->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); + d_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, info->name, share_types[j].desc, info->comment, + info->permissions, info->max_users, + info->current_users, info->path, + info->password, info->unknown); } break; } |