Page MenuHomePhabricator

Send unique keymap fds to clients
ClosedPublic

Authored by ManMower on Aug 17 2018, 8:19 AM.

Details

Summary

Prevent wayland clients from being able to destroy the compositor's
singleton keymap by making individual copies for each client.

Diff Detail

Repository
rE core/enlightenment
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ManMower created this revision.Aug 17 2018, 8:19 AM
ManMower requested review of this revision.Aug 17 2018, 8:19 AM
devilhorns accepted this revision.Aug 17 2018, 8:29 AM

Looks good to me, but wait for @zmike review before landing

zmike requested changes to this revision.Aug 17 2018, 9:46 AM
zmike added inline comments.
src/bin/e_comp_wl_input.c
373

I think it should be possible to just use memcpy here with a terminator?

src/bin/e_comp_wl_input.h
40

This needs to be EINTERN if it's not being used by modules and/or shouldn't be used by modules (which seems likely).

Also, EAPI is not valid inside Enlightenment. Use E_API.

This revision now requires changes to proceed.Aug 17 2018, 9:46 AM
ManMower updated this revision to Diff 16397.Aug 17 2018, 10:06 AM

Use memcpy instead of strcpy

use EINTERN where appropriate

zmike added inline comments.Aug 17 2018, 10:14 AM
src/bin/e_comp_wl_input.c
373

Doesn't this need a \0?

ManMower added inline comments.Aug 17 2018, 10:18 AM
src/bin/e_comp_wl_input.c
373

map_size should be the length including the \0 that was present in the original string...

Is the concern that xkb_map_get_as_string() might return an invalid string?

zmike accepted this revision.Aug 17 2018, 10:20 AM
zmike added inline comments.
src/bin/e_comp_wl_input.c
373

No, I just wanted explicit clarification.

This revision is now accepted and ready to land.Aug 17 2018, 10:20 AM
This revision was automatically updated to reflect the committed changes.