summaryrefslogtreecommitdiff
path: root/security/sshpass/patches/patch-main.c
blob: c33b73e0069ee37dc7ccba5b0e90a4a85af1e68a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$NetBSD: patch-main.c,v 1.1 2018/05/06 17:45:30 gavan Exp $

--- main.c.orig	2016-06-30 19:23:33.000000000 +0000
+++ main.c
@@ -280,6 +280,9 @@ 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 );
+        if ( ioctl(slavept, TIOCSCTTY, NULL) ) {
+                perror("sshpass: Failed to recover the controlling tty");
+        }
         close( slavept );
 	
 	close( masterpt );