[Pkg-privacy-commits] [nautilus-wipe] 40/224: Fix harmful use of remote file path with Nautilus 2.20
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Jul 7 19:45:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch master
in repository nautilus-wipe.
commit 4264e814bea10fe756ef3d8bb3773d11107a61dc
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Sun Feb 21 15:35:04 2010 +0100
Fix harmful use of remote file path with Nautilus 2.20
We got the remote path when we expect no path at all (for mounts that
are not local), leading to work on a local file with the same path
rather than properly failing.
---
nautilus-srm/compat.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/nautilus-srm/compat.h b/nautilus-srm/compat.h
index be6f2bf..a9f6949 100644
--- a/nautilus-srm/compat.h
+++ b/nautilus-srm/compat.h
@@ -68,6 +68,31 @@ nautilus_file_info_get_location (NautilusFileInfo *nfi)
return file;
}
+
+/*
+ * Workaround for the buggy behavior of g_file_get_path() on the GFile returned
+ * by our nautilus_file_info_get_location().
+ * Should be harmless in general, and at least for us.
+ *
+ * The buggy behavior made g_file_get_path() return the remote path for remote
+ * locations, such as "/foo" for "ftp://name.domain.tld/foo", obviously leading
+ * to really bad things such as unexpected data loss (by using a local file when
+ * the user thinks we use the remote one).
+ */
+static gchar *
+NAUTILUS_SRM_g_file_get_path (GFile *file)
+{
+ gchar *path = NULL;
+
+ if (g_file_has_uri_scheme (file, "file")) {
+ path = g_file_get_path (file);
+ }
+
+ return path;
+}
+/* overwrite the GIO implementation */
+#define g_file_get_path NAUTILUS_SRM_g_file_get_path
+
#endif /* HAVE_NAUTILUS_FILE_INFO_GET_LOCATION */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git
More information about the Pkg-privacy-commits
mailing list