diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2017-01-20 19:38:49 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2017-01-20 19:38:49 +0000 |
commit | 64129ffe3d1ea330405becdcfa1136f116c7af79 (patch) | |
tree | a0bc0373418405c217ad8c7928264eecc40367b8 /security/sshpass/files/patch-main.c | |
parent | sysutils/rubygem-winrm: use 0.5.x version of rubyntlm (diff) |
Update to 1.0.6
- While I'm here:
- Add LICENSE_FILE
- Regenerate patch file with makepatch:
- Update WWW
Changes: https://sourceforge.net/projects/sshpass/files/sshpass/1.06/ChangeLog/view
PR: 216319
Submitted by: Hung-Yi Chen <gaod@hychen.org> (maintainer)
Diffstat (limited to 'security/sshpass/files/patch-main.c')
-rw-r--r-- | security/sshpass/files/patch-main.c | 77 |
1 files changed, 7 insertions, 70 deletions
diff --git a/security/sshpass/files/patch-main.c b/security/sshpass/files/patch-main.c index f7aa90f1c241..3e1801e86909 100644 --- a/security/sshpass/files/patch-main.c +++ b/security/sshpass/files/patch-main.c @@ -1,78 +1,15 @@ ---- main.c.orig 2011-08-06 15:04:33.000000000 +0800 -+++ main.c 2016-01-30 22:17:43.489015000 +0800 -@@ -1,5 +1,5 @@ - /* This file is part of "sshpass", a tool for batch running password ssh authentication -- * Copyright (C) 2006 Lingnu Open Source Consulting Ltd. -+ * Copyright (C) 2006, 2015 Lingnu Open Source Consulting Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -69,6 +69,8 @@ - int fd; - const char *password; - } pwsrc; -+ -+ const char *pwprompt; - } args; - - static void show_help() -@@ -77,6 +79,7 @@ - " -f filename Take password to use from file\n" - " -d number Use number as file descriptor for getting password\n" - " -p password Provide password as argument (security unwise)\n" -+ " -P prompt Which string should sshpass search for to detect a password prompt\n" - " -e Password is passed as env-var \"SSHPASS\"\n" - " With no parameters - password will be taken from stdin\n\n" - " -h Show help (this screen)\n" -@@ -99,7 +102,7 @@ - fprintf(stderr, "Conflicting password source\n"); \ - error=RETURN_CONFLICTING_ARGUMENTS; } - -- while( (opt=getopt(argc, argv, "+f:d:p:heV"))!=-1 && error==-1 ) { -+ while( (opt=getopt(argc, argv, "+f:d:p:P:heV"))!=-1 && error==-1 ) { - switch( opt ) { - case 'f': - // Password should come from a file -@@ -130,6 +133,9 @@ - optarg[i]='z'; - } - break; -+ case 'P': -+ args.pwprompt=optarg; -+ break; - case 'e': - VIRGIN_PWTYPE; - -@@ -265,6 +271,12 @@ +--- main.c.orig 2016-06-30 19:23:33 UTC ++++ main.c +@@ -280,6 +280,12 @@ int runprogram( int argc, char *argv[] ) setsid(); // This line makes the ptty our controlling tty. We do not otherwise need it open slavept=open(name, O_RDWR ); +#ifdef __FreeBSD__ -+ if (ioctl(slavept, TIOCSCTTY, NULL) == -1) { -+ perror("sshpass: Failed to TIOCSCTTY"); -+ exit(RETURN_RUNTIME_ERROR); -+ } ++ if (ioctl(slavept, TIOCSCTTY, NULL) == -1) { ++ perror("sshpass: Failed to TIOCSCTTY"); ++ exit(RETURN_RUNTIME_ERROR); ++ } +#endif close( slavept ); close( masterpt ); -@@ -359,7 +371,7 @@ - // We are looking for the string - static int prevmatch=0; // If the "password" prompt is repeated, we have the wrong password. - static int state1, state2; -- static const char compare1[]="assword:"; // Asking for a password -+ static const char *compare1=PASSWORD_PROMPT; // Asking for a password - static const char compare2[]="The authenticity of host "; // Asks to authenticate host - // static const char compare3[]="WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"; // Warns about man in the middle attack - // The remote identification changed error is sent to stderr, not the tty, so we do not handle it. -@@ -367,6 +379,10 @@ - char buffer[40]; - int ret=0; - -+ if( args.pwprompt ) { -+ compare1 = args.pwprompt; -+ } -+ - int numread=read(fd, buffer, sizeof(buffer) ); - - state1=match( compare1, buffer, numread, state1 ); |