dia r3913 - in trunk: . app
- From: hans svn gnome org
- To: svn-commits-list gnome org
- Subject: dia r3913 - in trunk: . app
- Date: Sun, 9 Mar 2008 19:37:50 +0000 (GMT)
Author: hans
Date: Sun Mar 9 19:37:50 2008
New Revision: 3913
URL: http://svn.gnome.org/viewvc/dia?rev=3913&view=rev
Log:
2008-03-09 Hans Breuer <hans breuer org>
* app/load_save.c(diagram_data_save) : not using g_access() because
'My Documents' is write protected by default on XP but still can
contain writable files. With extended security attributes becoming
more common this change may even become necessary for *nix?
Fixes bug #504469.
Modified:
trunk/ChangeLog
trunk/app/load_save.c
Modified: trunk/app/load_save.c
==============================================================================
--- trunk/app/load_save.c (original)
+++ trunk/app/load_save.c Sun Mar 9 19:37:50 2008
@@ -940,8 +940,11 @@
/* Once we depend on GTK 2.8+, we can use these tests. */
#if GLIB_CHECK_VERSION(2,8,0)
/* Check that we're allowed to write to the target file at all. */
- if (g_file_test(filename, G_FILE_TEST_EXISTS) &&
- g_access(filename, W_OK) != 0) {
+ if ( g_file_test(filename, G_FILE_TEST_EXISTS)
+# if !defined G_OS_WIN32 /* not going to work with 'My Docments' - read-only but still useable, see bug #504469 */
+ && g_access(filename, W_OK) != 0
+# endif
+ ) {
message_error(_("Not allowed to write to output file %s\n"),
dia_message_filename(filename));
return FALSE;
@@ -960,10 +963,13 @@
tmpname = g_strconcat(dirname,"__diaXXXXXX",NULL);
bakname = g_strconcat(filename,"~",NULL);
-#if GLIB_CHECK_VERSION(2,8,0)
+#if GLIB_CHECK_VERSION(2,8,0) && !defined G_OS_WIN32
/* Check that we can create the other files */
- if (g_file_test(dirname, G_FILE_TEST_EXISTS) &&
- g_access(dirname, W_OK) != 0) {
+ if ( g_file_test(dirname, G_FILE_TEST_EXISTS)
+# if !defined G_OS_WIN32
+ && g_access(dirname, W_OK) != 0
+# endif
+ ) {
message_error(_("Not allowed to write temporary files in %s\n"),
dia_message_filename(dirname));
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]