Re: File change notification along with user

2011-10-12 Thread rohan puri
On Wed, Oct 12, 2011 at 12:17 PM, V.Ravikumar
wrote:

>
> On Wed, Oct 12, 2011 at 12:04 PM, rohan puri wrote:
>
>>
>>
>> On Wed, Oct 12, 2011 at 10:50 AM, V.Ravikumar <
>> ravikumar.valla...@gmail.com> wrote:
>>
>>> 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.
>>>
>>> Thanks,
>>> Ravi
>>>
>>> On Wed, Sep 21, 2011 at 10:27 AM, rohan puri wrote:
>>>


 On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar <
 ravikumar.valla...@gmail.com> wrote:

> Hi all,
>
> Is it possible to write a module/driver which notifies file/directory
> change asynchronously along with user name(or with uid) who modified it.
>
> inotify will do change notification but it will not provide uid who
> modified/created the file.
>
> audit and inotify combination can work, but I'm looking for a better
> option than this.
>
> Please help me.
>
> Thanks,
> Ravi
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> You can have a look at fanotify.

 Refer http://lwn.net/Articles/339253/

 Regards,
 Rohan Puri

>>>
>>> Hi Ravi,
>>
>> 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 : -
>>
>> 1. Easy & recommended : -
>>
>> 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.
>>
>>
>> Note : - stackable file system research work was done by Professor *Erez
>> Zadok.
>>
>> *
>> refer ecryptfs for an example.
>>
>
> This is more helpful for me.
>
>>
>> 2. Complex & not recommended : -
>>
>> 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
>>
>>
>  Even I've this in my mind. As it is not  recommended,I had dropped this
> choice
>
> 3. See if the module making use of LSM infrastructure will be able to do
>> this or not.
>>
>> Regards,
>> Rohan Puri
>>
> Hi Rohan
>
> Thank you for your valuable inputs. I will through the ecryptfs
>
> Thanks
> Ravi
>

Hi Ravi,

Good :). One more thing about that first approach, that stackable file
system has to be mounted on the top-level directory, for which (sub-dirs and
files) you need the notifications. This acts as the stacking trigger point.

Was just keen to know, where are you requiring it?

Regards,
Rohan Puri
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: File change notification along with user

2011-10-11 Thread V.Ravikumar
On Wed, Oct 12, 2011 at 12:04 PM, rohan puri  wrote:

>
>
> On Wed, Oct 12, 2011 at 10:50 AM, V.Ravikumar <
> ravikumar.valla...@gmail.com> wrote:
>
>> 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.
>>
>> Thanks,
>> Ravi
>>
>> On Wed, Sep 21, 2011 at 10:27 AM, rohan puri wrote:
>>
>>>
>>>
>>> On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar <
>>> ravikumar.valla...@gmail.com> wrote:
>>>
 Hi all,

 Is it possible to write a module/driver which notifies file/directory
 change asynchronously along with user name(or with uid) who modified it.

 inotify will do change notification but it will not provide uid who
 modified/created the file.

 audit and inotify combination can work, but I'm looking for a better
 option than this.

 Please help me.

 Thanks,
 Ravi

 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

 You can have a look at fanotify.
>>>
>>> Refer http://lwn.net/Articles/339253/
>>>
>>> Regards,
>>> Rohan Puri
>>>
>>
>> Hi Ravi,
>
> 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 : -
>
> 1. Easy & recommended : -
>
> 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.
>
>
> Note : - stackable file system research work was done by Professor *Erez
> Zadok.
>
> *
> refer ecryptfs for an example.
>

This is more helpful for me.

>
> 2. Complex & not recommended : -
>
> 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
>
>
 Even I've this in my mind. As it is not  recommended,I had dropped this
choice

3. See if the module making use of LSM infrastructure will be able to do
> this or not.
>
> Regards,
> Rohan Puri
>
Hi Rohan

Thank you for your valuable inputs. I will through the ecryptfs

Thanks
Ravi
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: File change notification along with user

2011-10-11 Thread rohan puri
On Wed, Oct 12, 2011 at 10:50 AM, V.Ravikumar
wrote:

> 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.
>
> Thanks,
> Ravi
>
> On Wed, Sep 21, 2011 at 10:27 AM, rohan puri wrote:
>
>>
>>
>> On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar <
>> ravikumar.valla...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Is it possible to write a module/driver which notifies file/directory
>>> change asynchronously along with user name(or with uid) who modified it.
>>>
>>> inotify will do change notification but it will not provide uid who
>>> modified/created the file.
>>>
>>> audit and inotify combination can work, but I'm looking for a better
>>> option than this.
>>>
>>> Please help me.
>>>
>>> Thanks,
>>> Ravi
>>>
>>> ___
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.org
>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>
>>> You can have a look at fanotify.
>>
>> Refer http://lwn.net/Articles/339253/
>>
>> Regards,
>> Rohan Puri
>>
>
> Hi Ravi,

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 : -

