[Python-ideas] Add shutil.chown(..., recursive=False)

Chris Angelico rosuav at gmail.com
Tue May 29 19:44:09 EDT 2018

On Wed, May 30, 2018 at 9:11 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> BTW, I wouldn't argue that Python shouldn't provide things
> that are only useful to root. While writing setuid utilities
> in Python is a bad idea for lots of reasons, I don't think
> there's anything wrong with becoming root by another means
> and then running a Python program that you know well enough
> to trust.

I'd go further. Once a shell script gets longer than about a page or
two of code, it often needs to be rewritten in a different language,
and Python is well situated to be that language. That doesn't change
when the script is to be run as root. I've written many Python scripts
to do sysadminning jobs for me - usually one-shot scripts, but also
some that stick around. Since I wrote the scripts myself, the trust
issue doesn't come up; I trust the Python interpreter the same way
that I trust /bin/bash.


More information about the Python-ideas mailing list