Index: sys/sys/conf.h =================================================================== --- sys/sys/conf.h +++ sys/sys/conf.h @@ -147,6 +147,23 @@ #define D_TTY 0x0004 #define D_MEM 0x0008 /* /dev/(k)mem */ +/* Defined uid and gid values. */ +#define UID_ROOT 0 +#define UID_BIN 3 +#define UID_UUCP 66 +#define UID_NOBODY 65534 + +#define GID_WHEEL 0 +#define GID_KMEM 2 +#define GID_TTY 4 +#define GID_OPERATOR 5 +#define GID_BIN 7 +#define GID_GAMES 13 +#define GID_VIDEO 44 +#define GID_DIALER 68 +#define GID_NOGROUP 65533 +#define GID_NOBODY 65534 + #ifdef _KERNEL #define D_TYPEMASK 0xffff @@ -308,22 +325,6 @@ ino_t devfs_alloc_cdp_inode(void); void devfs_free_cdp_inode(ino_t ino); - -#define UID_ROOT 0 -#define UID_BIN 3 -#define UID_UUCP 66 -#define UID_NOBODY 65534 - -#define GID_WHEEL 0 -#define GID_KMEM 2 -#define GID_TTY 4 -#define GID_OPERATOR 5 -#define GID_BIN 7 -#define GID_GAMES 13 -#define GID_VIDEO 44 -#define GID_DIALER 68 -#define GID_NOGROUP 65533 -#define GID_NOBODY 65534 typedef void (*dev_clone_fn)(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **result); Index: usr.sbin/mountd/mountd.c =================================================================== --- usr.sbin/mountd/mountd.c +++ usr.sbin/mountd/mountd.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD: head/usr.sbin/mountd/mountd.c 349376 2019-06-25 17:00:53Z mav $"); #include +#include #include #include #include @@ -1525,9 +1526,9 @@ * Set defaults. */ has_host = FALSE; - anon.cr_uid = 65534; + anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; - anon.cr_groups[0] = 65533; + anon.cr_groups[0] = GID_NOGROUP; exflags = MNT_EXPORTED; got_nondir = 0; opt_flags = 0; @@ -3461,8 +3462,8 @@ /* * Set up the unprivileged user. */ - cr->cr_uid = 65534; - cr->cr_groups[0] = 65533; + cr->cr_uid = UID_NOBODY; + cr->cr_groups[0] = GID_NOGROUP; cr->cr_ngroups = 1; /* * Get the user's password table entry.