Re: [PATCH] Saving agent-owned secrets for newly created connections



On Wed, 2011-11-09 at 17:13 +0100, Jirka Klimes wrote:
> Hello,
> 
> attached is a patch for sending secrets to agents when a new connection is 
> created (AddConnection, AddAndActivateConnection).
> 
> At present, when a new connection is created, the secrets are not sent to 
> agents and thus not saved. One has to edit the connection again. It is easily 
> reproducible by adding a VPN connection. When it is opened again in the 
> editor, the secrets are not there.

Hmm, could we do the save from pk_add_cb() and make the patch smaller?
That way nm_settings_connection_save_agent_secrets() could be made
private to nm-settings.c.  And we wouldn't have to pass the caller_uid
to the nm_settings_add_connection() callback, which saves some churn.

Ordering might also be interesting here; since this could trigger a
SaveSecrets before the agent has been able to process the new
connection, meaning that the agent may not actually have grabbed the
connection yet (since that's another dbus call) when SaveSecrets comes
in.  I don't think that's a problem in practice for the nm-applet agent
but it might be for others.  Not sure if there's anything we can do
about it though since the ordering would be correct.

One thing we should probably do (later though) is not call SaveSecrets
at all if there aren't any secrets left to send after filtering for
AGENT_OWNED secrets.  Shouldn't have any real effect, but would be more
"correct".

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]