GNU bug report logs - #73438
[PATCH] Better error message in checkStoreName

Previous Next

Package: guix-patches;

Reported by: Brennan Vincent <brennan <at> umanwizard.com>

Date: Mon, 23 Sep 2024 11:22:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73438 in the body.
You can then email your comments to 73438 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#73438; Package guix-patches. (Mon, 23 Sep 2024 11:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brennan Vincent <brennan <at> umanwizard.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 23 Sep 2024 11:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brennan Vincent <brennan <at> umanwizard.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] Better error message in checkStoreName
Date: Mon, 23 Sep 2024 07:21:07 -0400
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






Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 17 Nov 2024 21:46:02 GMT) Full text and rfc822 format available.

Notification sent to Brennan Vincent <brennan <at> umanwizard.com>:
bug acknowledged by developer. (Sun, 17 Nov 2024 21:46:02 GMT) Full text and rfc822 format available.

Message #10 received at 73438-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brennan Vincent <brennan <at> umanwizard.com>
Cc: 73438-done <at> debbugs.gnu.org
Subject: Re: [bug#73438] [PATCH] Better error message in checkStoreName
Date: Sun, 17 Nov 2024 22:42:58 +0100
Brennan Vincent <brennan <at> 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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Dec 2024 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.