Date: Wed, 29 May 2002 02:20:00 +0200 From: "Daniel Blankensteiner" <db@traceroute.dk> To: "Jonathan Chen" <jonc@chen.org.nz> Cc: <freebsd-questions@freebsd.org> Subject: Re: I386<<FreeBSD 4.5<<getlogin() Message-ID: <003501c206a6$92433110$6800a8c0@rafter> References: <005401c2068a$35c1ebf0$6800a8c0@rafter> <20020529100157.B60716@grimoire.chen.org.nz> <00f501c20696$f970de60$6800a8c0@rafter> <20020529120953.A61017@grimoire.chen.org.nz>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- From: "Jonathan Chen" <jonc@chen.org.nz> > On Wed, May 29, 2002 at 12:28:21AM +0200, Daniel Blankensteiner wrote: > > > But why does getlogin() give me "root", when I have su'ed to testuser? > > Because you logged in as "root". getuid() will return "testuser". No, it return the user number, but I have now found a function to get the username from the number. > > And what is the difference between a real and effective user? > > real and effective user ids may be different, possibly when you run > setuid programs. Dunno if this helps what you're trying to achieve. Ok, so if testuser run a suid program, then the real user is testuser and the effective user is root. What I am trying to achieve? Just an understanding of FreeBSD and the system calls, etc. :-) br db To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003501c206a6$92433110$6800a8c0>