From owner-freebsd-bugs Sat Feb 16 1: 0: 8 2002 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 06F2837B402 for ; Sat, 16 Feb 2002 01:00:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1G901f91281; Sat, 16 Feb 2002 01:00:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E352337B402 for ; Sat, 16 Feb 2002 00:52:18 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1G8qIv90495; Sat, 16 Feb 2002 00:52:18 -0800 (PST) (envelope-from nobody) Message-Id: <200202160852.g1G8qIv90495@freefall.freebsd.org> Date: Sat, 16 Feb 2002 00:52:18 -0800 (PST) From: Shunichiro Ariura To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/34992: fetch can not change timestamp when same name file is exist. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34992 >Category: bin >Synopsis: fetch can not change timestamp when same name file is exist. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 16 01:00:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Shunichiro Ariura >Release: 4.5-STABLE >Organization: >Environment: FreeBSD comet.blackshell.org 4.5-STABLE FreeBSD 4.5-STABLE #0: Thu Feb 14 19:08\ :36 JST 2002 admin@comet.blackshell.org:/opt/sources/src-stable/sys/compile\ /COMET i386 >Description: When downloading finished, fetch changes timestamp of file to original file's timestamp on remote host. But, if same name file is exist, fetch can not change This function is implemented as following: # I said abount src/usr.bin/fetch/fetch.c,v 1.10.2.17 2001/12/18 09:48:09 1) If same name file(original file) is exist, fetch download to templary file.(L475-489) 2) When downloading finished, fetch change timestamp of original file.(L544-554) 3) fetch rename from temporary file to original file. finaly, the file's timestamp is not changed. >How-To-Repeat: comet:ariura{83} date Sat Feb 16 17:43:34 JST 2002 comet:ariura{84} ls -l index.html ls: index.html: No such file or directory comet:ariura{85} fetch -q http://www.freebsd.org/index.html comet:ariura{86} ls -l index.html -rw-r--r-- 1 ariura wheel 24106 Feb 12 22:34 index.html comet:ariura{87} fetch -q http://www.freebsd.org/index.html comet:ariura{88} ls -l index.html -rw------- 1 ariura wheel 24106 Feb 16 17:43 index.html >Fix: When fetch change timestamp, check tmppath variable is NULL. If tmppath is'nt NULL, use tmppath to call utimes. I.E.: 552,553c552,558 < if (utimes(path, tv)) < warn("%s: utimes()", path); --- > if (tmppath != NULL ) { > if (utimes(tmppath, tv)) > warn("%s: utimes()", tmppath); > } else { > if (utimes(path, tv)) > warn("%s: utimes()", path); > } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message