Fix the conditional compilation on ACULOG so it actually works.

Turn it off by default -- it hardly saves any space, but it's
one of the reasons why the executable is installed setuid, and
other versions of tip/cu don't write a log file anyway.  We can
add syslog support later if we ever really want this back, the
file-writing is all encapsulated in log.c.
This commit is contained in:
tls 2006-04-02 19:16:22 +00:00
parent ad69069bcc
commit 6b0f06d935
6 changed files with 40 additions and 15 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.15 2006/04/02 19:00:40 tls Exp $
# $NetBSD: Makefile,v 1.16 2006/04/02 19:16:22 tls Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
#
# Files are:
@ -34,8 +34,8 @@
WARNS=4
PROG= tip
CPPFLAGS+=-I${.CURDIR} \
-DDEFBR=9600 -DDEFFS=BUFSIZ -DACULOG -DPRISTINE -DCONNECT \
-DHAYES #-DV831 -DVENTEL -DHAYES -DCOURIER -DT3000
-DDEFBR=9600 -DDEFFS=BUFSIZ -DCONNECT \
-DHAYES #-DV831 -DVENTEL -DHAYES -DCOURIER -DT3000 -DACULOG -DPRISTINE
.PATH: ${.CURDIR}/aculib
BINOWN= uucp
BINGRP= dialer
@ -46,7 +46,7 @@ SRCS= acu.c acutab.c cmds.c cmdtab.c cu.c hunt.c log.c partab.c \
# -- acutab is configuration dependent, and so depends on the Makefile
# -- remote.o depends on the Makefile because of DEFBR and DEFFS
# -- log.o depends on the Makefile because of ACULOG
acutab.o log.o remote.o: Makefile
# -- log.o, cu.o, acu.o, tip.o depend on the Makefile because of ACULOG
acutab.o log.o cu.o acu.o tip.o remote.o: Makefile
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: acu.c,v 1.9 2004/04/23 22:11:44 christos Exp $ */
/* $NetBSD: acu.c,v 1.10 2006/04/02 19:16:22 tls Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)acu.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: acu.c,v 1.9 2004/04/23 22:11:44 christos Exp $");
__RCSID("$NetBSD: acu.c,v 1.10 2006/04/02 19:16:22 tls Exp $");
#endif /* not lint */
#include "tip.h"
@ -78,7 +78,9 @@ connect()
if (!DU) { /* regular connect message */
if (CM != NULL)
xpwrite(FD, CM, strlen(CM));
#ifdef ACULOG
logent(value(HOST), "", DV, "call completed");
#endif
return (NULL);
}
/*
@ -91,7 +93,9 @@ connect()
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
printf("\ncall aborted\n");
#ifdef ACULOG
logent(value(HOST), "", "", "call aborted");
#endif
if (acu != NULL) {
setboolean(value(VERBOSE), FALSE);
if (conflag)
@ -113,12 +117,16 @@ connect()
if ((conflag = (*acu->acu_dialer)(phnum, CU)) != 0) {
if (CM != NULL)
xpwrite(FD, CM, strlen(CM));
#ifdef ACULOG
logent(value(HOST), phnum, acu->acu_name,
"call completed");
#endif
return (NULL);
} else
#ifdef ACULOG
logent(value(HOST), phnum, acu->acu_name,
"call failed");
#endif
tried++;
}
} else {
@ -151,18 +159,25 @@ connect()
fclose(fd);
if (CM != NULL)
xpwrite(FD, CM, strlen(CM));
#ifdef ACULOG
logent(value(HOST), phnum, acu->acu_name,
"call completed");
#endif
return (NULL);
} else
#ifdef ACULOG
logent(value(HOST), phnum, acu->acu_name,
"call failed");
#endif
tried++;
}
fclose(fd);
}
if (!tried)
if (!tried) {
#ifdef ACULOG
logent(value(HOST), "", acu->acu_name, "missing phone number");
#endif
}
else
(*acu->acu_abort)();
return (tried ? "call failed" : "missing phone number");
@ -174,15 +189,21 @@ disconnect(reason)
{
if (!conflag) {
#ifdef ACULOG
logent(value(HOST), "", DV, "call terminated");
#endif
return;
}
if (reason == NULL) {
#ifdef ACULOG
logent(value(HOST), "", acu->acu_name, "call terminated");
#endif
if (boolean(value(VERBOSE)))
printf("\r\ndisconnecting...");
} else
#ifdef ACULOG
logent(value(HOST), "", acu->acu_name, reason);
#endif
(*acu->acu_disconnect)();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cu.c,v 1.10 2006/04/02 19:04:24 tls Exp $ */
/* $NetBSD: cu.c,v 1.11 2006/04/02 19:16:22 tls Exp $ */
/*
* Copyright (c) 1983, 1993
@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: cu.c,v 1.10 2006/04/02 19:04:24 tls Exp $");
__RCSID("$NetBSD: cu.c,v 1.11 2006/04/02 19:16:22 tls Exp $");
#endif /* not lint */
#include "tip.h"
@ -186,7 +186,9 @@ cumain(argc, argv)
exit(3);
}
setbuf(stdout, NULL);
#ifdef ACULOG
loginit();
#endif
user_uid();
vinit();
switch (parity) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: remote.c,v 1.14 2006/04/02 19:03:55 tls Exp $ */
/* $NetBSD: remote.c,v 1.15 2006/04/02 19:16:22 tls Exp $ */
/*
* Copyright (c) 1992, 1993
@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
#if 0
static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: remote.c,v 1.14 2006/04/02 19:03:55 tls Exp $");
__RCSID("$NetBSD: remote.c,v 1.15 2006/04/02 19:16:22 tls Exp $");
#endif /* not lint */
#include "pathnames.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: tip.c,v 1.33 2006/04/02 19:04:24 tls Exp $ */
/* $NetBSD: tip.c,v 1.34 2006/04/02 19:16:22 tls Exp $ */
/*
* Copyright (c) 1983, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: tip.c,v 1.33 2006/04/02 19:04:24 tls Exp $");
__RCSID("$NetBSD: tip.c,v 1.34 2006/04/02 19:16:22 tls Exp $");
#endif /* not lint */
/*
@ -148,7 +148,9 @@ notnumber:
exit(3);
}
setbuf(stdout, NULL);
#ifdef ACULOG
loginit();
#endif
/*
* Now that we have the logfile and the ACU open

View File

@ -1,4 +1,4 @@
/* $NetBSD: tip.h,v 1.18 2006/04/02 19:04:24 tls Exp $ */
/* $NetBSD: tip.h,v 1.19 2006/04/02 19:16:22 tls Exp $ */
/*
* Copyright (c) 1989, 1993