Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!maxwell.concordia.ca From: smw@maxwell.concordia.ca ( Steven Winikoff ) Newsgroups: comp.unix.questions Subject: Problem with getuid() -- same as geteuid()?! Message-ID: <1836@clyde.concordia.ca> Date: 2 Feb 90 20:54:34 GMT Sender: usenet@clyde.concordia.ca Reply-To: smw@maxwell.concordia.ca ( Steven Winikoff ) Organization: Concordia University, Montreal, Quebec Lines: 40 I've encountered a problem using getuid(), on both a Sun 4/280 under SunOS 4.0 and a MIPS M-120/5 under MIPS RISC/os 4.0.1 (SVR3 plus BSD compatibility). The following short program produces the same results on both systems, and replicates the behaviour I've experienced in the middle of a much larger application: #include main() { int getuid(); printf("uid = %d\n", getuid()); } When I log in as user "smw" (user index = 1000), the program does indeed return "uid = 1000". However, when I then execute the su command, I receive "uid = 0" instead of the expected "uid = 1000". Am I missing something? I thought that this was the expected behaviour for geteuid() instead of getuid(), and that's why I used getuid() in the first place! Can anyone tell me if I'm just confused, or if I'm simply not doing it right, or if there's actually a bug in the Sun and MIPS implementation of these calls? Thanks very much in advance! Regards, - Steven ------------------------------------------------------------------------ Steven Winikoff smw@maxwell.concordia.ca Software Analyst Dept. of Computing services Concordia University voice: (514) 848-7619 Montreal, Quebec, Canada (10:00-18:00 EST)