[comp.unix.xenix] setgid

tan@bronson.UUCP (Tan Bronson) (07/09/89)

    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!
thanks
-- 
Tan Bronson		(home) tan@microvation.com (or tan@bronson.uucp)
Microvation Consultants (work) bronson@multiflow.com
Madison, CT 06443

karl@ddsw1.MCS.COM (Karl Denninger) (07/10/89)

In article <5@bronson.UUCP> tan@bronson.UUCP (Tan Bronson) writes:
>
>    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!
>thanks

SGID programs work fine, to my direct knowlege, on:

	Xenix V/386 2.2 & 2.3
	Xenix V/286 2.2

Now, 80286 XENIX programs executed on Interactive 386/ix that are SGID WILL
NOT work right.  Neither will SUID programs.  It has to do with the way
their emulator works.

'386 Xenix binaries on Interactive do work however.  We do that all the time
as well, without trouble.

--
Karl Denninger (karl@ddsw1.MCS.COM, <well-connected>!ddsw1!karl)
Public Access Data Line: [+1 312 566-8911], Voice: [+1 312 566-8910]
Macro Computer Solutions, Inc.		"Quality Solutions at a Fair Price"

chip@ateng.com (Chip Salzenberg) (07/22/89)

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         |       <chip@ateng.com> or <uunet!ateng!chip>
A T Engineering         |       Me?  Speak for my company?  Surely you jest!