Skip to content

[Error] distrobox enter fails if Username has "\" in name #1360

@AdaptiveThinking

Description

@AdaptiveThinking

Describe the bug
Default Enter-Command fails if Username contains a Backslash "", which is always the case if this is an ActiveDirectory (or LDAP)-Joined System.

Documentation of distrobox enter says it will execute "bash -l", but in reality it will try to use '... -c "\$(getent passwd ${USER}...' - which fails, because you have a Username of e.g. "AD\username".

distrobox enter will fail with "sh: 1: -l: not found", because "getent passwd ..." fails. It will show in the verbose mode:
sh -c "\$(getent passwd Asername | cut -f 7 -d :) -l"

If you specify a Startup command with -- bash -l or -e bash -l, then this works as expected.

To Reproduce
Use a Username like "AD\username".

Expected behavior
Dont fail at the default command or let the default command be set.

Logs
see above

Desktop (please complete the following information):

  • docker
  • Docker 24.0.5
  • Which version of distrobox? 1.6.0.1
  • Which host distribution? Ubuntu
  • How did you install distrobox? zip

Additional context
Runs in a virtual Desktop environment (Citrix) with Active Directory for Users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions