git: ed62b31e3000 - releng/15.0 - sys/rpc: Define AUTH_SYS_MAX_{GROUPS,HOSTNAME}

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Thu, 16 Oct 2025 18:50:20 UTC
The branch releng/15.0 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=ed62b31e300065e51237f0063e0dff3cf76503b7

commit ed62b31e300065e51237f0063e0dff3cf76503b7
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-10-07 07:51:23 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-16 18:48:04 +0000

    sys/rpc: Define AUTH_SYS_MAX_{GROUPS,HOSTNAME}
    
    As, respectively, the maximum number of "supplementary" groups and the
    maximum hostname size allowed in the credentials structure for AUTH_SYS
    (aka, AUTH_UNIX).
    
    Will be used in subsequent commits.
    
    Approved by:    re (cperciva)
    Reviewed by:    rmacklem
    MFC after:      2 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D52961
    
    (cherry picked from commit f7c4f800cc0b4fac1c99cda8e22d46b67592f9fa)
    (cherry picked from commit 37aeac44647dbf2c194c70a56a3fd52aef365aba)
---
 sys/rpc/auth.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/rpc/auth.h b/sys/rpc/auth.h
index 33c33ffd594d..648fb99a3a27 100644
--- a/sys/rpc/auth.h
+++ b/sys/rpc/auth.h
@@ -354,6 +354,10 @@ __END_DECLS
 #define RPCSEC_GSS	6		/* RPCSEC_GSS */
 #define	AUTH_TLS	7		/* Initiate RPC-over-TLS */
 
+/* RFC 5531's prescribed limits for variable-lenth arrays. */
+#define AUTH_SYS_MAX_HOSTNAME	255
+#define AUTH_SYS_MAX_GROUPS	16	/* Supplementary groups. */
+
 /*
  * Pseudo auth flavors for RPCSEC_GSS.
  */