classification
Title: shutil.copystat fails when attribute security.selinux is present
Type: behavior Stage: resolved
Components: IO Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: broken container/selinux integration
View: 38893
Assigned To: Nosy List: christian.heimes, hynek, ned.deily, sstirlin
Priority: normal Keywords:

Created on 2015-05-11 02:25 by sstirlin, last changed 2020-07-10 07:38 by christian.heimes. This issue is now closed.

Messages (3)
msg242881 - (view) Author: Spencer Stirling (sstirlin) Date: 2015-05-11 02:25
Using shutil.copytree to copy a directory tree.  The source dir lives on a Windows 7 host, however is being accessed from inside a VirtualBox VM as a "shared folder" (using vagrant to manage this whole thing).

The destination directory is just a regular linux directory inside the VM.  The guest OS is CentOS 5.

shutil.copystat dies on this copy.  I have tracked the problem down to line 154 in shutil.py:

os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)

The issue is that the src directory apparently defines the attribute security.selinux, however setxattr doesn't see this attribute in the destination and throws an exception.
msg242922 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2015-05-11 21:51
Possibly related: Issue15238 (msg165591 re root)
msg373446 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-07-10 07:38
I'm marking this as duplicate of #38893 because the newer bug contains more information.
History
Date User Action Args
2020-07-10 07:38:58christian.heimessetstatus: open -> closed

superseder: broken container/selinux integration

nosy: + christian.heimes
messages: + msg373446
resolution: duplicate
stage: resolved
2015-05-11 21:51:58ned.deilysetnosy: + hynek, ned.deily
messages: + msg242922
2015-05-11 03:01:29rhettingersettitle: shutil.copystat pukes when attribute security.selinux is present -> shutil.copystat fails when attribute security.selinux is present
2015-05-11 02:25:42sstirlincreate