- Replace char* with static array. Any chars > 1024 will be discarded.
- mlock() password buffer so it can't be written to swap.
- Clear password buffer after auth succeeds or fails.
This is basically the same treatment I gave the 0.15 branch in https://github.com/swaywm/sway/pull/1519
Colors are configured through the command line so that swaylock conforms
to the i3lock fork 'github.com/chrjguill/i3lock-color'. Differences from
it are that one letter options '-r' and '-s' are not implimentend because
'-s' is already used by '--scaling' in swaylock.
This commit also fixed whitespace in 'include/swaylock/swaylock.h' and
changed `parse_color` in 'common/util.h' so that it can accept colors
that do not start with a hash. This was done to keep compatability with
the i3lock fork.
Without unistd.h the following functions getuid, alarm and
close are implicitly declared causing compilation to fail due to
-Werror=implicit-function-declaration
Additionally
- Made background colors display when an image is enabled if
a --color is specified.
- Link CJson to swaylock.
- Add the --socket option to swaylock.
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).
A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
There is only a slight issue. When using a transparent color the views
are arranged to make room for swaylock which we can now see. I tried removing
the arrange call but that just made it worse by putting in an opaque view on the
workspace and not making the lockoverlay color. Ill raise an issue if
this is not easily solved