From: Yi Yang <yang.y.yi@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [2.6.16-rc5-m3 PATCH] inotify: add the monitor for the event source
Date: Thu, 09 Mar 2006 00:33:35 +0800 [thread overview]
Message-ID: <440F075F.1030404@gmail.com> (raw)
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);
next reply other threads:[~2006-03-08 16:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-08 16:33 Yi Yang [this message]
2006-03-08 16:53 ` [2.6.16-rc5-m3 PATCH] inotify: add the monitor for the event source 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=440F075F.1030404@gmail.com \
--to=yang.y.yi@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.