From owner-freebsd-audit Mon Mar 18 13: 9:21 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id BDC8A37B4BC; Mon, 18 Mar 2002 13:08:08 -0800 (PST) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id g2IL81C8158380; Mon, 18 Mar 2002 16:08:02 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20020318130904.A3869@schweikhardt.net> References: <20020318130904.A3869@schweikhardt.net> Date: Mon, 18 Mar 2002 16:08:04 -0500 To: Jens Schweikhardt , freebsd-audit@FreeBSD.ORG From: Garance A Drosihn Subject: Re: crontab changes for PR bin/22612; please comment Cc: joerg@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 1:09 PM +0100 3/18/02, Jens Schweikhardt wrote: >hello, world\n > >please comment on this patch (slightly different from the >one in the PR >http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/22612) > >Currently, checking for modification of the tmp file just >looks at the mtime and gives a false "no modification" if >the edit took less than 1 second. This is solved by simply >comparing the whole struct stat. I don't think you should blindly compare the entire struct. You don't know what fields are in there, so you don't know if some field has changed even though the contents of the file has not changed. If you do try this, you should at least zero out the entire struct-stat before each call to stat(), just in case there are unused fields in the record. Just MO. Stupid brain-dead alternative fix: Create the file. stat the file. sleep a second. *Then* open the file in the user's editor. Any change that they make will have to have been done more than a second later. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message