Imported from conserver-GNAC-6.11.tar.gz

This commit is contained in:
Bryan Stansell 1999-05-14 10:22:00 -07:00
parent f5fa8b8cf1
commit e3d53eb106
14 changed files with 140 additions and 33 deletions

View File

@ -1,6 +1,12 @@
CHANGES
=======
version 6.11:
- Added broadcast capability in client (-b option)
- Protected certain escape sequences from end-user use
- Added "console server shutting down" broadcast
- Improved local tty break code (thanks Craig and Brian!)
version 6.10:
- Documentation fixes
- Web page up and running
@ -33,5 +39,5 @@ before version 6.05:
and enhancements of various types were applied.
#
# $Id: CHANGES,v 1.6 1999-01-26 20:42:36-08 bryan Exp $
# $Id: CHANGES,v 1.7 1999-05-14 10:18:20-07 bryan Exp $
#

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.5 1999-01-25 15:10:05-08 bryan Exp $
# $Id: Makefile,v 1.6 1999-02-01 15:42:42-08 bryan Exp $
#
# Master Makefile
#
@ -9,6 +9,7 @@ all clean install install.man: FRC
@if [ -f .settings ]; then \
s=`cat .settings | grep -v '^#'`; \
settings=`echo $$s`; \
if [ -n "${PREFIX}" ]; then settings="'PREFIX=${PREFIX}' $$settings"; fi; \
for s in ${SUBDIRS}; do \
( cd $$s; eval ${MAKE} $$settings $@ ) \
done; \

4
README
View File

