Skip to content

Commit

Permalink
Backport of r148474
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-6/mono/; revision=148475
  • Loading branch information
grendello committed Dec 15, 2009
1 parent c275283 commit 5d24e70
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,10 @@
2009-12-15 Marek Habersack <mhabersack@novell.com>

* appdomain.c (mono_make_shadow_copy): make sure access mode of
the target files is reset to writable by owner and readable by
everyone else to prevent problems when updating shadow copies of
files whose source is read-only. Fixes bug #556884

2009-12-14 Miguel de Icaza <miguel@novell.com>

* verify.c (mono_method_verify): The Unused opcodes produce an
Expand Down
12 changes: 12 additions & 0 deletions mono/metadata/appdomain.c
Expand Up @@ -1181,6 +1181,12 @@ shadow_copy_sibling (gchar *src, gint srclen, const char *extension, gchar *targ

DeleteFile (dest);
copy_result = CopyFile (orig, dest, FALSE);

/* Fix for bug #556884 - make sure the files have the correct mode so that they can be
* overwritten when updated in their original locations. */
if (copy_result)
copy_result = SetFileAttributes (dest, FILE_ATTRIBUTE_NORMAL);

g_free (orig);
g_free (dest);

Expand Down Expand Up @@ -1566,6 +1572,12 @@ mono_make_shadow_copy (const char *filename)
dest = g_utf8_to_utf16 (shadow, strlen (shadow), NULL, NULL, NULL);
DeleteFile (dest);
copy_result = CopyFile (orig, dest, FALSE);

/* Fix for bug #556884 - make sure the files have the correct mode so that they can be
* overwritten when updated in their original locations. */
if (copy_result)
copy_result = SetFileAttributes (dest, FILE_ATTRIBUTE_NORMAL);

g_free (dest);
g_free (orig);

Expand Down

0 comments on commit 5d24e70

Please sign in to comment.