networkAgent: Handle empty vpn 'keyfiles'
Passing back no data is valid in case both secrets (group and user passwords) are stored. Just confirm the request in that case. https://bugzilla.gnome.org/show_bug.cgi?id=728681
This commit is contained in:
parent
21f0e422c0
commit
c2ae98209d
@ -510,10 +510,12 @@ const VPNRequestHandler = new Lang.Class({
|
|||||||
|
|
||||||
_showNewStyleDialog: function() {
|
_showNewStyleDialog: function() {
|
||||||
let keyfile = new GLib.KeyFile();
|
let keyfile = new GLib.KeyFile();
|
||||||
|
let data;
|
||||||
let contentOverride;
|
let contentOverride;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let data = this._dataStdout.peek_buffer();
|
data = this._dataStdout.peek_buffer();
|
||||||
|
|
||||||
keyfile.load_from_data(data.toString(), data.length,
|
keyfile.load_from_data(data.toString(), data.length,
|
||||||
GLib.KeyFileFlags.NONE);
|
GLib.KeyFileFlags.NONE);
|
||||||
|
|
||||||
@ -546,13 +548,16 @@ const VPNRequestHandler = new Lang.Class({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
// No output is a valid case it means "both secrets are stored"
|
||||||
|
if (data.length > 0) {
|
||||||
logError(e, 'error while reading VPN plugin output keyfile');
|
logError(e, 'error while reading VPN plugin output keyfile');
|
||||||
|
|
||||||
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (contentOverride.secrets.length) {
|
if (contentOverride && contentOverride.secrets.length) {
|
||||||
// Only show the dialog if we actually have something to ask
|
// Only show the dialog if we actually have something to ask
|
||||||
this._shellDialog = new NetworkSecretDialog(this._agent, this._requestId, this._connection, 'vpn', [], contentOverride);
|
this._shellDialog = new NetworkSecretDialog(this._agent, this._requestId, this._connection, 'vpn', [], contentOverride);
|
||||||
this._shellDialog.open(global.get_current_time());
|
this._shellDialog.open(global.get_current_time());
|
||||||
|
Loading…
Reference in New Issue
Block a user