Path: utzoo!attcan!uunet!cos!hadron!decuac!felix!info-ultrix From: local@jim.odr.oz.au (local src Local etc.) Newsgroups: comp.unix.ultrix Subject: getuid, geteuid broke? Message-ID: <67782@felix.UUCP> Date: 4 Nov 88 13:13:30 GMT Sender: news@felix.UUCP Reply-To: local@jim.odr.oz.au (local src Local etc.) Organization: O'Dowd Research Pty. Ltd., Melbourne, Australia. Lines: 41 Approved: zemon@felix.UUCP Reply-Path: Reply-to: local@jim.odr.oz.au (local src Local etc.) getuid() seems to always return the effective user id, and getgid() always returns the effective group id. I compiled and ran the following... /* tmp.c */ main() { printf("getuid = %d, geteuid = %d\n",getuid(),geteuid()); printf("getgid = %d, getegid = %d\n",getgid(),getegid()); } 57% cc tmp.c 58% a.out getuid = 290, geteuid = 290 getgid = 6, getegid = 6 59% whoami local 60% su Password: # 51% a.out getuid = 0, geteuid = 0 getgid = 0, getegid = 0 # 52% whoami root # 53% This is wrong, isn't it. I thought that getuid() should return the same thing after I did the su. I discovered this in emacs (18.52) using the functions (user-uid) and (user-real-uid) which call geteuid() and getuid() respectivly. Am I doing something wrong here, how do I fix it. We are running Ultrix 2.0 on a MicroVax II. Brian Wallis (brw@jim.odr.oz) O'Dowd Research P/L. (03) 562-0100 Fax: (03) 562-0616, Telex: Jacobs Radio (Bayswater) 152093