From nobody Thu Jan 11 01:28:36 2024 X-Original-To: dev-commits-src-branches@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 4T9Rrh2stJz56hkL; Thu, 11 Jan 2024 01:28:36 +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 4T9Rrh2SL1z4TsL; Thu, 11 Jan 2024 01:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936516; 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=k36IPm8tX540YWbqnsBsXDcynC+fPmoqES2HbU1CWSk=; b=vleTbp6Z9Kpy6RhB0BEJG7GKtpGKt8OVXRYesubvcxzFXuqUqywZtBxR7x/MSkgLTEiqnz 0llJIieuEs3fHjcBKwLlFT//Obwkz05ZssaGAk/TB3nk0kt8hXLc/JKch/qGmw5b59Chyn C+AhkkTJL72HrVziA5pI2tSt4y7uPYfQopSuJ3mr+l+phQKTAOyLyMIxxqqxpji6jvWMH1 n3YweDnDIzSMDAWjY76qSdyJRF6p/reJ8YRVpqNRSbQ+ySOEkjbzBe1EahxGb1eu2H0cgl Tf8HKBuqsEVBLn8K3ch8k/NlooYmtTgc3MwGUNtwIIr9oJ6EVrtamFnV4QmSTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936516; 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=k36IPm8tX540YWbqnsBsXDcynC+fPmoqES2HbU1CWSk=; b=sudSZDYDZoILd11YJaFSpYHOFbNf4MBlxLt2uNhrS+GX/1LcjEegvJPR4ego5QcLisrgjg xGb9CwrfdRU2jED0y8wMfeRZ8yBe3DsC7DTRHIgbQVAAUWRw0DDqkQsdH6j7xocxotvM1V K54GckZ5EJLQx1Q29foxHUKZ1vP7NlcQEFLRZ9iCOxdi5WB/egJV/6iZOgyOtsdiFHuBj8 Gf/TYxXcLQtVpYlDnr5j5fuzUKVRCsN7ls/JuIE3pwACiCHtH3HcDpK9bJB5hpu3euYsKi dNixxICZ0nhQnClG1oUDHiyYENrzWjEQ7mazi2MyONqkJ/+pYbHinKvykLJAmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936516; a=rsa-sha256; cv=none; b=dufdMKX5Xbm/3vCF8RzA4DwTp0Z7fpdY/o7Fqt/SrUsiKH90HWjpN7gNUjygO0Fj4EDpQT UIpMxWweGZeejuKjPpolWSlT+acX94omFmMtpw79fGfPLly4oDn/a8fuTiademO7OS3MoP xVsPMjTBdMXZV8IWVlibRIyPKzyOG0ySs8mwDnysnZoiY5OxwxiQ1z9MxQ/mAkl5SQxtxe 9JFYkxjEDzqFKjLGeV4B2PesKyWoclh9EE5FBfbyzMVbsSAImKmRhLWXY2imXbhK6huf6J uEt/N7wiE/WGbm1BF+3Vpzn4TB0yANRdI1nilIjleK4dhzCPvYNtvNJfArOReA== 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 4T9Rrh1YwkzywV; Thu, 11 Jan 2024 01:28:36 +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 40B1Sara089951; Thu, 11 Jan 2024 01:28:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1SaqN089948; Thu, 11 Jan 2024 01:28:36 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:28:36 GMT Message-Id: <202401110128.40B1SaqN089948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0b0e479d052e - stable/13 - efibootmgr: provide explicit error message if run as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0b0e479d052e4018a90b1ca98f7bcffb8ffd817d Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0b0e479d052e4018a90b1ca98f7bcffb8ffd817d commit 0b0e479d052e4018a90b1ca98f7bcffb8ffd817d Author: Ed Maste AuthorDate: 2023-10-15 17:21:52 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:28:27 +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 (cherry picked from commit c08ba4a588d517e3c5fe00cee0927294d2490993) (cherry picked from commit 01641167c9660e98122c3f6174878d534a83b57e) --- 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();