On Mon, May 28, 2018 at 10:13:47PM +0100, Barry wrote:
> 
> > On 28 May 2018, at 21:23, Giampaolo Rodola' <g.rod...@gmail.com> wrote:
[...]
> > It appears like a common enough use case to me ("chown -R path"). 
> > Thoughts?
> 
> I wonder if it is very common.
> Don’t you have to be root or use sudo chown?
> In which case it is only python code running as root that could use this.

Certainly not. You only have to be root to change permissions on files 
that you otherwise wouldn't be able to change permissions on. chmod -R 
works fine for regular users changing their own files. Why wouldn't it?


[steve@ando ~]$ ls -lR test
test:
total 12
-rw-rw-r-- 1 steve steve    5 Feb  4  2017 eggs.py
drwxrwxr-x 2 steve steve 4096 May 29 09:41 package
-rw-rw-r-- 1 steve steve   40 Feb  4  2017 spam.py

test/package:
total 0
-rw-rw-r-- 1 steve steve 0 May 29 09:41 __init__.py
-rw-rw-r-- 1 steve steve 0 May 29 09:41 spam.py

[steve@ando ~]$ chmod -R a-w test
[steve@ando ~]$ ls -lR test
test:
total 12
-r--r--r-- 1 steve steve    5 Feb  4  2017 eggs.py
dr-xr-xr-x 2 steve steve 4096 May 29 09:41 package
-r--r--r-- 1 steve steve   40 Feb  4  2017 spam.py

test/package:
total 0
-r--r--r-- 1 steve steve 0 May 29 09:41 __init__.py
-r--r--r-- 1 steve steve 0 May 29 09:41 spam.py



-- 
Steve
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to