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
52
53
54
55
|
Description: temporarly revert an upstream commit that made udev enabled under lxc
the new systemd doesn't work there (lp: #1914062)
---
src/libnm-platform/nm-linux-platform.c | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
Index: network-manager/src/libnm-platform/nm-linux-platform.c
===================================================================
--- network-manager.orig/src/libnm-platform/nm-linux-platform.c
+++ network-manager/src/libnm-platform/nm-linux-platform.c
@@ -29,7 +29,6 @@
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <sys/statvfs.h>
#include <unistd.h>
#include "libnm-glib-aux/nm-c-list.h"
@@ -9830,34 +9829,12 @@ constructed(GObject *_object)
}
}
-/* Similar to systemd's path_is_read_only_fs(), at
- * https://github.com/systemd/systemd/blob/v246/src/basic/stat-util.c#L132 */
-static int
-path_is_read_only_fs(const char *path)
-{
- struct statvfs st;
-
- if (statvfs(path, &st) < 0)
- return -errno;
-
- if (st.f_flag & ST_RDONLY)
- return TRUE;
-
- /* On NFS, statvfs() might not reflect whether we can actually
- * write to the remote share. Let's try again with
- * access(W_OK) which is more reliable, at least sometimes. */
- if (access(path, W_OK) < 0 && errno == EROFS)
- return TRUE;
-
- return FALSE;
-}
-
NMPlatform *
nm_linux_platform_new(gboolean log_with_ptr, gboolean netns_support, gboolean cache_tc)
{
gboolean use_udev = FALSE;
- if (nmp_netns_is_initial() && path_is_read_only_fs("/sys") == FALSE)
+ if (nmp_netns_is_initial() && access("/sys", W_OK) == 0)
use_udev = TRUE;
return g_object_new(NM_TYPE_LINUX_PLATFORM,
|