<br><div class="gmail_quote">On Wed, Oct 12, 2011 at 12:04 PM, rohan puri <span dir="ltr"><<a href="mailto:rohan.puri15@gmail.com">rohan.puri15@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Oct 12, 2011 at 10:50 AM, V.Ravikumar <span dir="ltr"><<a href="mailto:ravikumar.vallabhu@gmail.com" target="_blank">ravikumar.vallabhu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Other than fanotify , I can achieve my requirement through a driver/module. If this can be achieved through a driver/module please provide me inputs to start.<br><br>Thanks,<br>Ravi<br><br><div class="gmail_quote">On Wed, Sep 21, 2011 at 10:27 AM, rohan puri <span dir="ltr"><<a href="mailto:rohan.puri15@gmail.com" target="_blank">rohan.puri15@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div><div></div><div>On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar <span dir="ltr"><<a href="mailto:ravikumar.vallabhu@gmail.com" target="_blank">ravikumar.vallabhu@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
Hi all,<br><br>Is it possible to write a module/driver which notifies file/directory change asynchronously along with user name(or with uid) who modified it.<br><br>inotify will do change notification but it will not provide uid who modified/created the file.<br>
<br>audit and inotify combination can work, but I'm looking for a better option than this.<br><br>Please help me. <br><br>Thanks,<br>Ravi<br>
<br></div></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div>You can have a look at fanotify.<br><br>Refer <a href="http://lwn.net/Articles/339253/" target="_blank">http://lwn.net/Articles/339253/</a><br><br>Regards,<br><font color="#888888">Rohan Puri<br>
</font></blockquote></div><br></blockquote></div></div><div>Hi Ravi,<br><br>See, first of all if you want to notify file/dir change you need to the control after the invocation of that i_ops or f_ops. So there are two ways in which you can do : -<br>
<br>1. Easy & recommended : -<br><br>Write a stackable file system module. The aim of this module will be to intercept vfs-calls on files/dirs & then call the underlying file systems specific operations. Now after completion of this operation, you would generate the change event here which will be used to notify.<br>
<br><br>Note : - stackable file system research work was done by Professor <b>Erez Zadok. <br><br></b></div></div>refer ecryptfs for an example.<br></blockquote><div> <br> <span style="color: rgb(0, 0, 102);"> This is more helpful for me.</span><br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>2. Complex & not recommended : -<br><br>Instead of writing a stackable file system, you hook the mount sys call to get the control of the fs related structs. Then replace the original i_ops and f_ops pointer with your own defined ops. save the originals somewhere. Then when from user-space when some change operation is called, internally your ops will be called and now you call the original stored one and contruct the notification events<br>
<br></blockquote><div> <br> <span style="color: rgb(0, 0, 102);">Even I've this in my mind. As it is not</span> <span style="color: rgb(0, 0, 102);">recommended,I had dropped this choice</span><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
3. See if the module making use of LSM infrastructure will be able to do this or not.<br><br>Regards,<br><font color="#888888">Rohan Puri<br>
</font></blockquote></div>Hi Rohan<br><br>Thank you for your valuable inputs. I will through the ecryptfs<br><br>Thanks<br>Ravi<br>