From unknown Sat Sep 06 14:23:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6245: cp - copy files and directories, ls -Rld, chmod Resent-From: "estonoeshawaii@yahoo.com" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 22 May 2010 07:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6245 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 6245@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12745132192230 (code B ref -1); Sat, 22 May 2010 07:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 May 2010 07:26:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFj6o-0000Zv-8g for submit@debbugs.gnu.org; Sat, 22 May 2010 03:26:58 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFj00-0000WN-ME for submit@debbugs.gnu.org; Sat, 22 May 2010 03:19:57 -0400 Received: from lists.gnu.org ([199.232.76.165]:59441) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OFizx-00065U-Fa for submit@debbugs.gnu.org; Sat, 22 May 2010 03:19:53 -0400 Received: from [140.186.70.92] (port=58291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFizl-0004GP-W7 for bug-coreutils@gnu.org; Sat, 22 May 2010 03:19:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFizd-0001S8-Fp for bug-coreutils@gnu.org; Sat, 22 May 2010 03:19:41 -0400 Received: from web57701.mail.re3.yahoo.com ([68.142.236.53]:48289) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OFizd-0001Rm-97 for bug-coreutils@gnu.org; Sat, 22 May 2010 03:19:33 -0400 Received: (qmail 63068 invoked by uid 60001); 22 May 2010 07:19:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1274512770; bh=QQ1sV2KASBKGxOQLtJ3/kzNHA4hn486I1gepzwAoE2k=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=O1yb883Rp7R5Yegiquow6ByY0AOYaCqf8qjzgOjmEJHu3FlD9+gxGJpla85Ckquf3HKM2+5ybK0ycRICvzxUEII/m5FjLDY8KxPbbh7B9kkoiklkPz+IVoxJ6mkuzXm8SkYKbbb492iOgo9Cmi+ne2ySXVf4LLXoF3INQRbKA1k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=AvAte6oCtAVhjiplk9JSL0C6xlttaqsu7aEAmoa2IjO7f8liUZP62YPZi/e42DC1oWifywtYYkY1oWZVnE3VFrVhdsK+xgbRMhFZ50BZg35p0x4vU8yFedrLO8rT9M9sBGGcBGAgabYRAE8HXC9gwrWTYjkhxttWCs/wSTkjET8=; Message-ID: <721537.61727.qm@web57701.mail.re3.yahoo.com> X-YMail-OSG: T7xfr90VM1mocEbtznHtF37LnLphARfBlcgoTrPQQN6GsxW LyDSQhSJR2Q2ogmvy3WajeUIhrtBZAoyQ8tHoyubMPdUA1wR0BdB.47vpUpz DNIaQSD4MoCqPM5Kmc6BU7.OlIU.qkpaclrn._KBoEKfIpevxL88Fb2S2q_J FABcKiE6EO.sh1y7IHozAhJDRGipv5yWfwWc3jKrgiBeAv2VHiy7LTLb.ReF P2_NF0SQ7HG3bX7oYBPJm1Csrk715Ss6Ze.eEPOujBeg3VDHk7naq8GPjfC3 daeTnULc7NIAe Received: from [87.221.191.50] by web57701.mail.re3.yahoo.com via HTTP; Sat, 22 May 2010 00:19:30 PDT X-Mailer: YahooMailClassic/11.0.8 YahooMailWebService/0.8.103.269680 Date: Sat, 22 May 2010 00:19:30 -0700 (PDT) From: "estonoeshawaii@yahoo.com" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-526870909-1274512770=:61727" X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-Mailman-Approved-At: Sat, 22 May 2010 03:26:57 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --0-526870909-1274512770=:61727 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, 1. The copy command=A0 cp -a -a, --archive =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 same as -dpR -p=A0=A0=A0=A0 same as --preserve=3Dmode,ownership,timestamps is not doing what it is supposed to do (and thats is fine, of course), beca= use It does not preserve ownership (except if you are root) . The problem i= s that it doesn't tell you anything when it doesn't do it or that It should= n't be supposed to preserve ownership. ------------------- 2. Many commands act recursively on a directory with an -R option that affe= cts the directory and all the files it contains. There should be a ls -ld -R command that lists in detail the directory and its contents to quickly chec= k results in one step. -------------------------------- 3. If we have: drwx------ 2 user2 user2=A0 392 2010-01-11 12:04 /home/user2/directory user1@mypc:~$ su=A0 -c 'chmod -R 644 /home/user2/directory' user2 doesn't work. You need to change the mode of the directory first and then y= ou can apply a recursive chmod. Is this a bug? Many thanx for many things. :-) =0A=0A=0A --0-526870909-1274512770=:61727 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

1. The copy comma= nd  cp -a


-a, --archive
  =             same as = -dpR

-p     same as --preserve=3Dmode,ownership,= timestamps


is not doing what it is supposed = to do (and thats is fine, of course), because It do= es not preserve ownership (except if you are root) . The problem is that it= doesn't tell you anything when it doesn't do it or that It shouldn't be su= pposed to preserve ownership.
------------------= -
2. Many commands act recursively on a directory with an -R option that= affects the directory and all the files it contains.

There should b= e a

ls -ld -R

command that lists in detail the directory and = its contents to quickly check results in one step.
--------------------------------
= 3. If we have:

drwx------ 2 user2 user2  392 2010-01-11 12:04 /home/user= 2/directory

user1@mypc:~$= su  -c 'chmod -R 644 /home/user2/directory' user2

doesn= 't work. You need to change the mode of the directory first and then you ca= n apply a recursive chmod. Is this a bug?

Many thanx for many things= .
:-)


