                                                                                                                                                                                                                                                               
Delivered-To: ethersoft@gmail.com
Received: by 10.78.138.9 with SMTP id l9cs1132821hud;
        Mon, 1 Jan 2007 16:18:50 -0800 (PST)
Received: by 10.70.74.1 with SMTP id w1mr20141620wxa.1167697130104;
        Mon, 01 Jan 2007 16:18:50 -0800 (PST)
Return-Path: <acs@alumni.princeton.edu>
Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102])
        by mx.google.com with ESMTP id h12si27769307wxd.2007.01.01.16.18.49;
        Mon, 01 Jan 2007 16:18:50 -0800 (PST)
Received-SPF: neutral (google.com: 207.172.157.102 is neither permitted nor denied by best guess record for domain of acs@alumni.princeton.edu)
Received: from ms04.lnh.mail.rcn.net ([207.172.157.84])
  by smtp02.lnh.mail.rcn.net with ESMTP; 01 Jan 2007 19:18:49 -0500
Received: from localhost (localhost [127.0.0.1])
	by ms04.lnh.mail.rcn.net (MOS 3.7.5a-GA)
	id CQL24978;
	Mon,  1 Jan 2007 19:18:48 -0500 (EST)
Received: from mr04.lnh.mail.rcn.net (EHLO mr04.lnh.mail.rcn.net) ([207.172.157.24])
	by ms04.lnh.mail.rcn.net (MOS 3.7.5a-GA FastPath queued)
	with ESMTP id CQL24976;
	Mon, 01 Jan 2007 19:18:48 -0500 (EST)
Received: from mx05.lnh.mail.rcn.net (mx05.lnh.mail.rcn.net [207.172.157.55])
	by mr04.lnh.mail.rcn.net (MOS 3.7.5a-GA)
	with ESMTP id MQO89026;
	Mon, 1 Jan 2007 19:18:47 -0500 (EST)
Received: from gwyn.tux.org ([207.172.156.132])
  by mx05.lnh.mail.rcn.net with ESMTP; 01 Jan 2007 19:18:47 -0500
Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102])
	by gwyn.tux.org (8.12.11/8.12.11) with ESMTP id l020IkRT032438
	for <acs@xemacs.org>; Mon, 1 Jan 2007 19:18:46 -0500
Received: from mr02.lnh.mail.rcn.net ([207.172.157.22])
  by smtp02.lnh.mail.rcn.net with ESMTP; 01 Jan 2007 19:18:46 -0500
Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11])
	by mr02.lnh.mail.rcn.net (MOS 3.7.5a-GA)
	with ESMTP id MSL34485;
	Mon, 1 Jan 2007 19:18:44 -0500 (EST)
Received: from 65-78-15-41.c3-0.nwt-ubr2.sbo-nwt.ma.cable.rcn.com (HELO samwise.rcn.com) ([65.78.15.41])
  by smtp01.lnh.mail.rcn.net with ESMTP; 01 Jan 2007 19:18:45 -0500
Received: by samwise.rcn.com (Postfix, from userid 1000)
	id 79B8B6C20C; Mon,  1 Jan 2007 19:18:46 -0500 (EST)
To: acs@xemacs.org
Subject: benson patch
From: Vin Shelton <acs@alumni.princeton.edu>
Organization: EtherSoft, Inc
Date: Mon, 01 Jan 2007 19:18:46 -0500
Message-ID: <87ps9ygu1l.fsf@alumni.princeton.edu>
Lines: 43
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-1.6 (gwyn.tux.org [207.172.156.133]); Mon, 01 Jan 2007 19:18:46 -0500 (EST)
X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on gwyn.tux.org
X-Virus-Status: Clean
X-Junkmail-Status: score=10/50, host=mr04.lnh.mail.rcn.net
X-Junkmail-SD-Raw: score=unknown,
	refid=str=0001.0A090209.4599A347.006D,ss=1,fgs=0,
	ip=207.172.156.132,
	so=2006-05-09 23:27:51,
	dmn=5.2.125/2006-10-10
X-Mirapoint-Loop-Id: d19629265f8a561b05b595a46890c624


Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.290.2.116
diff -a -u -u -0 -r1.290.2.116 ChangeLog
--- src/ChangeLog	2006/12/10 00:14:52	1.290.2.116
+++ src/ChangeLog	2007/01/02 00:16:10
@@ -0,0 +1,7 @@
+2006-12-25  Benson I. Margulies  <benson@dchbk.us>
+
+	* src/fileio.c (check_writable): 
+        Cope with the fact that the read-only attribute trumps Windows NTFS
+        ACLS.
+
+
Index: src/fileio.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.66.2.8
diff -a -u -r1.66.2.8 fileio.c
--- src/fileio.c	2006/11/20 18:20:22	1.66.2.8
+++ src/fileio.c	2007/01/02 00:16:19
@@ -2307,13 +2307,17 @@
   filename = filename_buffer;
 #endif
 
+  // ask simple question first
+  attributes = GetFileAttributes(filename);
+  if (0 != (attributes & FILE_ATTRIBUTE_READONLY))
+      return 0;
+
   /* Win32 prototype lacks const. */
   error = GetNamedSecurityInfo((LPTSTR)filename, SE_FILE_OBJECT, 
                                DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
                                &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
   if (error != ERROR_SUCCESS) { // FAT?
-    attributes = GetFileAttributes(filename);
-    return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
+      return 1;
   }
 
   genericMapping.GenericRead = FILE_GENERIC_READ;
