mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 13:00:16 +01:00
platform/netns: don't try to overlay ro /sys with a rw one
Linux 4.15 won't allow us. No problem.
(cherry picked from commit d7c70dd9ec)
This commit is contained in:
parent
04a6600a60
commit
e7341d219b
1 changed files with 5 additions and 1 deletions
|
|
@ -475,6 +475,7 @@ nmp_netns_new (void)
|
|||
NMPNetns *self;
|
||||
int errsv;
|
||||
GError *error = NULL;
|
||||
unsigned long mountflags = 0;
|
||||
|
||||
_stack_ensure_init ();
|
||||
|
||||
|
|
@ -503,7 +504,10 @@ nmp_netns_new (void)
|
|||
goto err_out;
|
||||
}
|
||||
|
||||
if (mount ("sysfs", "/sys", "sysfs", 0, NULL) != 0) {
|
||||
if (access ("/sys", W_OK) == -1)
|
||||
mountflags = MS_RDONLY;
|
||||
|
||||
if (mount ("sysfs", "/sys", "sysfs", mountflags, NULL) != 0) {
|
||||
errsv = errno;
|
||||
_LOGE (NULL, "failed mount /sys: %s", g_strerror (errsv));
|
||||
goto err_out;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue