Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site nvuxd.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxb!mhuxr!ulysses!gamma!pyuxww!pyuxv!nvuxr!nvuxd!johnm
From: johnm@nvuxd.UUCP (J. Montgomery)
Newsgroups: net.unix-wizards
Subject: Query about setuid()
Message-ID: <131@nvuxd.UUCP>
Date: Wed, 6-Feb-85 20:21:41 EST
Article-I.D.: nvuxd.131
Posted: Wed Feb  6 20:21:41 1985
Date-Received: Fri, 8-Feb-85 02:10:59 EST
Organization: Bell Communications Research
Lines: 47



I have run the following program on a System V VAX and on a
newly aquired Pyramid 90x (I ran it setuid to uucp):

#include 

main()
{
        int Uid, Euid;

        Uid = getuid();
        Euid = geteuid();
        printf("uid = %d euid = %d\n", Uid, Euid);

        printf("setuid(%d) returns %d\n", Uid, setuid(Uid));
        printf("uid = %d euid = %d\n", getuid(), geteuid());

        printf("setuid(%d) returns %d\n", Euid, setuid(Euid));
        printf("uid = %d euid = %d\n", getuid(), geteuid());
}

on the VAX (USG 5.0.5) it gives

uid = 882 euid = 5
setuid(882) returns 0
uid = 882 euid = 882
setuid(5) returns 0
uid = 882 euid = 5

on the Pyramid it gives

uid = 100 euid = 5
setuid(100) returns -1
uid = 100 euid = 100
setuid(5) returns -1
uid = 100 euid = 100

I'm wondering which is correct.  The behavior of the Pyramid will
break some things I have on the VAX (including, I believe, the
honey danber uucp).  I'm assuming that (at least in the att universe)
the Pyramid is broken.  What should 4.2 do?  Please reply by mail,
I'll forward or post replies if there is interest.
-- 
	John Montgomery
	Bell Communications Research
	...{allegra,ihnp4}!nvuxd!johnm