summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--changelog36
-rw-r--r--ssh-agent-filter.C34
-rw-r--r--ssh-askpass-noinput.1.md9
-rw-r--r--version.h2
5 files changed, 63 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index f07d0d1..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 -lnettle
+LDLIBS = -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/changelog b/changelog
index 87a658b..f0e6f8e 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,39 @@
+commit a8c1ef855655e7419e54317a8e782f3993d99f7d
+Author: Timo Weingärtner <timo@tiwe.de>
+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 <timo@tiwe.de>
+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 <timo@tiwe.de>
+Date: 2013-11-02 11:38:40 +0100
+
+ replace __gnu_cxx::stdio_filebuf with boost::iostreams
+
+commit d11b2c830b7c7676d9c275d038f6a9593af2a4b8
+Author: chrysn <chrysn@fsfe.org>
+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 <timo@tiwe.de>
+Date: 2013-10-26 01:18:11 +0200
+
+ release 0.3
+
commit 5d55704009d1052db6f4039544aedb17ca8f541b
Author: chrysn <chrysn@fsfe.org>
Date: 2013-10-26 00:50:36 +0200
diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C
index dd1b508..8ee6aaf 100644
--- a/ssh-agent-filter.C
+++ b/ssh-agent-filter.C
@@ -25,6 +25,10 @@ namespace po = boost::program_options;
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
+#include <boost/iostreams/stream_buffer.hpp>
+#include <boost/iostreams/device/file_descriptor.hpp>
+namespace io = boost::iostreams;
+
#include <string>
#include <vector>
#include <set>
@@ -32,7 +36,6 @@ namespace fs = boost::filesystem;
#include <sstream>
#include <stdexcept>
#include <thread>
-#include <ext/stdio_filebuf.h>
#include <csignal>
#include <cstdlib>
@@ -201,7 +204,7 @@ void parse_cmdline (int const argc, char const * const * const argv) {
}
void setup_filters () {
- __gnu_cxx::stdio_filebuf<char> agent_filebuf{make_upstream_agent_conn(), std::ios::in | std::ios::out};
+ io::stream_buffer<io::file_descriptor> 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<char> agent_filebuf{make_upstream_agent_conn(), std::ios::in | std::ios::out};
+ io::stream_buffer<io::file_descriptor> 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<char> agent_filebuf{make_upstream_agent_conn(), std::ios::in | std::ios::out};
+ io::stream_buffer<io::file_descriptor> 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;
@@ -424,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
- __gnu_cxx::stdio_filebuf<char> client_filebuf_in{sock, std::ios::in};
- __gnu_cxx::stdio_filebuf<char> client_filebuf_out{sock, std::ios::out};
- 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<io::file_descriptor> 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) {
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 <chrysn@fsfe.org>.
+
+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.
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"