summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-05-17 13:49:34 +0200
committerDaiki Ueno <ueno@gnu.org>2019-05-18 06:50:47 +0200
commit68ce31aae9a22d18b28f4aa44b3e1006b7fe3aa7 (patch)
tree77f84437d69ad0f53b251e5d8012c3000a14c711
parent58cede114664e839b53d923863bff604ce58b1a7 (diff)
conf: Ignore user configuration if the program is running as root
Suggested by Bastien Nocera: https://bugzilla.redhat.com/show_bug.cgi?id=1688583
-rw-r--r--p11-kit/conf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/p11-kit/conf.c b/p11-kit/conf.c
index 3ec1c36..861231e 100644
--- a/p11-kit/conf.c
+++ b/p11-kit/conf.c
@@ -232,8 +232,10 @@ _p11_conf_load_globals (const char *system_conf, const char *user_conf,
if (getauxval (AT_SECURE)) {
p11_debug ("skipping user config in setuid or setgid program");
mode = CONF_USER_NONE;
+ } else if (getuid () == 0) {
+ p11_debug ("skipping user config in program running as root");
+ mode = CONF_USER_NONE;
} else if (secure_getenv ("P11_KIT_NO_USER_CONFIG")) {
- /* This one should be used in RPM %post and equivalent */
p11_debug ("skipping user config due to P11_NO_USER_CONFIG");
mode = CONF_USER_NONE;
}