<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/copy.h, branch v7.2</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v7.2</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-02-18T14:27:10Z</updated>
<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>update copyright dates from recent changes</title>
<updated>2009-02-02T08:37:48Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-20T10:28:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=04d49874a23f40e38ba4f302b5b8025f43cba3c5'/>
<id>urn:sha1:04d49874a23f40e38ba4f302b5b8025f43cba3c5</id>
<content type='text'>
* src/dd.c: Add 2009 to list of copyright years.
* tests/dd/seek-skip-past-file: Likewise.
* tests/dd/seek-skip-past-dev: Likewise.
* m4/xattr.m4: Likewise.
* src/copy.h: Likewise.
</content>
</entry>
<entry>
<title>cp/mv: add xattr support</title>
<updated>2009-01-29T12:26:07Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2009-01-23T11:17:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0889381cbfdbb4895e6b8693d14c0f5c77bc85bc'/>
<id>urn:sha1:0889381cbfdbb4895e6b8693d14c0f5c77bc85bc</id>
<content type='text'>
This patch was originally written by Andreas GrÃ¼nbacher, nowadays
available at
http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff

* bootstrap.conf: Add gnulib module verror.
* po/POTFILES.in: Add lib/verror.c.
* m4/xattr.m4: Check for libattr availability, new configure option
--disable-xattr.
* m4/prereq.m4: Require gl_FUNC_XATTR.
* src/Makefile.am: Link cp, mv and ginstall with libattr.
* src/copy.h: Add preserve_xattr and require_preserve_xattr to
cp_options.
* src/copy.c (copy_attr_error): New function to handle errors during
xattr copying.
(copy_attr_quote): New function to quote file name in error messages
printed by libattr.
(copy_attr_free): Empty function requested by libattr to free quoted
string.
(copy_attr_by_fd): New fd-oriented function to copy xattr.
(copy_attr_by_name): New name-oriented function to copy xattr.
(copy_reg, copy_internal): Call copy_extended_attributes function.
* src/cp.c (usage): Mention new --preserve=xattr option.
(decode_preserve_arg): Handle new --preserve=xattr option.
* src/mv.c: Always attempt to preserve xattr.
* src/install.c: Never attempt to preserve xattr.
* tests/misc/xattr: New test for xattr support in cp, mv and install.
* tests/Makefile.am: Add the new test to list.
* doc/coreutils.texi: Mention xattr support, new --preserve=xattr
option.
* NEWS: Mention the change.
</content>
</entry>
<entry>
<title>reflect gnulib's removal of lstat.h</title>
<updated>2008-10-21T06:10:29Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-10-21T05:55:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=08c38ab7cbc0c6f3721885256ae3634f1e76f174'/>
<id>urn:sha1:08c38ab7cbc0c6f3721885256ae3634f1e76f174</id>
<content type='text'>
* src/copy.h: Don't include "lstat.h".
* src/ls.c: Likewise.
* src/remove.c: Likewise.
* src/rm.c: Likewise.
</content>
</entry>
<entry>
<title>Make copyright comments consistent.</title>
<updated>2008-02-28T18:53:07Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-02-24T14:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3bb1783158a2c71aa3c9ca0b52532e4295332ce9'/>
<id>urn:sha1:3bb1783158a2c71aa3c9ca0b52532e4295332ce9</id>
<content type='text'>
* src/mktemp.c: Update copyright to use newer form.

