make afsdump_scan get ACLs right
authorStephan Wiesand <Stephan.Wiesand@desy.de>
Sun, 17 Apr 2011 22:37:36 +0000 (23:37 +0100)
committerDerrick Brashear <shadow@dementia.org>
Mon, 18 Apr 2011 18:34:04 +0000 (11:34 -0700)
This makes afsdump_scan get the ACLs right on little endian systems.
It also corrects and slightly beautifies some output (indentation,
cut&paste error for negative ACL label).

Change-Id: I5a120630158e56fe8b55500ff9db70dded5fe0d9
Reviewed-on: http://gerrit.openafs.org/4494
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/tests/parsevnode.c

index f259ee5..8f09fd1 100644 (file)
@@ -407,17 +407,17 @@ parse_acl(XFILE * X, unsigned char *tag, tagged_field * field,
        acl = (struct acl_accessList *)(v->acl);
        n = ntohl(acl->positive);
        if (n) {
-           printf("Positive ACL: %d entries\n", n);
+           printf(" Positive ACL: %d entries\n", n);
            for (i = 0; i < n; i++)
                printf("              %9d  %s\n", ntohl(acl->entries[i].id),
-                      rights2str(acl->entries[i].rights));
+                      rights2str(ntohl(acl->entries[i].rights)));
        }
        n = ntohl(acl->negative);
        if (n) {
-           printf("Positive ACL: %d entries\n", n);
+           printf(" Negative ACL: %d entries\n", n);
            for (i = ntohl(acl->positive); i < ntohl(acl->total); i++)
                printf("              %9d  %s\n", ntohl(acl->entries[i].id),
-                      rights2str(acl->entries[i].rights));
+                      rights2str(ntohl(acl->entries[i].rights)));
        }
     }
     return ReadByte(X, tag);
@@ -463,7 +463,7 @@ parse_vdata(XFILE * X, unsigned char *tag, tagged_field * field,
                    return r;
                symlink_buf[v->size] = 0;
                if (p->print_flags & DSPRINT_VNODE)
-                   printf("Target:       %s\n", symlink_buf);
+                   printf(" Target:       %s\n", symlink_buf);
            } else {
                /* Call the callback here, because it's non-fatal */
                if (p->cb_error)