From d11b2c830b7c7676d9c275d038f6a9593af2a4b8 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sat, 26 Oct 2013 10:53:24 +0200 Subject: confirm the license statement about files i created --- ssh-askpass-noinput.1.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ssh-askpass-noinput.1.md b/ssh-askpass-noinput.1.md index 2c9ce73..7b103ed 100644 --- a/ssh-askpass-noinput.1.md +++ b/ssh-askpass-noinput.1.md @@ -46,3 +46,12 @@ and implemented for *ssh-askpass* to be used more flexibly. # SEE ALSO ssh-agent-filter(1), ssh-agent(1), ssh-askpass(1) + +# AUTHORS + +ssh-askpass-noinput was conceived by chrysn . + +Both the program and this man page are free software; you can redistribute it +and/or modify it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 3 of the License, or (at your +option) any later version. -- cgit v1.2.3 From b05034bc176b38b3b3f31c7a2e1e53b4c16f61e2 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Sat, 2 Nov 2013 11:38:40 +0100 Subject: replace __gnu_cxx::stdio_filebuf with boost::iostreams --- Makefile | 2 +- ssh-agent-filter.C | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f07d0d1..d929b6c 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ CXXFLAGS ?= -g -O2 -Wall -Wold-style-cast CXXFLAGS += -std=c++11 -LDFLAGS += -lstdc++ -lboost_program_options -lboost_filesystem -lboost_system -lnettle +LDFLAGS += -lstdc++ -lboost_program_options -lboost_filesystem -lboost_system -lboost_iostreams -lnettle all: ssh-agent-filter.1 afssh.1 ssh-askpass-noinput.1 diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C index dd1b508..b4234c3 100644 --- a/ssh-agent-filter.C +++ b/ssh-agent-filter.C @@ -25,6 +25,10 @@ namespace po = boost::program_options; #include namespace fs = boost::filesystem; +#include +#include +namespace io = boost::iostreams; + #include #include #include @@ -32,7 +36,6 @@ namespace fs = boost::filesystem; #include #include #include -#include #include #include @@ -201,7 +204,7 @@ void parse_cmdline (int const argc, char const * const * const argv) { } void setup_filters () { - __gnu_cxx::stdio_filebuf agent_filebuf{make_upstream_agent_conn(), std::ios::in | std::ios::out}; + io::stream_buffer agent_filebuf{make_upstream_agent_conn(), io::close_handle}; std::iostream agent{&agent_filebuf}; agent.exceptions(std::ios::badbit | std::ios::failbit); @@ -325,7 +328,7 @@ rfc4251string handle_request (rfc4251string const & r) { switch (request_code) { case SSH2_AGENTC_REQUEST_IDENTITIES: { - __gnu_cxx::stdio_filebuf agent_filebuf{make_upstream_agent_conn(), std::ios::in | std::ios::out}; + io::stream_buffer agent_filebuf{make_upstream_agent_conn(), io::close_handle}; std::iostream agent{&agent_filebuf}; agent.exceptions(std::ios::badbit | std::ios::failbit); rfc4251string agent_answer; @@ -383,7 +386,7 @@ rfc4251string handle_request (rfc4251string const & r) { } if (allow) { - __gnu_cxx::stdio_filebuf agent_filebuf{make_upstream_agent_conn(), std::ios::in | std::ios::out}; + io::stream_buffer agent_filebuf{make_upstream_agent_conn(), io::close_handle}; std::iostream agent{&agent_filebuf}; agent.exceptions(std::ios::badbit | std::ios::failbit); rfc4251string agent_answer; @@ -428,8 +431,8 @@ void handle_client (int const sock) { // we could use only one streambuf and iostream but when // switching from read to write an lseek call is made that // fails with ESPIPE and causes an exception - __gnu_cxx::stdio_filebuf client_filebuf_in{sock, std::ios::in}; - __gnu_cxx::stdio_filebuf client_filebuf_out{sock, std::ios::out}; + io::stream_buffer client_filebuf_in{sock, io::close_handle}; + io::stream_buffer client_filebuf_out{sock, io::never_close_handle}; std::istream client_in{&client_filebuf_in}; std::ostream client_out{&client_filebuf_out}; client_out.exceptions(std::ios::badbit | std::ios::failbit); -- cgit v1.2.3 From a42c87e6a761a56ebc63cd7728fa2126b2e8805f Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Sat, 2 Nov 2013 12:27:10 +0100 Subject: (re)unify client iostreams boost::iostreams does not do lseek()s without being asked extend try-block around entire function --- ssh-agent-filter.C | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C index b4234c3..8ee6aaf 100644 --- a/ssh-agent-filter.C +++ b/ssh-agent-filter.C @@ -427,22 +427,17 @@ rfc4251string handle_request (rfc4251string const & r) { return rfc4251string{answer.str()}; } -void handle_client (int const sock) { - // we could use only one streambuf and iostream but when - // switching from read to write an lseek call is made that - // fails with ESPIPE and causes an exception - io::stream_buffer client_filebuf_in{sock, io::close_handle}; - io::stream_buffer client_filebuf_out{sock, io::never_close_handle}; - std::istream client_in{&client_filebuf_in}; - std::ostream client_out{&client_filebuf_out}; - client_out.exceptions(std::ios::badbit | std::ios::failbit); +void handle_client (int const sock) try { + io::stream_buffer client_filebuf{sock, io::close_handle}; + std::iostream client{&client_filebuf}; + client.exceptions(std::ios::badbit | std::ios::failbit); - rfc4251string request; - while (client_in >> request) try { - client_out << handle_request(request) << std::flush; - } catch (...) { - break; + for (;;) { + rfc4251string request; + client >> request; + client << handle_request(request) << std::flush; } +} catch (...) { } void sighandler (int sig) { -- cgit v1.2.3 From a8c1ef855655e7419e54317a8e782f3993d99f7d Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Wed, 13 Nov 2013 23:42:46 +0100 Subject: use LDLIBS instead of LDFLAGS LDLIBS are put behind the prerequisites by make's built-in rules so linking won't fail with --as-needed. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d929b6c..378c33d 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ CXXFLAGS ?= -g -O2 -Wall -Wold-style-cast CXXFLAGS += -std=c++11 -LDFLAGS += -lstdc++ -lboost_program_options -lboost_filesystem -lboost_system -lboost_iostreams -lnettle +LDLIBS = -lstdc++ -lboost_program_options -lboost_filesystem -lboost_system -lboost_iostreams -lnettle all: ssh-agent-filter.1 afssh.1 ssh-askpass-noinput.1 -- cgit v1.2.3 From 477a0a0f1507413be7a5d2882aba28d01f7e6111 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Thu, 19 Dec 2013 15:47:43 +0100 Subject: release 0.3.1 --- changelog | 36 ++++++++++++++++++++++++++++++++++++ version.h | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/changelog b/changelog index 87a658b..f0e6f8e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,39 @@ +commit a8c1ef855655e7419e54317a8e782f3993d99f7d +Author: Timo Weingärtner +Date: 2013-11-13 23:42:46 +0100 + + use LDLIBS instead of LDFLAGS + + LDLIBS are put behind the prerequisites by make's built-in rules so linking + won't fail with --as-needed. + +commit a42c87e6a761a56ebc63cd7728fa2126b2e8805f +Author: Timo Weingärtner +Date: 2013-11-02 12:27:10 +0100 + + (re)unify client iostreams + + boost::iostreams does not do lseek()s without being asked + extend try-block around entire function + +commit b05034bc176b38b3b3f31c7a2e1e53b4c16f61e2 +Author: Timo Weingärtner +Date: 2013-11-02 11:38:40 +0100 + + replace __gnu_cxx::stdio_filebuf with boost::iostreams + +commit d11b2c830b7c7676d9c275d038f6a9593af2a4b8 +Author: chrysn +Date: 2013-10-26 10:53:24 +0200 + + confirm the license statement about files i created + +commit bd2154e05c0ab15d8e25f997fb4e6ec61f7a4c1f (tag: 0.3) +Author: Timo Weingärtner +Date: 2013-10-26 01:18:11 +0200 + + release 0.3 + commit 5d55704009d1052db6f4039544aedb17ca8f541b Author: chrysn Date: 2013-10-26 00:50:36 +0200 diff --git a/version.h b/version.h index 964fa23..9572eb4 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define SSH_AGENT_FILTER_VERSION "ssh-agent-filter 0.3" +#define SSH_AGENT_FILTER_VERSION "ssh-agent-filter 0.3.1" -- cgit v1.2.3