On Sat, 2 Feb 2008 04:23:02 +0900, Daniel Berger <djberg96 / gmail.com> wrote:
> Hi all,
> 
> Say I've got a C extension with two rake tasks - 'build' and
> 'install'. For the build task, if currently being run as root, I would
> like it to drop down to, say, the 'nobody' user. Obviously, I'm only
> talking about Unix here.

Generally speaking, you should be able to use setreuid to set the
effective UID to 'nobody' while keeping the real UID as root.

(Actually 'nobody' may not be a good choice depending on the Unix
flavor; I believe it is something of a special case on HP-UX for
example)

-mental