LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ext4 - permission to create/modify a file without 'delete' permission (https://www.linuxquestions.org/questions/linux-general-1/ext4-permission-to-create-modify-a-file-without-delete-permission-4175507336/)

BeachHead 06-07-2014 12:59 PM

ext4 - permission to create/modify a file without 'delete' permission
 
Hallo,
i want to catch a temp file with dynamic name created by a program that is available only for some milliseconds. For this i probably need some permissions like this: Create/modify but no delete.

I can do this with NTFS but on ext4 it seems impossible. Chattr +i +u or setting folder to sticky seems useless. Setting folder to read-only probably works only if the file would already exist (allows 'modification' and 'no deletion' but unfortunately no 'creation').

Any suggestions?

unSpawn 06-08-2014 06:31 AM

Quote:

Originally Posted by BeachHead (Post 5184152)
i want to catch a temp file with dynamic name created by a program that is available only for some milliseconds.

If you mean "catch" as in "log" then you could use the audit service or FUSE LoggedFS or inotify(wait)?

BeachHead 06-08-2014 04:01 PM

Quote:

Originally Posted by unSpawn (Post 5184488)
If you mean "catch" as in "log" then you could use the audit service or FUSE LoggedFS or inotify(wait)?

No, that unfortunately doesn't help. Its a binary file and i'm trying to get it before it gets deleted.

rknichols 06-08-2014 07:16 PM

If this is a file that the program creates and immediately deletes while keeping the file open for its own use, you can still access the file via the /proc/{PID}/fd/{FD#} link.

BeachHead 06-08-2014 07:34 PM

That works indeed. :D
What a valuable tip.. Thank you! :)


All times are GMT -5. The time now is 08:57 AM.