GNU bug report logs - #8306
copy-file should report chmod or chown failure

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 21 Mar 2011 02:49:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8306 in the body.
You can then email your comments to 8306 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8306; Package emacs. (Mon, 21 Mar 2011 02:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 21 Mar 2011 02:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: copy-file should report chmod or chown failure
Date: Sun, 20 Mar 2011 19:47:51 -0700
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 */





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 23 Mar 2011 22:07:12 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Wed, 23 Mar 2011 22:07:12 GMT) Full text and rfc822 format available.

Message #10 received at 8306-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 8310-done <at> debbugs.gnu.org, 8318-done <at> debbugs.gnu.org, 
	8306-done <at> debbugs.gnu.org, 8303-done <at> debbugs.gnu.org, 
	8277-done <at> debbugs.gnu.org, 8298-done <at> debbugs.gnu.org, 
	8290-done <at> debbugs.gnu.org, 8278-done <at> debbugs.gnu.org
Subject: fix merged to trunk
Date: Wed, 23 Mar 2011 15:06:46 -0700
I committed a fix to the trunk for this,
as part of a recent merge (bzr 103721).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Apr 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.