Bug#420454: openssh-client: Please include a LD_PRELOAD enabled ssh-agent wrapper
Package: openssh-client
Version: 1:4.3p2-10
Severity: wishlist
Tags: patch
Because it is a setgid binary, ssh-agent does not propagate some
environment variables like LD_PRELOAD. This is a known problem according
to the documentation, which suggests to write a wrapper.
It would be better to include such a wrapper in the package itself, so
I'm attaching one.
--
.''`.
: :' : We are debian.org. Lower your prices, surrender your code.
`. `' We will add your hardware and software distinctiveness to
`- our own. Resistance is futile.
#! /bin/sh
set -e
agent=/usr/bin/ssh-agent
agent_opts=
help()
{
echo "Usage: $0 [options] command [args ...]"
echo "Options:"
echo " -d Debug mode."
echo " -a socket Bind agent socket to given name."
echo " -t life Default identity lifetime (seconds)."
exit 1
}
while getopts a:t:d opt
do
case "$opt" in
a) agent_opts="$agent_opts -a \"$OPTARG\"";;
t) agent_opts="$agent_opts -t \"$OPTARG\"";;
d) agent_opts="$agent_opts -d";;
\?) help;;
esac
done
if ! shift $((${OPTIND} - 1)); then
help
fi
res=$(eval $agent $agent_opts)
eval "$res" > /dev/null
"$@"
eval $($agent -k) >/dev/null
Reply to: