mirror of
git://git.suckless.org/slock
synced 2024-12-24 07:52:26 +00:00
22eba05f36
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)
13 lines
358 B
C
13 lines
358 B
C
/* user and group to drop privileges to */
|
|
static const char *user = "nobody";
|
|
static const char *group = "nogroup";
|
|
|
|
static const char *colorname[NUMCOLS] = {
|
|
"black", /* after initialization */
|
|
"#005577", /* during input */
|
|
"#CC3333", /* wrong password */
|
|
};
|
|
|
|
/* treat a cleared input like a wrong password */
|
|
static const int failonclear = 1;
|