Integrating valgrind with sftp-server

Damien Miller djm at mindrot.org
Thu Jul 18 10:36:04 EST 2013



On Wed, 17 Jul 2013, Kaushik Muthuravichandran wrote:

> Hi,
> 
> I am trying to integrate valgrind with sftp-server. I've replaced the sftp
> subsystem line  in /etc/ssh/sshd_config file as follows:
> 
> Subsystem       sftp    /usr/bin/valgrind --log-file=~/abc
> --trace-children=yes /root/openssh-6.2p2/sftp-server

It's probably because of the '~' in the path:

valgrind: --log-file: filename begins with '~'
valgrind: You probably expected the shell to expand the '~', but it
valgrind: didn't.  The rules for '~'-expansion vary from shell to shell.
valgrind: You might have more luck using $HOME instead.
valgrind: Bad option: --log-file=~/sftp-server.valgrind
valgrind: Use --help for more information or consult the user manual.

You don't need to run sftp-server via sshd to test it anyway:

cat > ~/sftp-server-valgrind << EOF
#!/bin/bash

valgrind --log-file=${HOME}/sftp-server.valgrind /path/to/openssh/sftp-server
EOF

sftp -D $HOME/sftp-server-valgrind

should do what you want.

-d



More information about the openssh-unix-dev mailing list