I have set up SSH with the SSH_ASKPASS and DISPLAY variable set. Everything works perfectly. When ssh is used without a tty, the askpass program is executed, providing the password. But when I change the location of the askpass program, so it contains a space in the absolute path name (for example "c:\My Documents\askpass") the askpass program cannot be found. I get a "c:\My is not recognized as an internal or external command, operable program or batch file" error message back. This indicates that openssh executes the askpass program with an absolute path, without decently quoting the string (surrounding it with "" characters). I am using the cygwin implementation of openssh, currently version 4.6p1. But I expect this bug to appear in all operating systems, supporting a space in file and directory names.
How are you specifying SSH_ASKPASS? Testing with env SSH_ASKPASS=/home/djm/bin/ssh\ askpass ssh-add </dev/null works for me as expected.
ssh-askpass is invoked (in readpass.c) via execl(2) which has no quoting requirements, as Damien's example showed. With no further info there's nothing we can do.
Close all resolved bugs after 7.3p1 release