[issue32347] System Integrity Protection breaks shutil.copystat()

2018-06-12 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32347] System Integrity Protection breaks shutil.copystat()

2017-12-17 Thread Ryan Govostes

Change by Ryan Govostes :


--
keywords: +patch
pull_requests: +4806
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32347] System Integrity Protection breaks shutil.copystat()

2017-12-16 Thread Ryan Govostes

New submission from Ryan Govostes :

On macOS, shutil.copystat() uses chflags() to try to copy filesystem flags from 
the source to destination.

In recent years, Apple introduced System Integrity Protection, which prevents 
modification of system files. These files have the non-standard SF_RESTRICTED 
flag set, which only the superuser can set.

Thus, unprivileged users can no longer use shutil.copy2() et al. to copy system 
files, which is a regression from previous releases of the OS.

It's unclear what the correct behavior should be: It some cases, it would be 
desirable to attempt to copy the bit.

It might be informative to look at the behavior of Apple's `copyfile_stat` 
function, which unsets these two flags:

   /*
* File flags that are not preserved when copying stat information.
*/
   #define COPYFILE_OMIT_FLAGS  (UF_TRACKED | SF_RESTRICTED)

https://opensource.apple.com/source/copyfile/copyfile-146/copyfile.c.auto.html

This was also filed to Apple as rdar://36090921

--
components: macOS
messages: 308479
nosy: Ryan Govostes, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: System Integrity Protection breaks shutil.copystat()
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com