[Samba] Delete files

John H Terpstra jht at samba.org
Tue Oct 22 23:31:02 GMT 2002

On Tue, 22 Oct 2002, Michael Luevane wrote:

> Hello, all.
> What mechanism does samba use to delete a file on a *nix box when deleted
> from a connected Win2k machine?
> In other words, does it run the rm -f command? Some other command?  Who does
> it run as?  Can I intercept the command and insert my own script?

It unlinks the file, but you can use a loadable VFS module to change the
way that low level file system calls get handled.

> I'm interested in creating an undelete shell script that keeps files from
> "accidentally-on-purpose" being erased from the fileserver.

Have you checked the samba source code. Samba-2.2.6 has a recycle bin
facility that might fit your needs.

The samba-team binary and source RPM packages for Caldera OpenLinux, SuSE
Linux, Red Hat Linux and Mandrake Linux all include ready to run loadable
VFS modules for this recycle bin functionality.

If you need more info please ask.

- John T.

John H Terpstra
Email: jht at samba.org

More information about the samba mailing list