keyfile: fix flags check for writing secrets

Duh, AND-ing flags with 0 (which is NM_SETTING_SECRET_FLAG_SYSTEM_OWNED)
is always going to be FALSE...  NM_SETTING_SECRET_FLAG_SYSTEM_OWNED is
special; because it's the default value if the key isn't present,
and at this point it's exclusive of all other flags.  So (at least for
now) it's OK that it's 0 but we might want to change it later so that
NM_SETTING_SECRET_FLAG_SYSTEM_OWNED can actually be used as a flag.
This commit is contained in:
Dan Williams 2011-01-31 19:20:16 -06:00
parent d391e1fac3
commit d95280756f

View file

@ -591,7 +591,7 @@ write_setting_value (NMSetting *setting,
*/
if ( (pspec->flags & NM_SETTING_PARAM_SECRET)
&& nm_setting_get_secret_flags (setting, key, &flags, NULL)
&& !(flags & NM_SETTING_SECRET_FLAG_SYSTEM_OWNED))
&& (flags != NM_SETTING_SECRET_FLAG_SYSTEM_OWNED))
return;
/* Look through the list of handlers for non-standard format key values */