diff options
author | jasoni <jasoni@cvs.openbsd.org> | 2001-05-24 07:13:44 +0000 |
---|---|---|
committer | jasoni <jasoni@cvs.openbsd.org> | 2001-05-24 07:13:44 +0000 |
commit | ef201cb599115f67244e44ab280e450a915901c3 (patch) | |
tree | d5e799f4ba176ba50744dbbbb2da7fe0761b131c /sys | |
parent | d60346bb423a606a6913cec591c32e57b6c9430c (diff) |
- fix pr 1548: Cannot set arbitrary atime/mtime on ext2fs volume
- checked by gluk@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_inode.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index a110763457e..4c15a917c50 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_inode.c,v 1.9 2000/06/23 02:14:39 mickey Exp $ */ +/* $OpenBSD: ext2fs_inode.c,v 1.10 2001/05/24 07:13:43 jasoni Exp $ */ /* $NetBSD: ext2fs_inode.c,v 1.1 1997/06/11 09:33:56 bouyer Exp $ */ /* @@ -137,11 +137,15 @@ ext2fs_update(v) struct buf *bp; struct inode *ip; int error; + struct timespec ts; if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) return (0); ip = VTOI(ap->a_vp); - EXT2FS_ITIMES(ip, &time, &time); + TIMEVAL_TO_TIMESPEC(&time, &ts); + EXT2FS_ITIMES(ip, + ap->a_access ? ap->a_access : &ts, + ap->a_modify ? ap->a_modify : &ts); if ((ip->i_flag & IN_MODIFIED) == 0) return (0); ip->i_flag &= ~IN_MODIFIED; |