ahkok / user-session-units

A collection of units for the systemd user session.
GNU Lesser General Public License v2.1
72 stars 23 forks source link

launcher: set groups/GID before setting the UID #15

Closed phmccarty closed 10 years ago

phmccarty commented 10 years ago

This is an additional change to fix up groups for the process before we drop privilege.

From the commit message:


If setresuid(2) is called on its own, the process will still have group "root", but it should be the group for the user with UID.

Also, setresgid(2) sets the supplementary groups for the process from the "current set", which is root's set in this case, so change the current set with initgroups(3) to use UID's supplementary groups.

sofar commented 10 years ago

Merged.