From nobody@FreeBSD.org  Tue Oct 30 02:25:05 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 333D337B405
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Oct 2001 02:25:05 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f9UAP5e29026;
	Tue, 30 Oct 2001 02:25:05 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200110301025.f9UAP5e29026@freefall.freebsd.org>
Date: Tue, 30 Oct 2001 02:25:05 -0800 (PST)
From: Stephen McKay <mckay@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cp is unable to copy trees with non-empty read-only directories
X-Send-Pr-Version: www-1.0

>Number:         31633
>Category:       bin
>Synopsis:       cp is unable to copy trees with non-empty read-only directories
>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:   Tue Oct 30 02:30:01 PST 2001
>Closed-Date:    Sat Dec 15 06:22:33 PST 2001
>Last-Modified:  Sat Dec 15 06:23:41 PST 2001
>Originator:     Stephen McKay
>Release:        4.4
>Organization:
Just me
>Environment:
>Description:
SUSV2 defines special handling of read-only directories.  cp should
first create them writable (S_IRWXU set), copy the contents, then fix
up permissions later.  Since rev 1.1, cp.c has attempted to do this,
but does this in the wrong order (create-writable, set-read-only,
copy-contents, oops).
>How-To-Repeat:
% mkdir a
% touch a/x
% chmod a-w a
% cp -R a b
cp: b/x: Permission denied
%
>Fix:
Gnu cp handles this by keeping a list of directory permissions to fix
after all copying has been done.  Such a mechanism could also be used to
close other outstanding PRs on cp problems (like preserving directory
modify times).
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mckay 
State-Changed-When: Sat Dec 15 06:22:33 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=31633 
>Unformatted:
