How can I automatically force file permissions?

5 réponses [Dernière contribution]
anonymous

I have a folder which I share via Samba. I want any file in that folder, regardless of its origin, to automatically be forced to provide full permissions to everyone.

Currently I need to constantly change the permissions with "sudo chmod -R 777 Public".

How can full permissions be automatically be forced upon any file which enters that folder?

lembas
Hors ligne
A rejoint: 05/13/2010

I guess one way would be using incron.

I wonder if a setup like that causes some security considerations.

DonaldET3 (non vérifié)

I think that is a good idea. I am not that worried about security. I tried the following command...

incrontab -e /home/det3/Public IN_ATTRIB IN_CREATE IN_MODIFY IN_MOVED_TO chmod -R 777 /home/det3/Public

...and got an error: invalid arguments - operation and source file cannot be combined

What am I not understanding?

lembas
Hors ligne
A rejoint: 05/13/2010

Try adding IN_NO_LOOP to the flags.

DonaldET3 (non vérifié)

I don't know; I'm still getting the "invalid arguments - operation and source file cannot be combined" error. I'll keep hacking on it.

lembas
Hors ligne
A rejoint: 05/13/2010

Perhaps try appending /* to the command,