Not sure if this would work on the NSLU2 but it should in theory work on a regular Linux system without patching samba (its still not exactly a trivial solution) :
Make the samba port run off a port proxy running from a netcat / named pipe. i.e. make netcat listen on the samba port and write to a named pipe. Read off the named pipe and send data to samba. Also tee the data going into the pipe into another /tmp file. You can find some info on how to set this up on the netcat wikipedia : http://en.wikipedia.org/wiki/Netcat
Once this is done, you need to read off the redirected tmp file (perl is good at reading packed binary data) with your script and try to spot operations that would lead to open requests for files and when it does, call your script!
This works without binary modifications but would require you to read up a little bit on the samba protocol itself (cant help you there because I dont know much about it either).
cheers,
Harsh
Make the samba port run off a port proxy running from a netcat / named pipe. i.e. make netcat listen on the samba port and write to a named pipe. Read off the named pipe and send data to samba. Also tee the data going into the pipe into another /tmp file. You can find some info on how to set this up on the netcat wikipedia : http://en.wikipedia
Once this is done, you need to read off the redirected tmp file (perl is good at reading packed binary data) with your script and try to spot operations that would lead to open requests for files and when it does, call your script!
This works without binary modifications but would require you to read up a little bit on the samba protocol itself (cant help you there because I dont know much about it either).
cheers,
Harsh
From: Mike Westerhof (mwester) <mwester@dls.
To: nslu2-linux@
Sent: Tue, 19 January, 2010 2:21:50 AM
Subject: Re: [nslu2-linux] Hooking SAMBA access to script?
Mai Kee Reis wrote:
> Hello friends of tiny linux boxes,
>
> I wonder if anybody could give me an advice how to hook some script to
> each fopen(), when initiated by a remote client.
> Currently, I'm running Samba 3.2.8 on a NSLU2 rev.2
> (uname -a: Linux Nslu2.home 2.6.27.8 #1 Sat Mar 7 06:32:59 UTC 2009
> armv5tel unknown unknown GNU/Linux)
>
> The idea is to catch all access to *.mp3 and *.ogg files from user
> 'audioplayer' to create some last played / most played / least played
> playlist files.
> Thus, it's not required to have it in real time.
>
> Of course I asked google (just found a lot "if-down.d hook samba") and
> my local smb.conf (/var/log/samba/
>
> Any hint? Impossible without patching samba?
>
Yes, impossible without patching samba.
-Mike (mwester)
------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.
(Yahoo! ID required)
<*> To change settings via email:
nslu2-linux-
nslu2-linux-
<*> To unsubscribe from this group, send an email to:
nslu2-linux-
<*> Your use of Yahoo! Groups is subject to:
http://docs.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
__._,_.___
.
__,_._,___
No comments:
Post a Comment