Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!ateng!chip From: chip@ateng.com (Chip Salzenberg) Newsgroups: comp.unix.xenix Subject: Re: setgid() broken on xenix? Message-ID: <24C78E40.16470@ateng.com> Date: 21 Jul 89 20:57:35 GMT References: <5@bronson.UUCP> Organization: A T Engineering, Tampa, FL Lines: 17 According to tan@bronson.UUCP (Tan Bronson): > A few weeks ago I recall someone else noticing that setgid programs >can't work on Xenix. Is there a workaround? I'm running `386 2.3.1... >I'd sure like to be able to use this someday! Xenix 2.2 and greater has no problem I'm aware of with running setgid programs. The bug is that if a program calls setgid(getgid()), and that program's effective uid isn't root, then the setgid() fails but returns -> zero <-. So it's saying "sure, no problem," but it's not doing anything. A workaround is: "setgid(getgid()); if (getegid() != getgid()) { PROBLEM }". -- You may redistribute this article only to those who may freely do likewise. Chip Salzenberg | or A T Engineering | Me? Speak for my company? Surely you jest!