[Samba] Absolute path of file transferred using samba

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Dec 23 02:36:47 MST 2009


On Tue, Dec 22, 2009 at 08:36:40PM -0800, HariK wrote:
> My interest is not in the audit module as such. I have a custom application
> running in uclinux that maintains a database for all entries in a directory
> say /mydir. When I add files or folders into the directory mydir using
> samba, I want my database to get updated correspondingly. My idea is to
> establish a message queue between my application and smbd, smbd will post
> messages with the file or folder path in the message.

Does uclinux support inotify? Then that might be the best
API to use.

> Could you please let me know in which file(s) of samba's source can I do the
> changes to hook the message queue creation and message posting stuff. It
> should be in the sources wherein the absolute destination path of the file
> or folder that is copied from windows using samba is visible.

You might want to write a VFS module that hooks into the
open call. That has access to both the absolute share path
(via "handle->conn->connectpath") and the relative file
name. From that you can calculate the absolute share path.
To set up the messaging path to your database daemon, you
want to hook into the VFS connect call.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba/attachments/20091223/b1247623/attachment.pgp>


More information about the samba mailing list