From owner-freebsd-hackers Tue Jul 14 07:27:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA09398 for freebsd-hackers-outgoing; Tue, 14 Jul 1998 07:27:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bright.ny.otec.com (bright.ny.otec.com [209.3.16.125]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA09391 for ; Tue, 14 Jul 1998 07:27:06 -0700 (PDT) (envelope-from bright@hotjobs.com) Received: from localhost (bright@localhost) by bright.ny.otec.com (8.8.8/8.8.8) with SMTP id KAA07334; Tue, 14 Jul 1998 10:27:08 -0500 (EST) (envelope-from bright@hotjobs.com) X-Authentication-Warning: bright.ny.otec.com: bright owned process doing -bs Date: Tue, 14 Jul 1998 10:27:08 -0500 (EST) From: Alfred Perlstein X-Sender: bright@bright.ny.otec.com To: Stephen Hocking-Senior Programmer PGS Tensor Perth cc: hackers@FreeBSD.ORG Subject: Re: How do you tell (within the kernel) if we started setuid? In-Reply-To: <199807140237.KAA10232@ariadne.tensor.pgs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG don't crosspost please. NAME issetugid - is current process tainted by uid or gid changes DESCRIPTION The issetugid() function returns 1 if the process environment or memory address space is considered ``tainted'', and returns 0 otherwise. A process is tainted if it was created as a result of an execve(2) system call which had either of the setuid or setgid bits set (and extra privi- leges were given as a result) or if it has changed any of it's real, ef- fective or saved user or group ID's since it began execution. -alfred On Tue, 14 Jul 1998, Stephen Hocking-Senior Programmer PGS Tensor Perth wrote: > > If you're executing a program that was started setuid root but has > subsequently given up its privileges, is there anyway to tell if it was > originally set uid? > > > Stephen > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message