[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

Ronald Oussoren report at bugs.python.org
Thu Aug 16 11:34:25 EDT 2018


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

I don't understand this clarification:

> Clarification: while Mac/OS falls under "posix" in python terms - maybe
> "breakage" will need to be accepted,
> or, for "back-ports" Mac/OS will be "as if root or super-user" and use
> an additional (optional) argument in 3.8 and beyond
> to keep backwards compatibility.

AFAIK macOS should behave just like other posix-y platforms here.  In particular, I've verified that cp(1) behaves the same as on other platforms: the SUID bit is stripped when copying a setuid file.

Do you have a reason to assume that macOS is special here?


P.S. macOS is spelled macOS, not Mac/OS

----------
nosy: +ronaldoussoren

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17180>
_______________________________________


More information about the Python-bugs-list mailing list