From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9002: file-error Doing chown operation not permitted Date: Sat, 16 Jul 2011 18:21:15 -0700 Organization: UCLA Computer Science Department Message-ID: <4E22390B.4010009@cs.ucla.edu> References: <878vscopig.fsf@jidanni.org> <4E2209AE.1050808@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1310865748 27654 80.91.229.12 (17 Jul 2011 01:22:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2011 01:22:28 +0000 (UTC) Cc: 9002@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 17 03:22:22 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QiG3p-0003JH-Nm for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jul 2011 03:22:21 +0200 Original-Received: from localhost ([::1]:33034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiG3n-0000TQ-7K for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jul 2011 21:22:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiG3Y-0000TB-76 for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2011 21:22:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QiG3X-0002AB-5C for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2011 21:22:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiG3X-0002A7-2M for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2011 21:22:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QiG3W-0001IB-Fy; Sat, 16 Jul 2011 21:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jul 2011 01:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9002 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9002-submit@debbugs.gnu.org id=B9002.13108656904927 (code B ref 9002); Sun, 17 Jul 2011 01:22:02 +0000 Original-Received: (at 9002) by debbugs.gnu.org; 17 Jul 2011 01:21:30 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QiG2z-0001HQ-2X for submit@debbugs.gnu.org; Sat, 16 Jul 2011 21:21:29 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QiG2w-0001HC-Hz for 9002@debbugs.gnu.org; Sat, 16 Jul 2011 21:21:27 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id BD9C539E80F2 for <9002@debbugs.gnu.org>; Sat, 16 Jul 2011 18:21:20 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bz5NhP6mLTRW for <9002@debbugs.gnu.org>; Sat, 16 Jul 2011 18:21:20 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5010439E80F0 for <9002@debbugs.gnu.org>; Sat, 16 Jul 2011 18:21:20 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 In-Reply-To: <4E2209AE.1050808@cs.ucla.edu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 16 Jul 2011 21:22:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:49304 Archived-At: 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 + + * 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 * 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 #endif +#include + #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)); }