shithub: drawterm

Download patch

ref: c1f45eb46dfc4e7bc5afd1d2e2e4308398b4d924
parent: 1077af5bb8c70351814b5a0042020116b23690d6
author: cinap_lenrek <[email protected]>
date: Sun Apr 17 16:21:23 EDT 2016

add -O option to disable new rcpu protocol, accept -h option just like cpu

--- a/cpu.c
+++ b/cpu.c
@@ -27,6 +27,7 @@
 static int	findkey(Authkey*, char*, char*, char*);
 
 static char	*host;
+static int	norcpu;
 static int	nokbd;
 static int	cflag;
 extern int	dbg;
@@ -50,7 +51,7 @@
 void
 usage(void)
 {
-	fprint(2, "usage: drawterm [-a authserver] [-c cpuserver] [-s secstore] [-u user] [-r root]\n");
+	fprint(2, "usage: drawterm [-BOp] [-h host | -c cpuserver] [-a authserver] [-s secstore] [-u user] [-r root]\n");
 	exits("usage");
 }
 
@@ -200,6 +201,7 @@
 	case 'a':
 		authserver = EARGF(usage());
 		break;
+	case 'h':
 	case 'c':
 		host = EARGF(usage());
 		break;
@@ -226,12 +228,12 @@
 			strcat(cmd, p);
 		}
 		break;
-	case 'k':
-		keyspec = EARGF(usage());
-		break;
 	case 's':
 		secstoreserver = EARGF(usage());
 		break;
+	case 'k':
+		keyspec = EARGF(usage());
+		break;
 	case 'u':
 		user = EARGF(usage());
 		break;
@@ -238,6 +240,9 @@
 	case 'B':
 		nokbd = 1;
 		break;
+	case 'O':
+		norcpu = 1;
+		break;
 	case 'p':
 		aanfilter = 1;
 		break;
@@ -273,7 +278,8 @@
 		}
 	}
 
-	rcpu(host);
+	if(!norcpu)
+		rcpu(host);
 
 	if((err = rexcall(&data, host, srvname)))
 		fatal(1, "%s: %s", err, host);