From owner-freebsd-threads@FreeBSD.ORG Mon Sep 19 11:50:06 2011 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 931F1106566B for ; Mon, 19 Sep 2011 11:50:06 +0000 (UTC) (envelope-from gonzalo.a.r@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id DD7458FC14 for ; Mon, 19 Sep 2011 11:50:05 +0000 (UTC) Received: by wwe3 with SMTP id 3so7291330wwe.31 for ; Mon, 19 Sep 2011 04:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=L49b5Vr98iEWVvDbSsJ80uBkjjji2VDu2iwtHiD9aTE=; b=jIO+ZrGjbumvvjqfexc+G2XJO6irzHaZHCv8IHIYe5dbY509MWnUmNr3V0KDt2CXrU cyPLye6jwM5gUDf4U4bZ82dHCHw2qjDmBKX6hne9EqJTSNrYGlZDDlQgaCDzhO5usRck iKyDz2azvyzYfB2PFS1AkUxV+72cffcdXDDHE= MIME-Version: 1.0 Received: by 10.216.138.142 with SMTP id a14mr2635105wej.63.1316433004809; Mon, 19 Sep 2011 04:50:04 -0700 (PDT) Received: by 10.216.208.23 with HTTP; Mon, 19 Sep 2011 04:50:04 -0700 (PDT) In-Reply-To: <4E755D84.7080103@freebsd.org> References: <201109171520.09423.tijl@coosemans.org> <4E755D84.7080103@freebsd.org> Date: Mon, 19 Sep 2011 08:50:04 -0300 Message-ID: From: Gonzalo To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Tijl Coosemans , freebsd-threads@freebsd.org Subject: Re: thread impersonation X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 11:50:06 -0000 What i'm trying to achieve is a program like NFS. Users will connect to this program and navigate the virtual filesystem. Each connection is a thread, and I need to impersonate them for the user associated to each connection, if I use setuid, all thread in the process would be impersonated. In Linux I achieved that using "setfsid" but that doesn't exists here in FreeBSD Thanks Gonzalo 2011/9/17 Julian Elischer > On 9/17/11 11:51 AM, Gonzalo wrote: > >> So, as a imagined, is not possible a thread impersonation on FreeBSD? >> >> 2011/9/17 Tijl Coosemans >> > I'm not quite sure what you are trying to achieve, and why. > each thread DOES have its own credentials but the kernel/unix spec defines > them to all be the same user.. > It MIGHT be possible for a thread spawned before a seteuid() to keep some > of the credentials of the prior ID > but I haven't looked.. Nor do I know how that would be used.. usually UID > tests are made on the PROCESS > credentials and not the thread credentials (which exist for other reasons). > >> On Monday 12 September 2011 21:31:03 Gonzalo wrote: >>> >>>> I'm new in freeBSD and I'm looking a way to impersonate threads in >>>> >>> FreeBSD. >>> >>>> In Linux I did that with setfsuid, but that only work in linux and is >>>> not >>>> portable :( >>>> >>> There's seteuid(2) or setuid(2) which are portable. They change the uid >>> of >>> the entire process though, not per thread. >>> >>> I saw that in FreeBSD there is Jails, that could work? Is possible to >>>> >>> create >>> >>>> a Jail for every new thread and "impersonate the Jail"? Maybe I'm saying >>>> things without sense :( >>>> >>> A jail is a form of virtualisation. It's not related to what you're >>> trying >>> to do. You can read more about jails in the handbook: >>> http://www.freebsd.org/doc/en_**US.ISO8859-1/books/handbook/** >>> jails-intro.html >>> >>> ______________________________**_________________ >> freebsd-threads@freebsd.org mailing list >> http://lists.freebsd.org/**mailman/listinfo/freebsd-**threads >> To unsubscribe, send any mail to "freebsd-threads-unsubscribe@** >> freebsd.org " >> >> >