Bug 2443703
| Summary: | python3 -m venv incorrectly preserves bin_t SELinux context on Activate.ps1 from system templates | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Alistair Lewars <alistair.lewars> |
| Component: | python3.14 | Assignee: | Miro Hrončok <mhroncok> |
| Status: | ASSIGNED --- | QA Contact: | |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 43 | CC: | ksurma, mhroncok, python-maint, python-packagers-sig |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Alistair Lewars
2026-03-01 21:01:45 UTC
I can reproduce. [~]$ ls -lZ /usr/lib64/python3.14/venv/scripts/common/ .rw-r--r-- 2.2k root system_u:object_r:bin_t:s0 3 Feb 16:32 activate .rw-r--r-- 2.2k root system_u:object_r:bin_t:s0 3 Feb 16:32 activate.fish .rw-r--r-- 9.0k root system_u:object_r:bin_t:s0 3 Feb 16:32 Activate.ps1 [~]$ ls -lZ /usr/lib64/python3.14/venv/scripts/posix/ .rw-r--r-- 937 root system_u:object_r:bin_t:s0 3 Feb 16:32 activate.csh [~]$ python3.14 -m venv ttt [~]$ ls -lZ ttt/bin/ .rw-r--r-- 2.1k churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 activate .rw-r--r-- 907 churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 activate.csh .rw-r--r-- 2.2k churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 activate.fish .rw-r--r-- 9.0k churchyard system_u:object_r:bin_t:s0 3 Feb 16:32 Activate.ps1 .rwxr-xr-x 240 churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 pip .rwxr-xr-x 240 churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 pip3 .rwxr-xr-x 240 churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 pip3.14 lrwxrwxrwx - churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 python -> python3.14 lrwxrwxrwx - churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 python3 -> python3.14 lrwxrwxrwx - churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 python3.14 -> /usr/bin/python3.14 lrwxrwxrwx - churchyard unconfined_u:object_r:user_home_t:s0 2 Mar 12:26 𝜋thon -> python3.14 I think the prolem might be near https://github.com/python/cpython/blob/v3.14.3/Lib/venv/__init__.py#L590 The Activate.ps1 file is the one that is identical and hence is copied by shutil.copy2'ed while the other files are created anew and "only" shutil.copymode'ed. I think we could use shuitl.copy + shutil.copymode instead of shutil.copy2 to fix this. Either way, we need to report this upstream. |