mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 21:50:17 +01:00
platform/tests: skip root tests when we can't mount /sys/devices
This commit is contained in:
parent
790e23df67
commit
15a26d6192
1 changed files with 4 additions and 0 deletions
|
|
@ -1554,6 +1554,10 @@ unshare_user (void)
|
|||
uid_t uid = geteuid ();
|
||||
gid_t gid = getegid ();
|
||||
|
||||
/* Don't try to set up the namespaces if we're in a container. */
|
||||
if (!nmtstp_is_sysfs_writable ())
|
||||
return FALSE;
|
||||
|
||||
/* Already a root? */
|
||||
if (gid == 0 && uid == 0)
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue