Issue when compiled against boost 1.64.0
I'm running Arch Linux, which recently received an upgrade to boost 1.64.0. I recompiled ssh-agent-filter against the new boost version, and noticed it stopped working:
[me@machine ~]$ afssh --comment [email protected] -- box.example.com
Agent pid 1234
error fetching identities for protocol 2: communication with agent failed
The agent has no identities.
Downgrading to boost 1.63.0 and recompiling again fixes the issue, so I assume that was the problem. I'm not sure if I can provide any other useful information, but I'm happy to try whatever is required to debug the issue further.
Please supply an strace of ssh-agent-filter for each version.
My usual invocation is: strace -ttTffo st -s 1024 $cmd
You might also try the --debug mode of ssh-agent-filter, follow the "copy to other terminal" instructions and run ssh-add -l there.
Are there any new compiler warnings with the new boost?
I have attached two tarballs, each containing the strace output for one of the boost library versions.
I have tried passing --debug to my afssh invocation, but if I do that, it just hangs there after key allowed by matching comment, regardless of the boost library version it was compiled against. Perhaps I'm missing something?
There are no new compiler warnings when using the new version of boost. The compiler output is identical.
to debug run ssh-agent-filter directly, without afssh:
terminal 1
ssh-agent-filter --comment [email protected] --debug
it will not fork, but spit out a variable to set in another terminal, with explanatory text.
terminal 2
-
set the variable
ssh-add -l
OK, the problem is visible in line 16 of pid 19242 vs. 19137.
That's the std::thread handling the client connection from ssh-add.
It reads the request, forwards it to the upstream agent (gnome-keyring in your case), reads its answer, filters it (invisible), and when sending the filtered answer back boost::iostreams::file_descriptor does an lseek() in the new version and fails.
Maybe I was wrong with a42c87e6a761a56ebc63cd7728fa2126b2e8805f.
Unfortunately I can't spot any relevant difference between boost-1.63.0..boost-1.64.0.
Is it possible to get a backtrace when the exception is thrown at https://github.com/tiwe-de/ssh-agent-filter/blob/master/ssh-agent-filter.C#L513 ? It should be in the operator<< when outputting the result of handle_request().
From what I can see boost:iostreams::file_descriptor is seekable by default. They fixed a bug in boostorg/iostreams@4c3ac29369c0b84941922fd203ca94fd664b4284 which now means that it does the seek that it didn't before.
According to the documentation it should be possible to set the mode to bidirectional instead, but the header has one template parameter less than the documentation.