mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-12-28 01:40:37 +00:00
Add askpass.c source code
This commit is contained in:
parent
ab7e1e8f32
commit
5f971b8d4f
2 changed files with 24 additions and 0 deletions
24
askpass.c
Normal file
24
askpass.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
ssh-add on Windows (probably part of the source at https://github.com/PowerShell/openssh-portable)
|
||||
does not/can not read the passphrase from stdin.
|
||||
|
||||
However, when the DISPLAY env var is set and ssh-add is not run from a terminal (however it tests
|
||||
that), it will run the executable pointed to by SSH_ASKPASS in a subprocess and read the passphrase
|
||||
from that subprocess' stdout.
|
||||
|
||||
This program can be used as the SSH_ASKPASS implementation. It will return the passphrase set
|
||||
in the SSH_PASS env variable.
|
||||
|
||||
To cross-compile from Ubuntu, I installed the `mingw-w64` package and ran
|
||||
$ x86_64-w64-mingw32-gcc askpass.c -static -o askpass.exe
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
printf("%s\n", getenv("SSH_PASS"));
|
||||
|
||||
return 0;
|
||||
}
|
BIN
askpass.exe
BIN
askpass.exe
Binary file not shown.
Loading…
Reference in a new issue