Message ID | 20190530052525.5598-2-sam@mendozajonas.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Dwyz2j1Qz9s00 for <incoming@patchwork.ozlabs.org>; Thu, 30 May 2019 15:25:47 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="TB5CUecQ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="10ofcn8W"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45Dwyz1dR1zDqTW for <incoming@patchwork.ozlabs.org>; Thu, 30 May 2019 15:25:47 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=66.111.4.29; helo=out5-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="TB5CUecQ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="10ofcn8W"; dkim-atps=neutral Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45Dwyq00qYzDqSn for <petitboot@lists.ozlabs.org>; Thu, 30 May 2019 15:25:38 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BBBF7220CB; Thu, 30 May 2019 01:25:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 30 May 2019 01:25:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=fm3; bh=wsPZpabQoEM2c+oLzliMgV9+W4txTZg6iU4rme+mHso=; b=TB5CU ecQBjdKVE7vZjmzrLDpxEgpfNg7hbOdGfNdJ6T8Co9STWVFSrfLFrFwoBtR4duE/ O/XSYNJJzzsRZxlKl9ymhMS5aEOHqjENvo9udFF/7r+iL2YWwHL9Ub+96vNvUW25 XK8NZXE9mTEHa2DuIslE0CcYqhcpNeaZISGGPbtXB9wtpVWQUX78JBKsGwZa5XHm c0zmpZyFChtTAWrxnQDovslu3kj9xR8lZMx8BexgHJFkg7+JQKbwLYBZBxW033TF cWeoxnjU/WNc+BGVMmHjfdEfAQxDJX/xU3m0ZGBGIAJQCFuvz38TdYzjvzwL2o7R 9WdZJhmGlydszQ6gg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=wsPZpabQoEM2c+oLzliMgV9+W4txTZg6iU4rme+mHso=; b=10ofcn8W BAGM7XXq1z67vludKD8Yup8sALSA7gZGXo03/s7SOJPcT6n5fp9/DzYLAYklCnJz p8x3lqIYJCAAbgY6QZX7g2Weo5hpFYlcVo/F0K1q9AOyAxzQuJmTCZq5/E0doa6b sjqSwpBU9A8wSVhzpsKn/uv8Jn8YbrhTw7MQw8owoZp8wgJNAmf3zi3HGo+BvfVR K7K7rsLjwynnRPLTFQp0yLLnKA1OcPdaQ10HCPeIfhE7ahr31CJMn7mGf9ajvdgZ L9WK+VZ64dTck9dLlonHMo9zGfq6ST7G7k5MHrni/7u2lrzTsG5/6B9fenGkbKfP wP+B+CJA2tRtWA== X-ME-Sender: <xms:UGnvXH4k0dBWVyyAFpUTqk4mgKdD2F9dpyZH-NZ-FhXQZmoyWIlgKg> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddvkedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepufgrmhhuvghlucfovghnughoiigrqdflohhnrghsuceoshgr mhesmhgvnhguohiirghjohhnrghsrdgtohhmqeenucfkphepuddvvddrleelrdekvddrud dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmsehmvghnughoiigrjhhonhgrshdr tghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: <xmx:UGnvXDQ8aAq1cx0UPYcrIVXUksxMz7Mam5sTOqz2tIwjOuZ-8U4mFg> <xmx:UGnvXKt7WClRrrHHG2a-bAKp7bimWJ_wKPuatBjzYctf8RULVhPVZw> <xmx:UGnvXF_p2crLIUUqOi3mOWdKRTmlmmcFyvJeHI3B6MkoDA8Err94iQ> <xmx:UGnvXI7knG8bnvjpEOG0Nl7q6DJPNMLEzqRwB6OcH9F4HnZuvpXUhA> Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 5F16280061; Thu, 30 May 2019 01:25:35 -0400 (EDT) From: Samuel Mendoza-Jonas <sam@mendozajonas.com> To: petitboot@lists.ozlabs.org Subject: [PATCH 2/2] utils: Optionally run utilities as root Date: Thu, 30 May 2019 15:25:25 +1000 Message-Id: <20190530052525.5598-2-sam@mendozajonas.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530052525.5598-1-sam@mendozajonas.com> References: <20190530052525.5598-1-sam@mendozajonas.com> MIME-Version: 1.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development <petitboot.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/petitboot>, <mailto:petitboot-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/petitboot/> List-Post: <mailto:petitboot@lists.ozlabs.org> List-Help: <mailto:petitboot-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/petitboot>, <mailto:petitboot-request@lists.ozlabs.org?subject=subscribe> Cc: Samuel Mendoza-Jonas <sam@mendozajonas.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" <petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
[1/2] utils: Quote plugin name and vendor variables
|
expand
|
diff --git a/utils/pb-exec b/utils/pb-exec index bfe13f6b..f1d22e6c 100755 --- a/utils/pb-exec +++ b/utils/pb-exec @@ -1,7 +1,17 @@ #!/bin/sh +PREFIX="" + +# Check if root required +if [[ "$(id -u)" != "0" ]]; then + read -n 1 -r -p "Running as user $(id -un), run as root? (y/N)" key + if [ "$key" == "y" ]; then + PREFIX="sudo" + fi +fi + # Run a program specified by Petitboot. -$@ +$PREFIX $@ echo "$0 ran '$@'" # Wait for the user to exit back to Petitboot.
In particular this fixes running pb-plugin executables from the UI since the wrapper requires root to set up the environment. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> --- utils/pb-exec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)