From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 5 04:22:44 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38B97106566B for ; Thu, 5 Jul 2012 04:22:44 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id D90CC8FC12 for ; Thu, 5 Jul 2012 04:22:43 +0000 (UTC) Received: by obbun3 with SMTP id un3so16031046obb.13 for ; Wed, 04 Jul 2012 21:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=D1aWP4IudsAIP8kMgOl+1+pSThWY9rSlRd3xW7NNFIg=; b=aAv3x1BRDU2PyUP83kMJgqAplylrH8o6Mw5eHApUJ5WNszFk/m42ktWH3V04OoIxPx W9k63hLvgkAQiUXCT8HCUHfWdmB1CmYHKGkQSQHhIkSmd3mV8aBOy/0A7XxJLtV70q+4 CDHGLjPrRxVL+m0YUJlaUXHHlLNTUhbCBjB4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-gm-message-state; bh=D1aWP4IudsAIP8kMgOl+1+pSThWY9rSlRd3xW7NNFIg=; b=IjVSV+1pZ78PDoxg1lyLEYjxGkzPh3csIoXbQycyyaWaylX0+fAsQjxZlJwDfWGUK/ nvTmE3Hcz5hR0AYQGZPCMV/bFXv8fdAYpSlBdHlTEZWSD21pHSVcesxvNltiPbXsFesL W9IKmMonZ0hKiKdD0XuxL/GBk4d+fn2U9ghtHYzk/4rL+0UuRqYcN1eVa2ScXWqN3itS rDp/6MW2HSejYbrCo5Ih+PK3KyrIeZ4+vJxgtVnsmt9QfsTMZcPDj+36euelhj3oVh3Z p+Ftz9Twp4d6ARpSGGTiLolCxiKAfx4/Q4vtPR4gvEwuPxQAbYDW7+YhsB2ZnVyHpNYk LyDw== Received: by 10.50.186.196 with SMTP id fm4mr12977032igc.34.1341462163154; Wed, 04 Jul 2012 21:22:43 -0700 (PDT) Received: from DataIX.net (adsl-108-73-115-46.dsl.klmzmi.sbcglobal.net. [108.73.115.46]) by mx.google.com with ESMTPS id bj4sm15471834igc.16.2012.07.04.21.22.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jul 2012 21:22:42 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q654Mc4R072752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Jul 2012 00:22:38 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jh@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q654MRrF072751; Thu, 5 Jul 2012 00:22:27 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Thu, 5 Jul 2012 00:22:27 -0400 From: Jason Hellenthal To: Peter Jeremy Message-ID: <20120705042227.GC392@DataIX.net> References: <20120704185104.GA42355@DataIX.net> <4FF4B36A.2040608@FreeBSD.org> <20120704180134.7c649e1b@bhuda.mired.org> <4FF4BEED.10103@FreeBSD.org> <4FF4CA45.7070502@rawbw.com> <4FF4CB54.1060004@FreeBSD.org> <20120704191008.0aa46225@bhuda.mired.org> <20120705011110.GA27618@server.rulingia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120705011110.GA27618@server.rulingia.com> X-Gm-Message-State: ALoCoQlfYzbVRNqDU3lCojF09ATgWxFjFvZaZwnbxM0U97DVeYPetAm1PlLiBHMgbHmFM8SalrLp Cc: "freebsd-hackers@freebsd.org" , Mike Meyer Subject: Re: install-prompt for missing features (Was: Re: Pull in upstream before 9.1 code freeze?) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 04:22:44 -0000 On Thu, Jul 05, 2012 at 11:11:10AM +1000, Peter Jeremy wrote: > On 2012-Jul-04 19:10:08 -0400, Mike Meyer wrote: > >My first thought was to suggest it be a port as well, but I'm not sure > >that can be done sanely. > > The easiest way is probably to implement some form of generic "command > not found" hook into sh(1) and tcsh(1) - in interactive mode, if a > specific function exists, execute it rather than reporting an error > message . The actual functionality to map a command name to a port > and suggest it to the user could nten be implemented separately as a > port and the user would enable it by adding the appropriate function > definition to their .profile/.login/.[t]cshrc files. > > Note that I'm not currently interested in this functionality and am > not volunteering to implement it. > Still appreciated input. I think it might be easier to make use "securely" of LD_PRELOAD and write a library with very specific functions and maybe even functions that will call in pkgng functions and such. LD_PRELOAD - Within interactive shell only load the functions... Check interactivity. Check return codes of commands issued. Make sure its a secure path and that any file referenced should not be owned by the user or writable by anyone else ... etc... etc... Check a database against plist mappings to packages for only those things that would be in the users PATH. Check to make sure that the user is in a preconfigured group of users authorized to be pestered by prompts.. - probably more - -- - (2^(N-1))