Search code examples
clinuxsystem-callslibrary-interposition

Problem replacing Linux system calls using LD_PRELOAD


I am trying to write a program that allows a binary to be run, substituting a certain file when requested with another. It is a library with simple replacements for the system call functions, that is used with LD_PRELOAD. The problem is that it catches opens for reading (the substitute file is read instead), but writes always go back to the actual, specified file. Are there any other "open" system calls I should know about?


Solution

  • Nevermind -- stupid mistake.

    Wasn't checking both absolute and relative paths...