[gvfs] Canonicalize mount prefix to prevent mountspec matching issues



commit 226a763614fbe3093fcde175ea5d6d569b610eaf
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Tue Aug 18 15:33:51 2009 +0200

    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.

 common/gmountspec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/common/gmountspec.c b/common/gmountspec.c
index d72e189..c55f996 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);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]