Skip to content

Commit

Permalink
sys_execve and sys_uselib do not call into fsnotify
Browse files Browse the repository at this point in the history
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@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Eric Paris authored and Al Viro committed Jan 5, 2009
1 parent 56ff5ef commit 6110e3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -132,6 +133,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;
Expand Down Expand Up @@ -684,6 +687,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);
Expand Down

0 comments on commit 6110e3a

Please sign in to comment.