--- Begin Message ---
Subject: |
copy-file should report chmod or chown failure |
Date: |
Sun, 20 Mar 2011 19:47:51 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
On the Emacs trunk, (copy-file A B) does not report
an error if A's permissions cannot be copied to B's,
and (copy-file A B nil nil t) does not report an
error if A's ownership info cannot be copied to B's.
I plan to install the following patch so that Emacs
reports errors in these cases.
* fileio.c (Fcopy_file): Report error if fchown or fchmod fail.
=== modified file 'src/fileio.c'
--- src/fileio.c 2011-03-15 21:14:06 +0000
+++ src/fileio.c 2011-03-21 02:38:48 +0000
@@ -1951,9 +1951,10 @@
owner and group. */
if (input_file_statable_p)
{
- if (! NILP (preserve_uid_gid))
- fchown (ofd, st.st_uid, st.st_gid);
- fchmod (ofd, st.st_mode & 07777);
+ if (!NILP (preserve_uid_gid) && fchown (ofd, st.st_uid, st.st_gid) != 0)
+ report_file_error ("Doing chown", Fcons (newname, Qnil));
+ if (fchmod (ofd, st.st_mode & 07777) != 0)
+ report_file_error ("Doing chmod", Fcons (newname, Qnil));
}
#endif /* not MSDOS */
--- End Message ---
--- Begin Message ---
Subject: |
fix merged to trunk |
Date: |
Wed, 23 Mar 2011 15:06:46 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 |
I committed a fix to the trunk for this,
as part of a recent merge (bzr 103721).
--- End Message ---