mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-01 07:16:07 -04:00
server: don't disclose the existence of invisible globals
Otherwise, a client iterate over a range of names binding with deliberately incorrect interfaces and receive error messages with expected interfaces regardless of global visibility. Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
This commit is contained in:
parent
c0a6e73606
commit
69aabecd18
1 changed files with 2 additions and 6 deletions
|
|
@ -1054,10 +1054,10 @@ registry_bind(struct wl_client *client,
|
||||||
if (global->name == name)
|
if (global->name == name)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (&global->link == &display->global_list)
|
if (&global->link == &display->global_list || !wl_global_is_visible(client, global))
|
||||||
wl_resource_post_error(resource,
|
wl_resource_post_error(resource,
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
"invalid global %s (%d)", interface, name);
|
"global %s (%"PRIu32") is unavailable", interface, name);
|
||||||
else if (strcmp(global->interface->name, interface) != 0)
|
else if (strcmp(global->interface->name, interface) != 0)
|
||||||
wl_resource_post_error(resource,
|
wl_resource_post_error(resource,
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
|
|
@ -1074,10 +1074,6 @@ registry_bind(struct wl_client *client,
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
"invalid version for global %s (%d): have %d, wanted %d",
|
"invalid version for global %s (%d): have %d, wanted %d",
|
||||||
interface, name, global->version, version);
|
interface, name, global->version, version);
|
||||||
else if (!wl_global_is_visible(client, global))
|
|
||||||
wl_resource_post_error(resource,
|
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
|
||||||
"invalid global %s (%d)", interface, name);
|
|
||||||
else
|
else
|
||||||
global->bind(client, global->data, version, id);
|
global->bind(client, global->data, version, id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue