Commit a560b856 authored by Paul Eggert's avatar Paul Eggert

Plain copy-file no longer chmods an existing destination.

* doc/lispref/files.texi (Changing Files): Document this.
* etc/NEWS: Document this.
* src/fileio.c (realmask): Now a static var, not a local.
(barf_or_query_if_file_exists): New arg KNOWN_TO_EXIST.
Remove arg STATPTR.  All uses changed.
(Fcopy_file): Do not alter permissions of existing destinations,
unless PRESERVE-PERMISSIONS (renamed from
PRESERVE-EXTENDED-ATTRIBUTES) is non-nil.
Avoid race when testing for existing destinations and for
when input and output files are the same.
If changing the group fails, adjust both default and
preserved permissions so that access is not granted to the
wrong group.
(Fset_default_file_modes, init_fileio): Update realmask.
(Fdefault_file_modes): Use realmask instead of calling umask.

Fixes: debbugs:16133
parent 830506d9
2013-12-29 Paul Eggert <eggert@cs.ucla.edu>
Plain copy-file no longer chmods an existing destination (Bug#16133).
* files.texi (Changing Files): Document this.
2013-12-28 Chong Yidong <cyd@gnu.org>
* modes.texi (Auto Major Mode): Document interpreter-mode-alist
......
......@@ -1563,8 +1563,6 @@ some operating systems.) If setting the time gets an error,
interactive call, a prefix argument specifies a non-@code{nil} value
for @var{time}.
This function copies the file modes, too.
If argument @var{preserve-uid-gid} is @code{nil}, we let the operating
system decide the user and group ownership of the new file (this is
usually set to the user running Emacs). If @var{preserve-uid-gid} is
......@@ -1572,10 +1570,11 @@ non-@code{nil}, we attempt to copy the user and group ownership of the
file. This works only on some operating systems, and only if you have
the correct permissions to do so.
If the optional argument @var{preserve-extended-attributes} is
non-@code{nil}, and Emacs has been built with the appropriate support,
this function attempts to copy the file's extended attributes, such as
its SELinux context and ACL entries (@pxref{File Attributes}).
If the optional argument @var{preserve-permissions} is non-@code{nil},
this function copies the file's permissions, such as its file modes,
its SELinux context, and ACL entries (@pxref{File Attributes}).
Otherwise, if the destination is created its file permission bits are
those of the source, masked by the default file permissions.
@end deffn
@deffn Command make-symbolic-link filename newname &optional ok-if-exists
......
2013-12-29 Paul Eggert <eggert@cs.ucla.edu>
Plain copy-file no longer chmods an existing destination (Bug#16133).
* NEWS: Document this.
2013-12-26 João Távora <joaotavora@gmail.com>
* NEWS: Describe new features of Electric Pair mode.
......
......@@ -952,6 +952,12 @@ alist of extended attributes as returned by the new function
`file-extended-attributes'. The attributes can be applied to another
file using `set-file-extended-attributes'.
** By default `copy-file' no longer copies file permission bits to an
existing destination; and it sets the file permission bits of a newly
created destination to those of the source, masked by the default file
permissions. To copy the file permission bits, pass t as the
PRESERVE-PERMISSIONS argument of `copy-file'.
+++
** `visited-file-modtime' now returns -1 for nonexistent files.
Formerly it returned a list (-1 LOW USEC PSEC), but this was ambiguous
......@@ -1100,8 +1106,8 @@ platforms, and nobody seems to have noticed or cared.
+++
*** The 6th argument to `copy-file' has been renamed to
PRESERVE-EXTENDED-ATTRIBUTES as it now handles both SELinux context
and ACL entries.
PRESERVE-PERMISSIONS as it now handles ACL entries and the traditional
Unix file permission bits as well as SELinux context.
+++
*** The function `file-ownership-preserved-p' now has an optional
......
2013-12-29 Paul Eggert <eggert@cs.ucla.edu>
Plain copy-file no longer chmods an existing destination (Bug#16133).
* fileio.c (realmask): Now a static var, not a local.
(barf_or_query_if_file_exists): New arg KNOWN_TO_EXIST.
Remove arg STATPTR. All uses changed.
(Fcopy_file): Do not alter permissions of existing destinations,
unless PRESERVE-PERMISSIONS (renamed from
PRESERVE-EXTENDED-ATTRIBUTES) is non-nil.
Avoid race when testing for existing destinations and for
when input and output files are the same.
If changing the group fails, adjust both default and
preserved permissions so that access is not granted to the
wrong group.
(Fset_default_file_modes, init_fileio): Update realmask.
(Fdefault_file_modes): Use realmask instead of calling umask.
2013-12-28 Paul Eggert <eggert@cs.ucla.edu>
Fix pipe bug with OS X emacs --daemon (Bug#16262).
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment