1
0
mirror of git://git.suckless.org/slock synced 2025-03-11 06:07:34 +00:00
simple X display locker utility
Go to file
NRK a70d5d2429 simplify post-lock cmd and die if it fails
this patch does two things:

0. simplify the code by using posix_spawn()
1. unify the behavior of what happens if the post-lock cmd fails.

currently, if `fork()` fails, slock will die without locking the screen.
HOWEVER if `execvp()` fails it prints a message to stderr (which the
user cannot see since the screen has been locked already) and only exits
the child while the parent locks the screen.

to reproduce:

	# slock some_bin_that_doesnt_exist

this behavior is inconsistent, if the idea is that post-lock cmd is
_not_ important then we shouldn't `die()` on `fork()` failure either.
and if we assume that the post-lock cmd _is_ important, then we should
die on exec failure as well.

this patch assumes the latter and calls `die()` if `posix_spawn()`
fails.
2025-03-09 10:02:34 +01:00
arg.h Refactor main() 2016-08-22 23:22:20 +02:00
config.def.h clarify colors in config.def.h 2016-11-20 00:29:41 +01:00
config.mk config.mk: no need to set CC 2023-10-06 11:41:19 +02:00
explicit_bzero.c clear passwords with explicit_bzero 2016-08-13 09:58:00 +02:00
LICENSE update LICENSE 2023-10-06 11:39:31 +02:00
Makefile Makefile: be verbose and remove options 2023-10-06 11:39:40 +02:00
README rm trailing whitespace in README 2016-11-23 00:29:18 +01:00
slock.1 slock.1: use standard wording for options 2023-10-06 11:57:31 +02:00
slock.c simplify post-lock cmd and die if it fails 2025-03-09 10:02:34 +01:00
util.h clear passwords with explicit_bzero 2016-08-13 09:58:00 +02:00

slock - simple screen locker
============================
simple screen locker utility for X.


Requirements
------------
In order to build slock you need the Xlib header files.


Installation
------------
Edit config.mk to match your local setup (slock is installed into
the /usr/local namespace by default).

Afterwards enter the following command to build and install slock
(if necessary as root):

    make clean install


Running slock
-------------
Simply invoke the 'slock' command. To get out of it, enter your password.