I run lock(1) with -np when I start X in order to lock the VT I logged in on.
With the latest snapshot lock -p will crash with syscall 2 when you enter
any character and enter at the Key: prompt. Lock will crash allowing
access to the terminal.
5829 lock CALL kbind(0x7f7fffff1fc8,0x18,0xdbab2a3e6e073288)
5829 lock RET kbind 0
5829 lock CALL fork()
5829 lock PSIG SIGKILL SIG_DFL
I experimented by adding proc to pledge to allow it to fork but then it
fails trying to execve. It's running /usr/libexec/auth/login_passwd
Also pledging exec returns lock to full functionality.
Index: lock.c
===================================================================
RCS file: /cvs/src/usr.bin/lock/lock.c,v
retrieving revision 1.31
diff -u -p -r1.31 lock.c
--- lock.c 10 Oct 2015 20:35:01 -0000 1.31
+++ lock.c 15 Oct 2015 02:13:05 -0000
@@ -90,7 +90,7 @@ main(int argc, char *argv[])
usemine = 0;
no_timeout = 0;
- if (pledge("stdio rpath wpath getpw tty", NULL) == -1)
+ if (pledge("stdio rpath wpath getpw tty proc exec", NULL) == -1)
err(1, "pledge");
if (!(pw = getpwuid(getuid())))