diff -up kbd-2.0.4/src/vlock/auth.c.orig kbd-2.0.4/src/vlock/auth.c --- kbd-2.0.4/src/vlock/auth.c.orig 2016-12-19 16:01:51.000000000 +0100 +++ kbd-2.0.4/src/vlock/auth.c 2024-03-11 12:21:29.861328176 +0100 @@ -90,6 +90,12 @@ int get_password(pam_handle_t *pamh, con } fflush(stdout); + if (prompt) { + printf(_("Press ENTER to continue.\n")); + fflush(stdout); + (void )getchar(); + } + /* * No need to request a delay on failure via pam_fail_delay(3): * authentication module should do it for us. diff -up kbd-2.0.4/src/vlock/parse.c.orig kbd-2.0.4/src/vlock/parse.c --- kbd-2.0.4/src/vlock/parse.c.orig 2016-12-19 16:01:51.000000000 +0100 +++ kbd-2.0.4/src/vlock/parse.c 2024-03-11 12:20:33.167302197 +0100 @@ -38,6 +38,13 @@ */ int o_lock_all; +/* + * This determines whether there will be prompt before invoking pam + * auth stack. + * 0 means no, 1 means yes. + */ +int prompt; + const char * locked_name(void) { @@ -63,6 +70,8 @@ show_help(void) " switch to other virtual consoles.\n" "-a or --all: lock all virtual consoles by preventing other users\n" " from switching virtual consoles.\n" + "-p or --prompt: wait for keypress before invoking pam auth stack,\n" + " useful for unlocking with smartcard setup.\n" "-v or --version: Print the version number of vlock and exit.\n" "-h or --help: Print this help message and exit.\n"), progname, progname); @@ -74,13 +83,14 @@ void parse(int ac, char *const av[]) static struct option long_options[] = { { "current", 0, 0, 'c' }, { "all", 0, 0, 'a' }, + { "prompt", 0, 0, 'p' }, { "version", 0, 0, 'v' }, { "help", 0, 0, 'h' }, { 0, 0, 0, 0 }, }; int c; - while ((c = getopt_long(ac, av, "acvh", long_options, 0)) != -1) { + while ((c = getopt_long(ac, av, "acpvh", long_options, 0)) != -1) { switch (c) { case 'c': o_lock_all = 0; @@ -88,6 +98,9 @@ void parse(int ac, char *const av[]) case 'a': o_lock_all = 1; break; + case 'p': + prompt = 1; + break; case 'v': fprintf(stderr, "%s\n", VERSION); exit(EXIT_SUCCESS); diff -up kbd-2.0.4/src/vlock/vlock.h.orig kbd-2.0.4/src/vlock/vlock.h --- kbd-2.0.4/src/vlock/vlock.h.orig 2016-12-19 16:01:55.000000000 +0100 +++ kbd-2.0.4/src/vlock/vlock.h 2024-03-11 12:21:29.861328176 +0100 @@ -40,5 +40,12 @@ const char *locked_name(void); */ extern int o_lock_all; +/* + * This determines whether there will be prompt before invoking pam + * auth stack. + * 0 means no, 1 means yes. + */ +extern int prompt; + /* Copy of the VT mode when the program was started. */ extern int is_vt;