From unknown Sat Aug 16 21:22:26 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#31675 <31675@debbugs.gnu.org> To: bug#31675 <31675@debbugs.gnu.org> Subject: Status: Existing directories and files permissions are not being kept intact Reply-To: bug#31675 <31675@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:22:26 +0000 retitle 31675 Existing directories and files permissions are not being kept= intact reassign 31675 coreutils submitter 31675 Gunjan Gupta severity 31675 normal tag 31675 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 01 03:40:02 2018 Received: (at submit) by debbugs.gnu.org; 1 Jun 2018 07:40:02 +0000 Received: from localhost ([127.0.0.1]:56624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOefK-0004Gw-3S for submit@debbugs.gnu.org; Fri, 01 Jun 2018 03:40:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOb5a-0006NQ-L1 for submit@debbugs.gnu.org; Thu, 31 May 2018 23:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOb5U-0007oG-Ik for submit@debbugs.gnu.org; Thu, 31 May 2018 23:50:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fOb5U-0007nd-Er for submit@debbugs.gnu.org; Thu, 31 May 2018 23:50:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOb5T-00027s-6p for bug-coreutils@gnu.org; Thu, 31 May 2018 23:50:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOb5R-0007fA-WD for bug-coreutils@gnu.org; Thu, 31 May 2018 23:50:47 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:42264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOb5R-0007at-Mv for bug-coreutils@gnu.org; Thu, 31 May 2018 23:50:45 -0400 Received: by mail-lf0-x229.google.com with SMTP id v135-v6so12768116lfa.9 for ; Thu, 31 May 2018 20:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=DpkJrrw29xEVBwrcxsMv4QnwM4LcEhG7K6Ul/2Ms5K0=; b=JOOdKG2tCV7yNnKCA5KAi2n+uETfTvmZKj1x0GvMxcQ8G65uia/IZ+bdi3UXUsjkWG URoZuByIoFgO+maDmkZj488sfizrTXV880TJkgvIVrqJ/KndwLDrgBZPeb6zPSnbQfoZ 8Spf7542YjyBY/HqD+M1d9ZNbuXqxh64r6w9YkUqC4pi+gi9q9e8zi2Fxt9VnTM08Ttf vQN6GVcGN/bGtOQartRVpI1eovUBeVEHrBm4EXaRL0BjGxaYZjDJ7qKZCu4pyr7PRIKt ZUCqk5HE4s/RxZX8ecvVDFEt6IYoqRDW6BxdC2KtMY433ROaMQ7BasF2iRGKKcyN0JlT QWyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DpkJrrw29xEVBwrcxsMv4QnwM4LcEhG7K6Ul/2Ms5K0=; b=XDXTWI5QhlAwZE2B3ZtpXJQXOktZViUZW8GhYYGc0vBfFRbVFBqJlw4FcexMCtlJY0 IasUAAxwS3Y0RjM6yiQzAIefKYv0Jb/EC6DTM1RY32jrnsHfhK9K8lUZDexc6Wgc12Pj 2QprmCqAMW+zYWlZyNjo/UpZPQlHR+pASkoxpq9YIMhX5fkSxY8Qqabq3+GxffA8D8/H 71OFbC+u44xq+KToWB8TZPOleOfEOnJmFtloua/j49biUzYl0ATz6CEuZy2rrN6/clNi 4ZbZgBdgvU0wp2dl+qwd2ReSNxr1t4QHBTB1AOkuXYjz+pSxs1JnoKbZiGqG5lBNRm3D yxKw== X-Gm-Message-State: ALKqPwcqc4S6fvWmSh3GW5W8FI6xWYV9DPyFAtztET72kfpgb3HdRFoE b0InSOrUlA6yDeCjVUMMqew09x6TzI5T+9WBsHhWyg== X-Google-Smtp-Source: ADUXVKJEo6+a9CxwlAjl2M3LNGqaJ7AtMhQ2nFHYh06U40PFfK9d0FqtViog7FXiip4/qR9fIa7VpzlSgLFu9IzOehI= X-Received: by 2002:a2e:635b:: with SMTP id x88-v6mr6955832ljb.103.1527825043559; Thu, 31 May 2018 20:50:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:63c9:0:0:0:0:0 with HTTP; Thu, 31 May 2018 20:50:42 -0700 (PDT) From: Gunjan Gupta Date: Fri, 1 Jun 2018 09:20:42 +0530 Message-ID: Subject: Existing directories and files permissions are not being kept intact To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="0000000000000018fb056d8c7d8b" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 01 Jun 2018 03:40:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --0000000000000018fb056d8c7d8b Content-Type: text/plain; charset="UTF-8" Hi, Suppose I have the following directory structure / | - destination (mode=0755) | - dir (mode=0755) | - file.txt (mode=0644) | - source | - dir (mode=0755) | - file.txt (mode=0644) My user has a umask of 0077. Now if I run the following cp command cp -aR --no-preserve=mode /source/* /destination I think the mode of destination/dir should stay as 0755 but it changes to 0700. Is this expected? I am using coreutils 8.26-3 on Debian Stretch Thanks & Regards Gunjan Gupta --0000000000000018fb056d8c7d8b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Suppose I have the follo= wing directory structure

