From 043ce2c655d1bd6d99bf61c2b11b5cda7d0965af Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 12:48:53 -0700 Subject: [PATCH] core: clear secrets on successful connection too This ensures that the next time secrets are required, they will be requested from the settings service. Internally, NM shouldn't be caching secrets; it should always request them from the settings service so that the settings service can enforce policy about password lifetime, if it wants to. --- src/nm-policy.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 6ee4e0eb6a..b1d3ba6ec7 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -803,10 +803,16 @@ device_state_changed (NMDevice *device, schedule_activate_check (policy, device, 3); break; case NM_DEVICE_STATE_ACTIVATED: - /* Clear the invalid tag on the connection */ - if (connection) + if (connection) { + /* Clear the invalid tag on the connection */ g_object_set_data (G_OBJECT (connection), INVALID_TAG, NULL); + /* And clear secrets so they will always be requested from the + * settings service when the next connection is made. + */ + nm_connection_clear_secrets (connection); + } + update_routing_and_dns (policy, FALSE); break; case NM_DEVICE_STATE_UNMANAGED: