Skip to content

Commit 4ae70c3

Browse files
committed
sys/rpc: UNIX auth: Support XDR_FREE
xdr_authunix_parms() does not allocate any auxiliary memory, so we can simply support XDR_FREE by just returning TRUE. Although there are currently no callers passing XDR_FREE, this makes us immune to such a change in a way that doesn't cost more but is more constructive than a mere KASSERT(). Suggested by: rmacklem MFC after: 2 days Sponsored by: The FreeBSD Foundation
1 parent d4cc791 commit 4ae70c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sys/rpc/authunix_prot.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred)
6161
uint32_t junk;
6262
char hostbuf[MAXHOSTNAMELEN];
6363

64+
if (xdrs->x_op == XDR_FREE)
65+
/* This function does not allocate auxiliary memory. */
66+
return (TRUE);
67+
6468
if (xdrs->x_op == XDR_ENCODE) {
6569
getcredhostname(NULL, hostbuf, sizeof(hostbuf));
6670
namelen = strlen(hostbuf);

0 commit comments

Comments
 (0)