diff options
author | Guy Harris <gharris@sonic.net> | 2020-05-25 18:47:06 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-05-25 18:47:06 -0700 |
commit | ffa50a60763f65518b325d241da11bf464b539fc (patch) | |
tree | cf50ebb23b69a3fe1ebe16bf2903b8e4e6ea4a5b /print-rx.c | |
parent | 496fb016709c6fce698cdf8c23d31cc6c5f9187f (diff) | |
download | tcpdump-ffa50a60763f65518b325d241da11bf464b539fc.tar.gz |
afs/rx: have a separate #define for the maximum user name size.
That clarifies the code a bit.
Diffstat (limited to 'print-rx.c')
-rw-r--r-- | print-rx.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -65,6 +65,7 @@ #define VLNAMEMAX 65 #define KANAMEMAX 64 #define BOSNAMEMAX 256 +#define USERNAMEMAX 1024 /* AFSOPAQUEMAX was used for this; does it need to be this big? */ #define PRSFS_READ 1 /* Read files */ #define PRSFS_WRITE 2 /* Write files */ @@ -1158,7 +1159,7 @@ acl_print(netdissect_options *ndo, { int pos, neg, acl; int n, i; - char user[AFSOPAQUEMAX+1]; + char user[USERNAMEMAX+1]; if (sscanf((char *) s, "%d %d\n%n", &pos, &neg, &n) != 2) return; @@ -1183,7 +1184,7 @@ acl_print(netdissect_options *ndo, acl & PRSFS_ADMINISTER ? "a" : ""); for (i = 0; i < pos; i++) { - if (sscanf((char *) s, "%" NUMSTRINGIFY(AFSOPAQUEMAX) "s %d\n%n", user, &acl, &n) != 2) + if (sscanf((char *) s, "%" NUMSTRINGIFY(USERNAMEMAX) "s %d\n%n", user, &acl, &n) != 2) return; s += n; ND_PRINT(" +{"); @@ -1196,7 +1197,7 @@ acl_print(netdissect_options *ndo, } for (i = 0; i < neg; i++) { - if (sscanf((char *) s, "%" NUMSTRINGIFY(AFSOPAQUEMAX) "s %d\n%n", user, &acl, &n) != 2) + if (sscanf((char *) s, "%" NUMSTRINGIFY(USERNAMEMAX) "s %d\n%n", user, &acl, &n) != 2) return; s += n; ND_PRINT(" -{"); |