From owner-freebsd-bugs Tue Mar 13 10:10: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8ECE137B71D for ; Tue, 13 Mar 2001 10:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2DIA1Q51181; Tue, 13 Mar 2001 10:10:01 -0800 (PST) (envelope-from gnats) Received: from hermes.mail.nl.demon.net (hermes.mail.nl.demon.net [194.159.72.197]) by hub.freebsd.org (Postfix) with ESMTP id D89C537B71A for ; Tue, 13 Mar 2001 10:02:49 -0800 (PST) (envelope-from pdp@nl.demon.net) Received: from samhain.noc.nl.demon.net ([194.159.72.214]) by hermes.mail.nl.demon.net with esmtp (Exim 3.22 #1) id 14ct8C-000JX7-00 for FreeBSD-gnats-submit@freebsd.org; Tue, 13 Mar 2001 19:02:48 +0100 Received: by samhain.noc.nl.demon.net with local id 14ct8C-0000B5-00 for FreeBSD-gnats-submit@freebsd.org; Tue, 13 Mar 2001 18:02:48 +0000 Message-Id: Date: Tue, 13 Mar 2001 18:02:48 +0000 From: Phil Pennock Reply-To: pdp@nl.demon.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/25777: atime not updated on exec Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25777 >Category: kern >Synopsis: atime not updated on exec >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 13 10:10:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Phil Pennock >Release: FreeBSD 3.5-STABLE i386 >Organization: Demon Internet Netherlands >Environment: FreeBSD kernel. Have checked CVSWeb, not seen sign of a fix. Verified presence of bug on FreeBSD 4.2-STABLE. >Description: The atime attribute of a file should be updated on execve(). It's not. >How-To-Repeat: $ cp /usr/bin/true . ; touch -t 199901011234 true $ ls -lu true ; ./true ; ls -lu true >Fix: This patch applies to my 3.5-STABLE system. --- kern/kern_exec.c.old Tue Mar 13 18:20:01 2001 +++ kern/kern_exec.c Tue Mar 13 18:47:51 2001 @@ -64,6 +64,10 @@ #include +#include +#include +#include + static long *exec_copyout_strings __P((struct image_params *)); static long ps_strings = PS_STRINGS; @@ -165,6 +169,15 @@ VOP_UNLOCK(imgp->vp, 0, p); if (error) goto exec_fail_dealloc; + + /* + * At this point, it counts as an access, whether it succeeds or + * fails. Ensure that atime gets updated if needed + */ + if ((imgp->vp->v_mount->mnt_flag & MNT_NOATIME) == 0) { + VTOI(imgp->vp)->i_flag |= IN_ACCESS; + ufs_itimes(imgp->vp); + } /* * Loop through list of image activators, calling each one. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message