| Age | Commit message (Collapse) | Author |
|
|
|
If a user calls `killall -USR1 swaylock`, they may end up signalling the
password backend. As the password backend forked before SIGUSR1 handling
was set up, it inherits the default handler and terminates.
Set the SIGUSR1 handler to SIG_IGN in the child process.
Fixes: https://github.com/swaywm/swaylock/issues/409
|
|
If it's not, we may be reading before the buffer bounds later.
(The password buffer size is aligned to the page size.)
|
|
read_comm_request() just copies bytes around. handle_conversation()
relies on the fact that the password buffer is NULL-terminated.
Make sure that's the case.
|
|
This reverts commit e0ca5adecd0b0f89f20322c9b410b460e8f73c5b.
See 285d0292914b ("comm: improve robustness") for details.
Also add EINTR handling.
|
|
This reverts commit 285d0292914bf6361a1a32ce1561a6d3fb6ebeca.
This got accidentally pushed to master.
|
|
swaylock was performing some read() calls with a >1 size and didn't
handle partial reads. Fix this by introducing two helpers, read_full()
and write_full(), to read/write a complete buffer.
read_comm_request() needs to make the difference between EOF at the
start of a message vs. in the middle, so needs to return a tri-state.
|
|
On my machine EOF doesn't trigger POLLHUP (not sure why), instead
read() returns zero. It just prints the following message in a
loop:
[comm.c:101] Failed to read pw result: Success
Better handle this case in read_comm_reply() by making a difference
between a failed read() and a failed authentication.
|
|
|
|
|
|
|