Description
Describe the bug
If a single-character file exists in the directory where distrobox-assemble is executing and it shares a character with one contained in the name of a distrobox to be assembled, it will fail.
- Deleting ...
Error response from daemon: No such container: my-distrobox
Error response from daemon: No such container: my-distrobox
Cannot find container my-distrobox.
- Creating ...
already exists
my-distrobox
is the default container name and it's used because $name
is never set. This is due to file globbing in the matching a single character file in the current directory, so the line becomes:
w
instead of
[tw]
and the section definition is not interpreted.
This is regression introduced in commit 1bb261a.
# shellcheck disable=SC2013
for line in $(cat "${file}"); do
# Remove comments and trailing spaces
The unquoted file contents are being interpreted by the shell rather than being passed as read.
To Reproduce
Create a distrobox.ini:
image=registry.opensuse.org/opensuse/distrobox:latest
init=true
nvidia=false
pull=true
root=false
replace=true
start_now=false
additional_packages="git vim ctags go1.24 osc fileb0x obs-service-go_modules"
volume="/src:/src"
volume="/var/scratch:/var/scratch"
and create a file in the same directory:
:> w
Then distrobox assemble create
Expected behavior
A distrobox named foo
will be created