summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-10-08 14:08:53 +0200
committerThomas Haller <thaller@redhat.com>2016-10-08 14:08:53 +0200
commita3d615933f19e28ba104a9361494638ba1494169 (patch)
treefba12d84b6b70710c968d3672f04087df36982c7
parenta1279c5cb1c9984978231b502b3572d29c2a7635 (diff)
downloadNetworkManager-a3d615933f19e28ba104a9361494638ba1494169.tar.gz
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index c9d7adecea..321d017d2d 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -125,12 +125,11 @@ set_secret (shvarFile *ifcfg,
goto error;
}
- /* Clear the secret from the associated "keys" file */
- svUnsetValue (keyfile, key);
-
/* Only write the secret if it's system owned and supposed to be saved */
if (flags == NM_SETTING_SECRET_FLAG_NONE)
svSetValue (keyfile, key, value, verbatim);
+ else
+ svUnsetValue (keyfile, key);
if (!svWriteFile (keyfile, 0600, &error)) {
_LOGW ("could not update ifcfg file '%s': %s",