Re: A few questions...



On 7/23/07, Darren Pilgrim <freebsd@xxxxxxxxxxxx> 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
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Is this related to some security restrictions?
    ... it's real-uid and effective-uid are both ... Effective UID == The Effective UID being used for privilege checking. ... suto root and issue the following ...
    (linux.redhat.misc)
  • Re: Rename root to avoid hacking?
    ... Those are remote attacks, ... root user by name, but I am absolutely certain that no system-local ones ... By using the UID instead of the username, ... ...reach exactly the same SMTP daemon welcome banner. ...
    (comp.os.linux.security)
  • Re[2]: accounting with ipfw (gid, uid riles)
    ... MS> The uid associated with a socket is the uid of the process which created ... it's still accounted to root. ... far, is adding alias interface, bind squid to this interface and count ...
    (FreeBSD-Security)
  • Re: Root is root no more
    ... > they required root access. ... > cchsu etc, cchsu being the first root uid account. ... > pwconv'd the file, added the passwd for these accounts, changed the $HOME ...
    (comp.unix.solaris)
  • Re: Question about SELinux and root privs
    ... "root" is just a normal user now, ... Yep, UID 0 of course, the username doesn't matter. ... > Well one of the points of SELinux seems to be there isn't any ... > account, and/or add/modify any privileges at will ... ...
    (comp.os.linux.security)