aboutsummaryrefslogtreecommitdiffstats
path: root/tests/openpgp/Makefile.am
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-02-08 12:49:41 +0000
committerJustus Winter <[email protected]>2017-02-08 13:28:49 +0000
commit6823ed46584e753de3aba48a00ab738ab009a860 (patch)
tree6fa13c04f89a665f0364e14d17e711df6f755520 /tests/openpgp/Makefile.am
parenttests: Skip key types not supported by OpenSSH. (diff)
downloadgnupg-6823ed46584e753de3aba48a00ab738ab009a860.tar.gz
gnupg-6823ed46584e753de3aba48a00ab738ab009a860.zip
gpg,common: Make sure that all fd given are valid.
* common/sysutils.c (gnupg_fd_valid): New function. * common/sysutils.h (gnupg_fd_valid): New declaration. * common/logging.c (log_set_file): Use the new function. * g10/cpr.c (set_status_fd): Likewise. * g10/gpg.c (main): Likewise. * g10/keylist.c (read_sessionkey_from_fd): Likewise. * g10/passphrase.c (set_attrib_fd): Likewise. * tests/openpgp/Makefile.am (XTESTS): Add the new test. * tests/openpgp/issue2941.scm: New file. -- Consider a situation where the user passes "--status-fd 3" but file descriptor 3 is not open. During the course of executing the rest of the commands, it's possible that gpg itself will open some files, and file descriptor 3 will get allocated. In this situation, the status information will be appended directly to whatever file happens to have landed on fd 3 (the trustdb? the keyring?). This is a potential data destruction issue for all writable file descriptor options: --status-fd --attribute-fd --logger-fd It's also a potential issue for readable file descriptor options, but the risk is merely weird behavior, and not data corruption: --override-session-key-fd --passphrase-fd --command-fd Fixes this by checking whether the fd is valid early on before using it. GnuPG-bug-id: 2941 Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/openpgp/Makefile.am')
-rw-r--r--tests/openpgp/Makefile.am3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 5cab3d55d..afac58fc8 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -97,7 +97,8 @@ XTESTS = \
issue2346.scm \
issue2417.scm \
issue2419.scm \
- issue2929.scm
+ issue2929.scm \
+ issue2941.scm
# XXX: Currently, one cannot override automake's 'check' target. As a
# workaround, we avoid defining 'TESTS', thus automake will not emit