<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/cp, branch v8.22</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.22</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.22'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2013-12-13T02:28:47Z</updated>
<entry>
<title>tests: restrict cp --link inode comparisons to compatible systems</title>
<updated>2013-12-13T02:28:47Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-12-12T22:43:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=10ffe43d68f085995de5b95a8b301a9b7170eac2'/>
<id>urn:sha1:10ffe43d68f085995de5b95a8b301a9b7170eac2</id>
<content type='text'>
* tests/cp/link-deref.sh: On systems were cp can't determine if
gnulib linkat() emulation might create a symlink instead of a hardlink
to a symlink, copy.c will create a symlink to the symlink so that
it has more control over its metadata.  Also even if the system
supports this operation, the particular file system under test may not.
So avoid the hardlinked symlink verification in these cases.
This fixes a false failure on aix, solaris and freebsd.
</content>
</entry>
<entry>
<title>tests: avoid warnings due to new filefrag -v format</title>
<updated>2013-12-11T04:42:59Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-12-11T04:42:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b95aac31803e64c766f4f0a097938366c7e3cee1'/>
<id>urn:sha1:b95aac31803e64c766f4f0a097938366c7e3cee1</id>
<content type='text'>
* tests/cp/sparse-fiemap.sh: Newer versions of filefrag output
more fields, in different orders, so handle that to avoid warnings.
</content>
</entry>
<entry>
<title>tests: avoid problematic $(&lt; file) shell construct</title>
<updated>2013-12-07T19:41:55Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-12-07T15:36:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0917c0c345f5e3c8856e3f59177b58608c21c6ea'/>
<id>urn:sha1:0917c0c345f5e3c8856e3f59177b58608c21c6ea</id>
<content type='text'>
* tests/cp/link-deref.sh: This was seen to cause an issue
with dash v0.5.6 at least, so change to a simpler expression.
</content>
</entry>
<entry>
<title>selinux: adjust utils to run restorecon with -Z</title>
<updated>2013-11-27T14:19:32Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-27T12:26:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=7958a4a4fe234f9787daf178a60bc83449605dac'/>
<id>urn:sha1:7958a4a4fe234f9787daf178a60bc83449605dac</id>
<content type='text'>
cp, mv, install, mkdir, mkfifo, mknod are adjusted so that:
 -Z no longer accepts an argument.
 -Z or --context without an argument do not warn without SELinux.
 --context with an argument will warn without SELinux.

* src/local.mk: Reference the new selinux module where required.
* src/system.h: Make the argument to --context optional.
* src/mkdir.c: Likewise.  Also handle the SMACK case for --context.
Note we currently silently ignore -Z with SMACK.
* src/mkfifo.c: Likewise.
* src/mknod.c: Likewise.
* src/install.c: Likewise.  Note install(1) by default already
set the context for target files to their system default,
albeit with an older method.  Use the -Z option to select between
the old and new context restoration behavior, and document
the differences and details for how context restoration
is done in new and old methods, with a view disabling the
old method entirely in future.
* src/cp.c: Make the argument to --context optional.
Note -Z implies --no-preserve=context.  I.E. -Z overrides
that aspect of -a no matter what order specified.
(struct cp_options): Document the context handling options.
(main): Check/adjust option combinations after all
options are processed, to both simplify processing
and to make handling independent of order of options
on the command line.  Also improve the diagnostics
from a failed call to setfscreatecon().
(set_process_security_ctx): A new function,
refactored to set the default context from the source file,
or with the type adjusted as per the system default for
the destination path.
(set_file_security_ctx): A new function refactored to
set the security context of an existing file, either based on
the process context or the default system context for a path.
(copy_internal): Use the refactored functions to simplify
error handling and consistently fail or warn as needed.
(copy_reg): Likewise.
(copy_internal): With --preserve=context, also copy
context from non regular files.  Note for directories this may
impact the copying of subsequent files to that directory?
(copy_attr): If we're handling SELinux explicitly,
then exclude to avoid the redudant copy with --preserve=context,
and the problematic copy with -Z.  Note SELinux attribute exclusion
also now honors cp -a --no-preserve=context.  Note there was a
very small window over 10 years ago, where attr_copy_file was
available, while attr_copy_check_permissions was not, so we
don't bother adding an explicit m4 check for the latter function.
* src/mv.c: Support --context, but don't allow specifying an argument.
* src/chcon.c: Adjust a comment to be specific to SELinux.
* src/runcon.c: Likewise.
* src/copy.c: Honor the context settings to "restorecon" as appropriate.
* src/copy.h: Add a new setting to select "restorecon" functionality.
* tests/mkdir/selinux.sh: s/-Z/--context=/
* tests/cp/cp-a-selinux.sh: Augment this test with cases
testing basic -Z functionality, and also test the various
invalid option combinations and option precedence.
* tests/mkdir/restorecon.sh: Add a new test for the
more involved mkdir -Z handling, since the directory changing
and non existent directories need to be specially handled.
Also check the similar but simpler handling of -Z by mk{nod,fifo}.
* tests/local.mk: Reference the new test.
* doc/coreutils.texi (cp invocation): Update as per interface changes.
(mv invocation): Likewise.
(install invocation): Likewise.
(mkfifo invocation): Likewise.
(mknod invocation): Likewise.
(mkdir invocation): Likewise.
* NEWS: Mention the new feature and change in behavior.
</content>
</entry>
<entry>
<title>cp: fix --link regarding the dereferencing of symbolic links</title>
<updated>2013-11-07T22:45:22Z</updated>
<author>
<name>Gian Piero Carrubba</name>
<email>gpiero@rm-rf.it</email>
</author>
<published>2013-11-07T22:35:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=bf6bf52dce37832b03ecfbe1b3a3b104f532df42'/>
<id>urn:sha1:bf6bf52dce37832b03ecfbe1b3a3b104f532df42</id>
<content type='text'>
* src/copy.c (create_hard_link): Add a bool 'dereference' parameter,
and pass AT_SYMLINK_FOLLOW as 'flags' to linkat() when dereference
is true.
(should_dereference): Add new 'bool' function to determine if a
file should be dereferenced or not.
(copy_internal): Use the above new should_dereference() and remember
its return value in a new local bool 'dereference' variable.  Use that
in all three calls to create_hard_link().
* src/cp.c (main): after parsing the options, if x.dereference is
still DEFEF_UNDEFINED and the x.recursive is true, then only set
x.dereference to DEREF_NEVER iff --link was not specified.
* doc/coreutils.texi (cp invocation): Mention that cp(1) does not
follow symbolic links in the source when --link is specified.
Likewise in the description of the -R option when used together with
that option.
* tests/cp/same-file.sh: Adapt the expected results for the -fl,
the -bl and the -bfl tests.
* tests/cp/link-deref.sh: Add a new test.
* tests/local.mk (all_tests): Reference the above new test.
* NEWS (Changes in behavior): Mention the change.

