From owner-freebsd-questions Tue May 28 15: 2: 6 2002 Delivered-To: freebsd-questions@freebsd.org Received: from chen.org.nz (chen.org.nz [210.54.19.51]) by hub.freebsd.org (Postfix) with ESMTP id 315F937B40A for ; Tue, 28 May 2002 15:02:01 -0700 (PDT) Received: from grimoire.chen.org.nz (localhost [127.0.0.1]) by chen.org.nz (8.12.3/8.12.3) with ESMTP id g4SM20Ng060771; Wed, 29 May 2002 10:02:00 +1200 (NZST) (envelope-from jonc@grimoire.chen.org.nz) Received: (from jonc@localhost) by grimoire.chen.org.nz (8.12.3/8.12.3/Submit) id g4SM1v7r060770; Wed, 29 May 2002 10:01:57 +1200 (NZST) Date: Wed, 29 May 2002 10:01:57 +1200 From: Jonathan Chen To: Daniel Blankensteiner Cc: freebsd-questions@FreeBSD.ORG Subject: Re: I386< References: <005401c2068a$35c1ebf0$6800a8c0@rafter> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <005401c2068a$35c1ebf0$6800a8c0@rafter>; from db@traceroute.dk on Tue, May 28, 2002 at 10:56:54PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, May 28, 2002 at 10:56:54PM +0200, Daniel Blankensteiner wrote: > Hi all > I have found a weird problem using getlogin() or maybe it is just me that > is weird ;-) [...] > db# su testuser > ~% whoami > testuser > ~% ./test > You are logged in as: root > Your group number is: 1000 > Your uid is: 1000 > What is going on? If I ssh to the computer and log in as testuser, the > program > works fine. Programs(proccess) that change user and use getlogin() may have > a security problem or am I just missing som "su" info? > btw what is the difference between a real and effective user? getlogin() is working fine. You should be using getuid(2) and geteuid(2) to determine real and effective user. -- Jonathan Chen ---------------------------------------------------------------------- "A person should be able to do a small bit of everything, specialisation is for insects" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message