Commit Graph

149 Commits

Author SHA1 Message Date
bakkeby
d06ca3a607 Makefile: be verbose and remove options
Some things to improve at some point:

* Respect system/packaging CFLAGS/LDFLAGS (don't hardcode -Os -Wall -pedantic,
  -s, etc).

ref.
https://git.suckless.org/slock/commit/5678764412873baa62e1536f0622d6a7cec62181.html
2023-10-06 12:36:01 +02:00
bakkeby
03112a0d32 update LICENSE
ref.
https://git.suckless.org/slock/commit/aecfb3f6803bc2e7a5478aeb4f3390cbaaa563c7.html
2023-10-06 12:32:12 +02:00
bakkeby
780a7887a3 Bump to 4f04554.
Makefile: explicit_bzero.c was copied twice (GNU make gives a warning)

bump version to 1.5

Ref.
https://git.suckless.org/slock/commit/265704d73647e0d4823126bbb7ddde1d415a618d.html
https://git.suckless.org/slock/commit/4f045545a25cc02c64bfc08d27ed2ccecb962292.html
2022-10-06 15:29:45 +02:00
Stein Gunnar Bakkeby
3131706fc5
Merge pull request #8 from herrwusel/pam_consistant
Consistent unlock styles with pam and blur patches
2022-06-03 09:44:08 +02:00
herrwusel
8f6f789708
Consistent unlock styles with pam and blur patches 2022-05-30 10:44:03 +00:00
bakkeby
9036c899a9 config.mk: adding reference to -D_NETBSD_SOURCE and -D_BSD_SOURCE 2022-03-28 16:15:30 +02:00
bakkeby
e71a42ee2b Adding background image patch 2022-03-28 14:23:34 +02:00
bakkeby
312951b978 Proposed change to avoid high CPU usage ref. #7 2022-01-11 13:51:52 +01:00
bakkeby
51d3f49e04 Fix for secret password patch compilation error ref. #6 2021-12-23 21:17:17 +01:00
bakkeby
dc5c20a6d1 Comment out dependencies by default 2021-09-13 15:42:39 +02:00
bakkeby
3f2ac9baec dwmlogo: avoid defining BACKGROUND colour if BLUR_PIXELATED_SCREEN_PATCH is enabled ref. #5 2021-09-13 15:40:10 +02:00
bakkeby
e5e04272d1 Adding dwmlogo patch ref. #5 2021-09-13 10:48:56 +02:00
bakkeby
e5a9d8539b Adding auto-timeout patch 2021-09-09 11:54:37 +02:00
bakkeby
35fd53f6f2 Adding secret password patch 2021-09-09 11:07:56 +02:00
bakkeby
7dc450118f Adding failure-command patch 2021-09-09 10:17:00 +02:00
bakkeby
d7b259be34 message patch: add xresources compatibility ref. #3 2021-06-08 14:12:46 +02:00
bakkeby
d2be9eb632 Adding color message patch ref. #3 2021-06-08 13:29:12 +02:00
bakkeby
ce8387f52c Adding link to alpha patch 2020-08-03 18:42:41 +02:00
bakkeby
0bba46172d Adding alpha patch 2020-08-03 17:25:50 +02:00
bakkeby
74c66223a5 Adding blur pixelated screen patch 2020-08-03 16:56:33 +02:00
bakkeby
c07648d3f9 Adding keypress_feedback patch 2020-08-03 15:53:34 +02:00
bakkeby
4b280b29ef Adding slock to .gitignore 2020-08-03 15:53:08 +02:00
bakkeby
55e6696897 Specifying latest version 2020-03-29 12:24:26 +02:00
bakkeby
2445d75b5d Fix bug in DPMS patch + moved patches.h to patches.def.h to match that of config 2020-01-26 16:16:38 +01:00
bakkeby
4c905a9c07 Adding xresources patch 2019-11-27 11:42:00 +01:00
bakkeby
2cf80900da Added capscolor, control clear, dpms, mediakeys, message, pam auth, quickcancel patches 2019-10-17 19:07:42 +02:00
Tobias Stoeckmann
35633d4567 Properly clear the last entered character
When enter is pressed, passwd[len] will be set to '\0'. Pressing
backspace is supposed to remove the last entered character.

But currently, the clearing has an off-by-one, as in setting
passwd[len] to '\0' just like enter would do.

