From 22057f76cc1929e3064c38d3e3cecc19c3a80fcb Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 16 Dec 2021 14:24:25 -0600 Subject: [PATCH] redfish: Use secure helper to set file permissions when setting password Instead of installing the conf file as locked down, set permissions when using it. This fixes a problem on snap first run: ``` cp: cannot open '/snap/fwupd/x1/etc/fwupd/redfish.conf' for reading: Permission denied ``` --- plugins/redfish/fu-plugin-redfish.c | 5 +++-- plugins/redfish/meson.build | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/redfish/fu-plugin-redfish.c b/plugins/redfish/fu-plugin-redfish.c index 2b6fc8c88..327296a98 100644 --- a/plugins/redfish/fu-plugin-redfish.c +++ b/plugins/redfish/fu-plugin-redfish.c @@ -272,10 +272,11 @@ fu_redfish_plugin_ipmi_create_user(FuPlugin *plugin, GError **error) fu_redfish_backend_set_password(data->backend, password_new); /* success */ - if (!fu_plugin_set_config_value(plugin, "Username", username_fwupd, error)) + if (!fu_plugin_set_secure_config_value(plugin, "Username", username_fwupd, error)) return FALSE; - if (!fu_plugin_set_config_value(plugin, "Password", password_new, error)) + if (!fu_plugin_set_secure_config_value(plugin, "Password", password_new, error)) return FALSE; + return TRUE; } #endif diff --git a/plugins/redfish/meson.build b/plugins/redfish/meson.build index 713583fcc..e4e4c023e 100644 --- a/plugins/redfish/meson.build +++ b/plugins/redfish/meson.build @@ -54,7 +54,6 @@ shared_module('fu_plugin_redfish', install_data(['redfish.conf'], install_dir: join_paths(sysconfdir, 'fwupd'), - install_mode: 'rw-r-----', ) if get_option('tests')