From 31ac05e1259c4bb422dcf5ffb6b221e8d991e51b Mon Sep 17 00:00:00 2001 From: Christian Neumair Date: Mon, 31 Mar 2008 16:47:44 +0000 Subject: [PATCH] Do not automount mount points inside hidden hierarchies (#524075). 2008-03-31 Christian Neumair * libnautilus-private/nautilus-autorun.c (should_skip_native_mount_root), (should_autorun_mount): Do not automount mount points inside hidden hierarchies (#524075). svn path=/trunk/; revision=14013 --- ChangeLog | 6 ++++++ libnautilus-private/nautilus-autorun.c | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 557f95477..288a8b68f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-31 Christian Neumair + + * libnautilus-private/nautilus-autorun.c + (should_skip_native_mount_root), (should_autorun_mount): + Do not automount mount points inside hidden hierarchies (#524075). + 2008-03-31 Christian Neumair * libnautilus-private/nautilus-icon-container.c diff --git a/libnautilus-private/nautilus-autorun.c b/libnautilus-private/nautilus-autorun.c index 1bfb9353a..33b43c336 100644 --- a/libnautilus-private/nautilus-autorun.c +++ b/libnautilus-private/nautilus-autorun.c @@ -1395,6 +1395,20 @@ nautilus_inhibit_autorun_for_volume (GVolume *volume) g_object_unref); } +static gboolean +should_skip_native_mount_root (GFile *root) +{ + char *path; + gboolean should_skip; + + /* skip any mounts in hidden directory hierarchies */ + path = g_file_get_path (root); + should_skip = strstr (path, "/.") != NULL; + g_free (path); + + return should_skip; +} + static gboolean should_autorun_mount (GMount *mount) { @@ -1435,7 +1449,7 @@ should_autorun_mount (GMount *mount) /* only do autorun on local files or files where g_volume_should_automount() returns TRUE */ ignore_autorun = TRUE; - if (g_file_is_native (root) || + if ((g_file_is_native (root) && !should_skip_native_mount_root (root)) || (enclosing_volume != NULL && g_volume_should_automount (enclosing_volume))) { ignore_autorun = FALSE; } -- GitLab