# experiment with sticky bit on programs I was wondering if a sticky bit on a program would prevent LD_PRELOAD from working. Similar to how an suid or sgid bit prevents it from working. ``` epoch@batou$ cat test.c #include int main(int argc,char *argv[]) { puts("ohai"); return 0; } epoch@batou$ gcc -o test test.c epoch@batou$ cat lib.c int puts(char *s) { return printf("lol hacked: %s\n",s); } epoch@batou$ gcc -fPIC -shared -o lib.so lib.c [warnings] epoch@batou$ chmod o+t test-sticky epoch@batou$ ./test ohai epoch@batou$ ./test-sticky ohai epoch@batou$ LD_PRELOAD=$(pwd)/lib.so ./test lol hacked: ohai epoch@batou$ LD_PRELOAD=$(pwd)/lib.so ./test-sticky lol hacked: ohai ``` A sticky bit on a program doesn't prevent LD_PRELOAD from working. Oh well. Guess a static binary would work for LD_PRELOAD-safe program.