summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-08-13 23:28:54 +0200
committerPavel Šimerda <psimerda@redhat.com>2013-08-13 23:28:54 +0200
commit5dc4be54e62aa0168478a3c9d6cf45c551c5ace8 (patch)
treead32018fc4700ac5194e8c779bd425c0d78b120b
parent80c48a62be1889a4ae3de858909fd66159125421 (diff)
downloadNetworkManager-5dc4be54e62aa0168478a3c9d6cf45c551c5ace8.tar.gz
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
-rw-r--r--src/settings/plugins/keyfile/reader.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c
index 2a25f51395..d03c9e0386 100644
--- a/src/settings/plugins/keyfile/reader.c
+++ b/src/settings/plugins/keyfile/reader.c
@@ -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;
}