1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
--- gnome-volume-manager-1.5.2/src/manager.c.orig 2005-10-06 14:32:31.000000000 +0200
+++ gnome-volume-manager-1.5.2/src/manager.c 2005-10-06 14:35:39.000000000 +0200
@@ -47,6 +47,11 @@
#define NAUTILUS_COMMAND BIN_NAUTILUS" -n --no-desktop %m"
+#define BIN_PMOUNT "/usr/bin/pmount-hal"
+#define PMOUNT_COMMAND BIN_PMOUNT" %h"
+#define BIN_PUNMOUNT "/usr/bin/pumount"
+#define PUNMOUNT_COMMAND BIN_PUNMOUNT" %d"
+
static struct gvm_configuration config;
static LibHalContext *hal_ctx = NULL;
static DBusConnection *dbus_connection = NULL;
@@ -1205,6 +1210,7 @@
static gboolean
gvm_device_mount (const char *udi, const char *device, const char *mount_point, int apply_policy)
{
+ char *mount_command = MOUNT_COMMAND;
struct _MountPolicy *policy;
policy = g_new (struct _MountPolicy, 1);
@@ -1213,8 +1219,12 @@
g_hash_table_insert (mount_table, policy->udi, policy);
+ /* Only check executable, as suid binaries might not be readable */
+ if (g_file_test (BIN_PMOUNT, G_FILE_TEST_IS_EXECUTABLE))
+ mount_command = PMOUNT_COMMAND;
+
dbg ("mounting %s...\n", udi);
- if (gvm_run_command (MOUNT_COMMAND, udi, device, mount_point))
+ if (gvm_run_command (mount_command, udi, device, mount_point))
return TRUE;
dbg ("mount failed: %s\n", udi);
@@ -1233,7 +1243,13 @@
static gboolean
gvm_device_unmount (const char *udi, const char *device, const char *mount_point)
{
- return gvm_run_command (UNMOUNT_COMMAND, udi, device, mount_point);
+ char *unmount_command = UNMOUNT_COMMAND;
+
+ /* Only check executable, as suid binaries might not be readable */
+ if (g_file_test (BIN_PUNMOUNT, G_FILE_TEST_IS_EXECUTABLE))
+ unmount_command = PUNMOUNT_COMMAND;
+
+ return gvm_run_command (unmount_command, udi, device, mount_point);
}
/*
|