Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/external/cddl/osnet/sys/sys Pull up following revision(s)...



details:   https://anonhg.NetBSD.org/src/rev/032341a825dd
branches:  netbsd-9
changeset: 940628:032341a825dd
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 12 10:26:59 2020 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #1111):

        external/cddl/osnet/sys/sys/cred.h: revision 1.8

Stub groupmember() has to test both group list and current group id.

Fixes kern/55675: ZFS mounts do not work with setuid programs

diffstat:

 external/cddl/osnet/sys/sys/cred.h |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 27a7bf0047cc -r 032341a825dd external/cddl/osnet/sys/sys/cred.h
--- a/external/cddl/osnet/sys/sys/cred.h        Mon Oct 12 10:17:33 2020 +0000
+++ b/external/cddl/osnet/sys/sys/cred.h        Mon Oct 12 10:26:59 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cred.h,v 1.6.2.1 2020/04/29 13:47:51 martin Exp $      */
+/*     $NetBSD: cred.h,v 1.6.2.2 2020/10/12 10:26:59 martin Exp $      */
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd%FreeBSD.org@localhost>
@@ -70,10 +70,12 @@
 static __inline int
 groupmember(gid_t gid, cred_t *cr) 
 {
-       int result;
+       int result, error;
 
-       kauth_cred_ismember_gid(cr, gid, &result);
-       return result;
+       error = kauth_cred_ismember_gid(cr, gid, &result);
+       if (error)
+               return 0;
+       return (kauth_cred_getegid(cr) == gid || result);
 }
 
 #endif /* _KERNEL */



Home | Main Index | Thread Index | Old Index