Skip to content

uucore: look up the -Z context of a relative name by its absolute name - #15336

Merged
sylvestre merged 1 commit into
uutils:mainfrom
abendrothj:uucore-fscreate-relative-lookup
Oct 22, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
abendrothj:uucore-fscreate-relative-lookup

Conversation

@abendrothj

@abendrothj abendrothj commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #15335

FsCreateContext asked the policy for the default context of the name as given. The policy lists absolute names only, so a relative name matched nothing, the miss counted as "no default", and the new object kept the type it inherited from its parent. The name now goes through absolute_for_policy_lookup, as set_selinux_security_context already does for cp -Z.

Checked as root on Fedora 44 (enforcing) against GNU 9.12: mkdir -Z with a relative name, with -p, and with an absolute name now gets the same type. Added test_selinux_default_context_relative_name for mkdir and one for mkfifo. They run in cargo's target/tmp, where the SELinux CI job's policy has a default, and fail without the change there; where there's no default they skip.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 05:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codspeed

codspeed Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ 119 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 398 untouched benchmarks
⏩ 70 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation factor_five_38_bit_primes 1.6 s 2 s -17.03%
⚡ Simulation factor_three_39_bit_primes 567 ms 291.9 ms +94.26%
⚡ Simulation factor_thirteen_39_bit_primes 9.5 s 9 s +5.85%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing abendrothj:uucore-fscreate-relative-lookup (203d45c) with main (c76f272)

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread src/uucore/src/lib/features/selinux.rs Outdated
Comment thread src/uucore/src/lib/features/selinux.rs Outdated
Comment thread tests/by-util/test_mkdir.rs
Comment thread tests/by-util/test_mkdir.rs
Copilot AI balanced review requested due to automatic review settings October 14, 2026 22:08
@abendrothj
abendrothj force-pushed the uucore-fscreate-relative-lookup branch from b933376 to 203d45c Compare October 14, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre
sylvestre merged commit bac5160 into uutils:main Oct 22, 2026
189 of 190 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

mkdir, mknod, mkfifo: -Z ignores the policy default for a relative name

3 participants