plfs / plfs-core

LANL no longer develops PLFS. Feel free to fork and develop as you wish.
41 stars 36 forks source link

EPERM from calling setgroups() with PLFS running as non-root - #318

Closed thewacokid closed 11 years ago

thewacokid commented 11 years ago

While doing some tracing today I noticed that we call setgroups() regardless of whether or not PLFS is running as root.

This fails with EPERM (Operation not permitted) if PLFS is not root, so shouldn't we just avoid calling it entirely by checking getuid() == 0 before trying to call setgroups()?

I coded up a quick fix for it and it made it much easier to read through the output of strace without thousands of entries complaining about permissions.

thewacokid commented 11 years ago

Going to add this to my current pull once I finish some other testing. https://github.com/plfs/plfs-core/pull/317