settings: fix requesting new secrets when the old ones don't work

If the connection had system secrets, previously the settings core
would consider those sufficient even if the device code had requested
new secrets because the old ones didn't work.
This commit is contained in:
Dan Williams 2011-03-29 22:56:08 -05:00
parent 4e4bfeb499
commit bc9803f92d

View file

@ -903,6 +903,7 @@ get_start (gpointer user_data)
if (setting_secrets && g_hash_table_size (setting_secrets)) {
NMConnection *tmp;
GError *error = NULL;
gboolean request_new = (req->flags & NM_SETTINGS_GET_SECRETS_FLAG_REQUEST_NEW);
/* The connection already had secrets; check if any more are required.
* If no more are required, we're done. If secrets are still needed,
@ -918,7 +919,7 @@ get_start (gpointer user_data)
} else {
/* Do we have everything we need? */
/* FIXME: handle second check for VPN connections */
if (nm_connection_need_secrets (tmp, NULL) == NULL) {
if ((nm_connection_need_secrets (tmp, NULL) == NULL) && (request_new == FALSE)) {
nm_log_dbg (LOGD_AGENTS, "(%p/%s) system settings secrets sufficient",
req, req->setting_name);