summaryrefslogtreecommitdiff
path: root/print-rx.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-05-25 18:47:06 -0700
committerGuy Harris <gharris@sonic.net>2020-05-25 18:47:06 -0700
commitffa50a60763f65518b325d241da11bf464b539fc (patch)
treecf50ebb23b69a3fe1ebe16bf2903b8e4e6ea4a5b /print-rx.c
parent496fb016709c6fce698cdf8c23d31cc6c5f9187f (diff)
downloadtcpdump-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/print-rx.c b/print-rx.c
index 6ae17cf7..56ce2464 100644
--- a/print-rx.c
+++ b/print-rx.c
@@ -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(" -{");