mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-11 21:48:50 +01:00
6823ed4658
* 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 <justus@g10code.com> |
||
---|---|---|
.. | ||
extrasamples | ||
fake-pinentries | ||
gpgme | ||
gpgscm | ||
gpgsm | ||
migrations | ||
openpgp | ||
pkits | ||
samplekeys | ||
samplemsgs | ||
567064FE6D14A17B2D811ABB407728BC558AA455 | ||
asschk.c | ||
cert_cci_sphinx_ca.pem | ||
cert_cci_test_wzs.pem | ||
cert_cci_test_zs.pem | ||
cert_cci_user02.pem | ||
cert_cci_user03.pem | ||
cert_cci_user04.pem | ||
cert_cci_user06.pem | ||
cert_cci_user07.pem | ||
cert_testpki_testpca.pem | ||
ChangeLog-2011 | ||
crl_testpki_testpca.pem | ||
inittests | ||
key_g10code_pete1.pem | ||
key_g10code_theo1.pem | ||
Makefile.am | ||
runtest | ||
skey_g10code_test1.pem | ||
sm-sign+verify | ||
sm-verify | ||
text-1.dsig.pem | ||
text-1.osig-bad.pem | ||
text-1.osig-badusage.pem | ||
text-1.osig.pem | ||
text-1.txt | ||
text-2.osig-bad.pem | ||
text-2.osig.pem | ||
text-2.txt | ||
text-3.txt |