0

I've got a file that contains information I need to let some apps read sometimes, but would generally prefer it's not accessed without me knowing about it.

How can I get the file descriptor open operation to prompt me for confirmation before it succeeds?

I could write my own file system emulator and mount it probably, but that sounds like too much.

Are there existing tools for that?

1
  • "I could write my own file system emulator and mount it probably" - a FUSE plug-in might work there too. Jul 12, 2021 at 19:55

1 Answer 1

2

You could monitor access but not deny it with something like inotifywait.

You could deliver the file contents to stdout by means of a small sudo-controlled script that mediated access to the restricted file.

I know of nothing that will do precisely what you want, but the beauty here is that you can build something similar to your required tool with existing utilities.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .