File CVE-2024-36472.patch of Package gnome-shell
Index: gnome-shell-41.9/js/ui/status/network.js
===================================================================
--- gnome-shell-41.9.orig/js/ui/status/network.js
+++ gnome-shell-41.9/js/ui/status/network.js
@@ -1762,6 +1762,7 @@ class Indicator extends PanelMenu.System
this._mainConnectionStateChangedId = 0;
this._notification = null;
+ this._PortalNotification = null;
this._nmDevices = [];
this._devices = { };
@@ -2001,6 +2002,8 @@ class Indicator extends PanelMenu.System
_mainConnectionStateChanged() {
if (this._mainConnection.state == NM.ActiveConnectionState.ACTIVATED && this._notification)
this._notification.destroy();
+ if (this._mainConnection.state == NM.ActiveConnectionState.ACTIVATED && this._PortalNotification)
+ this._PortalNotification.destroy();
}
_ignoreConnection(connection) {
@@ -2150,12 +2153,33 @@ class Indicator extends PanelMenu.System
if (!isPortal || Main.sessionMode.isGreeter)
return;
+ let name = this._mainConnection.get_id();
let path = this._mainConnection.get_path();
for (let item of this._connectivityQueue) {
if (item == path)
return;
}
+ if (this._PortalNotification)
+ this._PortalNotification.destroy();
+ const source = new MessageTray.Source(
+ _('Network Manager'), 'network-wireless-acquiring-symbolic');
+ source.policy =
+ new MessageTray.NotificationApplicationPolicy('gnome-network-panel')
+
+ this._PortalNotification = new MessageTray.Notification(source,
+ _('Sign Into Wi–Fi Network'),
+ _(name));
+ this._PortalNotification.connect('destroy',
+ () => (this._PortalNotification = null))
+ this._PortalNotification.connect('activated',
+ () => this._onNotificationActivated(path));
+
+ Main.messageTray.add(source);
+ source.showNotification(this._PortalNotification)
+ }
+
+ async _onNotificationActivated(path) {
let timestamp = global.get_current_time();
if (this._portalHelperProxy) {
this._portalHelperProxy.AuthenticateRemote(path, '', timestamp);