Decrypt fails due to SIGPIPE in large files

Volkan Yazıcı volkan at yazi.ci
Fri Oct 14 15:18:52 UTC 2022


Hello,

When the encrypted content is bigger than what is reported by `ulimit
-p`, `gpg -d` exits with 141 causing `pass -c` to fail:

$ ulimit -p
8

$ dd if=/dev/urandom bs=8193 count=1 | gpg -e -r XXX -o
~/.password-store/test.gpg --yes && pass show -c test; echo $?
1+0 records in
1+0 records out
8193 bytes (8.2 kB, 8.0 KiB) copied, 0.000199462 s, 41.1 MB/s
141

$ dd if=/dev/urandom bs=8192 count=1 | gpg -e -r XXX -o
~/.password-store/test.gpg --yes && pass show -c test; echo $?
1+0 records in
1+0 records out
8192 bytes (8.2 kB, 8.0 KiB) copied, 0.000193793 s, 42.3 MB/s
Copied test to clipboard. Will clear in 45 seconds.
0

In particular, these are the suspects causing the failure:

$ cat $(which pass)
...
set -o pipefail
...
pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | tail -n
+${selected_line} | head -n 1)" || exit $?
...

Is there a way `pass` can workaround this limitation?

Kind regards.


More information about the Password-Store mailing list