From: Brennan Vincent <brennan@umanwizard.com>
To: 73438@debbugs.gnu.org
Subject: [bug#73438] [PATCH] Better error message in checkStoreName
Date: Mon, 23 Sep 2024 07:21:07 -0400 [thread overview]
Message-ID: <871q1ad3a4.fsf@denver.mail-host-address-is-not-set> (raw)
When trying to pass a local-file beginning with a dot to something like
home-files-service-type, one gets an error message like:
guix home: error: invalid name: `.vimrc'
which does not explain what went wrong. This update should make it more clear.
Change-Id: I045a663bc6cd9844677c65b38a31d3941cf212b5
---
nix/libstore/store-api.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nix/libstore/store-api.cc b/nix/libstore/store-api.cc
index 781fb9e693..38a1403a71 100644
--- a/nix/libstore/store-api.cc
+++ b/nix/libstore/store-api.cc
@@ -61,7 +61,7 @@ void checkStoreName(const string & name)
/* Disallow names starting with a dot for possible security
reasons (e.g., "." and ".."). */
if (string(name, 0, 1) == ".")
- throw Error(format("invalid name: `%1%'") % name);
+ throw Error(format("invalid name: `%1%' (can't begin with dot)") % name);
foreach (string::const_iterator, i, name)
if (!((*i >= 'A' && *i <= 'Z') ||
(*i >= 'a' && *i <= 'z') ||
base-commit: 6ea75bb9bcc52521f0bb3f121799745fdc17f1c9
--
2.46.0
next reply other threads:[~2024-09-23 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 11:21 Brennan Vincent [this message]
2024-11-17 21:42 ` bug#73438: [PATCH] Better error message in checkStoreName Ludovic Courtès
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q1ad3a4.fsf@denver.mail-host-address-is-not-set \
--to=brennan@umanwizard.com \
--cc=73438@debbugs.gnu.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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).