summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-01 23:24:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-01 23:24:29 +0000
commitbd87f76711efa9118d7275364eadb475f7fc6e83 (patch)
treeee6394e049a53a97d2a72400b8ca8ff03db910b5 /usr.bin
parentf9e9659b09907d7ab1ae5a11c1007a6e313d00de (diff)
Wall pass, and oflow fix from eivind@bitbox.follo.net
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tip/acu.c11
-rw-r--r--usr.bin/tip/aculib/courier.c15
-rw-r--r--usr.bin/tip/cmds.c64
-rw-r--r--usr.bin/tip/cu.c8
-rw-r--r--usr.bin/tip/hunt.c6
-rw-r--r--usr.bin/tip/log.c7
-rw-r--r--usr.bin/tip/remote.c6
-rw-r--r--usr.bin/tip/tip.c40
-rw-r--r--usr.bin/tip/tip.h41
-rw-r--r--usr.bin/tip/tipout.c5
-rw-r--r--usr.bin/tip/uucplock.c14
-rw-r--r--usr.bin/tip/value.c23
12 files changed, 172 insertions, 68 deletions
diff --git a/usr.bin/tip/acu.c b/usr.bin/tip/acu.c
index 01ddbcb5b1d..5f71f63212b 100644
--- a/usr.bin/tip/acu.c
+++ b/usr.bin/tip/acu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acu.c,v 1.3 1997/04/02 01:47:01 millert Exp $ */
+/* $OpenBSD: acu.c,v 1.4 1997/09/01 23:24:23 deraadt Exp $ */
/* $NetBSD: acu.c,v 1.4 1996/12/29 10:34:03 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)acu.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: acu.c,v 1.3 1997/04/02 01:47:01 millert Exp $";
+static char rcsid[] = "$OpenBSD: acu.c,v 1.4 1997/09/01 23:24:23 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -70,7 +70,7 @@ connect()
register char *cp = PN;
char *phnum, string[256];
FILE *fd;
- int tried = 0;
+ volatile int tried = 0;
if (!DU) { /* regular connect message */
if (CM != NOSTR)
@@ -107,7 +107,7 @@ connect()
if (*cp)
*cp++ = '\0';
- if (conflag = (*acu->acu_dialer)(phnum, CU)) {
+ if ((conflag = (*acu->acu_dialer)(phnum, CU))) {
if (CM != NOSTR)
pwrite(FD, CM, size(CM));
logent(value(HOST), phnum, acu->acu_name,
@@ -144,7 +144,7 @@ connect()
if (*cp)
*cp++ = '\0';
- if (conflag = (*acu->acu_dialer)(phnum, CU)) {
+ if ((conflag = (*acu->acu_dialer)(phnum, CU))) {
fclose(fd);
if (CM != NOSTR)
pwrite(FD, CM, size(CM));
@@ -165,6 +165,7 @@ connect()
return (tried ? "call failed" : "missing phone number");
}
+void
disconnect(reason)
char *reason;
{
diff --git a/usr.bin/tip/aculib/courier.c b/usr.bin/tip/aculib/courier.c
index 669af03ad6f..c335cbd2f48 100644
--- a/usr.bin/tip/aculib/courier.c
+++ b/usr.bin/tip/aculib/courier.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: courier.c,v 1.5 1997/04/02 01:47:06 millert Exp $ */
+/* $OpenBSD: courier.c,v 1.6 1997/09/01 23:24:28 deraadt Exp $ */
/* $NetBSD: courier.c,v 1.7 1997/02/11 09:24:16 mrg Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: courier.c,v 1.5 1997/04/02 01:47:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: courier.c,v 1.6 1997/09/01 23:24:28 deraadt Exp $";
#endif /* not lint */
/*
@@ -56,8 +56,12 @@ static int timeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf, intbuf;
static int coursync(), cour_connect(), cour_swallow();
+void cour_nap();
static void cour_napx();
+void cour_disconnect __P((void));
+
+int
cour_dialer(num, acu)
register char *num;
char *acu;
@@ -115,6 +119,7 @@ badsynch:
return (connected);
}
+void
cour_disconnect()
{
/* first hang up the modem*/
@@ -125,6 +130,7 @@ cour_disconnect()
close(FD);
}
+void
cour_abort()
{
cour_write(FD, "\r", 1); /* send anything to abort the call */
@@ -141,8 +147,8 @@ sigALRM()
static int
cour_swallow(match)
- register char *match;
- {
+ register char *match;
+{
sig_t f;
char c;
@@ -348,6 +354,7 @@ static napms = 50; /* Give the courier 50 milliseconds between characters */
static int ringring;
+void
cour_nap()
{
int omask;
diff --git a/usr.bin/tip/cmds.c b/usr.bin/tip/cmds.c
index 1a81d83de37..0530eca9e93 100644
--- a/usr.bin/tip/cmds.c
+++ b/usr.bin/tip/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.6 1997/08/22 22:42:07 millert Exp $ */
+/* $OpenBSD: cmds.c,v 1.7 1997/09/01 23:24:23 deraadt Exp $ */
/* $NetBSD: cmds.c,v 1.7 1997/02/11 09:24:03 mrg Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cmds.c,v 1.6 1997/08/22 22:42:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmds.c,v 1.7 1997/09/01 23:24:23 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -64,6 +64,7 @@ void intcopy(); /* interrupt routine for file transfers */
* FTP - remote ==> local
* get a file from the remote host
*/
+void
getfl(c)
char c;
{
@@ -94,6 +95,7 @@ getfl(c)
/*
* Cu-like take command
*/
+void
cu_take(cc)
char cc;
{
@@ -102,7 +104,8 @@ cu_take(cc)
if (prompt("[take] ", copyname, sizeof(copyname)))
return;
- if ((argc = args(copyname, argv)) < 1 || argc > 2) {
+ if ((argc = args(copyname, argv, sizeof(argv)/sizeof(argv[0]))) < 1 ||
+ argc > 2) {
printf("usage: <take> from [to]\r\n");
return;
}
@@ -118,16 +121,19 @@ cu_take(cc)
}
static jmp_buf intbuf;
+
/*
* Bulk transfer routine --
* used by getfl(), cu_take(), and pipefile()
*/
+void
transfer(buf, fd, eofchars)
char *buf, *eofchars;
+ int fd;
{
register int ct;
char c, buffer[BUFSIZ];
- register char *p = buffer;
+ char *p = buffer;
register int cnt, eof;
time_t start;
sig_t f;
@@ -174,7 +180,7 @@ transfer(buf, fd, eofchars)
p = buffer;
}
}
- if (cnt = (p-buffer))
+ if ((cnt = (p-buffer)))
if (write(fd, buffer, cnt) != cnt)
printf("\r\nwrite error\r\n");
@@ -190,6 +196,7 @@ transfer(buf, fd, eofchars)
* FTP - remote ==> local process
* send remote input to local process via pipe
*/
+void
pipefile()
{
int cpid, pdes[2];
@@ -249,6 +256,7 @@ stopsnd()
* send local file to remote host
* terminate transmission with pseudo EOF sequence
*/
+void
sendfile(cc)
char cc;
{
@@ -280,6 +288,7 @@ sendfile(cc)
* Bulk transfer routine to remote host --
* used by sendfile() and cu_put()
*/
+void
transmit(fd, eofchars, command)
FILE *fd;
char *eofchars, *command;
@@ -377,6 +386,7 @@ out:
/*
* Cu-like put command
*/
+void
cu_put(cc)
char cc;
{
@@ -388,7 +398,8 @@ cu_put(cc)
if (prompt("[put] ", copyname, sizeof(copyname)))
return;
- if ((argc = args(copyname, argv)) < 1 || argc > 2) {
+ if ((argc = args(copyname, argv, sizeof(argv)/sizeof(argv[0]))) < 1 ||
+ argc > 2) {
printf("usage: <put> from [to]\r\n");
return;
}
@@ -411,8 +422,9 @@ cu_put(cc)
* FTP - send single character
* wait for echo & handle timeout
*/
+void
send(c)
- char c;
+ int c;
{
char cc;
int retry = 0;
@@ -455,11 +467,12 @@ timeout()
* Stolen from consh() -- puts a remote file on the output of a local command.
* Identical to consh() except for where stdout goes.
*/
+void
pipeout(c)
{
char buf[256];
int cpid, status, p;
- time_t start;
+ time_t start = time(NULL);
putchar(c);
if (prompt("Local command? ", buf, sizeof(buf)))
@@ -476,7 +489,7 @@ pipeout(c)
if ((cpid = fork()) < 0)
printf("can't fork!\r\n");
else if (cpid) {
- start = time(0);
+ start = time(NULL);
while ((p = wait(&status)) > 0 && p != cpid)
;
} else {
@@ -506,11 +519,12 @@ pipeout(c)
* 1 <-> remote tty out
* 2 <-> local tty out
*/
+void
consh(c)
{
char buf[256];
int cpid, status, p;
- time_t start;
+ time_t start = time(NULL);
putchar(c);
if (prompt("Local command? ", buf, sizeof(buf)))
@@ -555,17 +569,17 @@ consh(c)
/*
* Escape to local shell
*/
+void
shell()
{
int shpid, status;
- extern char **environ;
char *cp;
printf("[sh]\r\n");
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
unraw();
- if (shpid = fork()) {
+ if ((shpid = fork())) {
while (shpid != wait(&status));
raw();
printf("\r\n!\r\n");
@@ -590,6 +604,7 @@ shell()
* TIPIN portion of scripting
* initiate the conversation with TIPOUT
*/
+void
setscript()
{
char c;
@@ -612,6 +627,7 @@ setscript()
* Change current working directory of
* local portion of tip
*/
+void
chdirectory()
{
char dirname[PATH_MAX];
@@ -627,6 +643,7 @@ chdirectory()
printf("!\r\n");
}
+void
tipabort(msg)
char *msg;
{
@@ -642,6 +659,7 @@ tipabort(msg)
exit(0);
}
+void
finish()
{
char *dismsg;
@@ -661,6 +679,7 @@ intcopy()
longjmp(intbuf, 1);
}
+void
execute(s)
char *s;
{
@@ -674,8 +693,10 @@ execute(s)
execl(value(SHELL), cp, "-c", s, 0);
}
-args(buf, a)
+int
+args(buf, a, num)
char *buf, *a[];
+ int num;
{
register char *p = buf, *start;
register char **parg = a;
@@ -693,11 +714,12 @@ args(buf, a)
parg++, n++;
if (*p)
*p++ = '\0';
- } while (*p);
+ } while (*p && n < num);
return(n);
}
+void
prtime(s, a)
char *s;
time_t a;
@@ -717,6 +739,7 @@ prtime(s, a)
printf("\r\n!\r\n");
}
+void
variable()
{
char buf[256];
@@ -756,13 +779,14 @@ variable()
}
if (vtable[PARITY].v_access&CHANGED) {
vtable[PARITY].v_access &= ~CHANGED;
- setparity();
+ setparity(NOSTR);
}
}
/*
* Turn tandem mode on or off for remote tty.
*/
+void
tandem(option)
char *option;
{
@@ -783,6 +807,7 @@ tandem(option)
/*
* Send a break.
*/
+void
genbrk()
{
@@ -794,6 +819,7 @@ genbrk()
/*
* Suspend tip
*/
+void
suspend(c)
char c;
{
@@ -813,9 +839,9 @@ expand(name)
{
static char xname[BUFSIZ];
char cmdbuf[BUFSIZ];
- register int pid, l, rc;
+ register int pid, l;
register char *cp, *Shell;
- int s, pivec[2], (*sigint)();
+ int s, pivec[2];
if (!anyof(name, "~{[*?$`'\"\\"))
return(name);
@@ -877,13 +903,13 @@ expand(name)
/*
* Are any of the characters in the two strings the same?
*/
-
+int
anyof(s1, s2)
register char *s1, *s2;
{
register int c;
- while (c = *s1++)
+ while ((c = *s1++))
if (any(c, s2))
return(1);
return(0);
diff --git a/usr.bin/tip/cu.c b/usr.bin/tip/cu.c
index 269ba10aa47..f5970a66d26 100644
--- a/usr.bin/tip/cu.c
+++ b/usr.bin/tip/cu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cu.c,v 1.3 1997/04/02 01:47:02 millert Exp $ */
+/* $OpenBSD: cu.c,v 1.4 1997/09/01 23:24:24 deraadt Exp $ */
/* $NetBSD: cu.c,v 1.5 1997/02/11 09:24:05 mrg Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cu.c,v 1.3 1997/04/02 01:47:02 millert Exp $";
+static char rcsid[] = "$OpenBSD: cu.c,v 1.4 1997/09/01 23:24:24 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -48,7 +48,9 @@ void cleanup();
/*
* Botch the interface to look like cu's
*/
+void
cumain(argc, argv)
+ int argc;
char *argv[];
{
register int i;
@@ -109,7 +111,7 @@ cumain(argc, argv)
* The "cu" host name is used to define the
* attributes of the generic dialer.
*/
- (void)snprintf(sbuf, sizeof(sbuf), "cu%d", BR);
+ (void)snprintf(sbuf, sizeof(sbuf), "cu%ld", BR);
if ((i = hunt(sbuf)) == 0) {
printf("all ports busy\n");
exit(3);
diff --git a/usr.bin/tip/hunt.c b/usr.bin/tip/hunt.c
index fd2d22d87da..4c84e0f1ee8 100644
--- a/usr.bin/tip/hunt.c
+++ b/usr.bin/tip/hunt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hunt.c,v 1.5 1997/04/20 23:29:32 millert Exp $ */
+/* $OpenBSD: hunt.c,v 1.6 1997/09/01 23:24:24 deraadt Exp $ */
/* $NetBSD: hunt.c,v 1.6 1997/04/20 00:02:10 mellon Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: hunt.c,v 1.5 1997/04/20 23:29:32 millert Exp $";
+static char rcsid[] = "$OpenBSD: hunt.c,v 1.6 1997/09/01 23:24:24 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -63,7 +63,7 @@ hunt(name)
sig_t f;
f = signal(SIGALRM, dead);
- while (cp = getremote(name)) {
+ while ((cp = getremote(name))) {
deadfl = 0;
uucplock = strrchr(cp, '/')+1;
if (uu_lock(uucplock) < 0)
diff --git a/usr.bin/tip/log.c b/usr.bin/tip/log.c
index 57cd3c9a135..25b7eaa8b10 100644
--- a/usr.bin/tip/log.c
+++ b/usr.bin/tip/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.2 1996/06/26 05:40:44 deraadt Exp $ */
+/* $OpenBSD: log.c,v 1.3 1997/09/01 23:24:25 deraadt Exp $ */
/* $NetBSD: log.c,v 1.4 1994/12/24 17:56:28 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: log.c,v 1.2 1996/06/26 05:40:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: log.c,v 1.3 1997/09/01 23:24:25 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -49,7 +49,7 @@ static FILE *flog = NULL;
/*
* Log file maintenance routines
*/
-
+void
logent(group, num, acu, message)
char *group, *num, *acu, *message;
{
@@ -83,6 +83,7 @@ logent(group, num, acu, message)
(void) flock(fileno(flog), LOCK_UN);
}
+void
loginit()
{
flog = fopen(value(LOG), "a");
diff --git a/usr.bin/tip/remote.c b/usr.bin/tip/remote.c
index ac6bc48230e..a791839a772 100644
--- a/usr.bin/tip/remote.c
+++ b/usr.bin/tip/remote.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: remote.c,v 1.5 1997/04/20 23:29:33 millert Exp $ */
+/* $OpenBSD: remote.c,v 1.6 1997/09/01 23:24:25 deraadt Exp $ */
/* $NetBSD: remote.c,v 1.5 1997/04/20 00:02:45 mellon Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: remote.c,v 1.5 1997/04/20 23:29:33 millert Exp $";
+static char rcsid[] = "$OpenBSD: remote.c,v 1.6 1997/09/01 23:24:25 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -72,7 +72,7 @@ static char *db_array[3] = { _PATH_REMOTE, 0, 0 };
#define cgetflag(f) (cgetcap(bp, f, ':') != NULL)
-static
+static void
getremcap(host)
register char *host;
{
diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c
index 918f433682b..16cbef73ad2 100644
--- a/usr.bin/tip/tip.c
+++ b/usr.bin/tip/tip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tip.c,v 1.7 1997/08/25 16:30:13 deraadt Exp $ */
+/* $OpenBSD: tip.c,v 1.8 1997/09/01 23:24:26 deraadt Exp $ */
/* $NetBSD: tip.c,v 1.13 1997/04/20 00:03:05 mellon Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tip.c,v 1.7 1997/08/25 16:30:13 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tip.c,v 1.8 1997/09/01 23:24:26 deraadt Exp $";
#endif /* not lint */
/*
@@ -71,7 +71,9 @@ void cleanup();
char *sname();
char PNbuf[256]; /* This limits the size of a number */
+int
main(argc, argv)
+ int argc;
char *argv[];
{
char *system = NOSTR;
@@ -136,7 +138,7 @@ main(argc, argv)
for (p = system; *p; p++)
*p = '\0';
PN = PNbuf;
- (void)snprintf(sbuf, sizeof(sbuf), "tip%d", BR);
+ (void)snprintf(sbuf, sizeof(sbuf), "tip%ld", BR);
system = sbuf;
notnumber:
@@ -175,7 +177,7 @@ notnumber:
vinit(); /* init variables */
setparity("even"); /* set the parity table */
if ((i = speed(number(value(BAUDRATE)))) == 0) {
- printf("tip: bad baud rate %d\n", number(value(BAUDRATE)));
+ printf("tip: bad baud rate %ld\n", number(value(BAUDRATE)));
daemon_uid();
(void)uu_unlock(uucplock);
exit(3);
@@ -188,7 +190,7 @@ notnumber:
*/
if (HW)
ttysetup(i);
- if (p = connect()) {
+ if ((p = connect())) {
printf("\07%s\n[EOT]\n", p);
daemon_uid();
(void)uu_unlock(uucplock);
@@ -226,11 +228,12 @@ cucommon:
* so, fork one process for local side and one for remote.
*/
printf(cumode ? "Connected\r\n" : "\07connected\r\n");
- if (pid = fork())
+ if ((pid = fork()))
tipin();
else
tipout();
/*NOTREACHED*/
+ exit(0);
}
void
@@ -254,6 +257,7 @@ cleanup()
*/
static int uidswapped;
+void
user_uid()
{
if (uidswapped == 0) {
@@ -262,6 +266,7 @@ user_uid()
}
}
+void
daemon_uid()
{
@@ -271,6 +276,7 @@ daemon_uid()
}
}
+void
shell_uid()
{
setegid(gid);
@@ -280,6 +286,7 @@ shell_uid()
/*
* put the controlling keyboard into raw mode
*/
+void
raw()
{
tcsetattr(0, TCSADRAIN, &term);
@@ -289,6 +296,7 @@ raw()
/*
* return keyboard to normal mode
*/
+void
unraw()
{
tcsetattr(0, TCSADRAIN, &defterm);
@@ -301,9 +309,10 @@ static jmp_buf promptbuf;
* in from the terminal. Handles signals & allows use of
* normal erase and kill characters.
*/
+int
prompt(s, p, sz)
char *s;
- register char *p;
+ char *p;
size_t sz;
{
register int c;
@@ -342,6 +351,7 @@ intprompt()
/*
* ****TIPIN TIPIN****
*/
+void
tipin()
{
char gch, bol = 1;
@@ -389,6 +399,7 @@ extern esctable_t etable[];
* Escape handler --
* called on recognition of ``escapec'' at the beginning of a line
*/
+int
escape()
{
register char gch;
@@ -410,6 +421,7 @@ escape()
return (gch);
}
+int
speed(n)
int n;
{
@@ -421,15 +433,19 @@ speed(n)
return 0;
}
-any(c, p)
- register char c, *p;
+int
+any(cc, p)
+ register int cc;
+ char *p;
{
+ char c = cc;
while (p && *p)
if (*p++ == c)
return (1);
return (0);
}
+int
size(s)
register char *s;
{
@@ -447,7 +463,7 @@ interp(s)
static char buf[256];
register char *p = buf, c, *q;
- while (c = *s++) {
+ while ((c = *s++)) {
for (q = "\nn\rr\tt\ff\033E\bb"; *q; q++)
if (*q++ == c) {
*p++ = '\\'; *p++ = *q;
@@ -486,6 +502,7 @@ ctrl(c)
/*
* Help command
*/
+void
help(c)
char c;
{
@@ -504,6 +521,7 @@ help(c)
/*
* Set up the "remote" tty's state
*/
+void
ttysetup(speed)
int speed;
{
@@ -549,6 +567,7 @@ static char partab[0200];
* We are doing 8 bit wide output, so we just generate a character
* with the right parity and output it.
*/
+void
pwrite(fd, buf, n)
int fd;
char *buf;
@@ -575,6 +594,7 @@ pwrite(fd, buf, n)
/*
* Build a parity table with appropriate high-order bit.
*/
+void
setparity(defparity)
char *defparity;
{
diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h
index 7fb9fe035a4..7b2e63fad63 100644
--- a/usr.bin/tip/tip.h
+++ b/usr.bin/tip/tip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tip.h,v 1.7 1997/08/22 22:42:08 millert Exp $ */
+/* $OpenBSD: tip.h,v 1.8 1997/09/01 23:24:26 deraadt Exp $ */
/* $NetBSD: tip.h,v 1.7 1997/04/20 00:02:46 mellon Exp $ */
/*
@@ -44,6 +44,8 @@
#include <sys/types.h>
#include <sys/file.h>
#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/ioctl.h>
#include <termios.h>
#include <signal.h>
@@ -267,3 +269,40 @@ extern int disc; /* current tty discpline */
extern char *ctrl();
extern char *vinterp();
extern char *connect();
+
+char *sname __P((char *s));
+int any __P((int cc, char *p));
+int anyof __P((char *s1, char *s2));
+int args __P((char *buf, char *a[], int num));
+int escape __P((void));
+int prompt __P((char *s, char *p, size_t sz));
+int size __P((char *s));
+int speed __P((int n));
+int uu_lock __P((char *ttyname));
+int uu_unlock __P((char *ttyname));
+int vstring __P((char *s, char *v));
+long hunt __P((char *name));
+void cumain __P((int argc, char *argv[]));
+void daemon_uid __P((void));
+void disconnect __P((char *reason));
+void execute __P((char *s));
+void logent __P((char *group, char *num, char *acu, char *message));
+void loginit __P((void));
+void prtime __P((char *s, time_t a));
+void pwrite __P((int fd, char *buf, int n));
+void raw __P((void));
+void send __P((int c));
+void setparity __P((char *defparity));
+void setscript __P((void));
+void shell_uid __P((void));
+void tandem __P((char *option));
+void tipabort __P((char *msg));
+void tipin __P((void));
+void tipout __P((void));
+void transfer __P((char *buf, int fd, char *eofchars));
+void transmit __P((FILE *fd, char *eofchars, char *command));
+void ttysetup __P((int speed));
+void unraw __P((void));
+void user_uid __P((void));
+void vinit __P((void));
+void vlex __P((char *s));
diff --git a/usr.bin/tip/tipout.c b/usr.bin/tip/tipout.c
index d9591941d74..98bbab4419a 100644
--- a/usr.bin/tip/tipout.c
+++ b/usr.bin/tip/tipout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tipout.c,v 1.5 1997/08/23 00:03:46 millert Exp $ */
+/* $OpenBSD: tipout.c,v 1.6 1997/09/01 23:24:27 deraadt Exp $ */
/* $NetBSD: tipout.c,v 1.5 1996/12/29 10:34:12 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tipout.c,v 1.5 1997/08/23 00:03:46 millert Exp $";
+static char rcsid[] = "$OpenBSD: tipout.c,v 1.6 1997/09/01 23:24:27 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -118,6 +118,7 @@ intSYS()
/*
* ****TIPOUT TIPOUT****
*/
+void
tipout()
{
char buf[BUFSIZ];
diff --git a/usr.bin/tip/uucplock.c b/usr.bin/tip/uucplock.c
index efc47876aa3..825a6e55ed2 100644
--- a/usr.bin/tip/uucplock.c
+++ b/usr.bin/tip/uucplock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uucplock.c,v 1.4 1997/08/24 23:22:22 deraadt Exp $ */
+/* $OpenBSD: uucplock.c,v 1.5 1997/09/01 23:24:27 deraadt Exp $ */
/* $NetBSD: uucplock.c,v 1.7 1997/02/11 09:24:08 mrg Exp $ */
/*
@@ -38,15 +38,17 @@
#if 0
static char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: uucplock.c,v 1.4 1997/08/24 23:22:22 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: uucplock.c,v 1.5 1997/09/01 23:24:27 deraadt Exp $";
#endif /* not lint */
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/dir.h>
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+#include <unistd.h>
+#include <stdlib.h>
#include <errno.h>
#include "pathnames.h"
@@ -56,6 +58,7 @@ static char rcsid[] = "$OpenBSD: uucplock.c,v 1.4 1997/08/24 23:22:22 deraadt Ex
* -1 - failure
*/
+int
uu_lock(ttyname)
char *ttyname;
{
@@ -118,6 +121,7 @@ uu_lock(ttyname)
return(0);
}
+int
uu_unlock(ttyname)
char *ttyname;
{
diff --git a/usr.bin/tip/value.c b/usr.bin/tip/value.c
index dd6b3872232..b36b8decab4 100644
--- a/usr.bin/tip/value.c
+++ b/usr.bin/tip/value.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: value.c,v 1.4 1997/04/02 01:47:04 millert Exp $ */
+/* $OpenBSD: value.c,v 1.5 1997/09/01 23:24:28 deraadt Exp $ */
/* $NetBSD: value.c,v 1.6 1997/02/11 09:24:09 mrg Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)value.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: value.c,v 1.4 1997/04/02 01:47:04 millert Exp $";
+static char rcsid[] = "$OpenBSD: value.c,v 1.5 1997/09/01 23:24:28 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -51,6 +51,7 @@ static int col = 0;
/*
* Variable manipulation
*/
+void
vinit()
{
register value_t *p;
@@ -60,7 +61,7 @@ vinit()
for (p = vtable; p->v_name != NULL; p++) {
if (p->v_type&ENVIRON)
- if (cp = getenv(p->v_name))
+ if ((cp = getenv(p->v_name)))
p->v_value = cp;
if (p->v_type&IREMOTE)
setnumber(p->v_value, *address(p->v_value));
@@ -81,7 +82,7 @@ vinit()
while (fgets(file, sizeof(file)-1, f) != NULL) {
if (vflag)
printf("set %s", file);
- if (tp = strrchr(file, '\n'))
+ if ((tp = strrchr(file, '\n')))
*tp = '\0';
vlex(file);
}
@@ -97,6 +98,7 @@ vinit()
static int vaccess();
/*VARARGS1*/
+void
vassign(p, v)
register value_t *p;
char *v;
@@ -143,6 +145,7 @@ vassign(p, v)
static void vprint();
static void vtoken();
+void
vlex(s)
register char *s;
{
@@ -156,7 +159,7 @@ vlex(s)
register char *cp;
do {
- if (cp = vinterp(s, ' '))
+ if ((cp = vinterp(s, ' ')))
cp++;
vtoken(s);
s = cp;
@@ -176,9 +179,9 @@ vtoken(s)
register char *cp;
char *expand();
- if (cp = strchr(s, '=')) {
+ if ((cp = strchr(s, '='))) {
*cp = '\0';
- if (p = vlookup(s)) {
+ if ((p = vlookup(s))) {
cp++;
if (p->v_type&NUMBER)
vassign(p, atoi(cp));
@@ -189,7 +192,7 @@ vtoken(s)
}
return;
}
- } else if (cp = strchr(s, '?')) {
+ } else if ((cp = strchr(s, '?'))) {
*cp = '\0';
if ((p = vlookup(s)) && vaccess(p->v_access, READ)) {
vprint(p);
@@ -241,7 +244,7 @@ vprint(p)
case NUMBER:
col += 6;
- printf("%s=%-5d", p->v_name, number(p->v_value));
+ printf("%s=%-5ld", p->v_name, number(p->v_value));
break;
case CHAR:
@@ -341,7 +344,7 @@ vinterp(s, stop)
/*
* assign variable s with value v (for NUMBER or STRING or CHAR types)
*/
-
+int
vstring(s,v)
register char *s;
register char *v;