From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 27 22:22:55 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 204C416A419 for ; Fri, 27 Jul 2007 22:22:55 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CB1C113C4A8 for ; Fri, 27 Jul 2007 22:22:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l6RMKXl7040376; Fri, 27 Jul 2007 16:20:34 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 27 Jul 2007 16:20:36 -0600 (MDT) Message-Id: <20070727.162036.-1350495603.imp@bsdimp.com> To: dmw@unete.cl From: "M. Warner Losh" In-Reply-To: <200707232052.58485.dmw@unete.cl> References: <200707232052.58485.dmw@unete.cl> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 27 Jul 2007 16:20:34 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: A few questions... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 22:22:55 -0000 In message: <200707232052.58485.dmw@unete.cl> Daniel Molina Wegener writes: : : 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. The super user is always UID == 0. By definition. The root account typically is 0, but doesn't have to be. User accounts typically aren't 0, but can be (cf toor). Any account with a uid of 0 is a super user. It is the super user that gets all the toys. : b) Can normal users look for system processes or kernel threads? Sometimes. See the sysctls security.bsd.see_other_gids and security.bsd.see_other_uids. : c) Can root look for system processes or kernel threads? If it is the super user, yes. Warner