<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/cp, branch v7.3</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v7.3</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v7.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-04-28T09:16:33Z</updated>
<entry>
<title>tests: ensure that cp's -a doesn't silence --preserve=context</title>
<updated>2009-04-28T09:16:33Z</updated>
<author>
<name>Ondřej Vašík</name>
<email>ovasik@redhat.com</email>
</author>
<published>2009-04-27T15:29:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=cb9fd937437cf4f9347925f6b9c82f4e92bae6e5'/>
<id>urn:sha1:cb9fd937437cf4f9347925f6b9c82f4e92bae6e5</id>
<content type='text'>
* tests/cp/cp-a-selinux: Ensure that the -a option does not silence
error diagnostics from --preserve=context, when preserving context
is required.
</content>
</entry>
<entry>
<title>tests: add test for xattr diagnostics on dest. FS lacking xattr support</title>
<updated>2009-04-28T09:16:29Z</updated>
<author>
<name>Ondřej Vašík</name>
<email>ovasik@redhat.com</email>
</author>
<published>2009-04-27T15:20:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8259a73a85c5ef46c26da27f9424aeed360fa2cd'/>
<id>urn:sha1:8259a73a85c5ef46c26da27f9424aeed360fa2cd</id>
<content type='text'>
* tests/cp/cp-mv-enotsup-xattr: Ensure that xattr diagnostics are
displayed correctly when destination filesystem lacks xattr support.
* tests/Makefile.am (root_tests): Add new root-only test.
</content>
</entry>
<entry>
<title>cp: work around linux kernel bug: short-read != EOF on /proc</title>
<updated>2009-04-22T19:52:11Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-04-17T16:44:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c74fbaefebe91ca60e3a8582613a3714c740df65'/>
<id>urn:sha1:c74fbaefebe91ca60e3a8582613a3714c740df65</id>
<content type='text'>
Remove the optimization that avoided up to 50% of cp's read syscalls.
Do not assume that a short read on a regular file indicates EOF.
When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29]
into a 4k-byte buffer or larger, a short read does not
always indicate EOF.  For example, "cp /proc/slabinfo /tmp"
copies only 4068 of the total 7493 bytes.  This optimization
(25719a33154f0c62ea9881f0c79ae312dd4cec7a, Improve performance a bit
by optimizing away; 2005-11-24) appears to have been worth less than
a 2% speed-up (and usually much less), so the impact of removing it
is negligible.

* src/copy.c (copy_reg): Don't exit the loop early.
* tests/cp/proc-short-read: New test, lightly based on a suggestion
from Mike Frysinger, to exercise this fix.
* tests/Makefile.am (TESTS): Add cp/proc-short-read.
* NEWS (Improve robustness): Mention this change.
</content>
</entry>
<entry>
<title>tests: migrate setgid-check into test-lib.sh</title>
<updated>2009-03-27T08:28:08Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-03-27T08:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e65d0d0525159f963b3b859706dc920bcae0a636'/>
<id>urn:sha1:e65d0d0525159f963b3b859706dc920bcae0a636</id>
<content type='text'>
* tests/test-lib.sh (skip_if_setgid_): New function.
* tests/setgid-check: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove setgid-check.
* tests/chmod/c-option: Use the new function rather than sourcing
the separate file.
* tests/cp/cp-parents: Likewise.
* tests/install/install-C: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
</content>
</entry>
<entry>
<title>cp: diagnose invalid "cp -rl dir dir" right away, once again</title>
<updated>2009-02-27T10:44:26Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-02-27T08:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b50a4ae557d6ac479e659f685c8a8ff909e09393'/>
<id>urn:sha1:b50a4ae557d6ac479e659f685c8a8ff909e09393</id>
<content type='text'>
Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/...
rather than diagnosing the "copy-into-self" failure.

The easy fix would have been to revert this part of the change
[3ece0355 2008-11-09 cp: use far less memory in some cases]
that introduced the bug:

-         remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+         if (!x-&gt;hard_link)
+           remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);

However, that would have induced the failure of the new cp/link-heap
test, due to the added memory pressure of recording 10k dev/ino pairs.
And besides, I liked that improvement and wanted to keep it.

Now that it's obvious recording the just-created-directory dev/ino
needn't depend on the setting of hard_link, I realized it is necessary
to record the pair only for the first directory created for each
source command-line argument.

I made that change, then noticed the new test, cp -rl a d d, would pass
when run once, yet output the into-self diagnostic twice.  Also note
the side effect: it creates d/a and d/d.  However, running that same
command a second time, now with the modified directory, would fail.

That turned out to be due to the fact that although the first into-self
failure was detected in copy_dir, that function would continue copying
other entries regardless -- and that would make it fail (eventually)
with the unwanted recursion.

