A few questions...

Ben Kaduk minimarmot at gmail.com
Tue Jul 24 06:07:00 UTC 2007


On 7/23/07, Darren Pilgrim <freebsd at bitfreak.org> wrote:
> Daniel Molina Wegener wrote:
> > Hello,
> >
> >    I need information about few things, I hope someone can help
> > me and thanks in advance.
> >
> > a) Is there any function or variable that tells me which is the
> >    root user UID in the system, or root always have 0 and it's
> >    an "elegant" option to compare the variables or structure
> >    members against zero.
>
> Root is always UID 0.  Checking UID == 0 is the common practice for
> determining if the effective UID has root priveleges.
>

But should it be common practice?  What of suser(9) and priv(9)?

-Ben Kaduk


More information about the freebsd-hackers mailing list