unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8306: copy-file should report chmod or chown failure
@ 2011-03-21  2:47 Paul Eggert
  2011-03-23 22:06 ` bug#8306: fix merged to trunk Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggert @ 2011-03-21  2:47 UTC (permalink / raw)
  To: 8306

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 */






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#8306: fix merged to trunk
  2011-03-21  2:47 bug#8306: copy-file should report chmod or chown failure Paul Eggert
@ 2011-03-23 22:06 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2011-03-23 22:06 UTC (permalink / raw)
  To: 8310-done, 8318-done, 8306-done, 8303-done, 8277-done, 8298-done,
	8290-done

I committed a fix to the trunk for this,
as part of a recent merge (bzr 103721).





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-23 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21  2:47 bug#8306: copy-file should report chmod or chown failure Paul Eggert
2011-03-23 22:06 ` bug#8306: fix merged to trunk Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).