summaryrefslogtreecommitdiff
path: root/src/nm-core-utils.c
diff options
context:
space:
mode:
authorPavel Šimerda <pavlix@pavlix.net>2017-12-28 14:31:06 +0100
committerThomas Haller <thaller@redhat.com>2018-01-09 15:30:09 +0100
commit022c87e4ddd1eea5bf1e07852783752bd02e3f44 (patch)
tree2c35520e92e6dc9c8c8ff509247b2a6ab8a4778d /src/nm-core-utils.c
parent4ff155fa70e11ad2658ddfb0b5df62810494a929 (diff)
downloadNetworkManager-022c87e4ddd1eea5bf1e07852783752bd02e3f44.tar.gz
development: make it possible to run NetworkManager from build directoryth/pr/52
The combination of `./develop.sh` for bootstrap and configuration and the `./NetworkManager` and `./nmcli` makes it easy to build NetworkManager and then run it from the build directory.
Diffstat (limited to 'src/nm-core-utils.c')
-rw-r--r--src/nm-core-utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 197fa49ba9..76d8aad09a 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -4213,12 +4213,19 @@ nm_utils_validate_plugin (const char *path, struct stat *st, GError **error)
return FALSE;
}
+#if DEVELOP
+ /* Do not check plugin ownership when running NetworkManager from the
+ * build directory. It will typically belong to the user who is using
+ * sudo to run NetworkManager as root.
+ */
+#else
if (st->st_uid != 0) {
g_set_error_literal (error,
NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
"file has invalid owner (should be root)");
return FALSE;
}
+#endif
if (st->st_mode & (S_IWGRP | S_IWOTH | S_ISUID)) {
g_set_error_literal (error,