mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 03:48:09 +02: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;
|
NMPNetns *self;
|
||||||
int errsv;
|
int errsv;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
unsigned long mountflags = 0;
|
||||||
|
|
||||||
_stack_ensure_init ();
|
_stack_ensure_init ();
|
||||||
|
|
||||||
|
|
@ -503,7 +504,10 @@ nmp_netns_new (void)
|
||||||
goto err_out;
|
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;
|
errsv = errno;
|
||||||
_LOGE (NULL, "failed mount /sys: %s", g_strerror (errsv));
|
_LOGE (NULL, "failed mount /sys: %s", g_strerror (errsv));
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue