89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
9.43k stars 385 forks source link

[Error] No such file or directory when path contains "at" (@) character #1351

Closed karypid closed 2 months ago

karypid commented 2 months ago

Describe the bug

My Linux box uses Active Directory for authentication. As a result, my home path has the @ character in it. This seems to confuse "distrobox-export". I can create and run containers, but using the export command to list applications causes problems.

To Reproduce

I have reproduced this with podman on Fedora 39 (I do not have docker to check if the problem exists there). You do not need to actually join and Active Directory domain to reproduce this, you just need to have the @ character in the home directory name, which can also be achieved with the --badname parameter:

You need to have successfully exported an application so that when listing the apps, there is something to list.

I installed Citrix Workspace App so the export was done with:

📦[sampleuser@withatchar@f39 ~]$ distrobox-export --app Citrix
Application Citrix successfully exported.
OK!
Citrix will appear in your applications list in a few seconds.

When listing apps is the output that demonstrates the bug is:

📦[sampleuser@withatchar@f39 ~]$ distrobox-export --list-apps
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-selfservice.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-selfservice.desktop
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-wfica.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-wfica.desktop
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-new_store.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-new_store.desktop
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-configmgr.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-configmgr.desktop
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-conncenter.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-conncenter.desktop
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-receiver.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-receiver.desktop
grep: /run/host/home/sampleuser: No such file or directory
grep: withatchar/.local/share/applications/f39-receiver_fido2.desktop: No such file or directory
                     | withatchar/.local/share/applications/f39-receiver_fido2.desktop

Expected behavior The exported apps should be listed.

Logs Attached podman logs

Desktop (please complete the following information):

Additional context I think somewhere the code assumes that @ is never in the username / directory-path of a user running distrobox. While this is not normal for a regular user, it is quite common for users logging into machines that authenticate with Active Directory as a server.