[Bug 3253] start-stop-daemon --chuid does not set supplemental groups

bugzilla at busybox.net bugzilla at busybox.net
Thu Sep 15 16:27:44 UTC 2011


https://bugs.busybox.net/show_bug.cgi?id=3253

Denys Vlasenko <vda.linux at googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Denys Vlasenko <vda.linux at googlemail.com>  ---
Since current code is wrong for sure, for the time being (before I get info
about "standard" behavior) I'm going to change -c [USER][:GROUP] handling as
follows:

if (opt & OPT_c) {
        struct bb_uidgid_t ugid = { -1, -1 };
        parse_chown_usergroup_or_die(&ugid, chuid);
        if (ugid.uid != (uid_t) -1) {
                struct passwd *pw = xgetpwuid(ugid.uid);
                if (ugid.gid != (gid_t) -1)
                        pw->pw_gid = ugid.gid;
                /* initgroups, setgid, setuid: */
                change_identity(pw);
        } else if (ugid.gid != (gid_t) -1) {
                xsetgid(ugid.gid);
                setgroups(1, &ugid.gid);
        }
}

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list