GNU bug report logs - #63048
[Home] Shell alias values are not properly quoted

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Date: Mon, 24 Apr 2023 07:58:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Subject: bug#63048: closed (Re: bug#63048: [Home] Shell alias values are
 not properly quoted)
Date: Tue, 11 Jul 2023 15:03:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#63048: [Home] Shell alias values are not properly quoted

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 63048 <at> debbugs.gnu.org.

-- 
63048: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63048
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: 63048-done <at> debbugs.gnu.org
Cc: paren <at> disroot.org, Ekaitz Zarraga <ekaitz <at> elenq.tech>,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#63048: [Home] Shell alias values are not properly quoted
Date: Tue, 11 Jul 2023 17:02:34 +0200
Ludovic Courtès <ludo <at> gnu.org> skribis:

> From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
>
> Fixes <https://issues.guix.gnu.org/63048>.
> Reported by Ekaitz Zarraga <ekaitz <at> elenq.tech>.
>
> * gnu/home/services.scm (with-shell-quotation-bindings): New procedure.
> (environment-variable-shell-definitions): Use it instead of inline copy.
> * gnu/home/services/shells.scm (bash-serialize-aliases): Use it.  Add
> clause for 'literal-string?'.
> * tests/guix-home.sh: Add 'aliases' to 'home-bash-extension' and test it.

Pushed as 7d9fdfb19d17dc99a4cf2548942c4f8ae7433572!

Ludo'.

[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: bug-guix <at> gnu.org
Subject: [Home] Shell alias values are not properly quoted
Date: Mon, 24 Apr 2023 09:57:14 +0200
Hi!

As Ekaitz reported on Mastodon, shell alias values are not properly
quoted, which causes problem when an alias value contains double-quotes
for instance:

--8<---------------cut here---------------start------------->8---
(define (bash-serialize-aliases field-name val)
  #~(string-append
     #$@(map
         (match-lambda
           ((key . #f)
            "")
           ((key . #t)
            #~(string-append "alias " #$key "\n"))
           ((key . value)
            #~(string-append "alias " #$key "=\"" #$value "\"\n")))
         val)))
--8<---------------cut here---------------end--------------->8---

The solution is to borrow and factorize the code of
‘environment-variable-shell-definitions’, which does it right.

Ludo’.



This bug report was last modified 1 year and 317 days ago.

Previous Next


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