From nobody Sun Oct 15 18:32:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S7pl53LPgz4xGCY; Sun, 15 Oct 2023 18:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S7pl52spSz4fpC; Sun, 15 Oct 2023 18:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697394769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0i79WigNih31uKQHOcfaFS07IYUnuS8cEisZgrVIq9w=; b=Lrd1RYX4VhYZhh5qCXIDmQXj+EHjJHqD4HS2hfRhAEfD1/PJByyMPc0r+k9wVeFQ2GY8Sx WVu6DoEVXaL4MeqvhHMj2+vnhHtN1In2TPYlV5WiS0AzetegZO1x8AhohKVP1gs7/Hp9vE c8XKXWkIu8DwNpj/mFG6ImUiqRS6C5ziI35M7EY2iygVZ4lIPdOdngcjnFnnmjt7DB8bFQ NEJqh+TwlQ/B3fubl5c5T/qCOtEktfEjBOBBkTeNyQVJ9iP56QNnuvJ6NKpH/Z1KpFEtgz e4sfQJY/HRreWJMCbgyu+dtqLNItuAhbxs9VbNk5u7xyIcQpxQ283lmmLYn6kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697394769; a=rsa-sha256; cv=none; b=LDnrmeePFR+RcjiIz/Y4NgSvrFqu811O7Btf7U/2Bsufv/jVa+KpEGZBOftB818QXH476V CqsH4tAli68F1+8RoLsSmj6bduAyq4l4Na6IJylymKOHHMgchkT0YfLv2q52iza4cbTQ/y j8eX1WrVOPAhh4nA+V7At5s/cpkRBPRxzoWMXY+VK1qc84c9e2NlI+qdXimCoWn/0g0o9n Cc1IOUbehRrINRxl4QaL6nvXu9NSszM2vYZTyd7l/EM77rwkR35H/puebaoJnRQ3ZAUsy4 SmvliIwADGEYSMghzoxq11bew3S+n0/Vtjc6s4TDfl4tWCJaJ68h1Egm9JT27Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697394769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0i79WigNih31uKQHOcfaFS07IYUnuS8cEisZgrVIq9w=; b=krFN67ZNMfNunDleNRsFRdT6gMp2GWU6R8LuD7ixWYtJzBB2OvVQ1uQ2U8xeGmnXvk2dh0 t7W0d4/0LmIFV4Ah+FVsDj1yqsnuVIzrxK7GD1VYZWgDD0pnnlw4AxiF+ga/7YySGqk2mO FSSIhsOfM6bwN3ca29U0fKDL8kCcS7aWlOZDGFVxlnRrWHPdW1DxDJ23K5kUN4ZJa8+XCV CfczguK0wxfZ4E5jhyeF8QQNtnl0WHMFLyN68w/YEdJE/rypaavT7vysmvC+w+s4vzTfGE RJrIZKVzu2WnHVw/AvPrZwXsuW3Z3Urm+uFdbRMKBisaB1WleZFNxuZZBDUO1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S7pl51xRNz1MLS; Sun, 15 Oct 2023 18:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39FIWnqG092552; Sun, 15 Oct 2023 18:32:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39FIWnb5092549; Sun, 15 Oct 2023 18:32:49 GMT (envelope-from git) Date: Sun, 15 Oct 2023 18:32:49 GMT Message-Id: <202310151832.39FIWnb5092549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c08ba4a588d5 - main - efibootmgr: provide explicit error message if run as non-root List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c08ba4a588d517e3c5fe00cee0927294d2490993 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c08ba4a588d517e3c5fe00cee0927294d2490993 commit c08ba4a588d517e3c5fe00cee0927294d2490993 Author: Ed Maste AuthorDate: 2023-10-15 17:21:52 +0000 Commit: Ed Maste CommitDate: 2023-10-15 18:31:51 +0000 efibootmgr: provide explicit error message if run as non-root This should be less confusing for new users. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42213 --- usr.sbin/efibootmgr/efibootmgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index b0d023e3539c..8dcf9876486d 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1101,8 +1101,11 @@ main(int argc, char *argv[]) /* * find_dev can operate without any efi variables */ - if (!efi_variables_supported() && !opts.find_dev) - errx(1, "efi variables not supported on this system. root? kldload efirt?"); + if (!efi_variables_supported() && !opts.find_dev) { + if (errno == EACCES && geteuid() != 0) + errx(1, "must be run as root"); + errx(1, "efi variables not supported on this system. kldload efirt?"); + } read_vars();