machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.44k stars 353 forks source link

Drop privileges #106

Closed iankronquist closed 8 years ago

iankronquist commented 8 years ago

Recently bug #60 was closed and it was determined that OS X's existing permissions structure can't support granting special privileges to xhyve. It looks like the best way to set up networking for a vm without sudo is to use the setuid bit. However, after networking has been set up, root permissions are no longer needed and can be dropped. This PR drops privileges after networking has been initialized. As a bonus, it redirects the vmnet failure message to stderr instead of stdout.

iankronquist commented 8 years ago

I suppose I should note that this patch is in direct reaction to a comment by @xez on #60.

xez commented 8 years ago

:+1:

iankronquist commented 8 years ago

@xez thanks!