diff options
| author | Olivier Certner <olce@FreeBSD.org> | 2025-10-07 13:33:53 +0000 |
|---|---|---|
| committer | Olivier Certner <olce@FreeBSD.org> | 2025-10-14 12:21:49 +0000 |
| commit | e665c0f6f7a611d25d9d7e7f64d98c84b3a92820 (patch) | |
| tree | b5bce43e91f39e6296566481a7fdc479107f9766 | |
| parent | b119ef0f6a81eb32b0e1cd0075cec499543e7ddd (diff) | |
sys/rpc: UNIX auth: Use AUTH_SYS_MAX_{GROUPS,HOSTNAME} as limits (2/2)
Remove local defines from 'svc_auth_unix.c' and use the new limit
macros instead.
Reviewed by: rmacklem
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52963
| -rw-r--r-- | sys/rpc/svc_auth_unix.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index aad4e7610795..b3389bc79511 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -50,9 +50,6 @@ #include <rpc/rpc_com.h> -#define MAX_MACHINE_NAME 255 -#define NGRPS 16 - /* * Unix longhand authenticator */ @@ -76,7 +73,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) if (buf != NULL) { time = IXDR_GET_UINT32(buf); str_len = (size_t)IXDR_GET_UINT32(buf); - if (str_len > MAX_MACHINE_NAME) { + if (str_len > AUTH_SYS_MAX_HOSTNAME) { stat = AUTH_BADCRED; goto done; } @@ -85,7 +82,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) xcr->cr_uid = IXDR_GET_UINT32(buf); xcr->cr_gid = IXDR_GET_UINT32(buf); supp_ngroups = (size_t)IXDR_GET_UINT32(buf); - if (supp_ngroups > NGRPS) { + if (supp_ngroups > AUTH_SYS_MAX_GROUPS) { stat = AUTH_BADCRED; goto done; } |
