From owner-cvs-all Tue Sep 4 10:44:54 2001 Delivered-To: cvs-all@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id D4CA737B405; Tue, 4 Sep 2001 10:44:43 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f84HiNv22629; Tue, 4 Sep 2001 20:44:23 +0300 (EEST) (envelope-from ru) Date: Tue, 4 Sep 2001 20:44:23 +0300 From: Ruslan Ermilov To: Warner Losh Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/at panic.c privs.h Message-ID: <20010904204423.D17754@sunbay.com> References: <20010904192252.G1669@sunbay.com> <200109041615.f84GFpx76144@freefall.freebsd.org> <200109041620.f84GKZh35512@harmony.village.org> <20010904192252.G1669@sunbay.com> <200109041730.f84HUPh36129@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200109041730.f84HUPh36129@harmony.village.org>; from imp@harmony.village.org on Tue, Sep 04, 2001 at 11:30:25AM -0600 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Sep 04, 2001 at 11:30:25AM -0600, Warner Losh wrote: > In message <20010904192252.G1669@sunbay.com> Ruslan Ermilov writes: > : On Tue, Sep 04, 2001 at 10:20:35AM -0600, Warner Losh wrote: > : > In message <200109041615.f84GFpx76144@freefall.freebsd.org> Ruslan Ermilov writes: > : > : The setre[ug]id() calls are still used in the REDUCE_PERM macro (with > : > : the r[ug]id arguments of -1) so that the call changes the saved user > : > : and group IDs of the process to that specified. > : > > : > Just a side note: We should not use setre* calls in the base sources. > : > They present problems for dropping privs since they obliterate the > : > saved uid. > : > > : Exactly what was needed in this case -- to set saved IDs to the specified > : values. > > setuid() does the same thing and is a less dangerous interface to use > is my point. > Not in FreeBSD's implementation. In our implementation, setuid() always sets real, effective, and saved IDs to the specified values (if permitted). Consider the case where the ``setuid root'' program run by the user ``joe'' wants to "reduce" its privileges to ``setuid daemon'', still preserving the original real IDs, and allowing to switch between ``joe'' and ``daemon''. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message