mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 13:28:02 +02:00
Assert keyfiles are owned by euid, not root
This commit is contained in:
parent
41db8c7563
commit
604260c6ea
1 changed files with 3 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "libnm-glib-aux/nm-uuid.h"
|
||||
#include "libnm-glib-aux/nm-io-utils.h"
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
#include "nm-setting-wireless.h"
|
||||
#include "nm-setting-wireless-security.h"
|
||||
#include "nm-config.h"
|
||||
#include "src/core/main-utils.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
@ -337,7 +339,7 @@ nms_keyfile_utils_check_file_permissions_stat(NMSKeyfileFiletype filetype,
|
|||
g_return_val_if_reached(FALSE);
|
||||
|
||||
if (!NM_FLAGS_HAS(nm_utils_get_testing(), NM_UTILS_TEST_NO_KEYFILE_OWNER_CHECK)) {
|
||||
if (st->st_uid != 0) {
|
||||
if (st->st_uid != nm_main_utils_get_nm_uid()) {
|
||||
g_set_error(error,
|
||||
NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue