summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-02-07 10:07:15 +0000
committerderaadt <deraadt@openbsd.org>2015-02-07 10:07:15 +0000
commite80fbf03dd036dad20732b70d06c4affaa391e67 (patch)
tree7aa6c915e084944d8f8111d44406eff1067a17b6
parentConvert tls_connect_fds() and tls_accept_socket() to the new OpenSSL error (diff)
downloadwireguard-openbsd-e80fbf03dd036dad20732b70d06c4affaa391e67.tar.xz
wireguard-openbsd-e80fbf03dd036dad20732b70d06c4affaa391e67.zip
remove unused cu(1) support in tip; it is supplied as a seperate
simpler binary written by nicm since 5.4 ok jsing dlg
-rw-r--r--usr.bin/tip/Makefile4
-rw-r--r--usr.bin/tip/cu.c187
-rw-r--r--usr.bin/tip/tip.c22
-rw-r--r--usr.bin/tip/tip.h6
4 files changed, 7 insertions, 212 deletions
diff --git a/usr.bin/tip/Makefile b/usr.bin/tip/Makefile
index 2b28a3299f2..4ab78981666 100644
--- a/usr.bin/tip/Makefile
+++ b/usr.bin/tip/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.16 2013/03/10 17:55:54 nicm Exp $
+# $OpenBSD: Makefile,v 1.17 2015/02/07 10:07:15 deraadt Exp $
PROG= tip
MAN= tip.1
@@ -7,7 +7,7 @@ CFLAGS+=-I${.CURDIR} -DDEFBR=9600 -DDEFFS=BUFSIZ
LDADD= -lutil
DPADD= ${LIBUTIL}
-SRCS= cmds.c cmdtab.c cu.c hunt.c log.c partab.c remote.c tip.c \
+SRCS= cmds.c cmdtab.c hunt.c log.c partab.c remote.c tip.c \
tipout.c value.c
.include <bsd.prog.mk>
diff --git a/usr.bin/tip/cu.c b/usr.bin/tip/cu.c
deleted file mode 100644
index 01d88caafbe..00000000000
--- a/usr.bin/tip/cu.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* $OpenBSD: cu.c,v 1.37 2010/07/03 03:33:12 nicm Exp $ */
-/* $NetBSD: cu.c,v 1.5 1997/02/11 09:24:05 mrg Exp $ */
-
-/*
- * Copyright (c) 1983, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <err.h>
-#include <paths.h>
-#include <util.h>
-
-#include "tip.h"
-
-static void cuusage(void);
-
-/*
- * Botch the interface to look like cu's
- */
-void
-cumain(int argc, char *argv[])
-{
- int ch, i, parity, baudrate;
- const char *errstr;
- static char sbuf[12];
- char *device;
-
- if (argc < 2)
- cuusage();
- vsetnum(BAUDRATE, DEFBR);
- parity = 0; /* none */
-
- /*
- * Convert obsolecent -### speed to modern -s### syntax which
- * getopt() can handle.
- */
- for (i = 1; i < argc; i++) {
- if (argv[i][0] == '-') {
- switch (argv[i][1]) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- ch = snprintf(sbuf, sizeof(sbuf), "-s%s",
- &argv[i][1]);
- if (ch <= 0 || ch >= sizeof(sbuf)) {
- errx(3, "invalid speed: %s",
- &argv[i][1]);
- }
- argv[i] = sbuf;
- break;
- case '-':
- /* if we get "--" stop processing args */
- if (argv[i][2] == '\0')
- goto getopt;
- break;
- }
- }
- }
-
-getopt:
- while ((ch = getopt(argc, argv, "l:s:htoe")) != -1) {
- switch (ch) {
- case 'l':
- if (vgetstr(DEVICE) != NULL) {
- fprintf(stderr,
- "%s: cannot specify multiple -l options\n",
- __progname);
- exit(3);
- }
- if (strchr(optarg, '/'))
- vsetstr(DEVICE, optarg);
- else {
- if (asprintf(&device,
- "%s%s", _PATH_DEV, optarg) == -1)
- err(3, "asprintf");
- vsetstr(DEVICE, device);
- }
- break;
- case 's':
- baudrate = (int)strtonum(optarg, 0, INT_MAX, &errstr);
- if (errstr)
- errx(3, "speed is %s: %s", errstr, optarg);
- vsetnum(BAUDRATE, baudrate);
- break;
- case 'h':
- vsetnum(LECHO, 1);
- vsetnum(HALFDUPLEX, 1);
- break;
- case 't':
- /* Was for a hardwired dial-up connection. */
- break;
- case 'o':
- if (parity != 0)
- parity = 0; /* -e -o */
- else
- parity = 1; /* odd */
- break;
- case 'e':
- if (parity != 0)
- parity = 0; /* -o -e */
- else
- parity = -1; /* even */
- break;
- default:
- cuusage();
- break;
- }
- }
- argc -= optind;
- argv += optind;
-
- switch (argc) {
- case 1:
- /* Was phone number but now ignored. */
- case 0:
- break;
- default:
- cuusage();
- break;
- }
-
- signal(SIGINT, cleanup);
- signal(SIGQUIT, cleanup);
- signal(SIGHUP, cleanup);
- signal(SIGTERM, cleanup);
- signal(SIGCHLD, SIG_DFL);
-
- /*
- * The "cu" host name is used to define the
- * attributes of the generic dialer.
- */
- snprintf(sbuf, sizeof(sbuf), "cu%d", vgetnum(BAUDRATE));
- FD = hunt(sbuf);
- setbuf(stdout, NULL);
-
- loginit();
-
- switch (parity) {
- case -1:
- setparity("even");
- break;
- case 1:
- setparity("odd");
- break;
- default:
- setparity("none");
- break;
- }
- vsetnum(VERBOSE, 0);
- if (ttysetup(vgetnum(BAUDRATE))) {
- fprintf(stderr, "%s: unsupported speed %d\n",
- __progname, vgetnum(BAUDRATE));
- (void)uu_unlock(uucplock);
- exit(3);
- }
- con();
-}
-
-static void
-cuusage(void)
-{
- fprintf(stderr, "usage: cu [-eho] [-l line] [-s speed | -speed]\n");
- exit(8);
-}
diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c
index e911cb018f1..98727ab64d1 100644
--- a/usr.bin/tip/tip.c
+++ b/usr.bin/tip/tip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tip.c,v 1.54 2012/12/04 19:31:17 kettenis Exp $ */
+/* $OpenBSD: tip.c,v 1.55 2015/02/07 10:07:15 deraadt Exp $ */
/* $NetBSD: tip.c,v 1.13 1997/04/20 00:03:05 mellon Exp $ */
/*
@@ -33,8 +33,6 @@
/*
* tip - UNIX link to other systems
* tip [-v] [-speed] system-name
- * or
- * cu phone-number [-s speed] [-l line]
*/
#include <sys/types.h>
@@ -59,12 +57,6 @@ main(int argc, char *argv[])
/* XXX preserve previous braindamaged behavior */
vsetnum(DC, 1);
- if (strcmp(__progname, "cu") == 0) {
- cumode = 1;
- cumain(argc, argv);
- goto cucommon;
- }
-
if (argc > 4) {
fprintf(stderr, "usage: tip [-nv] [-speed] [system-name]\n");
exit(1);
@@ -119,12 +111,6 @@ main(int argc, char *argv[])
}
con();
-cucommon:
- /*
- * From here down the code is shared with
- * the "cu" version of tip.
- */
-
i = fcntl(FD, F_GETFL);
if (i == -1) {
perror("fcntl");
@@ -169,7 +155,7 @@ cucommon:
* internal data structures (variables)
* so, fork one process for local side and one for remote.
*/
- printf(cumode ? "Connected\r\n" : "\07connected\r\n");
+ printf("\07connected\r\n");
tipin_pid = getpid();
switch (tipout_pid = fork()) {
case -1:
@@ -305,7 +291,7 @@ tipin(void)
if (!(gch = escape()))
continue;
}
- } else if (!cumode && gch == vgetnum(RAISECHAR)) {
+ } else if (gch == vgetnum(RAISECHAR)) {
vsetnum(RAISE, !vgetnum(RAISE));
continue;
} else if (gch == '\r') {
@@ -315,7 +301,7 @@ tipin(void)
if (vgetnum(HALFDUPLEX))
printf("\r\n");
continue;
- } else if (!cumode && gch == vgetnum(FORCE)) {
+ } else if (gch == vgetnum(FORCE)) {
gch = getchar();
if (gch == EOF)
cleanup(0);
diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h
index 61126f1784d..781003d0dbc 100644
--- a/usr.bin/tip/tip.h
+++ b/usr.bin/tip/tip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tip.h,v 1.52 2010/07/02 07:32:16 nicm Exp $ */
+/* $OpenBSD: tip.h,v 1.53 2015/02/07 10:07:15 deraadt Exp $ */
/* $NetBSD: tip.h,v 1.7 1997/04/20 00:02:46 mellon Exp $ */
/*
@@ -157,7 +157,6 @@ volatile sig_atomic_t stop; /* stop transfer session flag */
volatile sig_atomic_t quit; /* same; but on other end */
volatile sig_atomic_t stoprompt;/* for interrupting a prompt session */
volatile sig_atomic_t timedout; /* ~> transfer timedout */
-int cumode; /* simulating the "cu" program */
int bits8; /* terminal is 8-bit mode */
#define STRIP_PAR (bits8 ? 0377 : 0177)
@@ -192,9 +191,6 @@ void timeout(int);
void tipabort(char *);
void variable(int);
-/* cu.c */
-void cumain(int, char **);
-
/* hunt.c */
int hunt(char *);