This fixes http://bugs.gnu.org/15173

Co-authored-by: Bernhard Voelker &lt;mail@bernhard-voelker.de&gt;
</content>
</entry>
<entry>
<title>tests: fix usage of require_ulimit_</title>
<updated>2013-04-25T10:13:48Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-04-25T10:03:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=94f4f658f029f5d0083c6e8fab75d74b73ee5a33'/>
<id>urn:sha1:94f4f658f029f5d0083c6e8fab75d74b73ee5a33</id>
<content type='text'>
* init.cfg (require_ulimit_v_): Renamed from require_ulimit_
as this only checks for ulimit -v support.  Other uses of
ulimit -t and ulimit -n in tests shouldn't cause false failures
if not supported.
* cfg.mk (sc_prohibit_test_ulimit_without_require_): A new syntax check
to ensure that require_ulimit_v_() is used iff required.
* tests/misc/head-c.sh: Add missing call to require_ulimit_v_.
* tests/rm/many-dir-entries-vs-OOM.sh: Likewise.
* tests/split/r-chunk.sh: Remove non mandatory require_ulimit_ call.
* tests/misc/sort-merge-fdlimit.sh: Likewise.
* tests/cp/link-heap.sh: Adjust to renamed require_ulimit_v_.
* tests/dd/no-allocate.sh: Likewise.
* tests/misc/csplit-heap.sh: Likewise.
* tests/misc/cut-huge-to-eol-range.sh: Likewise.
* tests/misc/printf-surprise.sh: Likewise.
</content>
</entry>
<entry>
<title>tests: avoid shared lib tests on unsupported platforms</title>
<updated>2013-04-04T02:02:10Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-03-27T12:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e92d16f68a97575ed7112204b069514edc8d54a0'/>
<id>urn:sha1:e92d16f68a97575ed7112204b069514edc8d54a0</id>
<content type='text'>
* init.cfg (require_gcc_shared_): A new function to check
that we can build shared libraries in the particular manner
we use in our tests.
* tests/cp/nfs-removal-race.sh: Use require_gcc_shared_.
Then fail rather than skip, if the actual shared lib build fails.
* tests/df/no-mtab-status.sh: Likewise.
* tests/df/skip-duplicates.sh: Likewise.
* tests/ls/getxattr-speedup.sh: Likewise.
Reported in http://bugs.gnu.org/14024
</content>
</entry>
<entry>
<title>tests: avoid actual/expected mismatch due to changed diagnostic</title>
<updated>2013-02-07T19:02:45Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@fb.com</email>
</author>
<published>2013-02-07T17:43:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1f1f41db85c559285c9969e1a1a3430a872d0722'/>
<id>urn:sha1:1f1f41db85c559285c9969e1a1a3430a872d0722</id>
<content type='text'>
* tests/cp/fail-perm.sh: Adjust expected diagnostic to match
just-changed cp diagnostic.
* tests/ln/hard-to-sym.sh: Likewise.
* .mailmap: Also map my new address.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2013-01-01T03:51:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2013-01-01T02:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=77da73c75432f3c5b4beebae7b0797a1e33160bc'/>
<id>urn:sha1:77da73c75432f3c5b4beebae7b0797a1e33160bc</id>
<content type='text'>
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
</content>
</entry>
<entry>
<title>cp: fix --no-preserve=mode to not exit 1</title>
<updated>2012-12-08T18:09:19Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2012-12-08T18:09:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=62543570d72b756a3b04ca9d1ebec6f4dd2eea4b'/>
<id>urn:sha1:62543570d72b756a3b04ca9d1ebec6f4dd2eea4b</id>
<content type='text'>
cp --no-preserve=mode exited 1 unconditionally.  Furthermore,
the tests which would have detected this error - namely
link-preserve.sh and reserve-mode.sh - failed to test
cp's exit code.

* src/copy.c (copy_reg): In the case x-&gt;explicit_no_preserve_mode,
do only set return_val to false iff the previous set_acl ()
failed.
* tests/cp/link-preserve.sh: Check cp's exit code.
* tests/cp/link-symlink.sh: Likewise.
* tests/cp/preserve-mode.sh: Likewise.
* NEWS: Mention the fix.

Bug introduced in commit v8.19-145-g24ebca6.

Reported by Florian Pritz in http://bugs.gnu.org/13119.
</content>
</entry>
</feed>
