From owner-freebsd-questions@FreeBSD.ORG Thu Nov 18 16:36:48 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D04106566C for ; Thu, 18 Nov 2010 16:36:48 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.39]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCDA8FC17 for ; Thu, 18 Nov 2010 16:36:47 +0000 (UTC) Received: (qmail 32525 invoked from network); 18 Nov 2010 16:36:47 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 18 Nov 2010 16:36:47 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id 4C48650825; Thu, 18 Nov 2010 11:36:46 -0500 (EST) From: Lowell Gilbert To: doug@safeport.com References: <20101118145239.10937b78@adolfputzen> Date: Thu, 18 Nov 2010 11:36:46 -0500 In-Reply-To: (doug@fledge.watson.org's message of "Thu, 18 Nov 2010 11:15:52 -0500 (EST)") Message-ID: <44k4kawpup.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org, Julian Fagir Subject: Re: Escaping from shell-scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 16:36:48 -0000 doug writes: > If you make a program a shell AFAIK to escape is to logff. Bash has a > chroot like facility that might work. However if you write a simple C > program as a wrapper for your shell script and make that program a > shell, I would think that is pretty secure. As long as you don't call anything that can create an inferior shell. A common mistake when doing this kind of thing is to allow some file editing or mail reading, using programs that have a "shell escape" capability.