From 2ed5e42378c913c806dfec93998d9fcb8b15191b Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Tue, 16 Jun 2020 02:31:22 +0000 Subject: [PATCH] Expose UID_xxx and GID_xxx definitions to userspace. This patch moves the UID_xxx and GID_xxx definitions out of the #ifdef _KERNEL section, so that userspace programs like mountd can use them. There are a couple of userspace programs that do define UID_ROOT, but they do not include sys/conf.h. Since they are defined as the same value, maybe they should be changed to include sys/conf.h. Reviewed by: kib Differential Revision: https:/reviews.freebsd.org/D25281 --- sys/sys/conf.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 678f6218ae1d..b1b8b1c95c13 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -147,6 +147,23 @@ typedef int dumper_hdr_t(struct dumperinfo *di, struct kerneldumpheader *kdh, #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 @@ -309,22 +326,6 @@ void devfs_clear_cdevpriv(void); 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);