Fix VPN auth regression

Fixes #1830343
This commit is contained in:
Florian Müllner 2020-08-14 01:30:58 +02:00
parent ee735651a9
commit 4ae74c795f
2 changed files with 176 additions and 0 deletions

173
fix-old-style-vpn.patch Normal file
View File

@ -0,0 +1,173 @@
From 112b139a9e1277a3f4e13cd8ba9f2da66babc5c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 13 Aug 2020 23:35:27 +0200
Subject: [PATCH 1/2] cleanup: Remove old compatibility code
Since gjs moved to mozjs60, return values of int8_t arrays can
no longer be treated as strings. We originally made the conversion
conditional to keep working with the (then) stable gjs release.
That was two years ago and we require a more recent gjs nowadays,
so there's no good reason for keeping the old code path.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407
---
js/ui/components/networkAgent.js | 9 ++-------
js/ui/extensionSystem.js | 4 ++--
js/ui/keyboard.js | 4 ++--
js/ui/padOsd.js | 4 ++--
js/ui/sessionMode.js | 4 ++--
5 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 1033a6de39..32ec1da852 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -2,6 +2,7 @@
/* exported Component */
const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
+const ByteArray = imports.byteArray;
const Signals = imports.signals;
const Dialog = imports.ui.dialog;
@@ -522,13 +523,7 @@ var VPNRequestHandler = class {
let contentOverride;
try {
- data = this._dataStdout.peek_buffer();
-
- if (data instanceof Uint8Array)
- data = imports.byteArray.toGBytes(data);
- else
- data = data.toGBytes();
-
+ data = ByteArray.toGBytes(this._dataStdout.peek_buffer());
keyfile.load_from_bytes(data, GLib.KeyFileFlags.NONE);
if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index f0b8361714..41ef98d70e 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -2,6 +2,7 @@
/* exported init connect disconnect */
const { GLib, Gio, GObject, Shell, St } = imports.gi;
+const ByteArray = imports.byteArray;
const Signals = imports.signals;
const ExtensionDownloader = imports.ui.extensionDownloader;
@@ -282,8 +283,7 @@ var ExtensionManager = class {
let metadataContents, success_;
try {
[success_, metadataContents] = metadataFile.load_contents(null);
- if (metadataContents instanceof Uint8Array)
- metadataContents = imports.byteArray.toString(metadataContents);
+ metadataContents = ByteArray.toString(metadataContents);
} catch (e) {
throw new Error('Failed to load metadata.json: %s'.format(e.toString()));
}
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 90bd17b86f..a579495ad6 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -2,6 +2,7 @@
/* exported KeyboardManager */
const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
+const ByteArray = imports.byteArray;
const Signals = imports.signals;
const InputSourceManager = imports.ui.status.keyboard;
@@ -532,8 +533,7 @@ var KeyboardModel = class {
_loadModel(groupName) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/%s.json'.format(groupName));
let [success_, contents] = file.load_contents(null);
- if (contents instanceof Uint8Array)
- contents = imports.byteArray.toString(contents);
+ contents = ByteArray.toString(contents);
return JSON.parse(contents);
}
diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
index 115b72be2e..9ab1cbb9df 100644
--- a/js/ui/padOsd.js
+++ b/js/ui/padOsd.js
@@ -3,6 +3,7 @@
const { Atk, Clutter, GDesktopEnums, Gio,
GLib, GObject, Gtk, Meta, Pango, Rsvg, St } = imports.gi;
+const ByteArray = imports.byteArray;
const Signals = imports.signals;
const Main = imports.ui.main;
@@ -297,8 +298,7 @@ var PadDiagram = GObject.registerClass({
_init(params) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/pad-osd.css');
let [success_, css] = file.load_contents(null);
- if (css instanceof Uint8Array)
- css = imports.byteArray.toString(css);
+ css = ByteArray.toString(css);
this._curEdited = null;
this._prevEdited = null;
this._css = css;
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index 454804933e..2136e948f1 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported SessionMode, listModes */
+const ByteArray = imports.byteArray;
const GLib = imports.gi.GLib;
const Signals = imports.signals;
@@ -105,8 +106,7 @@ function _loadMode(file, info) {
let fileContent, success_, newMode;
try {
[success_, fileContent] = file.load_contents(null);
- if (fileContent instanceof Uint8Array)
- fileContent = imports.byteArray.toString(fileContent);
+ fileContent = ByteArray.toString(fileContent);
newMode = JSON.parse(fileContent);
} catch (e) {
return;
--
2.26.2
From 990c171bed0e052a07145ad03fae89c33d86ac17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 13 Aug 2020 23:37:31 +0200
Subject: [PATCH 2/2] networkAgent: Add missing Uint8Array => string conversion
When promisifying async operations in commit 764527c8c, the
finish function for read_line_async() was sneakily changed from
read_line_finish_utf8() to read_line_finish().
That is, the call returns a Uint8Array now that requires an
explicit conversion to string.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407
---
js/ui/components/networkAgent.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 32ec1da852..29565d214f 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -494,7 +494,7 @@ var VPNRequestHandler = class {
return;
}
- this._vpnChildProcessLineOldStyle(line);
+ this._vpnChildProcessLineOldStyle(ByteArray.toString(line));
// try to read more!
this._readStdoutOldStyle();
--
2.26.2

View File

@ -12,6 +12,9 @@ Source0: http://download.gnome.org/sources/gnome-shell/3.37/%{name}-%{ver
# Replace Epiphany with Firefox in the default favourite apps list
Patch1: gnome-shell-favourite-apps-firefox.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1830343
Patch2: fix-old-style-vpn.patch
%define eds_version 3.33.1
%define gnome_desktop_version 3.35.91
%define glib2_version 2.56.0