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
```
This commit is contained in:
Mario Limonciello 2021-12-16 14:24:25 -06:00 committed by Mario Limonciello
parent 17db067d13
commit 22057f76cc
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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')