=0A=0A=0A=0A=0A=0A=0A=0A --0-526870909-1274512770=:61727-- From unknown Sat Sep 06 14:23:33 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "estonoeshawaii@yahoo.com" Subject: bug#6245: closed (Re: bug#6245: cp - copy files and directories, ls -Rld, chmod) Message-ID: References: <20100522193400.GA12512@dementia.proulx.com> <721537.61727.qm@web57701.mail.re3.yahoo.com> X-Gnu-PR-Message: they-closed 6245 X-Gnu-PR-Package: coreutils Reply-To: 6245@debbugs.gnu.org Date: Sat, 22 May 2010 19:35:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1274556901-28764-1" This is a multi-part message in MIME format... ------------=_1274556901-28764-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6245: cp - copy files and directories, ls -Rld, chmod which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 6245@debbugs.gnu.org. --=20 6245: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6245 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1274556901-28764-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6245-done) by debbugs.gnu.org; 22 May 2010 19:34:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFuTJ-0007Tl-CN for submit@debbugs.gnu.org; Sat, 22 May 2010 15:34:58 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFuST-0007TF-Am for 6245-done@debbugs.gnu.org; Sat, 22 May 2010 15:34:55 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id 84E0321363; Sat, 22 May 2010 13:34:00 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id 702323CC3A1; Sat, 22 May 2010 13:34:00 -0600 (MDT) Date: Sat, 22 May 2010 13:34:00 -0600 From: Bob Proulx To: "estonoeshawaii@yahoo.com" Subject: Re: bug#6245: cp - copy files and directories, ls -Rld, chmod Message-ID: <20100522193400.GA12512@dementia.proulx.com> References: <721537.61727.qm@web57701.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <721537.61727.qm@web57701.mail.re3.yahoo.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 6245-done Cc: 6245-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) estonoeshawaii@yahoo.com wrote: > course), because It does not preserve ownership (except if you are > root) . The problem is that it doesn't tell you anything when it > doesn't do it or that It shouldn't be supposed to preserve > ownership. This is related to this FAQ entry. It explains why only root can chown files. http://www.gnu.org/software/coreutils/faq/#Why-can-only-root-chown-files_003f The 'cp -a' option says: `-a' `--archive' Preserve as much as possible of the structure and attributes of the original files in the copy ... It is not possible to preserve the ownership of a file unless you are root. Therefore cp is preserving "as much as possible". > 2. Many commands act recursively on a directory with an -R option > that affects the directory and all the files it contains. > > There should be a > > ls -ld -R > > command that lists in detail the directory and its contents to > quickly check results in one step. The -R option is exactly the option you are asking for except you have explicitly blocked its action by adding the -d option. `-R' `--recursive' List the contents of all directories recursively. This does what you intend. `-d' `--directory' List just the names of directories, as with other types of files, rather than listing their contents. But you included the -d option that prevents it from recursing. > 3. If we have: > > drwx------ 2 user2 user2 392 2010-01-11 12:04 /home/user2/directory > > user1@mypc:~$ su -c 'chmod -R 644 /home/user2/directory' user2 > > doesn't work. You need to change the mode of the directory first and > then you can apply a recursive chmod. Is this a bug? Mode 644 isn't what you want for directories. That would remove the eXecute bit. The execute permission on a directory allows access to list the contents of the directory. If that permission is removed then the chmod command will not have access to list the directory contents. You probably want something that only affects files. Use find for that instead. Try something like this: su -c 'find /home/user2/directory -type f -exec chmod 644 {} +' user2 > Many thanx for many things. When reporting bugs (or at least when reporting what you are thinking is a bug :-) it is best to report only one item at a time. Mixing several items together causes all of them to be treated together as a group even if they are individually separate. Since none of these were bugs I am going to go ahead and mark it as being closed in the bug tracker. Feel free to follow-up normally if you have more information. In the future for general help with the utilities you might want to ask general help questions in the help-gnu-utils@gnu.org mailing list. Bob ------------=_1274556901-28764-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 May 2010 07:26:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFj6o-0000Zv-8g for submit@debbugs.gnu.org; Sat, 22 May 2010 03:26:58 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFj00-0000WN-ME for submit@debbugs.gnu.org; Sat, 22 May 2010 03:19:57 -0400 Received: from lists.gnu.org ([199.232.76.165]:59441) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OFizx-00065U-Fa for submit@debbugs.gnu.org; Sat, 22 May 2010 03:19:53 -0400 Received: from [140.186.70.92] (port=58291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFizl-0004GP-W7 for bug-coreutils@gnu.org; Sat, 22 May 2010 03:19:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFizd-0001S8-Fp for bug-coreutils@gnu.org; Sat, 22 May 2010 03:19:41 -0400 Received: from web57701.mail.re3.yahoo.com ([68.142.236.53]:48289) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OFizd-0001Rm-97 for bug-coreutils@gnu.org; Sat, 22 May 2010 03:19:33 -0400 Received: (qmail 63068 invoked by uid 60001); 22 May 2010 07:19:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1274512770; bh=QQ1sV2KASBKGxOQLtJ3/kzNHA4hn486I1gepzwAoE2k=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=O1yb883Rp7R5Yegiquow6ByY0AOYaCqf8qjzgOjmEJHu3FlD9+gxGJpla85Ckquf3HKM2+5ybK0ycRICvzxUEII/m5FjLDY8KxPbbh7B9kkoiklkPz+IVoxJ6mkuzXm8SkYKbbb492iOgo9Cmi+ne2ySXVf4LLXoF3INQRbKA1k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=AvAte6oCtAVhjiplk9JSL0C6xlttaqsu7aEAmoa2IjO7f8liUZP62YPZi/e42DC1oWifywtYYkY1oWZVnE3VFrVhdsK+xgbRMhFZ50BZg35p0x4vU8yFedrLO8rT9M9sBGGcBGAgabYRAE8HXC9gwrWTYjkhxttWCs/wSTkjET8=; Message-ID: <721537.61727.qm@web57701.mail.re3.yahoo.com> X-YMail-OSG: T7xfr90VM1mocEbtznHtF37LnLphARfBlcgoTrPQQN6GsxW LyDSQhSJR2Q2ogmvy3WajeUIhrtBZAoyQ8tHoyubMPdUA1wR0BdB.47vpUpz DNIaQSD4MoCqPM5Kmc6BU7.OlIU.qkpaclrn._KBoEKfIpevxL88Fb2S2q_J FABcKiE6EO.sh1y7IHozAhJDRGipv5yWfwWc3jKrgiBeAv2VHiy7LTLb.ReF P2_NF0SQ7HG3bX7oYBPJm1Csrk715Ss6Ze.eEPOujBeg3VDHk7naq8GPjfC3 daeTnULc7NIAe Received: from [87.221.191.50] by web57701.mail.re3.yahoo.com via HTTP; Sat, 22 May 2010 00:19:30 PDT X-Mailer: YahooMailClassic/11.0.8 YahooMailWebService/0.8.103.269680 Date: Sat, 22 May 2010 00:19:30 -0700 (PDT) From: "estonoeshawaii@yahoo.com" Subject: cp - copy files and directories, ls -Rld, chmod To: bug-coreutils@gnu.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-526870909-1274512770=:61727" X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 22 May 2010 03:26:57 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --0-526870909-1274512770=:61727 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, 1. The copy command=A0 cp -a -a, --archive =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 same as -dpR -p=A0=A0=A0=A0 same as --preserve=3Dmode,ownership,timestamps is not doing what it is supposed to do (and thats is fine, of course), beca= use It does not preserve ownership (except if you are root) . The problem i= s that it doesn't tell you anything when it doesn't do it or that It should= n't be supposed to preserve ownership. ------------------- 2. Many commands act recursively on a directory with an -R option that affe= cts the directory and all the files it contains. There should be a ls -ld -R command that lists in detail the directory and its contents to quickly chec= k results in one step. -------------------------------- 3. If we have: drwx------ 2 user2 user2=A0 392 2010-01-11 12:04 /home/user2/directory user1@mypc:~$ su=A0 -c 'chmod -R 644 /home/user2/directory' user2 doesn't work. You need to change the mode of the directory first and then y= ou can apply a recursive chmod. Is this a bug? Many thanx for many things. :-) =0A=0A=0A --0-526870909-1274512770=:61727 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

