Index: INSTALL.W32 =================================================================== Property changes on: INSTALL.W32 ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: configure =================================================================== --- configure (.../vendor/stunnel/4.05) (revision 39233) +++ configure (.../trunk/common/stunnel-4.05) (revision 39233) @@ -10124,7 +10124,7 @@ LIBS="$LIBS $wrap_LIB" -CPPFLAGS="$CPPFLAGS -DLIBDIR=\\\"$libdir\\\" -DCONFDIR=\\\"$sysconfdir/stunnel\\\" -DPIDFILE=\\\"$localstatedir/run/stunnel.pid\\\"" +CPPFLAGS="$CPPFLAGS -DLIBDIR=\\\"$libdir\\\" -DCONFDIR=\\\"$sysconfdir\\\" -DPIDFILE=\\\"$localstatedir/run/stunnel.pid\\\"" ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile tools/Makefile tools/stunnel.conf-sample tools/stunnel.init" Property changes on: configure ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: Makefile.in ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: AUTHORS ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: ChangeLog ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: src/stunnel.exe =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: src/protocol.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: src/make.bat =================================================================== Property changes on: src/make.bat ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/Makefile.in ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/ssl.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/sselect.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/Makefile.w32 ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/pty.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/sthreads.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: src/client.c =================================================================== --- src/client.c (.../vendor/stunnel/4.05) (revision 39233) +++ src/client.c (.../trunk/common/stunnel-4.05) (revision 39233) @@ -309,6 +309,7 @@ static int transfer(CLI *c) { /* transfer data */ fd_set rd_set, wr_set; + int inserted_ip = 0; int num, err, fdno; int check_SSL_pending; int ssl_closing; @@ -538,6 +539,36 @@ err=SSL_get_error(c->ssl, num); switch(err) { case SSL_ERROR_NONE: + /* dk: insert '__client ip' at end of user-agent header */ + if( !inserted_ip && + strstr( c->ssl_buff, "HTTP/" ) < strstr( c->ssl_buff, "\r" )) + { + /* find User-Agent: line */ + int i; + for( i = 0; i < strlen( c->ssl_buff ); i++) + { + if( !inserted_ip && + strncasecmp( c->ssl_buff + i, + "user-agent:", 11) == 0) + { + char *ua_end = strchr( c->ssl_buff + i, '\r' ); + + /* make room for client ip */ + memmove(ua_end+strlen(c->accepting_address)+2, + ua_end, + strlen(c->ssl_buff) - (ua_end-c->ssl_buff)); + + /* insert magic markers client ip */ + memcpy( ua_end+2, c->accepting_address, + strlen(c->accepting_address) ); + *(ua_end) = '_'; + *(ua_end+1) = '_'; + + inserted_ip = 1; + num += strlen( c->accepting_address ) + 2; + } + } + } c->ssl_ptr+=num; break; case SSL_ERROR_WANT_WRITE: @@ -573,6 +604,7 @@ "SSL write shutdown (output buffer empty)"); ssl_closing=1; } + if(!c->ssl_ptr && sock_wr) { shutdown(c->sock_wfd->fd, SHUT_WR); log(LOG_DEBUG, Property changes on: src/client.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/resources.h ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: src/stunnel.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: src/stunnel.ico ___________________________________________________________________ Name: svn:mime-type - application/octet-stream Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/log.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/gui.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/env.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/Makefile.am ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: src/stunnel.c =================================================================== --- src/stunnel.c (.../vendor/stunnel/4.05) (revision 39233) +++ src/stunnel.c (.../trunk/common/stunnel-4.05) (revision 39233) @@ -60,6 +60,37 @@ #ifndef USE_WIN32 int main(int argc, char* argv[]) { /* execution begins here 8-) */ + /* + * Bug #10314 (wa): + * + * When daemonizing, stunnel indiscriminately closes descriptors 0, 1, + * and 2 (for good reason, I'm sure). However, if these descriptors were + * already closed when stunnel was started, then OpenSSL's files and, + * most importantly in our case, stunnel's listening descriptor will be + * assigned one of these. One solution is to specifically make sure + * we're not closing the listening socket in daemonize() below. But, + * what about OpenSSL, or the maybe the config? There may also be issues + * lurking there. Another solution is to change the order of things, + * like calling daemonize() earlier. But, there's value in simple, early + * errors printing to stderr while debugging and supporting. + * + * So, a simple solution is to blithely open /dev/null three times, + * which will guarantee that descriptos 0, 1, and 2 and are always taken + * up by resources we care nothing about and can thus freely close them, + * and similarly guaranteeing all our critical resources will be at + * descriptors 3 or higher (possibly 6 and higher if 0, 1, and 2 were + * already open). + * + * If open fails what shall we do? Nothing I can think of at the moment. + * + * NOTE: It's critical to realize that Unix guarantees all new + * descriptors will fill the lowest slot available. This is fundamental + * to Unix's process and resource control paradigm. + */ + (void)open("/dev/null", O_RDONLY); + (void)open("/dev/null", O_WRONLY); + (void)open("/dev/null", O_WRONLY); + main_initialize(argc>1 ? argv[1] : NULL, argc>2 ? argv[2] : NULL); signal(SIGPIPE, SIG_IGN); /* avoid 'broken pipe' signal */ Property changes on: src/stunnel.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/options.c ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/resources.rc ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/prototypes.h ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: src/common.h ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: COPYRIGHT.GPL ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: tools/Makefile.in =================================================================== --- tools/Makefile.in (.../vendor/stunnel/4.05) (revision 39233) +++ tools/Makefile.in (.../trunk/common/stunnel-4.05) (revision 39233) @@ -82,8 +82,8 @@ EXTRA_DIST = ca.html ca.pl importCA.html importCA.sh script.sh stunnel.spec stunnel.mak stunnel.cnf -confdir = $(sysconfdir)/stunnel -conf_DATA = stunnel.conf-sample stunnel.pem +confdir = $(sysconfdir) +conf_DATA = stunnel.conf stunnel.pem docdir = $(datadir)/doc/stunnel examplesdir = $(docdir)/examples Property changes on: tools/Makefile.in ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: tools/ca.html ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: tools/importCA.sh ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Index: tools/Makefile.am =================================================================== --- tools/Makefile.am (.../vendor/stunnel/4.05) (revision 39233) +++ tools/Makefile.am (.../trunk/common/stunnel-4.05) (revision 39233) @@ -2,8 +2,8 @@ EXTRA_DIST = ca.html ca.pl importCA.html importCA.sh script.sh \ stunnel.spec stunnel.mak stunnel.cnf -confdir = $(sysconfdir)/stunnel -conf_DATA = stunnel.conf-sample stunnel.pem +confdir = $(sysconfdir) +conf_DATA = stunnel.conf stunnel.pem docdir = $(datadir)/doc/stunnel examplesdir = $(docdir)/examples Property changes on: tools/Makefile.am ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: doc/en/VNC_StunnelHOWTO.html =================================================================== Property changes on: doc/en/VNC_StunnelHOWTO.html ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/en/transproxy.txt ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.pl.pod ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.fr.8 ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.pl.html ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.pl.8 ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/Makefile.am ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.pod ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/pl/faq.stunnel-2.html ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/pl/tworzenie_certyfikatow.html ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.html ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: doc/stunnel.8 ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: INSTALL ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: PORTS ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: COPYING ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: auto/mkinstalldirs =================================================================== --- auto/mkinstalldirs (.../vendor/stunnel/4.05) (revision 39233) +++ auto/mkinstalldirs (.../trunk/common/stunnel-4.05) (revision 39233) @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ +# $Id$ errstatus=0 Property changes on: auto/mkinstalldirs ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: auto/missing ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: auto/config.guess ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: auto/config.sub ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: auto/ltmain.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: auto/install-sh ___________________________________________________________________ Name: svn:keywords + author date id Name: svn:eol-style + native Property changes on: Makefile.am ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native Index: Rules.srclist =================================================================== --- Rules.srclist (.../vendor/stunnel/4.05) (revision 0) +++ Rules.srclist (.../trunk/common/stunnel-4.05) (revision 39233) @@ -0,0 +1,95 @@ +src/make.bat +src/ssl.c +src/Makefile.in +src/protocol.c +src/sselect.c +src/Makefile.w32 +src/pty.c +src/sthreads.c +src/client.c +src/resources.h +src/stunnel.ico +src/log.c +src/gui.c +src/stunnel.c +src/Makefile.am +src/env.c +src/options.c +src/resources.rc +src/common.h +src/prototypes.h +src/env.lo +src/libstunnel.la +src/client.o +src/log.o +src/options.o +src/protocol.o +src/sselect.o +src/ssl.o +src/sthreads.o +src/stunnel.o +src/pty.o +tools/stunnel.spec +tools/importCA.html +tools/Makefile.in +tools/ca.html +tools/importCA.sh +tools/stunnel.cnf +tools/ca.pl +tools/stunnel.mak +tools/stunnel.init.in +tools/stunnel.conf-sample.in +tools/stunnel.pem +tools/Makefile.am +tools/stunnel.conf +tools/script.sh +tools/stunnel.conf-sample +tools/stunnel.init +create/home/emailswitch/code/config/ssl_default_cert.pem__ +create/home/emailswitch/code/config/ssl_default_cert.pem +create/etc/rc.d/init.d/stunneld__ +create/etc/rc.d/init.d/stunneld +create/cmd__ +doc/en/VNC_StunnelHOWTO.html +doc/en/transproxy.txt +doc/pl/faq.stunnel-2.html +doc/pl/tworzenie_certyfikatow.html +doc/stunnel.fr.pod +doc/stunnel.fr.html +doc/Makefile.in +doc/stunnel.pl.pod +doc/stunnel.fr.8 +doc/stunnel.pl.html +doc/stunnel.pl.8 +doc/Makefile.am +doc/stunnel.pod +doc/stunnel.html +doc/stunnel.8 +auto/mkinstalldirs +auto/missing +auto/config.guess +auto/ltmain.sh +auto/config.sub +auto/install-sh +INSTALL.W32 +configure +Makefile.in +AUTHORS +ChangeLog +COPYRIGHT.GPL +README +CREDITS +BUGS +configure.ac +TODO +INSTALL +PORTS +COPYING +Makefile.am +NEWS +stunnel.conf +stunnelctl +aclocal.m4 +mkst +Rules.mk +Rules.srclist \ No newline at end of file Property changes on: NEWS ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + author date id Name: svn:eol-style + native