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

/dev/null ownership changed on podman exec without -i in rootless container #24894

Open
pboguslawski opened this issue Dec 23, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@pboguslawski
Copy link

Issue Description

When podman exec is fired wihout -i in container running rootless (i.e. --user 2000:2000), /dev/null ownership is changed to 2000:2000 on host. No such problem when podman exec is run with -i.

Noticed in Debian 12:

# dpkg -s podman | grep Version
Version: 4.3.1+ds1-8+deb12u1

Steps to reproduce the issue

Steps to reproduce the issue

  1. Set /dev/null ownership to root:root on host if different.
  2. Start container rootless (i.e. --user 2000:2000).
  3. Execute any cmd inside this container with podman exec without -i parameter, i.e. podman exec containername true
  4. See /dev/null ownership on host (i.e. stat /dev/null) changed to 2000:2000.

Describe the results you received

Hosts /dev/null user and group changed to container uid/gid (2000:2000).

Describe the results you expected

Hosts /dev/null permissions not changed.

podman info output

Debian 12

# dpkg -s podman | grep Version
Version: 4.3.1+ds1-8+deb12u1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@pboguslawski pboguslawski added the kind/bug Categorizes issue or PR as related to a bug. label Dec 23, 2024
@rhatdan
Copy link
Member

rhatdan commented Dec 23, 2024

A rootless user does not have the rights to chown the UID:GID of /dev/null on the host. So I am guessing that something else strange is happening.

$ chown 2000:2000 /dev/null
chown: changing ownership of '/dev/null': Operation not permitted

@rhatdan
Copy link
Member

rhatdan commented Dec 23, 2024

Also Upstream only supports the latest Podman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants