GNU bug report logs - #9002
file-error Doing chown operation not permitted

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Tue, 5 Jul 2011 13:06:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 9002 <at> debbugs.gnu.org
Subject: Re: bug#9002: file-error Doing chown operation not permitted
Date: Sat, 16 Jul 2011 18:21:15 -0700
On 07/16/11 14:59, Paul Eggert wrote:
> copy-file's help string says "try to
> transfer the uid and gid", with the implication that it's OK
> if the attempt fails and no diagnosis should be made.

In further building/testing I ran into a problem with that patch:
it runs afoul of fchown's __attribute__((warn_unused_result)) in
recent glibc versions.  I've installed the following further patch
to address this:

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2011-07-16 23:40:44 +0000
+++ src/ChangeLog	2011-07-17 01:18:51 +0000
@@ -1,3 +1,11 @@
+2011-07-17  Paul Eggert  <eggert <at> cs.ucla.edu>
+
+	* fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
+	This works around a problem with the previous change to Fcopy_file.
+	Recent glibc declares fchown with __attribute__((warn_unused_result)),
+	and without this change, GCC might complain about discarding
+	fchown's return value.
+
 2011-07-16  Juanma Barranquero  <lekktu <at> gmail.com>
 
 	* makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).

=== modified file 'src/fileio.c'
--- src/fileio.c	2011-07-16 21:53:38 +0000
+++ src/fileio.c	2011-07-17 01:18:51 +0000
@@ -38,6 +38,8 @@
 #include <selinux/context.h>
 #endif
 
+#include <ignore-value.h>
+
 #include "lisp.h"
 #include "intervals.h"
 #include "buffer.h"
@@ -1960,7 +1962,7 @@
   if (input_file_statable_p)
     {
       if (!NILP (preserve_uid_gid))
-	fchown (ofd, st.st_uid, st.st_gid);
+	ignore_value (fchown (ofd, st.st_uid, st.st_gid));
       if (fchmod (ofd, st.st_mode & 07777) != 0)
 	report_file_error ("Doing chmod", Fcons (newname, Qnil));
     }





This bug report was last modified 13 years and 315 days ago.

Previous Next


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