* io.c (DeleteFile): Return ERROR_ACCESS_DENIED if the file is
readonly. Fixes bug 378229.
svn path=/trunk/mono/; revision=101040
+2008-04-17 Dick Porter <dick@ximian.com>
+
+ * io.c (DeleteFile): Return ERROR_ACCESS_DENIED if the file is
+ readonly. Fixes bug 378229.
+
2008-04-11 Geoff Norton <gnorton@novell.com>
* processes.c: The global extern environ doesn't exist on Mac. We
gchar *filename;
int retval;
gboolean ret = FALSE;
+ guint32 attrs;
if(name==NULL) {
#ifdef DEBUG
SetLastError (ERROR_INVALID_NAME);
return(FALSE);
}
+
+ attrs = GetFileAttributes (name);
+ if (attrs == INVALID_FILE_ATTRIBUTES) {
+#ifdef DEBUG
+ g_message ("%s: file attributes error", __func__);
+#endif
+ /* Error set by GetFileAttributes() */
+ return(FALSE);
+ }
+
+ if (attrs & FILE_ATTRIBUTE_READONLY) {
+#ifdef DEBUG
+ g_message ("%s: file %s is readonly", __func__, filename);
+#endif
+ SetLastError (ERROR_ACCESS_DENIED);
+ return(FALSE);
+ }
retval = _wapi_unlink (filename);