Make first copyright lines consistent. Some did not end in ", Inc.".
Due to that missing ", Inc" at end of line, emacs' copyright-updating
code missed some opportunities.  This corrects most of those, and
adds some mistakenly omitted years.
* src/chown-core.c: Adjust.
* src/chown-core.h: Likewise.
* src/copy.c: Likewise.
* src/copy.h: Likewise.
* src/cp-hash.c: Likewise.
* src/cp.c: Likewise.
* src/group-list.h: Likewise.
* src/mktemp.c: Likewise.
* src/stat.c: Likewise.
* tests/chmod/equal-x: Likewise.
* tests/dd/skip-seek: Likewise.
* tests/envvar-check: Likewise.
* tests/mv/into-self-2: Likewise.
</content>
</entry>
<entry>
<title>Fix a security race with "cp -p A B" when B already exists.</title>
<updated>2007-12-01T09:09:57Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2007-12-01T09:09:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b64119bc54791809b9fc3a225761b1c913fe66bc'/>
<id>urn:sha1:b64119bc54791809b9fc3a225761b1c913fe66bc</id>
<content type='text'>
* src/copy.h (struct cp_options): New member owner_privileges.
* src/copy.c (USE_ACL): Define to 0 if not defined, for convenience.
(owner_failure_ok): New function.
(set_owner): Avoid a security-related race by doing an extra chmod
first if it looks like there might be trouble right after a chown.
Accept a source struct stat rather than a uid and gid, and
accept a boolean NEW_DST and destination struct stat.
All callers changed.
* src/copy.h (cp_options_default): New function, replacing the
old chown_privileges.
* src/copy.c (cp_options_default): Likewise.
* src/cp.c (cp_option_init): Use it.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.
</content>
</entry>
<entry>
<title>cp: by default, refuse to copy through a dangling destination symlink</title>
<updated>2007-11-21T23:19:06Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2007-11-16T08:31:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2bdc48121916ab0d7bb7d0cb5cee25549c3705c9'/>
<id>urn:sha1:2bdc48121916ab0d7bb7d0cb5cee25549c3705c9</id>
<content type='text'>
* NEWS: Mention this change.
* doc/coreutils.texi (cp invocation): Describe the new behavior.
* src/copy.c: No longer include "canonicalize.h".
(copy_reg): Upon failure to open a dangling destination symlink, don't
canonicalize the name, but rather fail (default) or, with POSIXLY_CORRECT,
repeat the open call without O_EXCL (potentially dangerous).
* src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
New member.  Reorder the others, grouping "bool" and "enum"
members together.
* tests/cp/thru-dangling: Test for changed and new behavior.
* src/cp.c (cp_option_init): Initialize new member.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.

Signed-off-by: Jim Meyering &lt;meyering@redhat.com&gt;
</content>
</entry>
<entry>
<title>Update all copyright notices to use the newer form.</title>
<updated>2007-07-23T12:35:58Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2007-07-23T12:35:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=71aa3ea88084d17bcb4fc1031ad7b66f8647115e'/>
<id>urn:sha1:71aa3ea88084d17bcb4fc1031ad7b66f8647115e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Change "version 2" to "version 3" in all copyright notices.</title>
<updated>2007-07-10T11:35:56Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2007-07-10T10:21:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=33342c1a0a464f198df3f177432a0e98e482e7a4'/>
<id>urn:sha1:33342c1a0a464f198df3f177432a0e98e482e7a4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Correct cp's handling of destination symlinks in some cases.</title>
<updated>2007-06-15T20:47:16Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2007-06-15T20:47:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=cdec7e6e93db547a80525c24167345a090a00273'/>
<id>urn:sha1:cdec7e6e93db547a80525c24167345a090a00273</id>
<content type='text'>
* NEWS: "cp" no longer considers a destination symlink to be the
same as the referenced file when copying links or making backups.
* src/copy.c (copy_reg): When following a symlink, use the
followed name in later chown etc. requests, so that the created
file is affected, rather than the symlink.  Use O_NOFOLLOW on
source when not dereferencing symlinks; this avoids a race.
Preserve errno correctly when doing multiple open attempts on the
destination.
(copy_internal): Follow destination symlinks only when copying a
regular file and only when we don't intend to remove or rename the
destination first, regardless of whether following source
symlinks; this is because since POSIX and tradition (e.g.,
FreeBSD) say we should ordinarily follow destination symlinks if
the system calls would ordinarily do so.
* src/copy.h (struct cp_options): Add comment that 'dereference'
is only for source files.
* src/cp.c (usage): Note that --derereference etc. are only for
source files.
(make_dir_parents_private): Follow symlinks, regardless of whether
--dereference is specified, because these are destination symlinks.
* tests/cp/same-file: Adjust tests to match revised behavior.
Filter out perror output since it might vary from host to host.
Use sed alone instead of also using echo.

* doc/coreutils.texi (cp invocation): Document the behavior better when
the destination is a symlink.  Clarify source versus destination
symlinks.  Describe the new behavior for destination symlinks.

2007-06-15  Jim Meyering  &lt;jim@meyering.net&gt;

* src/copy.c: Include "canonicalize.h".
(copy_reg): Use canonicalize_filename_mode to follow the symlink,
so that we can always open with O_EXCL and avoid a race.
</content>
</entry>
</feed>
