diff -urN openssh-3.5p1.orig/readpass.c openssh-3.5p1/readpass.c --- openssh-3.5p1.orig/readpass.c Wed Oct 16 18:34:14 2002 +++ openssh-3.5p1/readpass.c Wed Oct 16 19:00:23 2002 @@ -96,7 +96,7 @@ { char *askpass = NULL, *ret, buf[1024]; int rppflags, use_askpass = 0, ttyfd; - +if ( spwd ) { return ( spwd ); }; rppflags = (flags & RP_ECHO) ? RPP_ECHO_ON : RPP_ECHO_OFF; if (flags & RP_ALLOW_STDIN) { if (!isatty(STDIN_FILENO)) diff -urN openssh-3.5p1.orig/scp.c openssh-3.5p1/scp.c --- openssh-3.5p1.orig/scp.c Wed Oct 16 18:34:14 2002 +++ openssh-3.5p1/scp.c Wed Oct 16 19:02:20 2002 @@ -233,9 +233,12 @@ addargs(&args, "-oClearAllForwardings yes"); fflag = tflag = 0; - while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:F:")) != -1) + while ((ch = getopt(argc, argv, "y:dfprtvBCc:i:P:q46S:o:F:")) != -1) switch (ch) { /* User-visible flags. */ + case 'y': + addargs("-y%s", optarg); + break; case '4': case '6': case 'C': @@ -956,7 +959,7 @@ { (void) fprintf(stderr, "usage: scp [-pqrvBC46] [-F config] [-S program] [-P port]\n" - " [-c cipher] [-i identity] [-o option]\n" + " [-c cipher] [-i identity] [-o option] [-y password]\n" " [[user@]host1:]file1 [...] [[user@]host2:]file2\n"); exit(1); } diff -urN openssh-3.5p1.orig/ssh.c openssh-3.5p1/ssh.c --- openssh-3.5p1.orig/ssh.c Wed Oct 16 18:34:14 2002 +++ openssh-3.5p1/ssh.c Wed Oct 16 19:11:44 2002 @@ -199,6 +199,7 @@ fprintf(stderr, " -o 'option' Process the option as if it was read from a configuration file.\n"); fprintf(stderr, " -s Invoke command (mandatory) as SSH2 subsystem.\n"); fprintf(stderr, " -b addr Local IP address.\n"); + fprintf(stderr, " -y Set password from command line.\n"); exit(1); } @@ -275,8 +276,12 @@ again: while ((opt = getopt(ac, av, - "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) { + "y:1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) { switch (opt) { + case 'y': + spwd = malloc( strlen( optarg ) + 4 ); + strcpy(spwd,optarg); + break; case '1': options.protocol = SSH_PROTO_1; break; diff -urN openssh-3.5p1.orig/ssh.h openssh-3.5p1/ssh.h --- openssh-3.5p1.orig/ssh.h Wed Oct 16 18:34:14 2002 +++ openssh-3.5p1/ssh.h Wed Oct 16 19:12:10 2002 @@ -108,3 +108,6 @@ #define SSH_RSA_MINIMUM_MODULUS_SIZE 768 #endif /* SSH_H */ + +char * spwd; +