* src/copy.c (copy_internal): This function needed an indicator of
whether, for a give command line argument, it had already created its
first directory.  If so, no more need to record dev/ino pairs.  If this
is the first, then do record its pair.  Hence, the new parameter.
(copy_dir, copy): Update callers.
(copy_dir): Upon any into-self failure, break out of the loop.
* tests/cp/into-self: Test for the above.
Reported by Mikael Magnusson.
</content>
</entry>
<entry>
<title>cp: -a now preserves SELinux context, with reduced diagnostics</title>
<updated>2009-02-18T14:27:10Z</updated>
<author>
<name>Ondřej Vašík</name>
<email>ovasik@redhat.com</email>
</author>
<published>2009-02-17T14:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8c243ff965d477a89582a1b329923516a4d64668'/>
<id>urn:sha1:8c243ff965d477a89582a1b329923516a4d64668</id>
<content type='text'>
* copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'.
(copy_internal): Likewise
* copy.h (cp_options): Add boolean reduce_diagnostics.
* cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all.
(cp_option_init): Initialize added reduce_diagnostics.
(main): Add reduce_diagnostics for the -a option, and preserve SELinux
context, if possible.
* mv.c (cp_options_init): Initialize new cp_options booleans.
* install.c (cp_option_init): Likewise.
* NEWS: Mention those behaviour changes.
* doc/coreutils.texi: Document --preserve=context, document that
diagnostics are not shown for failures of non-mandatory attributes
(just SELinux at the moment).
* tests/cp/cp-a-selinux: Check not only failures, but succesful use
of preserving SELinux context in cp.
</content>
</entry>
<entry>
<title>add missing copyright dates</title>
<updated>2009-02-18T13:07:30Z</updated>
<author>
<name>Eric Blake</name>
<email>ebb9@byu.net</email>
</author>
<published>2009-02-18T13:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=86cef85b3671ed0a14a444eef3b6cb07fa26ee64'/>
<id>urn:sha1:86cef85b3671ed0a14a444eef3b6cb07fa26ee64</id>
<content type='text'>
* NEWS: Add 2009 to copyright.
* README: Likewise.
* README-hacking: Likewise.
* TODO: Likewise.
* doc/Makefile.am: Likewise.
* m4/prereq.m4: Likewise.
* src/nl.c: Likewise.
* src/seq.c: Likewise.
* tests/cp/cp-i: Likewise.
* tests/install/install-C: Likewise.
* tests/install/install-C-root: Likewise.
* tests/install/install-C-selinux: Likewise.
* tests/misc/seq: Likewise.
* tests/mv/mv-n: Likewise.
</content>
</entry>
<entry>
<title>cp/mv: add --no-clobber (-n) option to not overwrite target</title>
<updated>2009-01-14T08:09:22Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2009-01-13T17:35:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d01338eb3d30e5634f1b4d4179c229f54eea0b44'/>
<id>urn:sha1:d01338eb3d30e5634f1b4d4179c229f54eea0b44</id>
<content type='text'>
* src/cp.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* src/mv.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* doc/coreutils.texi: Document new cp/mv option -n.
* tests/cp/cp-i: Add tests for -f, -i and -n options.
* tests/mv/mv-n: New test for mv -n.
* tests/Makefile.am: Add test mv/mv-n to the list.
* NEWS: Mention the change.
</content>
</entry>
<entry>
<title>tests: avoid failure of cp/link-heap on some systems</title>
<updated>2008-11-30T18:15:51Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-24T09:03:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b5b3690d069b0bd4a1d561a8c1b527768d067b5d'/>
<id>urn:sha1:b5b3690d069b0bd4a1d561a8c1b527768d067b5d</id>
<content type='text'>
* tests/cp/link-heap: Raise virtual memory limit from 10,000
to 14,000, to avoid failure on Debian/unstable (libc6 2.7-16).
</content>
</entry>
<entry>
<title>cp: use far less memory in some cases</title>
<updated>2008-11-20T09:21:52Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-19T18:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3ece0355d52e41a1b079c0c46477a32250278c11'/>
<id>urn:sha1:3ece0355d52e41a1b079c0c46477a32250278c11</id>
<content type='text'>
cp --link was "remembering" many name,dev,inode triples unnecessarily.
cp was doing the same, even without --link, for every directory in the
source hierarchy, while it can do its job with entries merely for the
command-line arguments.  Prompted by a report from Patrick Shoenfeld.
Details &lt;http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/15081&gt;.
* src/copy.c (copy_internal): Refrain from remembering
name,dev,inode for most files, when invoked via cp --link.
Record an infloop-avoidance triple for each directory specified
on the command line, not for each directory in the source tree.
Don't record a dir-triple when x-&gt;hard_link is set.
* NEWS (Buf fixes): Mention it.
* tests/cp/link-heap: New file.  Test for cp's lowered memory usage.
* tests/Makefile.am (TESTS): Add link-heap.
</content>
</entry>
</feed>
