util: Wait for initial name owners in DBusSenderCheck before checking

Otherwise an allowed caller might get rejected if the call is right
after a gnome-shell restart and the watchers have not finished running
their callbacks yet.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4813
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2048>
This commit is contained in:
Sebastian Keller
2021-11-23 02:48:04 +01:00
committed by Marge Bot
parent 37271ffe70
commit 85609a232d
4 changed files with 65 additions and 38 deletions

View File

@ -117,9 +117,9 @@ var IntrospectService = class {
type == Meta.WindowType.UTILITY;
}
GetRunningApplicationsAsync(params, invocation) {
async GetRunningApplicationsAsync(params, invocation) {
try {
this._senderChecker.checkInvocation(invocation);
await this._senderChecker.checkInvocation(invocation);
} catch (e) {
invocation.return_gerror(e);
return;
@ -128,13 +128,13 @@ var IntrospectService = class {
invocation.return_value(new GLib.Variant('(a{sa{sv}})', [this._runningApplications]));
}
GetWindowsAsync(params, invocation) {
async GetWindowsAsync(params, invocation) {
let focusWindow = global.display.get_focus_window();
let apps = this._appSystem.get_running();
let windowsList = {};
try {
this._senderChecker.checkInvocation(invocation);
await this._senderChecker.checkInvocation(invocation);
} catch (e) {
invocation.return_gerror(e);
return;