0

I was considering adding some custom security behaviour to the posix APIs of a distro of linux I'm working on.

For example, prompting the user to authenticate if a program asks to fopen() a directory it has write access to, but should not normally access.

Is there an easy way to hook custome behaviour in to a posix call before making the native linux call, or do I just have to branch my own source, and drop a function into the actual library before, performing the standard behaviour?

awiebe
  • 3,758
  • 4
  • 22
  • 33

1 Answers1

0

You can use LD_PRELOAD to load up your own library before the other system libraries. Through this you can write some sort of wrapper fopen() etc. See this link for more info.

Community
  • 1
  • 1
froztbyte
  • 1
  • 1