Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From c53e94a520b573aa0dcf12903e9563fe8badc34c Mon Sep 17 00:00:00 2001 |
| 2 | From: Marius Avram <marius.avram@intel.com> |
| 3 | Date: Wed, 27 Aug 2014 12:10:41 +0300 |
| 4 | Subject: [PATCH] Allow /run/media/sdX drive mount if username root |
| 5 | |
| 6 | In case that the username logged in the system is root |
| 7 | the drives are directly mounted in /run/media/sdX and |
| 8 | not /run/media/<username>/sdX as the function |
| 9 | g_unix_mount_guess_should_display() expects. |
| 10 | |
| 11 | Without this change USB stick mounts are not accesible from |
| 12 | graphical applications such as the File Manager (pcmanfm). |
| 13 | |
| 14 | Upstream-Status: Inappropriate |
| 15 | |
| 16 | Signed-off-by: Marius Avram <marius.avram@intel.com> |
| 17 | --- |
| 18 | gio/gunixmounts.c | 5 +++++ |
| 19 | 1 file changed, 5 insertions(+) |
| 20 | |
| 21 | diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c |
| 22 | index 4999354..f6c1472 100644 |
| 23 | --- a/gio/gunixmounts.c |
| 24 | +++ b/gio/gunixmounts.c |
| 25 | @@ -2136,6 +2136,11 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry) |
| 26 | mount_path[sizeof ("/run/media/") - 1 + user_name_len] == '/') |
| 27 | is_in_runtime_dir = TRUE; |
| 28 | |
| 29 | + /* Allow no username in path in /run/media if current user is root */ |
| 30 | + if (strcmp(user_name, "root") == 0 && |
| 31 | + strncmp (mount_path, "/run/media/", sizeof("run/media")) == 0) |
| 32 | + is_in_runtime_dir = TRUE; |
| 33 | + |
| 34 | if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/")) |
| 35 | { |
| 36 | char *path; |
| 37 | -- |
| 38 | 1.7.9.5 |
| 39 | |