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-next>] [day] [month] [year] [list]
Message-Id: <1427232308-22550-1-git-send-email-tsgatesv@gmail.com>
Date:	Tue, 24 Mar 2015 17:25:08 -0400
From:	Taesoo Kim <tsgatesv@...il.com>
To:	mikulas@...ax.karlin.mff.cuni.cz, linux-kernel@...r.kernel.org
Cc:	taesoo@...ech.edu, changwoo@...ech.edu, sanidhya@...ech.edu,
	blee@...ech.edu, csong84@...ech.edu,
	Taesoo Kim <tsgatesv@...il.com>
Subject: [PATCH 1/1] hpfs: update ctime/mtime of old/new_dir

Upon successful rename(), update ctime and mtime of
old/new_dir, as posix specifies.

Signed-off-by: Taesoo Kim <tsgatesv@...il.com>
---
 fs/hpfs/namei.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index bdbc2c3..8d8669c 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -600,6 +600,12 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	if (S_ISDIR(i->i_mode)) {
 		inc_nlink(new_dir);
 		drop_nlink(old_dir);
+
+		old_dir->i_ctime.tv_sec = old_dir->i_mtime.tv_sec = local_to_gmt(old_dir->i_sb, get_seconds());
+		old_dir->i_ctime.tv_nsec = old_dir->i_mtime.tv_nsec = 0;
+
+		new_dir->i_ctime.tv_sec = new_dir->i_mtime.tv_sec = local_to_gmt(new_dir->i_sb, get_seconds());
+		new_dir->i_ctime.tv_nsec = new_dir->i_mtime.tv_nsec = 0;
 	}
 	if ((fnode = hpfs_map_fnode(i->i_sb, i->i_ino, &bh))) {
 		fnode->up = cpu_to_le32(new_dir->i_ino);
-- 
2.3.3

--
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