|
@ -64,6 +64,8 @@ static struct ev_timer *dpms_timeout; |
|
|
static struct ev_timer *discard_passwd_timeout; |
|
|
static struct ev_timer *discard_passwd_timeout; |
|
|
extern unlock_state_t unlock_state; |
|
|
extern unlock_state_t unlock_state; |
|
|
extern pam_state_t pam_state; |
|
|
extern pam_state_t pam_state; |
|
|
|
|
|
int failed_attempts = 0; |
|
|
|
|
|
bool show_failed_attempts = false; |
|
|
|
|
|
|
|
|
static struct xkb_state *xkb_state; |
|
|
static struct xkb_state *xkb_state; |
|
|
static struct xkb_context *xkb_context; |
|
|
static struct xkb_context *xkb_context; |
|
@ -239,6 +241,7 @@ static void input_done(void) { |
|
|
fprintf(stderr, "Authentication failure\n"); |
|
|
fprintf(stderr, "Authentication failure\n"); |
|
|
|
|
|
|
|
|
pam_state = STATE_PAM_WRONG; |
|
|
pam_state = STATE_PAM_WRONG; |
|
|
|
|
|
failed_attempts += 1; |
|
|
clear_input(); |
|
|
clear_input(); |
|
|
redraw_screen(); |
|
|
redraw_screen(); |
|
|
|
|
|
|
|
@ -674,13 +677,14 @@ int main(int argc, char *argv[]) { |
|
|
{"tiling", no_argument, NULL, 't'}, |
|
|
{"tiling", no_argument, NULL, 't'}, |
|
|
{"ignore-empty-password", no_argument, NULL, 'e'}, |
|
|
{"ignore-empty-password", no_argument, NULL, 'e'}, |
|
|
{"inactivity-timeout", required_argument, NULL, 'I'}, |
|
|
{"inactivity-timeout", required_argument, NULL, 'I'}, |
|
|
|
|
|
{"show-failed-attempts", no_argument, NULL, 'f'}, |
|
|
{NULL, no_argument, NULL, 0} |
|
|
{NULL, no_argument, NULL, 0} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
if ((username = getenv("USER")) == NULL) |
|
|
if ((username = getenv("USER")) == NULL) |
|
|
errx(EXIT_FAILURE, "USER environment variable not set, please set it.\n"); |
|
|
errx(EXIT_FAILURE, "USER environment variable not set, please set it.\n"); |
|
|
|
|
|
|
|
|
char *optstring = "hvnbdc:p:ui:teI:"; |
|
|
char *optstring = "hvnbdc:p:ui:teI:f"; |
|
|
while ((o = getopt_long(argc, argv, optstring, longopts, &optind)) != -1) { |
|
|
while ((o = getopt_long(argc, argv, optstring, longopts, &optind)) != -1) { |
|
|
switch (o) { |
|
|
switch (o) { |
|
|
case 'v': |
|
|
case 'v': |
|
@ -738,9 +742,12 @@ int main(int argc, char *argv[]) { |
|
|
if (strcmp(longopts[optind].name, "debug") == 0) |
|
|
if (strcmp(longopts[optind].name, "debug") == 0) |
|
|
debug_mode = true; |
|
|
debug_mode = true; |
|
|
break; |
|
|
break; |
|
|
|
|
|
case 'f': |
|
|
|
|
|
show_failed_attempts = true; |
|
|
|
|
|
break; |
|
|
default: |
|
|
default: |
|
|
errx(EXIT_FAILURE, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]" |
|
|
errx(EXIT_FAILURE, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]" |
|
|
" [-i image.png] [-t] [-e] [-I]" |
|
|
" [-i image.png] [-t] [-e] [-I] [-f]" |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|