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?

naugtur
  • 2,263
  • 3
  • 15
  • 10

1 Answers1

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.

roaima
  • 107,089
  • 14
  • 139
  • 261