Skip to content
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

rootless script does not work on $(id -un) that returns backslash #253

Open
2 of 3 tasks
deltabungee opened this issue Sep 16, 2021 · 1 comment
Open
2 of 3 tasks

Comments

@deltabungee
Copy link

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Following the documentation https://docs.docker.com/engine/security/rootless/
the command below should enable the rootless mode for docker

curl -fsSL https://get.docker.com/rootless | sh

Actual behavior

the script fail on line
if ! grep "^$(id -un):\|^$(id -u):" /etc/subuid >/dev/null 2>&1; then

due to the presence of a backslash character in the output of the command "id -un"

Steps to reproduce the behavior

create and use a user with a backslash in his name
launch the command line :
curl -fsSL https://get.docker.com/rootless | sh

I have try to fix the lines for subuid and subgid detection using sed but it is not sufficient
grep "^$(id -un | sed -e "s/[\]/\\\\\\\\/g"):" /etc/subuid

Output of docker version:

(paste your output here)

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.)

aws workspace
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"

@thaJeztah
Copy link
Member

/cc @AkihiroSuda

@thaJeztah thaJeztah transferred this issue from docker/for-linux Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants