home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!utcsri!torn!watserv1!watmath!gamiddle
- From: gamiddle@math.waterloo.edu (Guy Middleton)
- Subject: setreuid() broken?
- Message-ID: <1992Jul23.224104.19277@math.waterloo.edu>
- Organization: University of Waterloo
- Date: Thu, 23 Jul 1992 22:41:04 GMT
- Lines: 31
-
- Sorry if this has been mentioned here before, but I just started reading this
- newsgroup. setreuid() doesn't seen to work right:
-
- # cat foo.c
- #include <errno.h>
-
- main() {
- setuid(0);
- seteuid(0);
-
- printf("%d, %d\n", getuid(), geteuid());
-
- if (setreuid(-1, 200))
- printf("errno = %d\n", errno);
-
- printf("%d, %d\n", getuid(), geteuid());
- }
- #
- # ./a.out
- 0, 0
- errno = 1
- 0, 0
- #
-
- This is crazy. If my uid and euid are 0, how could I possibly get an
- EPERM error?
-
- Is there any way to get this to do what I expect?
-
- -Guy Middleton, University of Waterloo gamiddleton@math.waterloo.edu
- (+1 519 885 1211 x3472) gamiddleton@math.uwaterloo.ca
-