Configuration management tools with far more code than this are regularly run with root privileges.<div><br></div><div>OTOH, Salt and Ansible, for example, both support recursive chown and chmod; and report what actually changed. Yum/dnf probably do, too.</div><div><br></div><div>Supporting recursive chmod/chown OOB may be useful. That it might be run as root is not the criteria, AFAIU.</div><div><br>On Tuesday, May 29, 2018, Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, May 30, 2018 at 9:11 AM, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br>
> BTW, I wouldn't argue that Python shouldn't provide things<br>
> that are only useful to root. While writing setuid utilities<br>
> in Python is a bad idea for lots of reasons, I don't think<br>
> there's anything wrong with becoming root by another means<br>
> and then running a Python program that you know well enough<br>
> to trust.<br>
<br>
I'd go further. Once a shell script gets longer than about a page or<br>
two of code, it often needs to be rewritten in a different language,<br>
and Python is well situated to be that language. That doesn't change<br>
when the script is to be run as root. I've written many Python scripts<br>
to do sysadminning jobs for me - usually one-shot scripts, but also<br>
some that stick around. Since I wrote the scripts myself, the trust<br>
issue doesn't come up; I trust the Python interpreter the same way<br>
that I trust /bin/bash.<br>
<br>
ChrisA<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</blockquote></div>