[PATCH] sys_execve and sys_uselib do not call into fsnotify

From: Eric Paris
Date: Wed Dec 17 2008 - 13:54:16 EST


sys_execve and sys_uselib do not call into fsnotify so inotify does not get
open events for these types of syscalls. This patch simply makes the
requisite fsnotify calls.

Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---

fs/exec.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/fs/exec.c b/fs/exec.c
index ec5df9a..cbd93b5 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -51,6 +51,7 @@
#include <linux/audit.h>
#include <linux/tracehook.h>
#include <linux/kmod.h>
+#include <linux/fsnotify.h>

#include <asm/uaccess.h>
#include <asm/mmu_context.h>
@@ -135,6 +136,8 @@ asmlinkage long sys_uselib(const char __user * library)
if (IS_ERR(file))
goto out;

+ fsnotify_open(file->f_path.dentry);
+
error = -ENOEXEC;
if(file->f_op) {
struct linux_binfmt * fmt;
@@ -687,6 +690,8 @@ struct file *open_exec(const char *name)
if (IS_ERR(file))
return file;

+ fsnotify_open(file->f_path.dentry);
+
err = deny_write_access(file);
if (err) {
fput(file);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/