Restricts the file access using LD_PRELOAD
C Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.rst
build_tester
compile
restrict_open.c
test1
test2

README.rst

Restrict

The restrict library restricts the open(), open64() and fopen() calls to only allow opening "allowed" files. Compile with:

./compile

Examples of usage:

LD_PRELOAD=./restrict.so touch test_file
LD_PRELOAD=./restrict.so cat test_file

How it Works

It preloads the open(), open64() and fopen() libc calls using the LD_PRELOAD mechanism. This means that static binaries, as well as accessing files by other means than through open/open64/fopen will not be checked.

License

All code in this package is released under the MIT license.