/
| - destinati= on (mode=3D0755)
=C2=A0=C2=A0=C2=A0=C2=A0 | - dir (mode=3D0755)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | - file.tx= t (mode=3D0644)
| - source
=C2=A0=C2=A0=C2=A0=C2=A0 | - dir (mode=3D0755)
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | - file.txt (mode=3D0644)

My user has a umask of 0077. Now if I run the fol= lowing cp command

cp -aR --no-preserve=3Dmode /sou= rce/* /destination

I think the mode of destination= /dir should stay as 0755 but it changes to 0700. Is this expected?

I am using coreutils 8.26-3 on Debian Stretch

Thanks & Regards
Gunjan Gupta
--0000000000000018fb056d8c7d8b-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 03 18:20:17 2018 Received: (at 31675) by debbugs.gnu.org; 3 Jun 2018 22:20:17 +0000 Received: from localhost ([127.0.0.1]:60614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPbMH-0005e2-DK for submit@debbugs.gnu.org; Sun, 03 Jun 2018 18:20:17 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:37844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPbMF-0005dr-FV; Sun, 03 Jun 2018 18:20:15 -0400 Received: from localhost.localdomain (unknown [76.21.115.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id BE5E3243; Sun, 3 Jun 2018 23:20:13 +0100 (IST) Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: Gunjan Gupta , 31675@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> Date: Sun, 3 Jun 2018 15:20:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31675 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tag 31675 notabug close 31675 stop On 31/05/18 20:50, Gunjan Gupta wrote: > Hi, > > Suppose I have the following directory structure > > / > | - destination (mode=0755) > | - dir (mode=0755) > | - file.txt (mode=0644) > | - source > | - dir (mode=0755) > | - file.txt (mode=0644) > > My user has a umask of 0077. Now if I run the following cp command > > cp -aR --no-preserve=mode /source/* /destination > > I think the mode of destination/dir should stay as 0755 but it changes to > 0700. Is this expected? > > I am using coreutils 8.26-3 on Debian Stretch This is a little surprising as cp didn't create /destination/dir in this case. However if it did create that dir, then the mode would be expected. So cp is keeping the destination consistent whether it previously existed or not. cheers, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 03 18:31:16 2018 Received: (at 31675) by debbugs.gnu.org; 3 Jun 2018 22:31:16 +0000 Received: from localhost ([127.0.0.1]:60627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPbWu-0007Ae-5p for submit@debbugs.gnu.org; Sun, 03 Jun 2018 18:31:16 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:38459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPbWt-00074x-47 for 31675@debbugs.gnu.org; Sun, 03 Jun 2018 18:31:15 -0400 Received: by mail-lf0-f54.google.com with SMTP id i83-v6so10085878lfh.5 for <31675@debbugs.gnu.org>; Sun, 03 Jun 2018 15:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uP6H3hP9uMH26FbZMDZ/AZe75z3HqMyi+oCgmhrG0tU=; b=aci8Koy6ONkid6NtczW1Vun8HV51q7pcA3BwsnJwc5/m/pblTQFwRhBGWx+X6SqGpP 6kbf3+1lFVQXBafn4s94INHqBPD8AMuN2vclq6wr89+WI+dsfnUVdiJ7NhMXMp4HNI0/ HLYjTdEHILiPrvBG41NFN/tkh7NnZTAEVGU0NvkCvzWBrJi39UG3+T8fj2U92FLN9vjj lnv0YeGQj+yMpLnJ0elMRKP19k90J2Kujt6OH0qsPtSZQxGcZDjdJ7EjqLJyvPvas6t3 I9brXHJH/tzzYkL6tl9B+V1bDmLBV9xp1QajuOpFLUF7sQdauOlEtNSzkX9gxWJJUZux HHQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uP6H3hP9uMH26FbZMDZ/AZe75z3HqMyi+oCgmhrG0tU=; b=IVMQbjV7woMhyPHHhAJdUSlw1+tQMCdx6duvul0RaMicbasMXVtRpkrHwXIDkQ5hd3 Bd2T493Q8MYyv0/qlaxuAi2/5GE9R0IA8CIHasCz88LKVEOB1M4qBCBg/izDS60NuaEq Pv/Db5Xxi49EBL17r4bPHFe8XNoAzzlfalekMY7C91qC8MhmIp7gL8HT4DioTtDQeb7g ghD3iSHu2+DwjiLcIZGn/Ldn9u+vEdgKAOEa4fD2seQNF+/OpOqCHPT7Mepyfa9EcUb3 eeXyHhckOaiCwoacOcsyfKm7sOoTMrhfgFLZAEbT2RowkRMFAn/5JHkLl9WBN8i+nXQ4 NePg== X-Gm-Message-State: ALKqPwcGo2iHMmKZEMxsOAI3Y4LlITzXnUH92RFM+9yQZ6v9vWfAOSb7 jva3nWngqlI5TwhHHKIDKTCjV3irO/hdVROYCfQ= X-Google-Smtp-Source: ADUXVKJwXEMFMwHfv9vMINc9qsfiZHswRmliVPqUsCdQnhFo3mMyiveAdjZgnGfBR5dddvBF9LHC6KFmJqcf0n7xp/8= X-Received: by 2002:a19:f86:: with SMTP id 6-v6mr11012081lfp.15.1528065069087; Sun, 03 Jun 2018 15:31:09 -0700 (PDT) MIME-Version: 1.0 References: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> In-Reply-To: From: Gunjan Gupta Date: Mon, 4 Jun 2018 04:00:57 +0530 Message-ID: Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: =?UTF-8?Q?P=C3=A1draig_Brady?= Content-Type: multipart/alternative; boundary="000000000000a301fd056dc45fe4" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31675 Cc: 31675@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000a301fd056dc45fe4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ++ bugs mailling list On Mon 4 Jun, 2018, 3:59 AM Gunjan Gupta, wrote: > No cpvdidnt created that directory. Directory was existing on the machine > before. > > It used to be fine before 8.26 version of coreutils and we use to supply > patches to our customer that use to use cp to copy files to the destinati= on. > > Starting from 8.26, its broken. What will happen if we use the same > command to copy files to say /etc directory. I had one of our patch that > used to do that. I tried installing it on new system and whole system bro= ke > because of this. > > Don't you think cp should preserve permissions for existing files and > directory? Using user's umask for new files sounds ok but why cp has to > change mode for existing files and directories? > > Is there a way I can tell cp to preserve destination permissions now? > > Thanks & Regards > Gunjan Gupta > > On Mon 4 Jun, 2018, 3:50 AM P=C3=A1draig Brady, wrote: > >> tag 31675 notabug >> close 31675 >> stop >> >> On 31/05/18 20:50, Gunjan Gupta wrote: >> > Hi, >> > >> > Suppose I have the following directory structure >> > >> > / >> > | - destination (mode=3D0755) >> > | - dir (mode=3D0755) >> > | - file.txt (mode=3D0644) >> > | - source >> > | - dir (mode=3D0755) >> > | - file.txt (mode=3D0644) >> > >> > My user has a umask of 0077. Now if I run the following cp command >> > >> > cp -aR --no-preserve=3Dmode /source/* /destination >> > >> > I think the mode of destination/dir should stay as 0755 but it changes >> to >> > 0700. Is this expected? >> > >> > I am using coreutils 8.26-3 on Debian Stretch >> >> This is a little surprising as cp didn't create /destination/dir in this >> case. >> However if it did create that dir, then the mode would be expected. >> So cp is keeping the destination consistent whether it previously existe= d >> or not. >> >> cheers, >> P=C3=A1draig >> >> --000000000000a301fd056dc45fe4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
++ bugs mailling list

On Mon 4 Jun, 2018, 3:59 AM Gunjan Gupta, <viraniac@gmail.com> wrote:
No cpvdidnt created that d= irectory. Directory was existing on the machine before.

It used to be fine before 8.26 version of c= oreutils and we use to supply patches to our customer that use to use cp to= copy files to the destination.

Starting from 8.26, its broken. What will happen if we use the sa= me command to copy files to say /etc directory. I had one of our patch that= used to do that. I tried installing it on new system and whole system brok= e because of this.

Don&#= 39;t you think cp should preserve permissions for existing files and direct= ory? Using user's umask for new files sounds ok but why cp has to chang= e mode for existing files and directories?

Is there a way I can tell cp to preserve destination per= missions now?

Thanks &am= p; Regards
Gunjan Gupta

<= div class=3D"gmail_quote" dir=3D"auto">
On Mon 4 Jun, 2018,= 3:50 AM P=C3=A1draig Brady, <P@draigbrady.com> wrote:
tag 31675 notabug
close 31675
stop

On 31/05/18 20:50, Gunjan Gupta wrote:
> Hi,
>
> Suppose I have the following directory structure
>
> /
> | - destination (mode=3D0755)
>=C2=A0 =C2=A0 =C2=A0 | - dir (mode=3D0755)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| - file.txt (mode=3D0644)
> | - source
>=C2=A0 =C2=A0 =C2=A0 | - dir (mode=3D0755)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| - file.txt (mode=3D0644)
>
> My user has a umask of 0077. Now if I run the following cp command
>
> cp -aR --no-preserve=3Dmode /source/* /destination
>
> I think the mode of destination/dir should stay as 0755 but it changes= to
> 0700. Is this expected?
>
> I am using coreutils 8.26-3 on Debian Stretch

This is a little surprising as cp didn't create /destination/dir in thi= s case.
However if it did create that dir, then the mode would be expected.
So cp is keeping the destination consistent whether it previously existed o= r not.

cheers,
P=C3=A1draig

--000000000000a301fd056dc45fe4-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 03 18:43:33 2018 Received: (at 31675) by debbugs.gnu.org; 3 Jun 2018 22:43:33 +0000 Received: from localhost ([127.0.0.1]:60632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPbin-00089e-DS for submit@debbugs.gnu.org; Sun, 03 Jun 2018 18:43:33 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:37890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPbil-00089U-H2 for 31675@debbugs.gnu.org; Sun, 03 Jun 2018 18:43:31 -0400 Received: from localhost.localdomain (unknown [76.21.115.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 7639F94A8; Sun, 3 Jun 2018 23:43:30 +0100 (IST) Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: Gunjan Gupta References: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <08b0f04c-56d8-8fca-4fc0-07063e1d936b@draigBrady.com> Date: Sun, 3 Jun 2018 15:43:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31675 Cc: 31675@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 03/06/18 15:30, Gunjan Gupta wrote: > ++ bugs mailling list > > On Mon 4 Jun, 2018, 3:59 AM Gunjan Gupta, wrote: > >> No cpvdidnt created that directory. Directory was existing on the machine >> before. >> >> It used to be fine before 8.26 version of coreutils and we use to supply >> patches to our customer that use to use cp to copy files to the destination. >> >> Starting from 8.26, its broken. What will happen if we use the same >> command to copy files to say /etc directory. I had one of our patch that >> used to do that. I tried installing it on new system and whole system broke >> because of this. >> >> Don't you think cp should preserve permissions for existing files and >> directory? Using user's umask for new files sounds ok but why cp has to >> change mode for existing files and directories? >> >> Is there a way I can tell cp to preserve destination permissions now? >> >> Thanks & Regards >> Gunjan Gupta >> >> On Mon 4 Jun, 2018, 3:50 AM Pádraig Brady, wrote: >> >>> tag 31675 notabug >>> close 31675 >>> stop >>> >>> On 31/05/18 20:50, Gunjan Gupta wrote: >>>> Hi, >>>> >>>> Suppose I have the following directory structure >>>> >>>> / >>>> | - destination (mode=0755) >>>> | - dir (mode=0755) >>>> | - file.txt (mode=0644) >>>> | - source >>>> | - dir (mode=0755) >>>> | - file.txt (mode=0644) >>>> >>>> My user has a umask of 0077. Now if I run the following cp command >>>> >>>> cp -aR --no-preserve=mode /source/* /destination >>>> >>>> I think the mode of destination/dir should stay as 0755 but it changes >>> to >>>> 0700. Is this expected? >>>> >>>> I am using coreutils 8.26-3 on Debian Stretch >>> >>> This is a little surprising as cp didn't create /destination/dir in this >>> case. >>> However if it did create that dir, then the mode would be expected. >>> So cp is keeping the destination consistent whether it previously existed >>> or not. Actually looking more, this is a relatively recent change: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.19-145-g24ebca6 Also in retrospect, using --no-preserve=mode should have no guarantees on the mode bits of the destination. So it's probably best to leave existing mode bits in place. Let me see if I can come up with a patch... thanks, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 03 18:49:32 2018 Received: (at 31675) by debbugs.gnu.org; 3 Jun 2018 22:49:32 +0000 Received: from localhost ([127.0.0.1]:60636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPboa-0008IG-4k for submit@debbugs.gnu.org; Sun, 03 Jun 2018 18:49:32 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPboX-0008I3-Hm for 31675@debbugs.gnu.org; Sun, 03 Jun 2018 18:49:30 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6F6ED16004E; Sun, 3 Jun 2018 15:49:23 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ase0-fXl4VNN; Sun, 3 Jun 2018 15:49:22 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AD5F1160564; Sun, 3 Jun 2018 15:49:22 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id U0YKZKSjEiXR; Sun, 3 Jun 2018 15:49:22 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 5C6F816004E; Sun, 3 Jun 2018 15:49:22 -0700 (PDT) Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: =?UTF-8?Q?P=c3=a1draig_Brady?= , Gunjan Gupta , 31675@debbugs.gnu.org References: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> From: Paul Eggert Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= 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 uNcby4U= Organization: UCLA Computer Science Department Message-ID: <76f5be59-1eb0-330c-2658-05d787e627a3@cs.ucla.edu> Date: Sun, 3 Jun 2018 15:49:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31675 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) P=C3=A1draig Brady wrote: > This is a little surprising as cp didn't create /destination/dir in thi= s case. > However if it did create that dir, then the mode would be expected. > So cp is keeping the destination consistent whether it previously exist= ed or not. Sorry, but I am not following this analysis. The --no-preserve=3Dmode opt= ion says=20 "do not copy the mode of the source to the destination", and yet cp is co= pying=20 the mode of the source to the destination. How is that not a bug? A longer analysis: the documentation for --preserve says what should happ= en in=20 the absence of the --preserve option (namely, that permissions of existin= g=20 destinations are unchanged), and --no-preserve=3Dmode is pretty clearly e= quivalent=20 to the absence of --preserve=3Dmode. So I don't see how the current behavior can be considered to match the=20 documentation. I don't see how it'd be that useful, either. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 03 19:28:59 2018 Received: (at 31675) by debbugs.gnu.org; 3 Jun 2018 23:28:59 +0000 Received: from localhost ([127.0.0.1]:60650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPcQl-0000iz-GN for submit@debbugs.gnu.org; Sun, 03 Jun 2018 19:28:59 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:38084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPcQh-0000ij-Nq for 31675@debbugs.gnu.org; Sun, 03 Jun 2018 19:28:57 -0400 Received: from localhost.localdomain (unknown [76.21.115.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 021A89940; Mon, 4 Jun 2018 00:28:53 +0100 (IST) Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: Gunjan Gupta References: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> <08b0f04c-56d8-8fca-4fc0-07063e1d936b@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Sun, 3 Jun 2018 16:28:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <08b0f04c-56d8-8fca-4fc0-07063e1d936b@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31675 Cc: 31675@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 03/06/18 15:43, Pádraig Brady wrote: > Actually looking more, this is a relatively recent change: > https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.19-145-g24ebca6 > > Also in retrospect, using --no-preserve=mode should > have no guarantees on the mode bits of the destination. > So it's probably best to leave existing mode bits in place. > > Let me see if I can come up with a patch... I pushed a fix in: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=5e7b892 thanks, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 03 19:33:38 2018 Received: (at 31675) by debbugs.gnu.org; 3 Jun 2018 23:33:38 +0000 Received: from localhost ([127.0.0.1]:60655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPcVG-0000ql-1N for submit@debbugs.gnu.org; Sun, 03 Jun 2018 19:33:38 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:42312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPcVE-0000qY-Qz for 31675@debbugs.gnu.org; Sun, 03 Jun 2018 19:33:37 -0400 Received: by mail-lf0-f41.google.com with SMTP id v135-v6so22370064lfa.9 for <31675@debbugs.gnu.org>; Sun, 03 Jun 2018 16:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EA7LH4x0Qgu4Dfuo89N46/xe6AdshU3MlUBIYZC5LyY=; b=Qw2S6P5OHkyyg5hD1NCUvD37QC/peVnx9qZZuO1vIyzz0IZtaihqrkhCVFKfOQ7STk MTjfjwwZVO2a34tCVBSAtigCPJA3xIh/iO9qGLUm5nMRLeIJwg6hS6wcgrv/xEyreDEC GksV7l4H7HlgjEhC5VkAcR6qXnUKU0rDE/aZ88H93XMmxreZvt7CBetMSIAx8Aqp/AEb 0VffNhrJjUHvFw5IHK5P09bMO7XzRPhs1cX/kFJJZ7i3lL633ZWp8JOXy4kn1/rIxsrO 90g5b0LYHOdxmp8afZFiJIX4FPcBUYxXD4xgYliNzsOmAlvR/QbNdP7T1dgdKWKQAaw2 dpsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EA7LH4x0Qgu4Dfuo89N46/xe6AdshU3MlUBIYZC5LyY=; b=M73Bs+ePIyQnmEOnjq0ttOfzOdkNJJZCAhOESYuwNMzPUSKa/fY8OS15DG4Fl7Bn5N kqN7vxKqXtJRpPAlDuCdeBlCKmw5+2BWPVEWPHHwqqZ3K6slyLRlMzSDzNUVD9nLQnZo 1zlKTo4tP9iIahTecFlPu/b78bF8r07W0jXz1g9aP6r9qnsaLcHDFK6bgRykeILKkwnH TRgAsjzjKM44FnwZzBgFf2+1ZZKY0ZXbW7QfTygSdyzUfUErqbBXmEJgTAiaQbKZieq9 Ums1GaA02Hh7UYpT0i8JqpeUvbWeryYk7ZbB+AztNwe91ZV5rYSbNAGeVl4yFRrAF/yW 4VjA== X-Gm-Message-State: ALKqPweHKvBsZb4EvMhT3DDm6n7A9BmVH+RY8j6OMFiikf7x4Myhr9Un ujTdyYDCMJUhf6ZmY7gfHzigtypoXczQVwHpMWE= X-Google-Smtp-Source: ADUXVKLmOC+cejYRwCDSLSeTLips+mBOOI/Rk1bLU8gGqweJe2yKcH9vun+XgTk/W9elvUnTSe0P7FDJgmOe/0yuoUg= X-Received: by 2002:a2e:200f:: with SMTP id g15-v6mr10362974ljg.63.1528068810751; Sun, 03 Jun 2018 16:33:30 -0700 (PDT) MIME-Version: 1.0 References: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> <08b0f04c-56d8-8fca-4fc0-07063e1d936b@draigBrady.com> In-Reply-To: From: Gunjan Gupta Date: Mon, 4 Jun 2018 05:03:19 +0530 Message-ID: Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: =?UTF-8?Q?P=C3=A1draig_Brady?= Content-Type: multipart/alternative; boundary="000000000000a8469f056dc53ee6" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31675 Cc: 31675@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000a8469f056dc53ee6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That was fast, I will test it and let you know if I face any issues Thanks & Regards Gunjan Gupta On Mon 4 Jun, 2018, 4:58 AM P=C3=A1draig Brady, wrote: > On 03/06/18 15:43, P=C3=A1draig Brady wrote: > > Actually looking more, this is a relatively recent change: > > > https://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3Dv8.19= -145-g24ebca6 > > > > Also in retrospect, using --no-preserve=3Dmode should > > have no guarantees on the mode bits of the destination. > > So it's probably best to leave existing mode bits in place. > > > > Let me see if I can come up with a patch... > > I pushed a fix in: > https://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3D5e7b8= 92 > > thanks, > P=C3=A1draig > --000000000000a8469f056dc53ee6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That was fast, I will test it and let you know if I face = any issues


Thanks & Regards
Gunjan Gupta

On Mon 4 Jun, 2018, 4:58= AM P=C3=A1draig Brady, <P@draigbrad= y.com> wrote:
On 03/06/18 15= :43, P=C3=A1draig Brady wrote:
> Actually looking more, this is a relatively recent change:
> https://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3Dv8.19= -145-g24ebca6
>
> Also in retrospect, using --no-preserve=3Dmode should
> have no guarantees on the mode bits of the destination.
> So it's probably best to leave existing mode bits in place.
>
> Let me see if I can come up with a patch...

I pushed a fix in:
https://git.sv= .gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3D5e7b892

thanks,
P=C3=A1draig
--000000000000a8469f056dc53ee6-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 04 01:50:56 2018 Received: (at 31675) by debbugs.gnu.org; 4 Jun 2018 05:50:56 +0000 Received: from localhost ([127.0.0.1]:60793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPiOO-0003PR-8v for submit@debbugs.gnu.org; Mon, 04 Jun 2018 01:50:56 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:32972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPiOM-0003PE-4e for 31675@debbugs.gnu.org; Mon, 04 Jun 2018 01:50:54 -0400 Received: by mail-lf0-f41.google.com with SMTP id y20-v6so23217723lfy.0 for <31675@debbugs.gnu.org>; Sun, 03 Jun 2018 22:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AaasEYWCs2zjfz6Basj7EKfPyei6u/MRGTjMzpj4MJE=; b=IDrlD6vjHef1Z8nMahTF6Yf50f9F+u2JHmGUIY9PiRpOsahbD3Fopn+cdTjGEtQyHj ASrJYYkFTuM/J5AAcV7tdnEs0qj50dH7BANA9d8A3eHZ9ASUgw0Cxi7jWBDQY+LFqe5A C1PBsN9sYGe1+dNdCNW83BzfWDvWy1DoKcfHApSIZ++Bdmh4j3DGKiFBcwR5D28HZ7Cd T6rg8mm2A86dYJbob8HPjz4+mOYB1z6GQmt57AYMPynf7hnyZz2Ct++85f0t2HH4l7om /OW6IaZb3DiNdPrYEQqiiGaoEZAHPWXuIvCwOCwVUXR3iYaa9TVrP0MstjK6VUeyB4/7 XaEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AaasEYWCs2zjfz6Basj7EKfPyei6u/MRGTjMzpj4MJE=; b=Y7tbgskJFYh12rmslGDNbXh19HQOGs5yILz7SZP3TTDxGEqMz7KiomLHSLIQ0RBEm8 JDWb4rTNEtzHYGiI7QYTZ+N+zLEE+yNs+MeTS12urFgTlnBxYifKebGS94oL1K5zNuxn SLqw4BWj3ZabVjVA3s2vzfHH0t9u1g2yv2ur+XuJlgX8U7D9uubenwlMJNWHZTYNNDeu R31cmuV4jttaJwm73vKPl3RWlzjtKhuj6aDw6WUnDPHjISxh4icCWWSoZIzBnUwOVf4J l+i5lpgnUoKKaFIw3mpxC7Bshwq4gO/eMKRP6zdkHztxVTimL4I9NrwU1LRZUsm+YadD 7jjQ== X-Gm-Message-State: ALKqPwcxHkNcvgAZ4k/nRYI9qFhUpapCyMeV67kWsF1A2UWtUPHLL2ux +fOc0DPpBQSjKOtSqbqj1glCCdW4NlT6yQZfXX4= X-Google-Smtp-Source: ADUXVKLZ2YlSV0g+lYiuguj+/oJxgmMCmhxll4SOk7u3A42kUXCnXltVvwLScQ32br1KqcMXAXxZB9GHpxGRCao20Jw= X-Received: by 2002:a19:d7aa:: with SMTP id q42-v6mr9857479lfi.75.1528091448069; Sun, 03 Jun 2018 22:50:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:63c9:0:0:0:0:0 with HTTP; Sun, 3 Jun 2018 22:50:47 -0700 (PDT) In-Reply-To: References: <32aa539f-aa89-bfd7-65d5-c663f964a0a5@draigBrady.com> <08b0f04c-56d8-8fca-4fc0-07063e1d936b@draigBrady.com> From: Gunjan Gupta Date: Mon, 4 Jun 2018 11:20:47 +0530 Message-ID: Subject: Re: bug#31675: Existing directories and files permissions are not being kept intact To: =?UTF-8?Q?P=C3=A1draig_Brady?= Content-Type: multipart/alternative; boundary="000000000000f252e2056dca83ec" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31675 Cc: 31675@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000f252e2056dca83ec Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Nice, it works!!! I only applied the patch to the copy.c file and didn't patched the test and NEWS file on my system though. I have another question. Can I tell cp to only preserve the executable mode for a file? Thanks & Regards Gunjan Gupta On Mon, Jun 4, 2018 at 5:03 AM, Gunjan Gupta wrote: > That was fast, I will test it and let you know if I face any issues > > > Thanks & Regards > Gunjan Gupta > > On Mon 4 Jun, 2018, 4:58 AM P=C3=A1draig Brady, wrote: > >> On 03/06/18 15:43, P=C3=A1draig Brady wrote: >> > Actually looking more, this is a relatively recent change: >> > https://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff; >> h=3Dv8.19-145-g24ebca6 >> > >> > Also in retrospect, using --no-preserve=3Dmode should >> > have no guarantees on the mode bits of the destination. >> > So it's probably best to leave existing mode bits in place. >> > >> > Let me see if I can come up with a patch... >> >> I pushed a fix in: >> https://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3D5e7b= 892 >> >> thanks, >> P=C3=A1draig >> > --000000000000f252e2056dca83ec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nice, it works!!! I only applied the patch to the cop= y.c file and didn't patched the test and NEWS file on my system though.=

I have another question. Can I tell cp to onl= y preserve the executable mode for a file?

Thanks = & Regards
Gunjan Gupta

On Mon, Jun 4, 2018 at 5:03 AM, Gunjan G= upta <viraniac@gmail.com> wrote:
That was fast, I will test it and let you know if= I face any issues


Thanks & Regards
Gunjan Gupta
<= br>
On Mon 4 Jun, 2018, 4:58 AM = P=C3=A1draig Brady, <P@draigbrady.com> wrote:
= On 03/06/18 15:43, P=C3=A1draig Brady wrote:
> Actually looking more, this is a relatively recent change:
> https://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3Dv8.19-145-g24ebca6
>
> Also in retrospect, using --no-preserve=3Dmode should
> have no guarantees on the mode bits of the destination.
> So it's probably best to leave existing mode bits in place.
>
> Let me see if I can come up with a patch...

I pushed a fix in:
https://git.sv= .gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3D5e7b892=

thanks,
P=C3=A1draig

--000000000000f252e2056dca83ec-- From unknown Sat Aug 16 21:22:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 02 Jul 2018 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator