From owner-freebsd-standards@freebsd.org Sun Jul 16 17:49:43 2017 Return-Path: Delivered-To: freebsd-standards@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 413B7C0A3B8 for ; Sun, 16 Jul 2017 17:49:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C2C82255 for ; Sun, 16 Jul 2017 17:49:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GHnhUZ023455 for ; Sun, 16 Jul 2017 17:49:43 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-standards@FreeBSD.org Subject: [Bug 220779] getgroups result is affected by setegid Date: Sun, 16 Jul 2017 17:49:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: muh.muhten@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jul 2017 17:49:43 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220779 Bug ID: 220779 Summary: getgroups result is affected by setegid Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: standards Assignee: freebsd-standards@FreeBSD.org Reporter: muh.muhten@gmail.com On FreeBSD, the groups applicable to a process are stored in an array with = the egid in [0] and and zero or more (not necessarily distinct) additional gids= in sorted order. The setgid, setegid, and setregid functions change the egid of a process, b= ut the process's supplementary group ids are to remain unchanged. Since getgro= ups, which claims to conform to IEEE Std 1003.1-2008 (=E2=80=9CPOSIX.1=E2=80=9D)= , is defined to fill its second argument with calling process's supplementary group ids, so its output must not include the egid, which is changed by setgid &c.. The curre= nt implementation fills the second argument with the entire groups array, which does include the egid in [0]. - "The setgid() function shall not affect the supplementary group list in a= ny way. Any supplementary group IDs of the calling process shall remain unchanged." - "The setegid() function shall not affect the supplementary group list in = any way." - (ditto for setregid) - "The getgroups() function shall fill in the array grouplist with the curr= ent supplementary group IDs of the calling process. It is implementation-defined whether getgroups() also returns the effective group ID in the grouplist array." - "A process has up to {NGROUPS_MAX} supplementary group IDs in addition to= the effective group ID." --=20 You are receiving this mail because: You are the assignee for the bug.=