1. The copy comma= nd  cp -a


-a, --archive
  =             same as = -dpR

-p     same as --preserve=3Dmode,ownership,= timestamps


is not doing what it is supposed = to do (and thats is fine, of course), because It do= es not preserve ownership (except if you are root) . The problem is that it= doesn't tell you anything when it doesn't do it or that It shouldn't be su= pposed to preserve ownership.
------------------= -
2. Many commands act recursively on a directory with an -R option that= affects the directory and all the files it contains.

There should b= e a

ls -ld -R

command that lists in detail the directory and = its contents to quickly check results in one step.
--------------------------------
= 3. If we have:

drwx------ 2 user2 user2  392 2010-01-11 12:04 /home/user= 2/directory

user1@mypc:~$= su  -c 'chmod -R 644 /home/user2/directory' user2

doesn= 't work. You need to change the mode of the directory first and then you ca= n apply a recursive chmod. Is this a bug?

Many thanx for many things= .
:-)


=0A=0A=0A=0A=0A=0A=0A=0A --0-526870909-1274512770=:61727-- ------------=_1274556901-28764-1-- From unknown Sat Sep 06 14:23:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6245: cp - copy files and directories, ls -Rld, chmod Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 22 May 2010 23:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6245 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 6245@debbugs.gnu.org, bob@proulx.com Received: via spool by 6245-submit@debbugs.gnu.org id=B6245.12745721813275 (code B ref 6245); Sat, 22 May 2010 23:50:03 +0000 Received: (at 6245) by debbugs.gnu.org; 22 May 2010 23:49:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFyRo-0000qm-JX for submit@debbugs.gnu.org; Sat, 22 May 2010 19:49:40 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OFyRm-0000qh-2R for 6245@debbugs.gnu.org; Sat, 22 May 2010 19:49:38 -0400 Received: (qmail 12618 invoked from network); 22 May 2010 23:49:33 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 22 May 2010 23:49:33 -0000 Message-ID: <4BF86CF4.2080803@draigBrady.com> Date: Sun, 23 May 2010 00:47:00 +0100 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 References: <721537.61727.qm@web57701.mail.re3.yahoo.com> <20100522193400.GA12512@dementia.proulx.com> In-Reply-To: <20100522193400.GA12512@dementia.proulx.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) On 22/05/10 20:34, Bob Proulx wrote: > estonoeshawaii@yahoo.com wrote: >> course), because It does not preserve ownership (except if you are >> root) . The problem is that it doesn't tell you anything when it >> doesn't do it or that It shouldn't be supposed to preserve >> ownership. > > This is related to this FAQ entry. It explains why only root can > chown files. > > http://www.gnu.org/software/coreutils/faq/#Why-can-only-root-chown-files_003f > > The 'cp -a' option says: > > `-a' > `--archive' > Preserve as much as possible of the structure and attributes of the > original files in the copy ... > > It is not possible to preserve the ownership of a file unless you are > root. Therefore cp is preserving "as much as possible". I noticed myself that `cp --preserve=owner` does not give an error when running as non root. A pertinent comment from the source: /* If non-root uses -p, it's ok if we can't preserve ownership. But root probably wants to know, e.g. if NFS disallows it, or if the target system doesn't support file ownership. */ Perhaps if "owner" is explicitly specified they we should warn? I'm not sure it's worth diverging the warning characteristics for this though. cheers, Pádraig. From unknown Sat Sep 06 14:23:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6245: cp - copy files and directories, ls -Rld, chmod Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 23 May 2010 01:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6245 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 6245@debbugs.gnu.org Received: via spool by 6245-submit@debbugs.gnu.org id=B6245.12745764365266 (code B ref 6245); Sun, 23 May 2010 01:01:01 +0000 Received: (at 6245) by debbugs.gnu.org; 23 May 2010 01:00:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFzYS-0001Mt-Jx for submit@debbugs.gnu.org; Sat, 22 May 2010 21:00:36 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFzYQ-0001Mo-E3 for 6245@debbugs.gnu.org; Sat, 22 May 2010 21:00:35 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id 21E7A21363 for <6245@debbugs.gnu.org>; Sat, 22 May 2010 19:00:30 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id 18EA23CC3A1; Sat, 22 May 2010 19:00:30 -0600 (MDT) Date: Sat, 22 May 2010 19:00:30 -0600 From: Bob Proulx Message-ID: <20100523010030.GA17352@dementia.proulx.com> References: <721537.61727.qm@web57701.mail.re3.yahoo.com> <20100522193400.GA12512@dementia.proulx.com> <4BF86CF4.2080803@draigBrady.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4BF86CF4.2080803@draigBrady.com> User-Agent: Mutt/1.5.18 (2008-05-17) Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) P=E1draig Brady wrote: > I noticed myself that `cp --preserve=3Downer` does not give an > error when running as non root. A pertinent comment from the source: >=20 > /* If non-root uses -p, it's ok if we can't preserve ownership. > But root probably wants to know, e.g. if NFS disallows it, > or if the target system doesn't support file ownership. */ >=20 > Perhaps if "owner" is explicitly specified they we should warn? > I'm not sure it's worth diverging the warning characteristics > for this though. I don't know. I am not sure I am either for it or against it. It seems defensible that --preserve=3Downer should produce a diagnostic if it can't actually set the owner. I couldn't oppose it. And some traditional systems such as SysV do allow giving away file ownership. I know you are not talking about cp -a but I wanted to say that I often use cp -a to copy files not owned by me into my directory to make a working copy that I can change. If it started to produce errors or warnings that would be bad. I certainly think that behavior shouldn't change or it would create a large problem for users. Bob