summaryrefslogtreecommitdiff
path: root/common/gmountspec.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2009-08-18 15:33:51 +0200
committerTomas Bzatek <tbzatek@redhat.com>2009-08-18 15:47:18 +0200
commit226a763614fbe3093fcde175ea5d6d569b610eaf (patch)
treef35daed88b763def55f7cc60037efb62f0f90caa /common/gmountspec.c
parent2b4d11a7e0eee6a6cd24234fdbdeae1672323cd3 (diff)
downloadgvfs-226a763614fbe3093fcde175ea5d6d569b610eaf.tar.gz
Canonicalize mount prefix to prevent mountspec matching issues
This prevents mismatches during mount spec comparation, e.g. with trailing slash in mount_prefix ("/subdir" vs. "/subdir/"). See bug 590730 for details.
Diffstat (limited to 'common/gmountspec.c')
-rw-r--r--common/gmountspec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/gmountspec.c b/common/gmountspec.c
index d72e1894..c55f9961 100644
--- a/common/gmountspec.c
+++ b/common/gmountspec.c
@@ -71,7 +71,7 @@ g_mount_spec_new_from_data (GArray *items,
if (mount_prefix == NULL)
spec->mount_prefix = g_strdup ("/");
else
- spec->mount_prefix = mount_prefix;
+ spec->mount_prefix = g_mount_spec_canonicalize_path (mount_prefix);
g_array_sort (spec->items, item_compare);
@@ -112,7 +112,7 @@ g_mount_spec_set_mount_prefix (GMountSpec *spec,
const char *mount_prefix)
{
g_free (spec->mount_prefix);
- spec->mount_prefix = g_strdup (mount_prefix);
+ spec->mount_prefix = g_mount_spec_canonicalize_path (mount_prefix);
}