Author: rmacklem
Date: Tue Jun 16 02:35:30 2020
New Revision: 362215
URL: https://svnweb.freebsd.org/changeset/base/362215

Log:
  Make use of the UID_NOBODY and GID_NOGROUP definitions in sys/conf.h.
  
  r362214 exposed UID_NOBODY and GID_NOGROUP to userspace, so use them
  instead of the numbers.
  
  Reviewed by:  kib
  Differential Revision:        https://reviews.freebsd.org/D25281

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c       Tue Jun 16 02:31:22 2020        
(r362214)
+++ head/usr.sbin/mountd/mountd.c       Tue Jun 16 02:35:30 2020        
(r362215)
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/conf.h>
 #include <sys/fcntl.h>
 #include <sys/fnv_hash.h>
 #include <sys/linker.h>
@@ -1525,9 +1526,9 @@ get_exportlist_one(int passno)
                 * 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;
@@ -3456,8 +3457,8 @@ parsecred(char *namelist, struct expcred *cr)
        /*
         * 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.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to