summaryrefslogtreecommitdiff
path: root/sysutils/hal/files/patch-tools_hal-storage-mount.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2009-01-10 05:22:13 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2009-01-10 05:22:13 +0000
commit610ae5681637c1051a0c17b54e29d97f53da2f3a (patch)
treec231a1eb74b07e444fa7363012cb84bf23d83ce0 /sysutils/hal/files/patch-tools_hal-storage-mount.c
parentAdd a new framework for browser plugins, USE_WEBPLUGINS. It is for which foo (diff)
Presenting GNOME 2.24 for FreeBSD.
See http://library.gnome.org/misc/release-notes/2.24/ for the general release notes. On the FreeBSD front, this release introduces Fuse support in HAL, adds multi-CPU support to libgtop, WebKit updates, and fixes some long-standing seahorse and gnome-keyring bugs. The documentation updates to the website are forthcoming. This release features commits by adamw, ahze, kwm, mezz, and myself. It would not have been possible without are contributors and testers: Alexander Loginov Craig Butler [1] Dmitry Marakasov [6] Eric L. Chen Joseph S. Atkinson Kris Moore Lapo Luchini [7] Nikos Ntarmos Pawel Worach Romain Tartiere TAOKA Fumiyoshi [3] Yasuda Keisuke Zyl aZ [4] bf [2] [5] Florent Thoumie Peter Wemm pluknet PR: 125857 [1] 126993 [2] 130031 [3] 127399 [4] 127661 [5] 124302 [6] 129570 [7] 129936 123790
Notes
Notes: svn path=/head/; revision=225629
Diffstat (limited to 'sysutils/hal/files/patch-tools_hal-storage-mount.c')
-rw-r--r--sysutils/hal/files/patch-tools_hal-storage-mount.c86
1 files changed, 83 insertions, 3 deletions
diff --git a/sysutils/hal/files/patch-tools_hal-storage-mount.c b/sysutils/hal/files/patch-tools_hal-storage-mount.c
index c270893c2b2c..390d35111481 100644
--- a/sysutils/hal/files/patch-tools_hal-storage-mount.c
+++ b/sysutils/hal/files/patch-tools_hal-storage-mount.c
@@ -1,11 +1,91 @@
---- tools/hal-storage-mount.c.orig 2008-04-29 20:05:38.000000000 -0400
-+++ tools/hal-storage-mount.c 2008-04-29 20:05:44.000000000 -0400
-@@ -56,7 +56,7 @@
+--- tools/hal-storage-mount.c.orig 2008-05-07 19:24:23.000000000 -0400
++++ tools/hal-storage-mount.c 2008-10-09 00:54:34.000000000 -0400
+@@ -56,8 +56,9 @@
#ifdef __FreeBSD__
#define MOUNT "/sbin/mount"
-#define MOUNT_OPTIONS "noexec,nosuid"
+#define MOUNT_OPTIONS "nosuid"
#define MOUNT_TYPE_OPT "-t"
++#define FUSE_DB "/tmp/.fuse-mnts"
#elif sun
#define MOUNT "/sbin/mount"
+ #define MOUNT_OPTIONS "noexec,nosuid"
+@@ -255,6 +256,51 @@ out:
+ return f;
+ }
+
++#ifdef __FreeBSD__
++static char *
++resolve_fuse (const char *special)
++{
++ gchar *contents;
++ gchar **lines;
++ gsize len;
++ int i;
++
++ if (! g_file_get_contents (FUSE_DB, &contents, &len, NULL))
++ return g_strdup (special);
++
++ lines = g_strsplit (contents, "\n", 0);
++ g_free (contents);
++
++ for (i = 0; lines && lines[i]; i++) {
++ gchar **fields;
++
++ fields = g_strsplit (lines[i], "=", 2);
++ if (fields && g_strv_length (fields) == 2) {
++ if (strcmp (fields[0], special) == 0) {
++ g_strfreev (fields);
++ g_strfreev (lines);
++ return g_strdup (fields[1]);
++ }
++ }
++ g_strfreev (fields);
++ }
++
++ g_strfreev (lines);
++
++ return g_strdup (special);
++}
++#endif
++
++static char *
++resolve_special (const char *special)
++{
++#ifdef __FreeBSD__
++ if (strstr(special, "fuse"))
++ return resolve_fuse (special);
++#endif
++ return g_strdup (special);
++}
++
+ static LibHalVolume *
+ volume_findby (LibHalContext *hal_ctx, const char *property, const char *value)
+ {
+@@ -400,18 +446,20 @@ device_is_mounted (const char *device, c
+ unknown_error ("Cannot open /etc/mtab or equivalent");
+ }
+ while (((entry = mtab_next (handle, mount_point)) != NULL) && (ret == FALSE)) {
+- char *resolved;
++ char *resolved, *rspecial;
+
+ resolved = resolve_symlink (entry);
++ rspecial = resolve_special (resolved);
++ g_free (resolved);
+ #ifdef DEBUG
+- printf ("/proc/mounts: device %s -> %s \n", entry, resolved);
++ printf ("/proc/mounts: device %s -> %s \n", entry, rspecial);
+ #endif
+- if (strcmp (device, resolved) == 0) {
+- printf ("%s (-> %s) found in mount list. Not mounting.\n", entry, resolved);
++ if (strcmp (device, rspecial) == 0) {
++ printf ("%s (-> %s) found in mount list. Not mounting.\n", entry, rspecial);
+ ret = TRUE;
+ }
+
+- g_free (resolved);
++ g_free (rspecial);
+ }
+ mtab_close (handle);
+ return ret;