--- zzzz-none-000/linux-3.10.107/include/linux/uidgid.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/include/linux/uidgid.h 2021-02-04 17:41:59.000000000 +0000 @@ -17,8 +17,6 @@ struct user_namespace; extern struct user_namespace init_user_ns; -#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS - typedef struct { uid_t val; } kuid_t; @@ -31,6 +29,7 @@ #define KUIDT_INIT(value) (kuid_t){ value } #define KGIDT_INIT(value) (kgid_t){ value } +#ifdef CONFIG_MULTIUSER static inline uid_t __kuid_val(kuid_t uid) { return uid.val; @@ -40,25 +39,16 @@ { return gid.val; } - #else - -typedef uid_t kuid_t; -typedef gid_t kgid_t; - static inline uid_t __kuid_val(kuid_t uid) { - return uid; + return 0; } static inline gid_t __kgid_val(kgid_t gid) { - return gid; + return 0; } - -#define KUIDT_INIT(value) ((kuid_t) value ) -#define KGIDT_INIT(value) ((kgid_t) value ) - #endif #define GLOBAL_ROOT_UID KUIDT_INIT(0) @@ -119,12 +109,12 @@ static inline bool uid_valid(kuid_t uid) { - return !uid_eq(uid, INVALID_UID); + return __kuid_val(uid) != (uid_t) -1; } static inline bool gid_valid(kgid_t gid) { - return !gid_eq(gid, INVALID_GID); + return __kgid_val(gid) != (gid_t) -1; } #ifdef CONFIG_USER_NS