From owner-freebsd-bugs Tue Oct 30 2:30: 6 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 6B61937B407 for ; Tue, 30 Oct 2001 02:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9UAU1f29699; Tue, 30 Oct 2001 02:30: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 333D337B405 for ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/31633: cp is unable to copy trees with non-empty read-only directories 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: 31633 >Category: misc >Synopsis: cp is unable to copy trees with non-empty read-only directories >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: Tue Oct 30 02:30:01 PST 2001 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message