From: Daniel Berger Date: 2008-02-02T06:12:18+09:00 Subject: Re: Temporarily dropping root access On Feb 1, 1:05 pm, MenTaLguY wrote: > On Sat, 2 Feb 2008 04:23:02 +0900, Daniel Berger 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) Oh, and just curious, is there ever a time when you *would* want to build as root? Thanks, Dan