From nobody@FreeBSD.org  Fri Jun  8 10:35:52 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id A89DA37B405
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  8 Jun 2001 10:35:52 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.3/8.11.3) id f58HZqn16177;
	Fri, 8 Jun 2001 10:35:52 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200106081735.f58HZqn16177@freefall.freebsd.org>
Date: Fri, 8 Jun 2001 10:35:52 -0700 (PDT)
From: christophe.deroulers@ens.fr
To: freebsd-gnats-submit@FreeBSD.org
Subject: cp -pR does not preserve modification times of the directories if they are not empty
X-Send-Pr-Version: www-1.0

>Number:         27970
>Category:       bin
>Synopsis:       cp -pR does not preserve modification times of the directories if they are not empty
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 08 10:40:01 PDT 2001
>Closed-Date:    Sat Dec 15 06:15:13 PST 2001
>Last-Modified:  Sat Dec 15 06:19:57 PST 2001
>Originator:     Christophe Deroulers
>Release:        FreeBSD 4.2-RELEASE
>Organization:
Ecole normale superieure
>Environment:
FreeBSD pc-aa3.ens.fr 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386

>Description:
 If a directory is not empty, cp -pR will correctly set the modification time of the directory after copy but will overwrite it with the current time when it will add the files inside the directory.

 A similar problem occured with OpenBSD cp's and it was fixed some days ago, so it probably comes from the base code taken from BSD.

 NB This is maybe the same problem as bin/16155.

>How-To-Repeat:
 mkdir a
 touch a/b
 touch -m -t 01010000 a
# a has now time January, 1st at 00:00
 cp -pR a b
# b should have time January, 1st but has not.

>Fix:
 Look at OpenBSD cp bug fix ?

>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: christophe.deroulers@ens.fr
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/27970: cp -pR does not preserve modification times of the directories if they are not empty
Date: Fri, 8 Jun 2001 20:55:13 +0300

 On Fri, Jun 08, 2001 at 10:35:52AM -0700, christophe.deroulers@ens.fr wrote:
 > 
 > >Number:         27970
 > >Category:       bin
 > >Synopsis:       cp -pR does not preserve modification times of the directories if they are not empty
 > >Originator:     Christophe Deroulers
 > >Release:        FreeBSD 4.2-RELEASE
 > >Organization:
 > Ecole normale superieure
 > >Environment:
 > FreeBSD pc-aa3.ens.fr 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386
 > 
 > >Description:
 >  If a directory is not empty, cp -pR will correctly set the modification time of the directory after copy but will overwrite it with the current time when it will add the files inside the directory.
 > 
 >  A similar problem occured with OpenBSD cp's and it was fixed some days ago, so it probably comes from the base code taken from BSD.
 > 
 >  NB This is maybe the same problem as bin/16155.
 > 
 > >How-To-Repeat:
 >  mkdir a
 >  touch a/b
 >  touch -m -t 01010000 a
 > # a has now time January, 1st at 00:00
 >  cp -pR a b
 > # b should have time January, 1st but has not.
 > 
 > >Fix:
 >  Look at OpenBSD cp bug fix ?
 
 Even before looking at this in detail, I feel like it might be very
 similar to the one in PR bin/20646..  And apparently the patch in
 bin/20646 does not quite fix it - I can reproduce this here, although
 I'm running with that patch.
 
 G'luck,
 Peter
 
 -- 
 I am not the subject of this sentence.
State-Changed-From-To: open->closed 
State-Changed-By: mckay 
State-Changed-When: Sat Dec 15 06:15:13 PST 2001 
State-Changed-Why:  
Fixed in cp.c rev 1.28 and 1.24.2.4 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27970 
>Unformatted:
