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

tests: umockdev-record: t_system_single: handle missing SELinux context on /dev/null #256

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

g7
Copy link
Contributor

@g7 g7 commented Oct 30, 2024

/sys/fs/selinux might exist, yet the checked path might have no
context defined.

Drop the check for the selinux pseudo-fs, and check the eventual
errno if lgetfilecon() fails.

On ENODATA (context doesn't exist, or the process can't access it),
ENOTSUP (extended attributes not supported/disabled) and ENOSYS
(lgetxattr syscall used by lgetfilecon() not available), ensure
__DEVCONTEXT is not there and continue.

On every other error, fail the test case as before.

Copy link
Owner

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'd like to understand this a bit better first, though.

tests/test-umockdev-record.vala Outdated Show resolved Hide resolved
tests/test-umockdev-record.vala Outdated Show resolved Hide resolved
…xt on /dev/null

/sys/fs/selinux might exist, yet the checked path might have no
context defined.

Drop the check for the selinux pseudo-fs, and check the eventual
errno if lgetfilecon() fails.

On ENODATA (context doesn't exist, or the process can't access it),
ENOTSUP (extended attributes not supported/disabled) and ENOSYS
(lgetxattr syscall used by lgetfilecon() not available), ensure
__DEVCONTEXT is not there and continue.

On every other error, fail the test case as before.

Signed-off-by: Eugenio Paolantonio <[email protected]>
@g7 g7 force-pushed the test-umockdev-record-selinux branch from edf2d52 to 28f5365 Compare October 31, 2024 13:26
@g7 g7 changed the title tests: umockdev-record: t_system_single: do not fail on lgetfilecon call failure tests: umockdev-record: t_system_single: handle missing SELinux context on /dev/null Oct 31, 2024
@g7
Copy link
Contributor Author

g7 commented Oct 31, 2024

v2:

  • Drop check for /sys/fs/selinux
  • Explicitly check against ENODATA, ENOTSUP and ENOSYS
  • Update commit (and Pull Request) description reflecting these new changes

Copy link
Owner

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The gentoo error is unrelated, it already started a month ago. I'll look at that separately.

@martinpitt martinpitt merged commit f5c3a2e into martinpitt:main Oct 31, 2024
22 of 23 checks passed
@martinpitt

This comment was marked as off-topic.

@martinpitt
Copy link
Owner

Sorry, let's discuss that Gentoo issue in PR #257 instead.

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

Successfully merging this pull request may close these issues.

2 participants