My attempt is to override calls to unlink/unlinkat when using Samba. To that effect I wrote a shared library. I then executed the line:
export LD_PRELOAD=<my shared library>
and restarted smbd service. Now if I delete a file from the current directory I can see that my version of unlink is being called but when I do the same via Samba from a different Ubuntu box my overrides aren't being called. I think it's got to do with the placement of LD_PRELOAD. I placed it in /etc/samba/smb.conf and /etc/init/smbd.conf but that didn't work and the only file left is /etc/init.d/smbd. However I don't know where to place the LD_PRELOAD. I did place the LD_PRELOAD in a few places but that didn't work either. I'm hoping that someone cuold help me out. Thanks in advance for any help.
Platform: Ubuntu 14.04