From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Date: Tue, 13 Dec 2011 07:18:56 -0500 Message-ID: <4EE742B0.1080703@cornell.edu> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1323778796 14262 80.91.229.12 (13 Dec 2011 12:19:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2011 12:19:56 +0000 (UTC) Cc: 10257@debbugs.gnu.org To: jaalto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 13 13:19:51 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 1RaRKo-0006D6-Pg for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Dec 2011 13:19:51 +0100 Original-Received: from localhost ([::1]:40399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRKn-0000CP-47 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Dec 2011 07:19:49 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRKj-0000CG-UJ for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2011 07:19:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaRKi-0000xT-Os for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2011 07:19:45 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRKi-0000xP-NM for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2011 07:19:44 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RaRLy-0000JT-7J for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2011 07:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13237788241158 (code B ref 10257); Tue, 13 Dec 2011 12:21:02 +0000 Original-Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 12:20:24 +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 1RaRLL-0000Id-QR for submit@debbugs.gnu.org; Tue, 13 Dec 2011 07:20:24 -0500 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaRLI-0000IS-2s for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 07:20:21 -0500 Original-Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBDCJ0VJ016523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Dec 2011 07:19:01 -0500 (EST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <20111210095858.GA19881@cante.cante.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 13 Dec 2011 07:21:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:54914 Archived-At: On 12/10/2011 4:58 AM, jaalto wrote: > On 2011-12-09 15:33, Ken Brown wrote: > | > |>Here is an example under Cygwin Emacs: > |> > |> (file-attributes "/cygdrive/z/tmp/test-epackage.el") > |> => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 > |> 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) > |> > |>Under Cygwin Bash shell it looks like this: > |> > |> $ ls -la /cygdrive/z/tmp/test-epackage.el > |> -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el > |> > | > | Is there really a problem on *any* network drive, or is the issue > | that you have some particular file system on that drive for which > | Cygwin can't get reliable permission information? > > See above. The permissions from Cygwin shell look correct. It's the > UID, GID that don't translate back to windows, because this not a domain. > > | I would think that you should try to get help on the Cygwin list > | before talking about making emacs bypass permission checks on > | Cygwin. I don't use network drives myself, but I know that plenty > | of people do, and the Cygwin maintainers are very accommodating in > | trying to teach Cygwin to recognize problematic file systems. > | > | And if that fails, can't you solve the problem by mounting your > | drive with the noacl option? > > There are no problems under Cygwin. On Bash shell, all cp(1), mv(1) > and editors (nanoe, joe) write operations continue to work as usual. > > For some reason Emacs thinks that all files are write protected. emacs uses file-writable-p, which calls check_writable() (defined in fileio.c), which calls euidaccess(). That explains why emacs thinks the file is not writable when Cygwin can't determine the UID. It would certainly be possible to make check_writable() use a different method of determining writability on Cygwin, as it already does on MSDOS. But I still think it would be best to try to fix this in Cygwin first. > The Disk drive has been mapped with Standard Windows "Map network > drive" feature. So why don't you ask on the Cygwin list whether access() and euidaccess() can be taught to give the "right" answer for files on such drives. Or maybe the question is simply whether Cygwin can be taught to determine the correct UID. Ken