os-posix: set groups properly for -runas
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Sat, 9 Jul 2011 09:22:07 +0000 (10:22 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Tue, 12 Jul 2011 21:41:29 +0000 (21:41 +0000)
commit49248515095c4602fb3eb3c0bdb434c0f7d81b22
tree3ab1a05e9b21edfbae7aa0235336537bd5468925
parentb1041a24e7beed162b9c05284bebdbef372190bb
os-posix: set groups properly for -runas

Andrew Griffiths reports that -runas does not set supplementary group
IDs.  This means that gid 0 (root) is not dropped when switching to an
unprivileged user.

Add an initgroups(3) call to use the -runas user's /etc/groups
membership to update the supplementary group IDs.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
os-posix.c