I don't know if this is even possible so I need to ask. I'd like to allow a single file to be created by a user (a flag-file) but only that file should be able to be created.
As I have the parent directory read-only for that user, it's currently not possible for the user to create (via touch <filename>
) the file.
And as the file yet does not exists, I can not grant write rights with chmod (e.g. chmod u+w <filename>
).
Is there a way to set permissions of currently non-existent files to come into action when the file is being created?
I've looked into ACLs for the first time and played with setfacl
but it seems it can't pre-create entries for non-existent files.
Background: I'm doing this scenario for testing purposes. In the essence I want to prevent modification of files so most of them are read-only. But from time to time a certain file is to be created and I want to allow it for specific filenames / paths only.
I'm doing this on a Ubuntu 14.04 Linux box.