* [bug#73438] [PATCH] Better error message in checkStoreName
@ 2024-09-23 11:21 Brennan Vincent
2024-11-17 21:42 ` bug#73438: " Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Brennan Vincent @ 2024-09-23 11:21 UTC (permalink / raw)
To: 73438
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#73438: [PATCH] Better error message in checkStoreName
2024-09-23 11:21 [bug#73438] [PATCH] Better error message in checkStoreName Brennan Vincent
@ 2024-11-17 21:42 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2024-11-17 21:42 UTC (permalink / raw)
To: Brennan Vincent; +Cc: 73438-done
Brennan Vincent <brennan@umanwizard.com> skribis:
> 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
I tweaked the commit log to match our conventions and applied it,
thanks!
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-17 21:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23 11:21 [bug#73438] [PATCH] Better error message in checkStoreName Brennan Vincent
2024-11-17 21:42 ` bug#73438: " Ludovic Courtès
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.