[gnome-shell/gnome-3-38] networkAgent: Use VPN specific method to add VPN secrets



commit 08b62a3ffb019e55f98645289cd2479903642342
Author: Sebastian Keller <skeller gnome org>
Date:   Mon Dec 14 16:27:45 2020 +0100

    networkAgent: Use VPN specific method to add VPN secrets
    
    Use the method introduced in the previous commit to add VPN secrets
    instead of adding them as regular secrets/passwords. This ensures
    correct serialization of these secrets.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2105
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1535>
    (cherry picked from commit eb95f6a0fabc0a7ec04d747925d303ce2e411368)

 js/ui/components/networkAgent.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 29565d214f..38b55da303 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -132,8 +132,12 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
         for (let i = 0; i < this._content.secrets.length; i++) {
             let secret = this._content.secrets[i];
             valid = valid && secret.valid;
-            if (secret.key != null)
-                this._agent.set_password(this._requestId, secret.key, secret.value);
+            if (secret.key !== null) {
+                if (this._settingName === 'vpn')
+                    this._agent.add_vpn_secret(this._requestId, secret.key, secret.value);
+                else
+                    this._agent.set_password(this._requestId, secret.key, secret.value);
+            }
         }
 
         if (valid) {
@@ -476,7 +480,7 @@ var VPNRequestHandler = class {
                     this._stdin.write('QUIT\n\n', null);
                 } catch (e) { /* ignore broken pipe errors */ }
             } else {
-                this._agent.set_password(this._requestId, this._previousLine, line);
+                this._agent.add_vpn_secret(this._requestId, this._previousLine, line);
                 this._previousLine = undefined;
             }
         } else {
@@ -552,7 +556,7 @@ var VPNRequestHandler = class {
                     if (!value.length) // Ignore empty secrets
                         continue;
 
-                    this._agent.set_password(this._requestId, groups[i], value);
+                    this._agent.add_vpn_secret(this._requestId, groups[i], value);
                 }
             }
         } catch (e) {


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