uwac: handle wl_seat with version >= 7
Starting at version 7, the wayland client is supposed to mmap the keymap as MAP_PRIVATE to prevent accidental or intentional modifications.
This commit is contained in:
parent
42c083eaea
commit
b9ceb13058
@ -66,6 +66,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
|||||||
struct xkb_keymap *keymap;
|
struct xkb_keymap *keymap;
|
||||||
struct xkb_state *state;
|
struct xkb_state *state;
|
||||||
char *map_str;
|
char *map_str;
|
||||||
|
int mapFlags = MAP_SHARED;
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
close(fd);
|
close(fd);
|
||||||
@ -77,7 +78,10 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
if (input->seat_version >= 7)
|
||||||
|
mapFlags = MAP_PRIVATE;
|
||||||
|
|
||||||
|
map_str = mmap(NULL, size, PROT_READ, mapFlags, fd, 0);
|
||||||
if (map_str == MAP_FAILED) {
|
if (map_str == MAP_FAILED) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user