summaryrefslogtreecommitdiffstats
path: root/mutt_tunnel.c
AgeCommit message (Collapse)Author
2021-06-18Reset SIGPIPE signal handler in child process before exec().Kevin McCarthy
Ignored signals, such as SIGPIPE in Mutt, are inherited by child processes. This can cause incorrect behavior in filter-like programs that expect SIGPIPE to be the default value of "Term". A couple other places in Mutt already reset SIGTERM, SIGTSTP, and SIGCONT, with a comment mentioning it really wasn't necessary. Since I don't much like messing with signals, I'll leave those resets in. Extract those plus SIGPIPE into a new function, mutt_reset_child_signals() and add that before each exec call. Thanks to Vincent Lefèvre for reporting the issue and for the initial patch, which this commit is based upon.
2020-06-24Correct wording in a comment.Vincent Lefevre
2020-06-23Add $tunnel_is_secure config, defaulting set.Kevin McCarthy
The config variable is to resolve an ambiguity in Mutt about whether using $tunnel is secure. On the one hand, the examples in the manual show using ssh or a direct pipe to a program. Many users do this to connect to an IMAP server with PREAUTH configured, relying on the tunnel to be secured by ssh or by the fact that it's a local pipe. On the other hand, the Mutt connection code still respects $ssl_starttls and $ssl_force_tls, as if the $tunnel connection were not already secured. After some discussion on mutt-dev, it seemed the best idea to assume the connection is secure by default, in order to not break IMAP PREAUTH connections, but to provide a configuration variable in case there are situations where it is not. Thanks to Aaron Schrab for the original idea of setting conn->ssf for $tunnel in his patch to ticket 250.
2019-01-21Fix tunnels to also retry and write full buffer.Kevin McCarthy
Change the tunnel_socket_read() and tunnel_socket_write() as the raw sockets were adjusted in the previous commit. Retry on EINTR, and complete a full write so all the implementations have the same behavior.
2017-07-22Add timeout parameter to mutt_socket_poll.Kevin McCarthy
This will be used in the next commit to add a timeout when polling for new mail.
2017-04-30Convert all exec calls to use mutt_envlist(), remove setenv function.Vincent Lefevre
The documentation implies that all children processes will be affected by the setenv command, so convert all the exec calls to use mutt_envlist(). The setenv("GPG_TTY") call is no longer needed so remove it. With that removed, there are no other setenv calls in mutt, so remove the autoconf check and replacement function.
2016-11-20Minor resource and error logic cleanup in tunnel_socket_open()Kevin McCarthy
Free the conn->sockdata on failure. conn->fd is not set until the bottom, and before it is set, conn->conn_close() will not be called. Close the pin pipe if the pout pipe fails. Call mutt_perror first on a fork failure. Calling after the close() may cause errno to be changed on a close failure.
2016-11-20Don't close stderr when opening a tunnel. (closes #3726)Kevin McCarthy
Instead of closing stderr, redirect it to /dev/null in tunnel_socket_open(). Otherwise a program can accidentally open a file into handle 2 and then unknowingly use that when trying to print to stderr. Thanks to lotheac for the original patch, which I just modified slightly.
2016-05-09Back out wrapper sys_socket.h workaround (23334e967dd7)Kevin McCarthy
After renaming all internal macros from M_* to MUTT_*, the sys_socket.h workaround is no longer necessary.
2016-04-27Create a wrapper sys_socket.h to work around Solaris namespace issues. ↵Kevin McCarthy
(closes #3833) Solaris includes "sys/stream.h" inside their "sys/socket.h". This include file adds many non-reserved macros to Mutt's namespace, two of which conflict with existing Mutt macros. The simplest fix would be to rename those macros in Mutt, however this will cause difficulty with out-of-tree patches. This fix creates a wrapper include file that preserves those existing macros and prevents the Solaris values from entering Mutt's namespace.
2005-12-12IMAP IDLE support.Brendan Cully
2005-09-17Gah, forgot the zip code when updating the FSF address...Brendan Cully
2005-09-17Update FSF address (via sed, I hope nothing got mangled). Closes: #2071.Brendan Cully
2005-08-06Report non-zero exit status of tunnel command. Closes: #1749.Brendan Cully
2005-03-05Rename open/close/read/write function pointers to avoid problems with systemsBrendan Cully
where standard open/close/read/write functions are implemented with macros. Thanks to Aaron Crane and others for their input about the problem.
2005-02-03Add config.h to the top of every C file that could possibly want it.Brendan Cully
Remove it from mutt.h
2001-09-04patch-bac.tunnelreopen-1 from Brendan Cully.Thomas Roessler
2001-06-05patch-bac.sockets-20010605.1Thomas Roessler
2001-05-31Tunnel fixes.Thomas Roessler
2001-05-30Socket API clean-up from Brendan Cully.Thomas Roessler
2001-05-29GSSAPI fixes, tunnel driver. From Brendan Cully.Thomas Roessler