mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 15:18:05 +02:00
keyfile: Drop owner check
In nm_keyfile_plugin_connection_from_file(), disable the "bad owner" check. As root you can read all files anyway, or if necessary even chown them, and for other users the standard file permissions will do a fine job. This fixes running "make check" as root. https://bugzilla.gnome.org/show_bug.cgi?id=701112
This commit is contained in:
parent
80c48a62be
commit
5dc4be54e6
1 changed files with 4 additions and 5 deletions
|
|
@ -1151,7 +1151,7 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
|
|||
{
|
||||
GKeyFile *key_file;
|
||||
struct stat statbuf;
|
||||
gboolean bad_owner, bad_permissions;
|
||||
gboolean bad_permissions;
|
||||
NMConnection *connection = NULL;
|
||||
NMSettingConnection *s_con;
|
||||
NMSetting *setting;
|
||||
|
|
@ -1168,13 +1168,12 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bad_owner = getuid () != statbuf.st_uid;
|
||||
bad_permissions = statbuf.st_mode & 0077;
|
||||
|
||||
if (bad_owner || bad_permissions) {
|
||||
if (bad_permissions) {
|
||||
g_set_error (error, KEYFILE_PLUGIN_ERROR, 0,
|
||||
"File permissions (%o) or owner (%d) were insecure",
|
||||
statbuf.st_mode, statbuf.st_uid);
|
||||
"File permissions (%o) were insecure",
|
||||
statbuf.st_mode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue