GNU bug report logs - #24251
Potential cp bug: directories created with --parents and --no-preserve=mode retain original mode bits don't match ~umask

Previous Next

Package: coreutils;

Reported by: Mark Mitchell <mark81 <at> gmail.com>

Date: Wed, 17 Aug 2016 15:35:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24251: closed (Potential cp bug: directories created with
 --parents and --no-preserve=mode retain original mode bits don't match
 ~umask)
Date: Thu, 18 Aug 2016 12:58:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 18 Aug 2016 13:57:48 +0100
with message-id <57B5B0CC.6030203 <at> draigBrady.com>
and subject line Re: bug#24251: Potential cp bug: directories created with --parents and --no-preserve=mode retain original mode bits don't match ~umask
has caused the debbugs.gnu.org bug report #24251,
regarding Potential cp bug: directories created with --parents and --no-preserve=mode retain original mode bits don't match ~umask
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24251: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24251
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mark Mitchell <mark81 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Potential cp bug: directories created with --parents and
 --no-preserve=mode retain original mode bits don't match ~umask
Date: Wed, 17 Aug 2016 11:42:40 +0000
[Message part 3 (text/plain, inline)]
Hi,

I'm writing to report a potential bug with cp.  I don't think the mode bits
always get properly set on directories created when using the --parents
option combined with --no-preserve=mode option.  I'm not sure what the
expected behaviour is supposed to be, but my assumption is that the created
directories would match process's ~umask (like mkdir -p).

I've attached a simple script and its output to demonstrate the behaviour.
I've tested this on the most recent master branch of the coreutils git
repository (output of git describe is 'v8.25-55-gff2178b').

Thanks for your efforts on these utilities, it is much appreciated :-).

-Mark
[Message part 4 (text/html, inline)]
[test-output.txt (text/plain, attachment)]
[test-cp-parents-umask.sh (application/x-sh, attachment)]
[Message part 7 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Mark Mitchell <mark81 <at> gmail.com>, 24251-done <at> debbugs.gnu.org
Subject: Re: bug#24251: Potential cp bug: directories created with --parents
 and --no-preserve=mode retain original mode bits don't match ~umask
Date: Thu, 18 Aug 2016 13:57:48 +0100
[Message part 8 (text/plain, inline)]
On 17/08/16 12:42, Mark Mitchell wrote:
> Hi,
> 
> I'm writing to report a potential bug with cp.  I don't think the mode bits
> always get properly set on directories created when using the --parents
> option combined with --no-preserve=mode option.  I'm not sure what the
> expected behaviour is supposed to be, but my assumption is that the created
> directories would match process's ~umask (like mkdir -p).
> 
> I've attached a simple script and its output to demonstrate the behaviour.
> I've tested this on the most recent master branch of the coreutils git
> repository (output of git describe is 'v8.25-55-gff2178b').
> 
> Thanks for your efforts on these utilities, it is much appreciated :-).

I agree that's unexpected, especially since cp -r --no-preserve=mode
does not copy the permissions for created dirs.

I think this may have changed with:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v5.92-435-gfdffb6b

I've adjusted things back in the attached.

thanks,
Pádraig.
[cp-parents-no-preserve-mode.patch (text/x-patch, attachment)]

This bug report was last modified 8 years and 336 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.