Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2001 02:25:05 -0800 (PST)
From:      Stephen McKay <mckay@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/31633: cp is unable to copy trees with non-empty read-only directories
Message-ID:  <200110301025.f9UAP5e29026@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110301025.f9UAP5e29026>