You can also verify it by imagining len=1 and that it's impossible to
clear passwd[0] by pressing backspace with the current code.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-03-25 21:51:29 +01:00
Markus Teich
2d2a21a90a rm trailing whitespace in README 2016-11-23 00:29:18 +01:00
Markus Teich
325581b935 syntax fix 2016-11-23 00:28:43 +01:00
Markus Teich
0ff0d9f7a7 there can only be one window in the event 2016-11-23 00:28:25 +01:00
Bob Uhl
7a604ec1fa Fix resize with multiple monitors and portrait mode
When connecting/disconnecting a portrait monitor, the
XRRScreenChangeNotifyEvent height & width are reversed due to the XRandR
rotation; detect this and DTRT.
2016-11-23 00:26:51 +01:00
Markus Teich
fa11589584 bump version 2016-11-20 01:07:11 +01:00
Markus Teich
d5da84cf5a add arg.h and util.h to Makefile 2016-11-20 01:01:47 +01:00
Markus Teich
ae96836f90 clarify colors in config.def.h 2016-11-20 00:29:41 +01:00
Markus Teich
7d31ff65a0 move config.h inclusion after type declarations 2016-11-20 00:29:01 +01:00
Laslo Hunhold
597469541c Unboolify slock.c 2016-10-18 00:29:41 +02:00
FRIGN
c96e725df0 Use explicit strcmp() instead of inlining it
Makes it a tad more readable; the previous "optimization" will be done
by the compiler anyway.
2016-10-10 20:40:13 +02:00
FRIGN
6a1bd89635 No need for oldc to be static 2016-10-10 20:40:13 +02:00
FRIGN
b099d2fd18 Use NUL character constant explicitly 2016-10-10 20:40:13 +02:00
FRIGN
0a43b78d00 Keep the line-lengths at bay
This makes the code more readable and prevents wraparounds in the
editor.
2016-10-10 20:39:33 +02:00
FRIGN
bd069b08c5 Add a section on security considerations
The section on security considerations sheds some light on the problems that we
can't solve within slock but which the user has to solve in his X configuration.
2016-09-28 22:01:58 +02:00
Markus Teich
2d85c5baed remove confusing DPMS comment
FRIGN on hackers@suckless.org:
What has been bugging me for quite a while is this DPMS comment that was added
there for no reason. Every sane mind would agree that fiddling with DPMS makes
no sense whatsoever. When I slock, my screen turns off after 10 minutes. So, if
I don't like that, I disable DPMS. If I do, I just fiddle around with my mouse a
bit and get the slock promt.
2016-09-26 13:28:09 +02:00
Markus Teich
a98fba8971 error out early on crypt() fail 2016-09-23 19:08:39 +02:00
FRIGN
dc2e8e839e Stop using $USER for shadow entries
This was extremely bad practice, effectively making the program behave
different depending on which architecture you are running it on.

OpenBSD offers getpwuid_shadow, but there is no getspuid for getspnam,
so we resort to using the pw_name entry in the struct passwd we filled
earlier.

This prevents slock from crashing when $USER is empty (easy to do). If
you want to run slock as a different user, don't use

	$ USER="tom" slock

but doas or sudo which were designed for this purpose.
2016-09-23 18:54:56 +02:00
FRIGN
9a617db716 Rename getpw() and pws to gethash() and hash 2016-09-23 18:51:40 +02:00
FRIGN
b00f444a4e Remove cleanup and deglobalize and rework data structures
The cleanup removal is a joint-venture with Markus. We assume the X server does
the cleanup, so we don't need it. The idea is that the fds are closed at exit
and thus already indicate to the X server that the client has quit. Analogously
the same applies to freeing memory sections previously allocated for the X
server.

We love XXXXXL burgers and therefore removed
XUngrabPointer
XUngrabKeyboard
XFreeColors
XFreePixmap
XDestroyWindow
Lines of Code.

For a project like slock there is no need to carry around global state. By
moving the three structures to main() it is now clear which functions modify
which state, greatly improving the readability of the code, especially given
slock is a suid program.
2016-09-23 18:39:01 +02:00
Quentin Rameau
cd3c546c37 config.mk: be more explicative about FLAGS
Group each *FLAG with its description and add a NetBSD specific.
2016-09-08 23:36:07 +02:00
FRIGN
22eba05f36 Ensure Polyphemus-Mitigation and properly drop privileges
Don't hide privilege drops inside readpw() and actually make it
configurable what you are dropping to in config.h.

The privilege drop comes after opening the Display because the
user "nobody" with "nogroup" can't do that.

So why do I call this strategy the Polyphemus-Mitigation?

"""
After the giant returns in the evening and eats two more of the men,
Odysseus offers Polyphemus some strong and undiluted wine given to him
earlier on his journey. Drunk and unwary, the giant asks Odysseus his
name, promising him a guest-gift if he answers. Odysseus tells him
"Οὖτις", which means "nobody" and Polyphemus promises to eat this
"Nobody" last of all. With that, he falls into a drunken sleep. Odysseus
had meanwhile hardened a wooden stake in the fire and now drives it into
Polyphemus' eye. When Polyphemus shouts for help from his fellow giants,
saying that "Nobody" has hurt him, they think Polyphemus is being
afflicted by divine power and recommend prayer as the answer.
"""

(source: https://en.wikipedia.org/wiki/Polyphemus)
2016-09-08 00:36:45 +02:00
Quentin Rameau
04143fd68d Unify how we check passwords between different OSes 2016-09-07 13:10:25 +02:00
Markus Teich
9698224090 make error message prefix consistent 2016-09-07 10:04:06 +02:00