Alter system calls with LD_PRELOAD
Published at October 17, 2021 · 4 min read
Use LD_PRELOAD to alter library calls I have a program that is failing because it is making a system call to change permissins on a file with chmod, fchmodat, and fchmod -S 2. The program does not own the file, and doesn’t need to change the permission but fails with -1 EPERM on this call. This was determined with strace -f -e chmod,fchmod,fchmodat $program Example program This program simulates the behaviour of the application with the issue....