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

e2e: fix run_volume_test #16989

Merged
merged 1 commit into from
Jan 5, 2023
Merged

Conversation

sstosh
Copy link
Contributor

@sstosh sstosh commented Jan 4, 2023

When SELinux is running in enforcing mode,
this test needs to add an suffix :Z to the volume mount.

Signed-off-by: Toshiki Sonoda [email protected]

Does this PR introduce a user-facing change?

None

When SELinux is running in enforcing mode,
this test needs to add an suffix :Z to the volume mount.

Signed-off-by: Toshiki Sonoda <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jan 4, 2023

/approve
LGTM
@containers/podman-maintainers PTAL
@edsantiago Thoughts on why this is passing on CI/CD system up til now?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, sstosh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 4, 2023
@edsantiago
Copy link
Member

There seems to be something magic about /tmp, it does not need SELinux muckery for stat()ing a file (it does for opendir()):

$ i=quay.io/libpod/testimage:20221018
$ mkdir -p /tmp/foo foo
$ touch /tmp/foo/myfile foo/myfile
$ bin/podman run -v /tmp/foo:/data $i ls -l /data/myfile
-rw-rw-r--    1 root     root             0 Jan  4 14:05 /data/myfile
$ bin/podman run -v $(pwd)/foo:/data $i ls -l /data/myfile
ls: /data/myfile: Permission denied       ---- but works with :Z 

! Neither /tmp nor pwd work when given the dirname, not the file path
$ bin/podman run -v /tmp/foo:/data $i ls -l /data
ls: can't open '/data': Permission denied
total 0

Why that is, I defer to you.

@rhatdan
Copy link
Member

rhatdan commented Jan 4, 2023

ls -ldZ /tmp/foo

Might be a (Dir) read allowed, if we switched to touch it should blow up.

@rhatdan
Copy link
Member

rhatdan commented Jan 4, 2023

$ sesearch -A -s container_t -c dir -p read | grep tmp
allow domain tmpfs_t:dir { add_name getattr ioctl lock open read remove_name search write }

@rhatdan
Copy link
Member

rhatdan commented Jan 5, 2023

/lgtm
Anyways this is the correct fix, I have no idea what else is going on.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2023
@openshift-merge-robot openshift-merge-robot merged commit 7f3dd30 into containers:main Jan 5, 2023
@sstosh sstosh deleted the fix-e2e branch January 25, 2023 06:28
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants