-
Notifications
You must be signed in to change notification settings - Fork 450
[Error] File globbing triggered during file parsing in distrobox-assemble #1712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
Something isn't working
Comments
jeffmahoney
added a commit
to jeffmahoney/distrobox
that referenced
this issue
Mar 18, 2025
commit 1bb261a (assemble: fix regression in file reading) introduced a different regression in file parsing. When create a distrobox I observed: - 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 In the loop reading the file, the file contents are being interpreted by the shell rather than being passed as read. This results in the section header being treated as a single-character glob expression. If a file or directory exists in the working directory and is named with a single character contained in the section header, the line will only contain that character rather than the section header. This naturally results in the distrobox not being created because the start of the section is never detected, $name, goes unset, and run_distrobox is called without a name. distrobox rm uses a default name of "my-distrobox" which, on my test system doesn't exist. Then distrobox create is called with an empty name, which fails, but that's interpreted as already existing by run_distrobox. It appears a few separate changes went into that commit and restoring the while read loop fixes the issue for me. Fixes: 89luca89#1712 Fixes: 1bb261a
jeffmahoney
added a commit
to jeffmahoney/distrobox
that referenced
this issue
Mar 18, 2025
commit 1bb261a (assemble: fix regression in file reading) introduced a different regression in file parsing. When creating a distrobox I observed: - 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 In the loop reading the file, the file contents are being interpreted by the shell rather than being passed as read. This results in the section header being treated as a single-character glob expression. If a file or directory exists in the working directory and is named with a single character contained in the section header, the line will only contain that character rather than the section header. This naturally results in the distrobox not being created because the start of the section is never detected, $name, goes unset, and run_distrobox is called without a name. distrobox rm uses a default name of "my-distrobox" which, on my test system doesn't exist. Then distrobox create is called with an empty name, which fails, but that's interpreted as already existing by run_distrobox. It appears a few separate changes went into that commit and restoring the while read loop fixes the issue for me. Fixes: 89luca89#1712 Fixes: 1bb261a
jeffmahoney
added a commit
to jeffmahoney/distrobox
that referenced
this issue
Mar 18, 2025
commit 1bb261a (assemble: fix regression in file reading) introduced a different regression in file parsing. When creating a distrobox I observed: - 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 In the loop reading the file, the file contents are being interpreted by the shell rather than being passed as read. This results in the section header being treated as a single-character glob expression. If a file or directory exists in the working directory and is named with a single character contained in the section header, the line will only contain that character rather than the section header. This naturally results in the distrobox not being created because the start of the section is never detected, $name, goes unset, and run_distrobox is called without a name. distrobox rm uses a default name of "my-distrobox" which, on my test system doesn't exist. Then distrobox create is called with an empty name, which fails, but that's interpreted as already existing by run_distrobox. It appears a few separate changes went into that commit and restoring the while read loop fixes the issue for me. Fixes: 89luca89#1712 Fixes: 1bb261a
jeffmahoney
added a commit
to jeffmahoney/distrobox
that referenced
this issue
Mar 18, 2025
commit 1bb261a (assemble: fix regression in file reading) introduced a different regression in file parsing. When creating a distrobox I observed: - 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 In the loop reading the file, the file contents are being interpreted by the shell rather than being passed as read. This results in the section header being treated as a single-character glob expression. If a file or directory exists in the working directory and is named with a single character contained in the section header, the line will only contain that character rather than the section header. This naturally results in the distrobox not being created because the start of the section is never detected, $name, goes unset, and run_distrobox is called without a name. distrobox rm uses a default name of "my-distrobox" which, on my test system doesn't exist. Then distrobox create is called with an empty name, which fails, but that's interpreted as already existing by run_distrobox. It appears a few separate changes went into that commit and restoring the while read loop fixes the issue for me. Fixes: 89luca89#1712 89luca89#1487 Fixes: 1bb261a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.
The unquoted file contents are being interpreted by the shell rather than being passed as read.
To Reproduce
Create a distrobox.ini:
and create a file in the same directory:
:> w
Then
distrobox assemble create
Expected behavior
A distrobox named
foo
will be createdThe text was updated successfully, but these errors were encountered: