lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141006132449.GD7526@quack.suse.cz>
Date:	Mon, 6 Oct 2014 15:24:49 +0200
From:	Jan Kara <jack@...e.cz>
To:	Heinrich Schuchardt <xypron.glpk@....de>
Cc:	Alexander Viro <viro@...iv.linux.org.uk>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Jan Kara <jack@...e.cz>, Eric Paris <eparis@...isplace.org>,
	Michael Kerrisk <mtk.manpages@...il.com>,
	John McCutchan <john@...nmccutchan.com>,
	Robert Love <rlove@...ve.org>
Subject: Re: [PATCH 1/1] ftruncate: create FAN_MODIFY and IN_MODIFY events

On Fri 03-10-14 20:16:30, Heinrich Schuchardt wrote:
> The fanotify and the inotify API can be used to monitor changes of the file
> system.
> 
> System call ftruncate modifies files. Hence it should trigger the corresponding
> fanotify (FAN_MODIFY) and inotify (IN_MODIFY) events.
  Hum, I would think that the appropriate event gets generated by
fsnotify_change() called from notify_change()?

								Honza
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@....de>
> ---
>  fs/open.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/open.c b/fs/open.c
> index d6fd3ac..e36f26e 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -189,6 +189,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
>  		error = security_path_truncate(&f.file->f_path);
>  	if (!error)
>  		error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, f.file);
> +	if (!error) 
> +		fsnotify_modify(f.file);
>  	sb_end_write(inode->i_sb);
>  out_putf:
>  	fdput(f);
> -- 
> 2.1.0
> 
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