From owner-freebsd-arch@FreeBSD.ORG Thu May 28 13:53:10 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7941065673; Thu, 28 May 2009 13:53:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3678FC24; Thu, 28 May 2009 13:53:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B6CF246B09; Thu, 28 May 2009 09:53:09 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 77E0F8A028; Thu, 28 May 2009 09:53:08 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Date: Thu, 28 May 2009 08:16:29 -0400 User-Agent: KMail/1.9.7 References: <20090528000147.GB3704@isilon.com> In-Reply-To: <20090528000147.GB3704@isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905280816.29617.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 28 May 2009 09:53:08 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: steven.danneman@isilon.com, Zachary Loafman Subject: Re: pthread_setugid_np X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 13:53:10 -0000 On Wednesday 27 May 2009 8:01:48 pm Zachary Loafman wrote: > arch@ - > > Isilon has need of per-thread impersonation. We're looking at > implementing something like the pthread_setugid_np mechanism found on > OS X, loosely documented in the code: > > http://fxr.watson.org/fxr/source/bsd/kern/kern_prot.c?v=xnu-1228 > (see settid and setgroups1) > > and some here: > http://lists.apple.com/archives/perfoptimization-dev/2008/Jan/msg00043.html > > Does anyone have strong objections to Apple's APIs here? There's > obviously no portable itnerface to handle it, and it seems a little > saner to just adopt someone else's API/semantics rather than reinvent. I suppose you would implement this by having a new flag in td_pflags to indicate that the thread is using a private credential and use that to disable the automatic updating of td_ucred on syscall return and then just point td_ucred at the thread-specific credential? Hmm, the XXX in Darwin's source about P_SUGID is probably meaningful for us as we still use that flag. I would defer to Robert on how that should work though. -- John Baldwin