1. Easy & recommended : -

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.


Note : - stackable file system research work was done by Professor *Erez
Zadok.

*
refer ecryptfs for an example.

2. Complex & not recommended : -

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

3. See if the module making use of LSM infrastructure will be able to do
this or not.

Regards,
Rohan Puri
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: File change notification along with user

2011-10-11 Thread V.Ravikumar
On Wed, Oct 12, 2011 at 11:30 AM, Abhijit Pawar wrote:

>  On 10/12/2011 10:50 AM, V.Ravikumar wrote:
>
> 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.
>
> Thanks,
> Ravi
>
> On Wed, Sep 21, 2011 at 10:27 AM, rohan puri wrote:
>
>>
>>
>>  On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar <
>> ravikumar.valla...@gmail.com> wrote:
>>
>>>  Hi all,
>>>
>>> Is it possible to write a module/driver which notifies file/directory
>>> change asynchronously along with user name(or with uid) who modified it.
>>>
>>> inotify will do change notification but it will not provide uid who
>>> modified/created the file.
>>>
>>> audit and inotify combination can work, but I'm looking for a better
>>> option than this.
>>>
>>> Please help me.
>>>
>>> Thanks,
>>> Ravi
>>>
>>>  ___
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.org
>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>
>>>  You can have a look at fanotify.
>>
>> Refer http://lwn.net/Articles/339253/
>>
>> Regards,
>> Rohan Puri
>>
>
>
>
> ___
> Kernelnewbies mailing 
> listKernelnewbies@kernelnewbies.orghttp://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>  Hi Ravi,
> As mentioned in the article, you can start looking at fsnotify code in the
> kernel. What we need is like something inserted between the VFS Layer and
> the filesystem driver which will tell you what is going on.
>
> Regards,
> Abhijit Pawar
>

Thank you Abhijit for your response.

Previously I had gone through the inotify code (ie fsnotify). What I've
observed is, there are inotify patches *(with fsnotify_ prefix )* in every
file I/O system calls implementation. So what I understood is we can not
achieve file change notification without patching the existing kernel source
code. ie I can not achieve this using a simple device driver kind of
mechanism.

Please correct me if I'm wrong.

Regards,
Ravi
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: File change notification along with user

2011-10-11 Thread Abhijit Pawar

On 10/12/2011 10:50 AM, V.Ravikumar wrote:
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.


Thanks,
Ravi

On Wed, Sep 21, 2011 at 10:27 AM, rohan puri > wrote:




On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar
mailto:ravikumar.valla...@gmail.com>> wrote:

Hi all,

Is it possible to write a module/driver which notifies
file/directory change asynchronously along with user name(or
with uid) who modified it.

inotify will do change notification but it will not provide
uid who modified/created the file.

audit and inotify combination can work, but I'm looking for a
better option than this.

Please help me.

Thanks,
Ravi

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org

http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

You can have a look at fanotify.

Refer http://lwn.net/Articles/339253/

Regards,
Rohan Puri




___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Hi Ravi,
As mentioned in the article, you can start looking at fsnotify code in 
the kernel. What we need is like something inserted between the VFS 
Layer and the filesystem driver which will tell you what is going on.


Regards,
Abhijit Pawar
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: File change notification along with user

2011-10-11 Thread V.Ravikumar
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.

Thanks,
Ravi

On Wed, Sep 21, 2011 at 10:27 AM, rohan puri  wrote:

>
>
> On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar <
> ravikumar.valla...@gmail.com> wrote:
>
>> Hi all,
>>
>> Is it possible to write a module/driver which notifies file/directory
>> change asynchronously along with user name(or with uid) who modified it.
>>
>> inotify will do change notification but it will not provide uid who
>> modified/created the file.
>>
>> audit and inotify combination can work, but I'm looking for a better
>> option than this.
>>
>> Please help me.
>>
>> Thanks,
>> Ravi
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>> You can have a look at fanotify.
>
> Refer http://lwn.net/Articles/339253/
>
> Regards,
> Rohan Puri
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: File change notification along with user

2011-09-20 Thread rohan puri
On Wed, Sep 21, 2011 at 10:03 AM, V.Ravikumar
wrote:

> Hi all,
>
> Is it possible to write a module/driver which notifies file/directory
> change asynchronously along with user name(or with uid) who modified it.
>
> inotify will do change notification but it will not provide uid who
> modified/created the file.
>
> audit and inotify combination can work, but I'm looking for a better option
> than this.
>
> Please help me.
>
> Thanks,
> Ravi
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> You can have a look at fanotify.

Refer http://lwn.net/Articles/339253/

Regards,
Rohan Puri
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies