All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6.16-rc5-m3 PATCH] inotify: add the monitor for the event source
@ 2006-03-08 16:33 Yi Yang
  2006-03-08 16:53 ` Arjan van de Ven
  0 siblings, 1 reply; 8+ messages in thread
From: Yi Yang @ 2006-03-08 16:33 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton

Current inotify implementation only focus on change of file system, but it doesn't
 know who results in this change, this patch adds three fields to struct inotify_event,
 tgid, uid and gid, they will save process ID, user ID and user group ID of the process
 which leads to change in the file system, such software as anti-virus can make use 
of this feature to monitor who is modifying a specific file.

Signed-off-by: Yi Yang <yang.y.yi@gmail.com>
--- a/include/linux/inotify.h.orig	2006-03-08 21:40:12.000000000 +0800
+++ b/include/linux/inotify.h	2006-03-08 23:51:54.000000000 +0800
@@ -19,6 +19,9 @@ struct inotify_event {
 	__s32		wd;		/* watch descriptor */
 	__u32		mask;		/* watch mask */
 	__u32		cookie;		/* cookie to synchronize two events */
+	__u32		tgid;		/* process ID of the event source */
+	__u32		uid;		/* user ID of the responding process */
+	__u32		gid;		/* group ID of the responding process */
 	__u32		len;		/* length (including nulls) of name */
 	char		name[0];	/* stub for possible name */
 };
--- a/fs/inotify.c.orig	2006-03-08 20:58:31.000000000 +0800
+++ b/fs/inotify.c	2006-03-09 00:05:47.000000000 +0800
@@ -219,6 +219,9 @@ static struct inotify_kernel_event * ker
 	kevent->event.wd = wd;
 	kevent->event.mask = mask;
 	kevent->event.cookie = cookie;
+	kevent->event.tgid = current->tgid;
+	kevent->event.uid = current->uid;
+	kevent->event.gid = current->gid;
 
 	INIT_LIST_HEAD(&kevent->list);
 



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-10  7:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-08 16:33 [2.6.16-rc5-m3 PATCH] inotify: add the monitor for the event source Yi Yang
2006-03-08 16:53 ` Arjan van de Ven
2006-03-09  5:18   ` Yi Yang
2006-03-09  5:35     ` Arjan van de Ven
2006-03-09  9:55       ` Yi Yang
2006-03-09 19:35         ` Arjan van de Ven
2006-03-10  1:27           ` Yi Yang
2006-03-10  7:39             ` Arjan van de Ven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.