all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: "(" <paren@disroot.org>, 57016@debbugs.gnu.org
Subject: [bug#57016] [PATCH] scripts: Bail out when running pull/package commands as root.
Date: Sat, 6 Aug 2022 13:47:36 +0200	[thread overview]
Message-ID: <4ae42a10-0c06-a920-e85b-bf9981eab6e1@telenet.be> (raw)
In-Reply-To: <20220806114153.23153-1-paren@disroot.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 847 bytes --]


On 06-08-2022 13:41, ( via Guix-patches via wrote:
> +(define (assert-not-root override-flag)
> +  "Throw an error if Guix was invoked by root.  This allows us to
> +inform new users that it is usually a mistake to run commands such
> +as `guix package' as root.  OVERRIDE-FLAG should be a flag that can
> +be used with the invoked command to override this requirement."
> +  (when (= (getuid) 0)
> +    (leave (G_ "this command should not be run as root
> +
> +Note: Running this command as root will only affect the `root' user,
> +not the entire system, due to Guix's support for per-user package
> +management.  Use `~a' to continue regardless.~%")
> +           override-flag)))

Looks like a nice safety net, but maybe this would better use the 'hint' 
mechanism for consistency in error messages?

Greetings,
Maxime.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  parent reply	other threads:[~2022-08-06 11:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06 11:41 [bug#57016] [PATCH] scripts: Bail out when running pull/package commands as root ( via Guix-patches via
2022-08-06 11:46 ` ( via Guix-patches via
2022-08-06 11:47 ` Maxime Devos [this message]
2022-08-06 11:48   ` ( via Guix-patches via
2022-08-06 11:56   ` ( via Guix-patches via
2022-08-06 11:55 ` [bug#57016] [PATCH v2] " ( via Guix-patches via
2022-08-06 12:30 ` [bug#57016] [PATCH] " Tobias Geerinckx-Rice via Guix-patches via
2022-08-06 13:30 ` bug#57016: Closing ( via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ae42a10-0c06-a920-e85b-bf9981eab6e1@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=57016@debbugs.gnu.org \
    --cc=paren@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.