Skip to content

install: give files the policy's default context under -Z - #15359

Draft
abendrothj wants to merge 3 commits into
uutils:mainfrom
abendrothj:install-context-files
Draft

abendrothj wants to merge 3 commits into
uutils:mainfrom
abendrothj:install-context-files

Conversation

@abendrothj

Copy link
Copy Markdown
Contributor

Closes #15091

Based on #15333.

With -Z, install labelled a new file from its parent directory's context, and turned any type containing tmp into user_home_t, instead of asking the policy as GNU does. It now sets the policy's default after the copy, as -d -Z does for an existing directory, and keeps the kernel's label where the policy has none. The parent-derived helper is removed.

Checked on Fedora (enforcing) against GNU 9.12: install -Z f /tmp/f is now user_tmp_t (was user_home_t), and a file in an etc_t directory under $HOME gets user_home_t (was etc_t). Added two tests that fail without the change.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)

@codspeed

codspeed Bot commented Oct 15, 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 1.9 s -12.47%
⚡ Simulation factor_three_39_bit_primes 567 ms 449.3 ms +26.18%
⚡ Simulation factor_thirteen_39_bit_primes 9.5 s 9.1 s +4.42%

Tip

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


Comparing abendrothj:install-context-files (4a1a28b) 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. ↩

This branch has not been deployed

No deployments
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.

install: -Z gives new files and directories a different SELinux type than GNU

1 participant