From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 24 15:00:41 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8102A16A4B3 for ; Fri, 24 Oct 2003 15:00:41 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A03C243FBF for ; Fri, 24 Oct 2003 15:00:39 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9OM0bFY056199 for ; Fri, 24 Oct 2003 15:00:37 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9OM0b3s056198; Fri, 24 Oct 2003 15:00:37 -0700 (PDT) (envelope-from gnats) Date: Fri, 24 Oct 2003 15:00:37 -0700 (PDT) Message-Id: <200310242200.h9OM0b3s056198@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "C. Stephen Gunn" Subject: Re: kern/58497: sysctl knob to return current process' jid X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "C. Stephen Gunn" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2003 22:00:41 -0000 The following reply was made to PR kern/58497; it has been noted by GNATS. From: "C. Stephen Gunn" To: "Poul-Henning Kamp" Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: kern/58497: sysctl knob to return current process' jid Date: Fri, 24 Oct 2003 16:50:35 -0500 On Fri, 24 Oct 2003 22:57:39 +0200, "Poul-Henning Kamp" wrote: > >There is no easy way to tell if a process is operating in a Jail > >environment. > > Yes, in fact there is: Good point, my problem statemen was unnecessairly broad. As we discussed on IRC, perhaps letting jail'd processes learn their jid servese no useful purpose, which might weaken security. For posterity, one way to detect if we're operating in a jail from the command line would be something like: INJAIL=`ps -p $$ | awk '$3 ~ /.*J/ { print "yes" };'` Unless someone sees other value in a sysctl to get the JID, someone can go ahead and resolve this request. Thanks. - Steve