Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2007 20:53:31 -0700
From:      Darren Pilgrim <freebsd@bitfreak.org>
To:        dmw@unete.cl
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: A few questions...
Message-ID:  <46A577BB.5020400@bitfreak.org>
In-Reply-To: <200707232052.58485.dmw@unete.cl>
References:  <200707232052.58485.dmw@unete.cl>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

> b) Can normal users look for system processes or kernel threads?

Yes, depending on the value of the security.bsd.see_other_uids sysctl. 
If security.bsd.see_other_uids=0, non-root users can only see their own 
processes.

> c) Can root look for system processes or kernel threads?

Yes, regardless of the value of security.bsd.see_other_uids.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46A577BB.5020400>