Mercurial > hg > xemacs-beta
changeset 3781:a257e03c580e
[xemacs-hg @ 2007-01-08 13:33:42 by vins]
On Windows, check read-only bit first.
author | vins |
---|---|
date | Mon, 08 Jan 2007 13:33:43 +0000 |
parents | 48cade988b67 |
children | be319d43a76b |
files | src/ChangeLog src/fileio.c |
diffstat | 2 files changed, 15 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Sun Jan 07 22:51:08 2007 +0000 +++ b/src/ChangeLog Mon Jan 08 13:33:43 2007 +0000 @@ -1,3 +1,7 @@ +2007-01-06 Vin Shelton <acs@xemacs.org> + + * fileio.c (check_writable): Check old-style readonly bit first. + 2006-12-21 Aidan Kehoe <kehoea@parhasard.net> * file-coding.c:
--- a/src/fileio.c Sun Jan 07 22:51:08 2007 +0000 +++ b/src/fileio.c Mon Jan 08 13:33:43 2007 +0000 @@ -2311,8 +2311,8 @@ PRIVILEGE_SET PrivilegeSet; DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET ); BOOL fAccessGranted = FALSE; - DWORD dwAccessAllowed; - Extbyte *fnameext; + DWORD dwAccessAllowed; + Extbyte *fnameext; #ifdef CYGWIN cygwin_conv_to_full_win32_path(filename, filename_buffer); @@ -2320,12 +2320,18 @@ #endif C_STRING_TO_TSTR(filename, fnameext); + + // First check for a normal file with the old-style readonly bit + attributes = qxeGetFileAttributes(fnameext); + if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY))) + return 0; + /* Win32 prototype lacks const. */ error = qxeGetNamedSecurityInfo(fnameext, SE_FILE_OBJECT, - DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, - &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc); + DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, + &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc); if(error != ERROR_SUCCESS) { // FAT? - attributes = qxeGetFileAttributes((Extbyte *)filename); + attributes = qxeGetFileAttributes(fnameext); return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY)); }