Skip to content

Commit e665c0f

Browse files
committed
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
1 parent b119ef0 commit e665c0f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sys/rpc/svc_auth_unix.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050

5151
#include <rpc/rpc_com.h>
5252

53-
#define MAX_MACHINE_NAME 255
54-
#define NGRPS 16
55-
5653
/*
5754
* Unix longhand authenticator
5855
*/
@@ -76,7 +73,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg)
7673
if (buf != NULL) {
7774
time = IXDR_GET_UINT32(buf);
7875
str_len = (size_t)IXDR_GET_UINT32(buf);
79-
if (str_len > MAX_MACHINE_NAME) {
76+
if (str_len > AUTH_SYS_MAX_HOSTNAME) {
8077
stat = AUTH_BADCRED;
8178
goto done;
8279
}
@@ -85,7 +82,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg)
8582
xcr->cr_uid = IXDR_GET_UINT32(buf);
8683
xcr->cr_gid = IXDR_GET_UINT32(buf);
8784
supp_ngroups = (size_t)IXDR_GET_UINT32(buf);
88-
if (supp_ngroups > NGRPS) {
85+
if (supp_ngroups > AUTH_SYS_MAX_GROUPS) {
8986
stat = AUTH_BADCRED;
9087
goto done;
9188
}

0 commit comments

Comments
 (0)