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: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: NChris Wright <chrisw@sous-sol.org> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
Showing
想要评论请 注册 或 登录