summary refs log tree commit diff
path: root/src/mystring.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2019-01-18 13:01:18 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-02-25 12:52:12 +0800
commit48875c1201930d1e71d358eb1cf3eacc166795be (patch)
tree999c367b70ef908863c937944a206fb8b3cdcf7b /src/mystring.c
parentoutput: Fix clang warnings about GNU old-style field designator (diff)
downloaddash-48875c1201930d1e71d358eb1cf3eacc166795be.tar.gz
dash-48875c1201930d1e71d358eb1cf3eacc166795be.zip
redir: Handle nested exec within REALLY_CLOSED redirection
The value of REALLY_CLOSED is used to avoid an unnecessary close(2)
call when restoring redirections.  However, as it stands it can
remove a close(2) call that's actually needed.  This happens when
an enclosed exec(1) command leaves an open file descriptor behind.

This patch fixes this by replacing REALLY_CLOSED with closed_redirs
to track the current status of redirected file descriptors and
leaving redirlist to only handle the previous state of redirected
file descriptors.

Reported-by: Martijn Dekker <martijn@inlv.org>
Fixes: ce0f1900d869 ("[REDIR] Fix redirect restore on saved file...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
798cb6c7ed&follow=1'>Say OpenSSL in additional permission noticesJune McEnroe 2020-10-27Refactor IMAP structJune McEnroe 2020-10-27Rewrite compat and add configure scriptJune McEnroe 2020-10-24Use open_memstream rather than fmemopenJune McEnroe 2020-06-08Add additional permission for linking with LibreSSLJune McEnroe https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs 2020-05-05Update email addresses 1.1June McEnroe 2020-05-05Update compat.h for split read/write streamsJune McEnroe 2020-05-05Encode the path as Subject with QJune McEnroe 2020-05-04Clean up notemap with dataCheckJune McEnroe 2020-05-04Update IMAP parserJune McEnroe 2020-04-08Use a real IMAP parserJune McEnroe 2020-01-28Call fopencookie with a+ 1.0June McEnroe This fixes strange behaviour when interleaving reads and writes. 2020-01-28Add arc4random_buf compatibilityJune McEnroe