Make udisks_daemon_util_resolve_link() work when @name contains slashes
authorDavid Zeuthen <zeuthen@gmail.com>
Thu, 13 Sep 2012 21:39:55 +0000 (17:39 -0400)
committerDavid Zeuthen <zeuthen@gmail.com>
Thu, 13 Sep 2012 22:01:47 +0000 (18:01 -0400)
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
src/udisksdaemonutil.c

index ef925f5..0ad2185 100644 (file)
@@ -257,10 +257,13 @@ udisks_daemon_util_resolve_link (const gchar *path,
   if (num != -1)
     {
       char *absolute_path;
+      gchar *full_path_dir;
 
       link_path[num] = '\0';
 
-      absolute_path = g_build_filename (path, link_path, NULL);
+      full_path_dir = g_path_get_dirname (full_path);
+      absolute_path = g_build_filename (full_path_dir, link_path, NULL);
+      g_free (full_path_dir);
       if (realpath (absolute_path, resolved_path) != NULL)
         {
           found_it = TRUE;