This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: shutil._copyxattr() function shouldn't fail if setting security.selinux xattr fails
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: broken container/selinux integration
View: 38893
Assigned To: Nosy List: bigon, christian.heimes, tarek
Priority: normal Keywords:

Created on 2016-02-10 13:03 by bigon, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg260009 - (view) Author: Laurent Bigonville (bigon) Date: 2016-02-10 13:03
Hi,

In the _copyxattr() function from the shutil module, the function throw an exception as soon as the copy of an attribute is failing.

But setting the "security.selinux" xattr will likely fail if selinux is enforcing more.

If this function is supposed to behave like cp -a, failing to set the security.selinux xattr shouldn't be fatal


See: https://bugs.python.org/issue14082 and https://bugs.python.org/msg157903
msg260013 - (view) Author: Laurent Bigonville (bigon) Date: 2016-02-10 14:37
SELinux would block setting the "security.selinux" attribute with EACCES not EPERM, so another solution could be to add errono.EACCES to the list
msg373452 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-07-10 08:35
I'm marking this as duplicate of #38893. The other bug has more information.
History
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70516
2020-07-10 08:35:35christian.heimessetstatus: open -> closed

superseder: broken container/selinux integration

nosy: + christian.heimes
messages: + msg373452
resolution: duplicate
stage: resolved
2016-02-11 10:02:46ezio.melottisetnosy: + tarek
2016-02-10 14:37:39bigonsetmessages: + msg260013
2016-02-10 13:03:44bigoncreate