When the caller of pinentry-curses does not own it's tty (such as when su'ed
to root in a terminal), pinentry-curses does not prompt for a passphrrase.
A truss of the pinentry-curses process reveals:
...
21524 capget(0x20080522, 0, NULL) = 0
21524 capset(0x20080522, 0, {CAP_IPC_LOCK, CAP_IPC_LOCK, 0}) = 0
21524 mlock(0xb7826000, 65536) = 0
21524 capget(0x20080522, 0, NULL) = 0
21524 capset(0x20080522, 0, {0, CAP_IPC_LOCK, 0}) = 0
21524 getuid32() = 0
21524 geteuid32() = 0
21524 getuid32() = 0
21524 geteuid32() = 0
...
21524 open("/dev/pts/0", O_RDONLY) = -1 EACCES (Permission denied)
...
I.e., root does not have permission to open /dev/pts/0
because the capabilities(7) calls around the call to mlock()
drop all capabilities except CAP_IPC_LOCK. In particular,
the CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH and CAP_FOWNER
capabilities are dropped by the calls in lock_pool().
Suggested work-around: Recompile without USE_CAPABILITIES.