@ -36,8 +36,8 @@ Other Good Information
Zonker Harris has fabulous documents regarding the hookup
of consoles to terminal servers and other such devices. His
Greater Scroll of Console Knowledge is a great place to start
(http://ttt.tio.net/~zonker/consoles/gsosck.html).
(http://www.jeffk.com/~zonker/consoles/).
#
# $Id: README,v 1.5 1999-01-26 17:48:13-08 bryan Exp $
# $Id: README,v 1.6 1999-05-14 10:09:07-07 bryan Exp $
#

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.5 1999-01-25 15:38:20-08 bryan Exp $
# $Id: Makefile,v 1.6 1999-04-12 21:29:57-07 bryan Exp $
#
# Makefile for conserver.cf
#
@ -7,7 +7,7 @@ PREFIX=/usr/local
BIN=${PREFIX}/bin
ETC=${PREFIX}/etc
MAN=${PREFIX}/man
MANSECT=8
MANSECT=4
all:

View File

@ -1,6 +1,6 @@
.\" $Id: conserver.cf.man,v 1.3 1999-01-25 15:05:17-08 bryan Exp $
.\" $Id: conserver.cf.man,v 1.4 1999-04-12 22:40:55-07 bryan Exp $
.\" @(#)constab.5 01/06/91 OSU CIS; Thomas A. Fine
.TH CONSERVER.CF 5L "Local"
.TH CONSERVER.CF 4 "Local"
.SH NAME
conserver.cf \- table of server console terminals used by conserver(8L)
.SH SYNOPSIS

View File

@ -23,4 +23,4 @@ shell:|:9600p:&:
%%
# list of clients we allow
# type machines
allowed: 127.0.0.1
trusted: 127.0.0.1

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.11 1999-01-25 18:40:48-08 bryan Exp $
# $Id: Makefile,v 1.12 1999-02-02 17:02:25-08 bryan Exp $
#
# Makefile for console server
#
@ -27,7 +27,7 @@ ${PROG}: ${OBJ}
${CC} -o $@ ${CFLAGS} ${OBJ} ${LIBS}
clean: FRC
rm -f Makefile.bak ${PROG} a.out *.o core errs lint.out tags
rm -f Makefile.bak ${PROG} *.tbl a.out *.o core errs lint.out tags
depend: ${HDR} ${SRC} FRC
makedepend ${CDEFS} ${INCLUDE} ${SRC}

View File

@ -1,5 +1,5 @@
/*
* $Id: client.h,v 5.12 1999-01-26 20:35:17-08 bryan Exp $
* $Id: client.h,v 5.13 1999-02-02 11:36:26-08 bryan Exp $
*
* Copyright GNAC, Inc., 1998
*
@ -44,6 +44,7 @@
#define S_HOST 8 /* still needs a host name to connect */
#define S_PASSWD 9 /* still needs a passwd to connect */
#define S_QUOTE 10 /* send any character we can spell */
#define S_BCAST 11 /* send a broadcast message to all connections */
typedef struct client { /* Connection Information: */
int fd; /* file descriptor */
@ -68,6 +69,8 @@ typedef struct client { /* Connection Information: */
char caccess; /* did we trust the remote machine */
char accmd[MAXSERVLEN+1];/* the command the user issued */
int icursor; /* the length of the command issused */
char msg[1024]; /* the broadcast message */
int mcursor; /* the length of the message */
struct sockaddr_in
cnct_port; /* where from */
} CLIENT;

View File

@ -1,6 +1,6 @@
.\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine
.\" $Id: conserver.man,v 1.4 1999-01-25 18:57:52-08 bryan Exp $
.TH CONSERVER 8L "LOCAL"
.\" $Id: conserver.man,v 1.5 1999-04-12 22:40:55-07 bryan Exp $
.TH CONSERVER 8 "Local"
.SH NAME
conserver \- console server daemon
.SH SYNOPSIS

View File

@ -1,5 +1,5 @@
/*
* $Id: group.c,v 5.52 1999-01-26 20:35:17-08 bryan Exp $
* $Id: group.c,v 5.55 1999-05-14 10:16:48-07 bryan Exp $
*
* Copyright GNAC, Inc., 1998
*
@ -237,6 +237,42 @@ Mark(arg)
alarm(ALARMTIME);
}
void
SendClientsMsg(pGE, message)
GRPENT *pGE;
char *message;
{
register CLIENT *pCL;
if ((GRPENT *)0 == pGE) {
return;
}
for (pCL = pGE->pCLall; (CLIENT *)0 != pCL; pCL = pCL->pCLscan) {
if (pCL->fcon) {
(void)write(pCL->fd, message, strlen(message));
}
}
}
void
SendShutdownMsg(pGE)
GRPENT *pGE;
{
SendClientsMsg(pGE, "[-- Console server shutting down --]\r\n");
}
static SIGRETS
GoAway(sig)
int sig;
{
SendShutdownMsg(pGEHup);
exit(0);
_exit(0);
abort();
}
#if DO_VIRTUAL
/* on a TERM we have to cleanup utmp entries (ask ptyd to do it) (ksb)
*/
@ -251,6 +287,8 @@ int sig;
return;
}
SendShutdownMsg(pGEHup);
for (i = 0, pCE = pGEHup->pCElist; i < pGEHup->imembers; ++i, ++pCE) {
if (-1 == pCE->fdtty || 0 == pCE->fvirtual) {
continue;
@ -514,7 +552,7 @@ int sfd;
(void)signal(SIGTERM, DeUtmp);
(void)signal(SIGCHLD, ReapVirt);
#else
(void)signal(SIGTERM, SIG_DFL);
(void)signal(SIGTERM, GoAway);
(void)signal(SIGCHLD, SIG_DFL);
#endif
@ -759,6 +797,31 @@ drop:
}
for (i = 0; i < nr; ++i) switch (pCLServing->iState) {
case S_BCAST:
/* gather message */
if (pCLServing->mcursor == sizeof(pCLServing->msg)) {
CSTROUT(pCLServing->fd, "Message too long.\r\n");
goto drop;
}
if (&CECtl != pCLServing->pCEto) {
write(pCLServing->fd, &acIn[i], 1);
}
if ('\n' != acIn[i]) {
pCLServing->msg[pCLServing->mcursor++] = acIn[i];
continue;
}
pCLServing->msg[pCLServing->mcursor] = '\000';
if ('\r' == pCLServing->msg[pCLServing->mcursor-1]) {
pCLServing->msg[--pCLServing->mcursor] = '\000';
}
pCLServing->mcursor = 0;
sprintf(acOut, "[Broadcast: %s]\r\n", pCLServing->msg);
SendClientsMsg(pGE, acOut);
pCLServing->iState = S_NORMAL;
continue;
case S_IDENT:
/* append chars to acid until white space
*/
@ -1005,24 +1068,25 @@ drop:
continue;
}
#else
#if USE_TERMIOS || USE_TCBREAK
CSTROUT(pCLServing->fd, "- ");
#if USE_TCBREAK
if (-1 == tcsendbreak(pCEServing->fdtty, 9)) {
CSTROUT(pCLServing->fd, "failed]\r\n");
continue;
}
#else
#if USE_TERMIOS
if (-1 == ioctl(pCEServing->fdtty, TIOCSBRK, (char *)0)) {
CSTROUT(pCLServing->fd, "failed]\r\n");
continue;
}
CSTROUT(pCLServing->fd, "- ");
sleep(3);
sleep(1);
if (-1 == ioctl(pCEServing->fdtty, TIOCCBRK, (char *)0)) {
CSTROUT(pCLServing->fd, "failed]\r\n");
continue;
}
#endif
#endif
#endif
}
CSTROUT(pCLServing->fd, "sent]\r\n");
@ -1082,10 +1146,22 @@ drop:
break;
case ';': /* ;login: */
if (&CECtl != pCLServing->pCEto) {
goto unknown;
}
CSTROUT(pCLServing->fd, "login:\r\n");
pCLServing->iState = S_IDENT;
break;
case 'b': /* broadcast message */
case 'B':
if (&CECtl != pCLServing->pCEto) {
goto unknown;
}
CSTROUT(pCLServing->fd, "Enter message]\r\n");
pCLServing->iState = S_BCAST;
break;
case 'a': /* attach */
case 'A':
if (&CECtl == pCEServing) {
@ -1489,6 +1565,7 @@ drop:
CSTROUT(pCLServing->fd, "quote \\");
break;
default: /* unknown sequence */
unknown:
CSTROUT(pCLServing->fd, "unknown -- use `?\']\r\n");
break;
}
@ -1574,6 +1651,7 @@ drop:
pCL->ic[1] = DEFESC;
pCL->caccess = cType;
pCL->icursor = 0;
pCL->mcursor = 0;
/* mark as stopped (no output from console)
* and spy only (on chars to console)

View File

@ -1,5 +1,5 @@
/*
* $Id: port.h,v 1.6 1999-01-26 20:35:17-08 bryan Exp $
* $Id: port.h,v 1.7 1999-05-14 10:17:14-07 bryan Exp $
*
* Copyright GNAC, Inc., 1998
*
@ -211,10 +211,10 @@
#define USE_TERMIO (defined(ETA10)||defined(V386))
#endif
#if !defined(USE_TERMIOS)
#define USE_TERMIOS (defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX2)||defined(IRIX6))
#define USE_TERMIOS (defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX2)||defined(IRIX6)||defined(SUN4)||defined(BSDOS3))
#endif
#if !defined(USE_TCBREAK)
#define USE_TCBREAK (defined(SUN4)||defined(PTX)||defined(BSDOS3))
#define USE_TCBREAK (defined(PTX))
#endif
/* if we have <strings.h> define this to 1, else define to 0

View File

@ -1,9 +1,9 @@
/*
* $Id: version.h,v 1.10 1999-01-26 20:35:17-08 bryan Exp $
* $Id: version.h,v 1.11 1999-05-14 10:17:49-07 bryan Exp $
*
* Copyright GNAC, Inc., 1998
*
* Maintainer/Enhancer: Bryan Stansell (bryan@gnac.com)
*/
#define GNAC_VERSION "GNAC version 6.10"
#define GNAC_VERSION "GNAC version 6.11"

View File

@ -1,5 +1,5 @@
/*
* $Id: console.c,v 5.25 1999-01-26 20:35:17-08 bryan Exp $
* $Id: console.c,v 5.26 1999-02-02 11:36:26-08 bryan Exp $
*
* Copyright GNAC, Inc., 1998
*
@ -77,7 +77,7 @@ extern char *sys_errlist[];
#endif
static char rcsid[] =
"$Id: console.c,v 5.25 1999-01-26 20:35:17-08 bryan Exp $";
"$Id: console.c,v 5.26 1999-02-02 11:36:26-08 bryan Exp $";
static char *progname =
rcsid;
int fVerbose = 0, fReplay = 0, fRaw = 0;
@ -154,6 +154,7 @@ FILE *fp;
static char *apcLong[] = {
"a(A) attach politelty (and replay last 20 lines)",
"b broadcast message",
"d(D) display (local) daemon version",
"e esc set the initial escape characters",
"f(F) force read/write connection (and replay)",
@ -962,8 +963,13 @@ char *pcMaster, *pcMach, *pcCmd, *pcWho;
/* send sign-on stuff, then wait for a reply, like "ok\r\n"
* before allowing a write
*/
(void)sprintf(acMesg, "%c%c%c%c%c.", DEFATTN, DEFESC, *pcCmd, DEFATTN, DEFESC);
SendOut(s, acMesg, 9);
if ( *pcCmd == 'b' ) {
(void)sprintf(acMesg, "%c%c%c%s\r\n%c%c.", DEFATTN, DEFESC, *pcCmd, pcMach, DEFATTN, DEFESC);
SendOut(s, acMesg, strlen(acMesg));
} else {
(void)sprintf(acMesg, "%c%c%c%c%c.", DEFATTN, DEFESC, *pcCmd, DEFATTN, DEFESC);
SendOut(s, acMesg, 6);
}
/* read the server's reply,
* We buffer until we close the connection because it
@ -1148,8 +1154,9 @@ char **argv;
auto int fLocal;
auto char acPorts[1024];
auto char *pcUser;
auto char *pcMsg;
auto int (*pfiCall)();
static char acOpts[] = "aAdDsSfFe:hl:M:pvVwWUqQrux";
static char acOpts[] = "b:aAdDsSfFe:hl:M:pvVwWUqQrux";
extern long atol();
extern int optind;
extern char *optarg;
@ -1207,6 +1214,11 @@ char **argv;
pcCmd = "attach";
break;
case 'b':
pcCmd = "broadcast";
pcMsg = optarg;
break;
case 'D':
fLocal = 1;
/*fallthrough*/
@ -1274,7 +1286,7 @@ char **argv;
case 'h':
printf("%s: usage [-aAfFsS] [-rv] [-e esc] [-M mach] [-l username] machine\n", progname);
printf("%s: usage [-v] [-hdDuVwx]\n", progname);
printf("%s: usage [-v] [-hdDuVwx] [-b message]\n", progname);
printf("%s: usage [-qQ] [-M mach]\n", progname);
Usage(stdout, apcLong);
exit(0);
@ -1300,6 +1312,7 @@ char **argv;
if ((char *)0 == pcCmd) {
pcCmd = "attach";
}
if ('a' == *pcCmd || 'f' == *pcCmd || 's' == *pcCmd) {
if (optind >= argc) {
fprintf(stderr, "%s: missing machine name\n", progname);
@ -1314,6 +1327,9 @@ char **argv;
exit(1);
}
(void)sprintf(acPorts, "@%s", pcInMaster);
if ('b' == *pcCmd) {
pcTo = pcMsg;
}
if ('q' == *pcCmd) {
auto char acPass[32];
(void)strcpy(acPass, getpass("Enter root password:"));

View File

@ -1,11 +1,11 @@
.\" $Id: console.man,v 1.3 1999-01-25 18:37:20-08 bryan Exp $
.TH CONSOLE 8L "Local"
.\" $Id: console.man,v 1.5 1999-04-12 22:40:55-07 bryan Exp $
.TH CONSOLE 8 "Local"
.SH NAME
console \- console server client program
.SH SYNOPSIS
\fBconsole\fP [\-\fBaAfFsS\fP] [\-\fBrv\fP] [\-\fBe\fP \fIesc\fP] [\-\fBM\fP \fIserver\fP] \fIhost\fP
.br
\fBconsole\fP [\-\fBv\fP] [\-\fBhdDuVwx\fP]
\fBconsole\fP [\-\fBv\fP] [\-\fBhdDuVwx\fP] [\-\fBb\fP \fImessage\fP]
.br
\fBconsole\fP [\-\fBqQ\fP] [\-\fBM\fP \fIserver\fP]
.SH DESCRIPTION
@ -26,6 +26,9 @@ outputs only the requested information.
.B \-a
Access a console with a two-way connection (this is the default).
.TP
.BI \-b message
Broadcast a \fImessage\fP to all users connected to the console server.
.TP
.B \-d
Display daemon versions. The \fIconsole\fP client connects to each
server to request its version information. The uppercase varient of