From owner-svn-ports-head@freebsd.org Sat Jan 30 14:24:40 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3254A73EB7; Sat, 30 Jan 2016 14:24:39 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDFBB822; Sat, 30 Jan 2016 14:24:39 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UEOc6F047812; Sat, 30 Jan 2016 14:24:38 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UEOc6i047811; Sat, 30 Jan 2016 14:24:38 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201601301424.u0UEOc6i047811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 30 Jan 2016 14:24:38 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r407527 - head/security/sshpass/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 14:24:40 -0000 Author: kevlo Date: Sat Jan 30 14:24:38 2016 New Revision: 407527 URL: https://svnweb.freebsd.org/changeset/ports/407527 Log: On FreeBSD, using TIOCSCTTY ioctl to get a controlling tty. Approved by: maintainer timeout (13 months) Modified: head/security/sshpass/files/patch-main.c Modified: head/security/sshpass/files/patch-main.c ============================================================================== --- head/security/sshpass/files/patch-main.c Sat Jan 30 13:47:57 2016 (r407526) +++ head/security/sshpass/files/patch-main.c Sat Jan 30 14:24:38 2016 (r407527) @@ -1,5 +1,5 @@ ---- main.c.orig 2011-08-06 07:04:33 UTC -+++ main.c +--- 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. @@ -7,7 +7,7 @@ * * 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 @@ struct { +@@ -69,6 +69,8 @@ int fd; const char *password; } pwsrc; @@ -16,7 +16,7 @@ } args; static void show_help() -@@ -77,6 +79,7 @@ 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" @@ -24,7 +24,7 @@ " -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 @@ static int parse_options( int argc, char +@@ -99,7 +102,7 @@ fprintf(stderr, "Conflicting password source\n"); \ error=RETURN_CONFLICTING_ARGUMENTS; } @@ -33,7 +33,7 @@ switch( opt ) { case 'f': // Password should come from a file -@@ -130,6 +133,9 @@ static int parse_options( int argc, char +@@ -130,6 +133,9 @@ optarg[i]='z'; } break; @@ -43,7 +43,20 @@ case 'e': VIRGIN_PWTYPE; -@@ -359,7 +365,7 @@ int handleoutput( int fd ) +@@ -265,6 +271,12 @@ + 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); ++ } ++#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; @@ -52,7 +65,7 @@ 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 +373,10 @@ int handleoutput( int fd ) +@@ -367,6 +379,10 @@ char buffer[40]; int ret=0;