Imported from conserver-8.1.11.tar.gz

This commit is contained in:
Bryan Stansell 2004-11-09 01:34:27 -08:00
parent 4ce124e121
commit 892f52dbd4
24 changed files with 277 additions and 180 deletions

21
CHANGES
View File

@ -1,9 +1,24 @@
CHANGES CHANGES
======= =======
version 8.1.11 (Nov 9, 2004):
- fixed array bounds and stack tromping - reported by Emmett
Hogan <hogan@bigcityit.com>
- most recent client to ask for read-write now gets it (used to
be first client to connect)
- client read-write mode now separate from console up/down state
- 'make autologin.install' now compiles autologin - reported by
Graham Merrill <teddgram@sbcglobal.net>
- new 'autocomplete' option for controlling shortest-prefix
console name matching (which has always been on)
- client now blocks on ^Eco, waiting for status of connection
- added 'a' and 'A' for upper and lowercase alphanumeric
(0-9a-z) conversions to the *subst config items - based on
patch by Jonathan Chen <jon+conserver@spock.org>
version 8.1.10 (Sep 21, 2004): version 8.1.10 (Sep 21, 2004):
- fix "forwarding level too deep" issue with '^Ec;' - reported by Han - fix "forwarding level too deep" issue with '^Ec;' - reported
Pilmeyer <han.pilmeyer@hp.com> by Han Pilmeyer <han.pilmeyer@hp.com>
version 8.1.9 (Jul 14, 2004): version 8.1.9 (Jul 14, 2004):
- fixed bug processing access lists when duplicates exist in the - fixed bug processing access lists when duplicates exist in the
@ -773,5 +788,5 @@ before version 6.05:
and enhancements of various types were applied. and enhancements of various types were applied.
# #
# $Id: CHANGES,v 1.193 2004/09/21 23:45:20 bryan Exp $ # $Id: CHANGES,v 1.196 2004/11/09 09:01:41 bryan Exp $
# #

4
TODO
View File

@ -100,6 +100,8 @@ Bryan Stansell
- send sequences to console on client connect? (to repaint screen, - send sequences to console on client connect? (to repaint screen,
for example) : John Cagle <jcagle@gmail.com> for example) : John Cagle <jcagle@gmail.com>
- uucp locks : Sebastian Zagrodzki <sebek@heron.net.icm.edu.pl>
# #
# $Id: TODO,v 1.51 2004/09/21 23:45:30 bryan Exp $ # $Id: TODO,v 1.52 2004/11/06 01:03:36 bryan Exp $
# #

View File

@ -45,7 +45,7 @@ clean:
distclean: clean distclean: clean
rm -f Makefile rm -f Makefile
install: install: autologin
$(MKDIR) $(DESTDIR)$(bindir) $(MKDIR) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) autologin $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) autologin $(DESTDIR)$(bindir)

9
config.guess vendored
View File

@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
timestamp='2004-09-07' timestamp='2004-10-25'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -342,7 +342,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
DRS?6000:unix:4.0:6*) DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6 echo sparc-icl-nx6
exit 0 ;; exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*) DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;; sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;; esac ;;
@ -1247,7 +1247,10 @@ EOF
A*) echo alpha-dec-vms && exit 0 ;; A*) echo alpha-dec-vms && exit 0 ;;
I*) echo ia64-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;;
V*) echo vax-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;;
esac esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit 0 ;;
esac esac
#echo '(No uname command or uname output not recognized.)' 1>&2 #echo '(No uname command or uname output not recognized.)' 1>&2

View File

@ -1,5 +1,5 @@
.\" $Id: conserver.cf.man,v 1.68 2004/07/14 05:28:42 bryan Exp $ .\" $Id: conserver.cf.man,v 1.69 2004/11/06 00:20:30 bryan Exp $
.TH CONSERVER.CF 5 "2004/07/14" "conserver-8.1.10" "conserver" .TH CONSERVER.CF 5 "2004/11/06" "conserver-8.1.11" "conserver"
.SH NAME .SH NAME
conserver.cf \- console configuration file for conserver.cf \- console configuration file for
.BR conserver (8) .BR conserver (8)
@ -507,8 +507,9 @@ characters, padded with 0s if
.I n .I n
begins with a 0, and space characters otherwise. begins with a 0, and space characters otherwise.
.I f .I f
must be either `d', `x' or `X', specifying a decimal, lower-case must be either `d', `x', `X', `a', or `A', specifying a decimal, lowercase
hexadecimal, or an uppercase hexadecimal conversion. hexadecimal (0-9a-f), uppercase hexadecimal (0-9A-F), lowercase
alphanumeric (0-9a-z), or uppercase alphanumeric (0-9A-Z) conversion.
If the null string (``\f3""\fP'') is used, no replacements will be done. If the null string (``\f3""\fP'') is used, no replacements will be done.
.TP .TP
\f3exec\fP \f2command|\f3""\fP \f3exec\fP \f2command|\f3""\fP

View File

@ -1,5 +1,5 @@
.\" $Id: conserver.passwd.man,v 1.10 2004/01/08 16:12:33 bryan Exp $ .\" $Id: conserver.passwd.man,v 1.10 2004/01/08 16:12:33 bryan Exp $
.TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.10" "conserver" .TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.11" "conserver"
.SH NAME .SH NAME
conserver.passwd \- user access information for conserver.passwd \- user access information for
.BR conserver (8) .BR conserver (8)

View File

@ -161,7 +161,7 @@
He isn't actively developing it, however, according to He isn't actively developing it, however, according to
the website. Next, there's Kevin Braunsdorf's version at the website. Next, there's Kevin Braunsdorf's version at
<A href= <A href=
"ftp://ftp.physics.purdue.edu/pub/pundits/">ftp://ftp.physics.purdue.edu/pub/pundits/</A>. "http://www.npcguild.org/software/pundits/">http://www.npcguild.org/software/pundits/</A>.
It doesn't look like Kevin is working on his thread ony It doesn't look like Kevin is working on his thread ony
more either. No new versions have been out since August more either. No new versions have been out since August
2000 (version 8.5), but maybe this info will be out of 2000 (version 8.5), but maybe this info will be out of
@ -183,11 +183,11 @@
<H3>Downloading</H3> <H3>Downloading</H3>
<P>The current version, released on Sep 21, 2004, is <A <P>The current version, released on Nov 9, 2004, is <A
href="8.1.10.tar.gz">8.1.10.tar.gz</A>. You can get it href="8.1.11.tar.gz">8.1.11.tar.gz</A>. You can get it
via <A href= via <A href=
"ftp://ftp.conserver.com/conserver/8.1.10.tar.gz">FTP</A> "ftp://ftp.conserver.com/conserver/8.1.11.tar.gz">FTP</A>
or <A href="8.1.10.tar.gz">HTTP</A>. See the <A href= or <A href="8.1.11.tar.gz">HTTP</A>. See the <A href=
"CHANGES">CHANGES</A> file for information on the latest "CHANGES">CHANGES</A> file for information on the latest
updates.</P> updates.</P>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: client.c,v 5.84 2004/05/28 16:39:51 bryan Exp $ * $Id: client.c,v 5.85 2004/10/25 07:18:18 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -67,9 +67,7 @@ FindWrite(pCE)
* most recent or some such... I guess it doesn't matter that * most recent or some such... I guess it doesn't matter that
* much. * much.
*/ */
if (pCE->pCLwr != (CONSCLIENT *)0 || pCE->fronly || if (pCE->pCLwr != (CONSCLIENT *)0 || pCE->fronly)
!(pCE->fup && pCE->ioState == ISNORMAL &&
pCE->initfile == (CONSFILE *)0))
return; return;
for (pCL = pCE->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) { for (pCL = pCE->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) {
@ -89,6 +87,25 @@ FindWrite(pCE)
} }
} }
void
#if PROTOTYPES
BumpClient(CONSENT *pCE, char *message)
#else
BumpClient(pCE, message)
CONSENT *pCE;
char *message;
#endif
{
if ((CONSCLIENT *)0 == pCE->pCLwr)
return;
if ((char *)0 != message)
FileWrite(pCE->pCLwr->fd, FLAGFALSE, message, -1);
pCE->pCLwr->fwantwr = 0;
pCE->pCLwr->fwr = 0;
pCE->pCLwr = (CONSCLIENT *)0;
}
/* replay last iBack lines of the log file upon connect to console (ksb) /* replay last iBack lines of the log file upon connect to console (ksb)
* *
* NB: we know the console might be spewing when the replay happens, * NB: we know the console might be spewing when the replay happens,

View File

@ -1,5 +1,5 @@
/* /*
* $Id: client.h,v 5.36 2003/12/25 19:22:00 bryan Exp $ * $Id: client.h,v 5.38 2004/10/25 07:18:18 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -58,6 +58,7 @@ typedef struct client { /* Connection Information: */
short fwantwr; /* (client) wants to write */ short fwantwr; /* (client) wants to write */
short fro; /* read-only permission */ short fro; /* read-only permission */
short fecho; /* echo commands (not set by machines) */ short fecho; /* echo commands (not set by machines) */
short fiwait; /* client wanting for console init */
STRING *acid; /* login and location of client */ STRING *acid; /* login and location of client */
STRING *peername; /* location of client */ STRING *peername; /* location of client */
STRING *username; /* login of client */ STRING *username; /* login of client */
@ -88,3 +89,4 @@ extern void Replay PARAMS((CONSENT *, CONSFILE *, int));
extern void HelpUser PARAMS((CONSCLIENT *)); extern void HelpUser PARAMS((CONSCLIENT *));
extern void FindWrite PARAMS((CONSENT *)); extern void FindWrite PARAMS((CONSENT *));
extern int ClientAccessOk PARAMS((CONSCLIENT *)); extern int ClientAccessOk PARAMS((CONSCLIENT *));
extern void BumpClient PARAMS((CONSENT *, char *));

View File

@ -1,5 +1,5 @@
/* /*
* $Id: consent.c,v 5.140 2004/06/03 21:53:59 bryan Exp $ * $Id: consent.c,v 5.144 2004/10/25 07:25:35 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -324,20 +324,6 @@ StartInit(pCE)
StopInit(pCE); StopInit(pCE);
} }
if (pCE->pCLwr != (CONSCLIENT *)0) {
CONSCLIENT *pCL = pCE->pCLwr;
pCL->fwr = 0;
pCL->fwantwr = 1;
/*
FileWrite(pCL->fd,
"[forced to `spy' mode by initialization command]\r\n",
-1);
TagLogfileAct(pCE, "initialization command bumped %s",
pCL->acid->string);
*/
pCE->pCLwr = (CONSCLIENT *)0;
}
/* pin[0] = parent read, pin[1] = child write */ /* pin[0] = parent read, pin[1] = child write */
if (pipe(pin) != 0) { if (pipe(pin) != 0) {
Error("[%s] StartInit(): pipe(): %s", pCE->server, Error("[%s] StartInit(): pipe(): %s", pCE->server,
@ -606,6 +592,39 @@ VirtDev(pCE)
return -1; return -1;
} }
char *
#if PROTOTYPES
ConsState(CONSENT *pCE)
#else
ConsState(pCE)
CONSENT *pCE;
#endif
{
if (!pCE->fup)
return "down";
if (pCE->initfile != (CONSFILE *)0)
return "initializing";
switch (pCE->ioState) {
case ISNORMAL:
return "up";
case INCONNECT:
return "connecting";
case ISDISCONNECTED:
return "disconnected";
#if HAVE_OPENSSL
case INSSLACCEPT:
return "SSL_accept";
case INSSLSHUTDOWN:
return "SSL_shutdown";
#endif
case ISFLUSHING:
return "flushing";
}
return "in unknown state";
}
/* down a console, virtual or real (ksb) /* down a console, virtual or real (ksb)
* *
* this should be kept pretty simple, 'cause the config file reading code * this should be kept pretty simple, 'cause the config file reading code
@ -843,15 +862,14 @@ ConsInit(pCE)
if (ret == 0) { if (ret == 0) {
pCE->ioState = ISNORMAL; pCE->ioState = ISNORMAL;
pCE->stateTimer = 0; pCE->stateTimer = 0;
pCE->fup = 1;
} else { } else {
pCE->ioState = INCONNECT; pCE->ioState = INCONNECT;
pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT; pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT;
if (timers[T_STATE] == (time_t)0 || if (timers[T_STATE] == (time_t)0 ||
timers[T_STATE] > pCE->stateTimer) timers[T_STATE] > pCE->stateTimer)
timers[T_STATE] = pCE->stateTimer; timers[T_STATE] = pCE->stateTimer;
pCE->fup = 1;
} }
pCE->fup = 1;
break; break;
case DEVICE: case DEVICE:
if (-1 == if (-1 ==
@ -929,11 +947,11 @@ ConsInit(pCE)
} }
if (pCE->downHard == FLAGTRUE) { if (pCE->downHard == FLAGTRUE) {
if (pCE->ioState == ISNORMAL) if (pCE->ioState == ISNORMAL) {
Msg("[%s] console up", pCE->server); Msg("[%s] console up", pCE->server);
else
Msg("[%s] console initializing", pCE->server);
pCE->downHard = FLAGFALSE; pCE->downHard = FLAGFALSE;
} else
Msg("[%s] console initializing", pCE->server);
} }
#if HAVE_GETTIMEOFDAY #if HAVE_GETTIMEOFDAY
if (gettimeofday(&tv, (void *)0) == 0) if (gettimeofday(&tv, (void *)0) == 0)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: consent.h,v 5.58 2004/06/01 23:45:47 bryan Exp $ * $Id: consent.h,v 5.59 2004/10/25 07:18:18 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -178,3 +178,4 @@ extern REMOTE *FindUniq PARAMS((REMOTE *));
extern void DestroyRemoteConsole PARAMS((REMOTE *)); extern void DestroyRemoteConsole PARAMS((REMOTE *));
extern void StartInit PARAMS((CONSENT *)); extern void StartInit PARAMS((CONSENT *));
extern void StopInit PARAMS((CONSENT *)); extern void StopInit PARAMS((CONSENT *));
extern char *ConsState PARAMS((CONSENT *));

View File

@ -1,6 +1,6 @@
.\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine .\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine
.\" $Id: conserver.man,v 1.50 2004/06/08 16:19:46 bryan Exp $ .\" $Id: conserver.man,v 1.50 2004/06/08 16:19:46 bryan Exp $
.TH CONSERVER 8 "2004/06/08" "conserver-8.1.10" "conserver" .TH CONSERVER 8 "2004/06/08" "conserver-8.1.11" "conserver"
.SH NAME .SH NAME
conserver \- console server daemon conserver \- console server daemon
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -1,5 +1,5 @@
/* /*
* $Id: cutil.c,v 1.118 2004/05/25 00:38:15 bryan Exp $ * $Id: cutil.c,v 1.121 2004/11/09 08:37:05 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -3092,7 +3092,7 @@ ProcessSubst(s, repl, str, name, id)
* you could pass all arguments in...then both types of actions occur. * you could pass all arguments in...then both types of actions occur.
*/ */
char *p; char *p;
char *repfmt[255]; char *repfmt[256];
unsigned short repnum; unsigned short repnum;
int i; int i;
@ -3151,7 +3151,8 @@ ProcessSubst(s, repl, str, name, id)
goto subst_err; goto subst_err;
break; break;
case REP_INT: case REP_INT:
if (*p == 'd' || *p == 'x' || *p == 'X') { if (*p == 'd' || *p == 'x' || *p == 'X' || *p == 'a' ||
*p == 'A') {
if (s->tokens[(unsigned)(*(repfmt[repnum]))] != if (s->tokens[(unsigned)(*(repfmt[repnum]))] !=
ISNUMBER) ISNUMBER)
goto subst_err; goto subst_err;
@ -3251,20 +3252,27 @@ ProcessSubst(s, repl, str, name, id)
case 'X': case 'X':
base = 16; base = 16;
break; break;
case 'a':
case 'A':
base = 36;
break;
default: default:
return; return;
} }
while (port >= base) { while (port >= base) {
if (port % base >= 10) if (port % base >= 10)
BuildStringChar((port % base) - 10 + BuildStringChar((port % base) - 10 +
(*c == 'x' ? 'a' : 'A'), num); ((*c == 'x' ||
*c == 'a') ? 'a' : 'A'),
num);
else else
BuildStringChar((port % base) + '0', num); BuildStringChar((port % base) + '0', num);
port /= base; port /= base;
} }
if (port >= 10) if (port >= 10)
BuildStringChar(port - 10 + BuildStringChar(port - 10 +
(*c == 'x' ? 'a' : 'A'), num); ((*c == 'x' ||
*c == 'a') ? 'a' : 'A'), num);
else else
BuildStringChar(port + '0', num); BuildStringChar(port + '0', num);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: group.c,v 5.305 2004/07/14 05:28:42 bryan Exp $ * $Id: group.c,v 5.311 2004/10/25 07:25:35 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -89,6 +89,29 @@ time_t timers[T_MAX];
static unsigned long dmallocMarkClientConnection = 0; static unsigned long dmallocMarkClientConnection = 0;
#endif #endif
void
#if PROTOTYPES
SendIWaitClientsMsg(CONSENT *pCE, char *message)
#else
SendIWaitClientsMsg(pCE, message)
CONSENT *pCE;
char *message;
#endif
{
CONSCLIENT *pCL;
if ((CONSENT *)0 == pCE) {
return;
}
for (pCL = pCE->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) {
if (pCL->fcon && pCL->fiwait) {
pCL->fiwait = 0;
FileWrite(pCL->fd, FLAGFALSE, message, -1);
}
}
}
void void
#if PROTOTYPES #if PROTOTYPES
SendClientsMsg(CONSENT *pCE, char *message) SendClientsMsg(CONSENT *pCE, char *message)
@ -184,6 +207,47 @@ AbortAnyClientExec(pCL)
} }
} }
void
#if PROTOTYPES
ClientWantsWrite(CONSCLIENT *pCL)
#else
ClientWantsWrite(pCL)
CONSCLIENT *pCL;
#endif
{
CONSENT *pCE;
if ((CONSCLIENT *)0 == pCL)
return;
if (pCL->fwr)
return;
pCL->fwr = 0;
pCL->fwantwr = 1;
pCE = pCL->pCEto;
if ((CONSENT *)0 == pCE)
return;
/* promote the client to the top of the list
* (which allows them to be picked first for
* aquiring read-write access)
* first by extracting...
*/
if ((CONSCLIENT *)0 != pCL->pCLnext) {
pCL->pCLnext->ppCLbnext = pCL->ppCLbnext;
}
*(pCL->ppCLbnext) = pCL->pCLnext;
/* now by inserting...
*/
pCL->pCLnext = pCE->pCLon;
pCL->ppCLbnext = &pCE->pCLon;
if ((CONSCLIENT *)0 != pCL->pCLnext) {
pCL->pCLnext->ppCLbnext = &pCL->pCLnext;
}
pCE->pCLon = pCL;
}
void void
#if PROTOTYPES #if PROTOTYPES
DisconnectClient(GRPENT *pGE, CONSCLIENT *pCL, char *message, FLAG force) DisconnectClient(GRPENT *pGE, CONSCLIENT *pCL, char *message, FLAG force)
@ -234,14 +298,12 @@ DisconnectClient(pGE, pCL, message, force)
* and turn logging back on... * and turn logging back on...
*/ */
if (pCL->fwr) { if (pCL->fwr) {
pCL->fwr = 0; BumpClient(pCEServing, (char *)0);
pCL->fwantwr = 0;
TagLogfileAct(pCEServing, "%s detached", pCL->acid->string); TagLogfileAct(pCEServing, "%s detached", pCL->acid->string);
if (pCEServing->nolog) { if (pCEServing->nolog) {
pCEServing->nolog = 0; pCEServing->nolog = 0;
TagLogfile(pCEServing, "Console logging restored (logout)"); TagLogfile(pCEServing, "Console logging restored (logout)");
} }
pCEServing->pCLwr = (CONSCLIENT *)0;
FindWrite(pCEServing); FindWrite(pCEServing);
} }
@ -502,6 +564,7 @@ DestroyConsent(pGE, pCE)
FD_CLR(FileFDNum(pCL->fd), &winit); FD_CLR(FileFDNum(pCL->fd), &winit);
FileClose(&pCL->fd); FileClose(&pCL->fd);
if (pCL->fwr) { if (pCL->fwr) {
BumpClient(pCE, (char *)0);
TagLogfileAct(pCE, "%s detached", pCL->acid->string); TagLogfileAct(pCE, "%s detached", pCL->acid->string);
if (pCE->nolog) { if (pCE->nolog) {
pCE->nolog = 0; pCE->nolog = 0;
@ -864,14 +927,6 @@ ConsoleError(pCE)
CONSENT *pCE; CONSENT *pCE;
#endif #endif
{ {
/* If someone was writing, they fall back to read-only */
if (pCE->pCLwr != (CONSCLIENT *)0) {
pCE->pCLwr->fwr = 0;
pCE->pCLwr->fwantwr = 1;
TagLogfileAct(pCE, "%s detached", pCE->pCLwr->acid->string);
pCE->pCLwr = (CONSCLIENT *)0;
}
if (pCE->autoreinit != FLAGTRUE) { if (pCE->autoreinit != FLAGTRUE) {
ConsDown(pCE, FLAGTRUE, FLAGTRUE); ConsDown(pCE, FLAGTRUE, FLAGTRUE);
} else { } else {
@ -880,9 +935,7 @@ ConsoleError(pCE)
ConsInit(pCE); ConsInit(pCE);
/* If we didn't succeed, try again later */ /* If we didn't succeed, try again later */
if (pCE->fup) if (!pCE->fup)
FindWrite(pCE);
else
pCE->autoReUp = 1; pCE->autoReUp = 1;
} }
} }
@ -1063,9 +1116,7 @@ ReUp(pGE, automatic)
ConsInit(pCE); ConsInit(pCE);
if (updateDelay) if (updateDelay)
UpdateDelay(pCE); UpdateDelay(pCE);
if (pCE->fup) if (!pCE->fup && automatic > 0)
FindWrite(pCE);
else if (automatic > 0)
pCE->autoReUp = autoReUp; pCE->autoReUp = autoReUp;
} }
} while (retry); } while (retry);
@ -1470,7 +1521,6 @@ ReapVirt(pGE)
TagLogfileAct(pCE, "initcmd terminated"); TagLogfileAct(pCE, "initcmd terminated");
pCE->initpid = 0; pCE->initpid = 0;
StopInit(pCE); StopInit(pCE);
FindWrite(pCE);
break; break;
} }
@ -1482,15 +1532,6 @@ ReapVirt(pGE)
if (WIFSIGNALED(UWbuf)) if (WIFSIGNALED(UWbuf))
Msg("[%s] signal(%d)", pCE->server, WTERMSIG(UWbuf)); Msg("[%s] signal(%d)", pCE->server, WTERMSIG(UWbuf));
/* If someone was writing, they fall back to read-only */
if (pCE->pCLwr != (CONSCLIENT *)0) {
pCE->pCLwr->fwr = 0;
pCE->pCLwr->fwantwr = 1;
TagLogfileAct(pCE, "%s detached",
pCE->pCLwr->acid->string);
pCE->pCLwr = (CONSCLIENT *)0;
}
if (pCE->autoreinit != FLAGTRUE && if (pCE->autoreinit != FLAGTRUE &&
!(WIFEXITED(UWbuf) && WEXITSTATUS(UWbuf) == 0)) { !(WIFEXITED(UWbuf) && WEXITSTATUS(UWbuf) == 0)) {
ConsDown(pCE, FLAGTRUE, FLAGFALSE); ConsDown(pCE, FLAGTRUE, FLAGFALSE);
@ -1500,9 +1541,7 @@ ReapVirt(pGE)
ConsInit(pCE); ConsInit(pCE);
/* If we didn't succeed, try again later */ /* If we didn't succeed, try again later */
if (pCE->fup) if (!pCE->fup)
FindWrite(pCE);
else
pCE->autoReUp = 1; pCE->autoReUp = 1;
} }
break; break;
@ -1844,19 +1883,13 @@ CommandAttach(pGE, pCLServing, pCEServing, tyme)
{ {
CONSCLIENT *pCL; CONSCLIENT *pCL;
ClientWantsWrite(pCLServing);
if (pCEServing->fronly) { if (pCEServing->fronly) {
FileWrite(pCLServing->fd, FLAGFALSE, "console is read-only]\r\n", FileWrite(pCLServing->fd, FLAGFALSE, "console is read-only]\r\n",
-1); -1);
} else if (pCEServing->initfile != (CONSFILE *)0 ||
pCEServing->ioState == INCONNECT) {
FileWrite(pCLServing->fd, FLAGFALSE,
"read-only -- initializing]\r\n", -1);
pCLServing->fwantwr = 1;
} else if (pCLServing->fro) { } else if (pCLServing->fro) {
FileWrite(pCLServing->fd, FLAGFALSE, "read-only]\r\n", -1); FileWrite(pCLServing->fd, FLAGFALSE, "read-only]\r\n", -1);
} else if (!(pCEServing->fup && pCEServing->ioState == ISNORMAL)) {
FileWrite(pCLServing->fd, FLAGFALSE,
"line to console is down]\r\n", -1);
} else if ((CONSCLIENT *)0 == (pCL = pCEServing->pCLwr)) { } else if ((CONSCLIENT *)0 == (pCL = pCEServing->pCLwr)) {
pCEServing->pCLwr = pCLServing; pCEServing->pCLwr = pCLServing;
pCLServing->fwr = 1; pCLServing->fwr = 1;
@ -1875,7 +1908,6 @@ CommandAttach(pGE, pCLServing, pCEServing, tyme)
FileWrite(pCLServing->fd, FLAGFALSE, "ok]\r\n", -1); FileWrite(pCLServing->fd, FLAGFALSE, "ok]\r\n", -1);
} }
} else { } else {
pCLServing->fwantwr = 1;
FilePrint(pCLServing->fd, FLAGFALSE, "no, %s is attached]\r\n", FilePrint(pCLServing->fd, FLAGFALSE, "no, %s is attached]\r\n",
pCL->acid->string); pCL->acid->string);
} }
@ -1940,15 +1972,7 @@ CommandDown(pGE, pCLServing, pCEServing, tyme)
{ {
CONSCLIENT *pCL; CONSCLIENT *pCL;
/* if client is read-only OR if (!pCLServing->fwr) {
* console is read-only OR
* (console is up, normal state, and not running command AND
* client isn't the writer)
* then just pop out an "error" message
*/
if (pCLServing->fro || pCEServing->fronly ||
(pCEServing->fup && pCEServing->ioState == ISNORMAL &&
pCEServing->initfile == (CONSFILE *)0 && !pCLServing->fwr)) {
FileWrite(pCLServing->fd, FLAGFALSE, "attach to down line]\r\n", FileWrite(pCLServing->fd, FLAGFALSE, "attach to down line]\r\n",
-1); -1);
return; return;
@ -1958,9 +1982,6 @@ CommandDown(pGE, pCLServing, pCEServing, tyme)
return; return;
} }
pCLServing->fwr = 0;
pCEServing->pCLwr = (CONSCLIENT *)0;
TagLogfileAct(pCEServing, "%s detached", pCLServing->acid->string);
ConsDown(pCEServing, FLAGFALSE, FLAGFALSE); ConsDown(pCEServing, FLAGFALSE, FLAGFALSE);
FileWrite(pCLServing->fd, FLAGFALSE, "line down]\r\n", -1); FileWrite(pCLServing->fd, FLAGFALSE, "line down]\r\n", -1);
@ -2034,23 +2055,15 @@ CommandForce(pGE, pCLServing, pCEServing, tyme)
{ {
CONSCLIENT *pCL; CONSCLIENT *pCL;
ClientWantsWrite(pCLServing);
if (pCLServing->fro) { if (pCLServing->fro) {
FileWrite(pCLServing->fd, FLAGFALSE, "read-only]\r\n", -1); FileWrite(pCLServing->fd, FLAGFALSE, "read-only]\r\n", -1);
return; return;
} else if (pCEServing->initfile != (CONSFILE *)0 ||
pCEServing->ioState == INCONNECT) {
FileWrite(pCLServing->fd, FLAGFALSE,
"read-only -- initializing]\r\n", -1);
pCLServing->fwantwr = 1;
return;
} else if (pCEServing->fronly) { } else if (pCEServing->fronly) {
FileWrite(pCLServing->fd, FLAGFALSE, "console is read-only]\r\n", FileWrite(pCLServing->fd, FLAGFALSE, "console is read-only]\r\n",
-1); -1);
return; return;
} else if (!(pCEServing->fup && pCEServing->ioState == ISNORMAL)) {
FileWrite(pCLServing->fd, FLAGFALSE,
"line to console is down]\r\n", -1);
return;
} }
if ((CONSCLIENT *)0 != (pCL = pCEServing->pCLwr)) { if ((CONSCLIENT *)0 != (pCL = pCEServing->pCLwr)) {
if (pCL == pCLServing) { if (pCL == pCLServing) {
@ -2062,8 +2075,6 @@ CommandForce(pGE, pCLServing, pCEServing, tyme)
} }
return; return;
} }
pCL->fwr = 0;
pCL->fwantwr = 1;
if (pCEServing->nolog) { if (pCEServing->nolog) {
FilePrint(pCLServing->fd, FLAGFALSE, FilePrint(pCLServing->fd, FLAGFALSE,
"bumped %s (nologging)]\r\n", pCL->acid->string); "bumped %s (nologging)]\r\n", pCL->acid->string);
@ -2072,6 +2083,8 @@ CommandForce(pGE, pCLServing, pCEServing, tyme)
pCL->acid->string); pCL->acid->string);
} }
AbortAnyClientExec(pCL); AbortAnyClientExec(pCL);
BumpClient(pCEServing, (char *)0);
ClientWantsWrite(pCL);
if (pCL->fcon) if (pCL->fcon)
FilePrint(pCL->fd, FLAGFALSE, FilePrint(pCL->fd, FLAGFALSE,
"\r\n[forced to `spy' mode by %s]\r\n", "\r\n[forced to `spy' mode by %s]\r\n",
@ -2315,15 +2328,7 @@ CommandOpen(pGE, pCLServing, pCEServing, tyme)
{ {
CONSCLIENT *pCL; CONSCLIENT *pCL;
/* if client is read-only OR if (!pCLServing->fwr) {
* console is read-only OR
* (console is up, normal state, and not running command AND
* client isn't the writer)
* then just pop out an "error" message
*/
if (pCLServing->fro || pCEServing->fronly ||
(pCEServing->fup && pCEServing->ioState == ISNORMAL &&
pCEServing->initfile == (CONSFILE *)0 && !pCLServing->fwr)) {
FileWrite(pCLServing->fd, FLAGFALSE, "attach to reopen]\r\n", -1); FileWrite(pCLServing->fd, FLAGFALSE, "attach to reopen]\r\n", -1);
return; return;
} }
@ -2331,26 +2336,27 @@ CommandOpen(pGE, pCLServing, pCEServing, tyme)
* change fd's * change fd's
*/ */
ConsInit(pCEServing); ConsInit(pCEServing);
if (pCEServing->initfile != (CONSFILE *)0 || if (pCEServing->fup &&
pCEServing->ioState == INCONNECT) { (pCEServing->initfile != (CONSFILE *)0 ||
FileWrite(pCLServing->fd, FLAGFALSE, pCEServing->ioState == INCONNECT)) {
"read-only -- initializing]\r\n", -1); FileWrite(pCLServing->fd, FLAGFALSE, "connecting...", -1);
} else if (!(pCEServing->fup && pCEServing->ioState == ISNORMAL)) { pCLServing->fiwait = 1;
FileWrite(pCLServing->fd, FLAGFALSE,
"line to console is down]\r\n", -1);
} else if (pCEServing->fronly) { } else if (pCEServing->fronly) {
FileWrite(pCLServing->fd, FLAGFALSE, "up read-only]\r\n", -1); FilePrint(pCLServing->fd, FLAGFALSE, "%s -- read-only]\r\n",
pCEServing->fup ? "up" : "down");
} else if ((CONSCLIENT *)0 == (pCL = pCEServing->pCLwr)) { } else if ((CONSCLIENT *)0 == (pCL = pCEServing->pCLwr)) {
pCEServing->pCLwr = pCLServing; pCEServing->pCLwr = pCLServing;
pCLServing->fwr = 1; pCLServing->fwr = 1;
FileWrite(pCLServing->fd, FLAGFALSE, "up -- attached]\r\n", -1); FilePrint(pCLServing->fd, FLAGFALSE, "%s -- attached]\r\n",
pCEServing->fup ? "up" : "down");
TagLogfileAct(pCEServing, "%s attached", pCLServing->acid->string); TagLogfileAct(pCEServing, "%s attached", pCLServing->acid->string);
} else if (pCL == pCLServing) { } else if (pCL == pCLServing) {
FileWrite(pCLServing->fd, FLAGFALSE, "up]\r\n", -1); FilePrint(pCLServing->fd, FLAGFALSE, "%s]\r\n",
pCEServing->fup ? "up" : "down");
TagLogfileAct(pCEServing, "%s attached", pCLServing->acid->string); TagLogfileAct(pCEServing, "%s attached", pCLServing->acid->string);
} else { } else {
FilePrint(pCLServing->fd, FLAGFALSE, "up, %s is attached]\r\n", FilePrint(pCLServing->fd, FLAGFALSE, "%s, %s is attached]\r\n",
pCL->acid->string); pCEServing->fup ? "up" : "down", pCL->acid->string);
} }
} }
@ -2430,7 +2436,7 @@ DoConsoleRead(pCEServing)
/* read terminal line */ /* read terminal line */
if ((nr = if ((nr =
FileRead(pCEServing->cofile, acInOrig, sizeof(acInOrig))) < 0) { FileRead(pCEServing->cofile, acInOrig, sizeof(acInOrig))) < 0) {
Error("[%s] read failure", pCEServing->server); Error("[%s] read failure: unexpected EOF", pCEServing->server);
ConsoleError(pCEServing); ConsoleError(pCEServing);
return; return;
} }
@ -2623,7 +2629,6 @@ DoCommandRead(pCEServing)
if ((nr = if ((nr =
FileRead(pCEServing->initfile, acInOrig, sizeof(acInOrig))) < 0) { FileRead(pCEServing->initfile, acInOrig, sizeof(acInOrig))) < 0) {
StopInit(pCEServing); StopInit(pCEServing);
FindWrite(pCEServing);
return; return;
} }
CONDDEBUG((1, "DoCommandRead(): read %d bytes from fd %d", nr, fd)); CONDDEBUG((1, "DoCommandRead(): read %d bytes from fd %d", nr, fd));
@ -3027,18 +3032,6 @@ DoClientRead(pGE, pCLServing)
if (pCEServing->fronly) { if (pCEServing->fronly) {
FileWrite(pCLServing->fd, FLAGFALSE, FileWrite(pCLServing->fd, FLAGFALSE,
"[console is read-only]\r\n", -1); "[console is read-only]\r\n", -1);
} else if (pCEServing->initfile != (CONSFILE *)0 ||
pCEServing->ioState == INCONNECT) {
pCLServing->fwantwr = 1;
FileWrite(pCLServing->fd, FLAGFALSE,
"[read-only -- initializing]\r\n",
-1);
} else
if (!
(pCEServing->fup &&
pCEServing->ioState == ISNORMAL)) {
FileWrite(pCLServing->fd, FLAGFALSE,
"[line to console is down]\r\n", -1);
} else if (((CONSCLIENT *)0 == pCEServing->pCLwr) } else if (((CONSCLIENT *)0 == pCEServing->pCLwr)
&& !pCLServing->fro) { && !pCLServing->fro) {
pCEServing->pCLwr = pCLServing; pCEServing->pCLwr = pCLServing;
@ -3050,7 +3043,7 @@ DoClientRead(pGE, pCLServing)
TagLogfileAct(pCEServing, "%s attached", TagLogfileAct(pCEServing, "%s attached",
pCLServing->acid->string); pCLServing->acid->string);
} else { } else {
pCLServing->fwantwr = 1; ClientWantsWrite(pCLServing);
FileWrite(pCLServing->fd, FLAGFALSE, FileWrite(pCLServing->fd, FLAGFALSE,
"[spy]\r\n", -1); "[spy]\r\n", -1);
} }
@ -3232,9 +3225,7 @@ DoClientRead(pGE, pCLServing)
continue; continue;
case S_SUSP: case S_SUSP:
if (! if (!pCEServing->fup) {
(pCEServing->fup &&
pCEServing->ioState == ISNORMAL)) {
FileWrite(pCLServing->fd, FLAGFALSE, FileWrite(pCLServing->fd, FLAGFALSE,
" -- line down]\r\n", -1); " -- line down]\r\n", -1);
} else if (pCEServing->fronly) { } else if (pCEServing->fronly) {
@ -3276,7 +3267,10 @@ DoClientRead(pGE, pCLServing)
case S_CEXEC: case S_CEXEC:
/* if we can write, write to slave tty /* if we can write, write to slave tty
*/ */
if (pCLServing->fwr) { if (pCEServing->fup &&
pCEServing->initfile == (CONSFILE *)0 &&
pCEServing->ioState == ISNORMAL &&
pCLServing->fwr && !pCLServing->fiwait) {
PutConsole(pCEServing, acIn[i], 1); PutConsole(pCEServing, acIn[i], 1);
continue; continue;
} }
@ -3285,10 +3279,17 @@ DoClientRead(pGE, pCLServing)
* (LLL nice to put chars out as ^Ec, rather * (LLL nice to put chars out as ^Ec, rather
* than octal escapes, but....) * than octal escapes, but....)
*/ */
if ('\r' == acIn[i] || '\n' == acIn[i]) { if (!pCLServing->fiwait &&
('\r' == acIn[i] || '\n' == acIn[i])) {
char *m = "";
if (pCLServing->fwr)
m = ConsState(pCEServing);
else
m = "read-only";
FilePrint(pCLServing->fd, FLAGFALSE, FilePrint(pCLServing->fd, FLAGFALSE,
"[read-only -- use %s %s ? for help]\r\n", "[%s -- use %s %s ? for help]\r\n",
FmtCtl(pCLServing->ic[0], acA1), m, FmtCtl(pCLServing->ic[0],
acA1),
FmtCtl(pCLServing->ic[1], acA2)); FmtCtl(pCLServing->ic[1], acA2));
} }
continue; continue;
@ -3396,6 +3397,21 @@ DoClientRead(pGE, pCLServing)
case S_CMD: /* have 1/2 of the escape sequence */ case S_CMD: /* have 1/2 of the escape sequence */
pCLServing->iState = S_NORMAL; pCLServing->iState = S_NORMAL;
switch (acIn[i]) { switch (acIn[i]) {
case '=':
if (!pCLServing->fcon) {
char *m = ConsState(pCEServing);
if (strcmp(m,"up") == 0)
FileWrite(pCLServing->fd,
FLAGFALSE, "up]\r\n",
-1);
else
FilePrint(pCLServing->fd,
FLAGFALSE,
"`%s' -- console is %s]\r\n",
pCEServing->server, m);
} else
goto unknownchar;
break;
case ';': case ';':
if (pCLServing->fcon) { if (pCLServing->fcon) {
FileSetQuoteIAC(pCLServing->fd, FileSetQuoteIAC(pCLServing->fd,
@ -3557,10 +3573,9 @@ DoClientRead(pGE, pCLServing)
"ok]\r\n", -1); "ok]\r\n", -1);
break; break;
} }
pCLServing->fwr = 0; BumpClient(pCEServing, (char *)0);
TagLogfileAct(pCEServing, "%s detached", TagLogfileAct(pCEServing, "%s detached",
pCLServing->acid->string); pCLServing->acid->string);
pCEServing->pCLwr = (CONSCLIENT *)0;
FindWrite(pCEServing); FindWrite(pCEServing);
FileWrite(pCLServing->fd, FLAGFALSE, FileWrite(pCLServing->fd, FLAGFALSE,
"spying]\r\n", -1); "spying]\r\n", -1);
@ -3629,13 +3644,12 @@ DoClientRead(pGE, pCLServing)
pCLServing->fcon = 0; pCLServing->fcon = 0;
pCLServing->iState = S_SUSP; pCLServing->iState = S_SUSP;
if (pCEServing->pCLwr == pCLServing) { if (pCEServing->pCLwr == pCLServing) {
pCLServing->fwr = 0; BumpClient(pCEServing, (char *)0);
pCLServing->fwantwr = 0;
pCEServing->pCLwr = (CONSCLIENT *)0;
TagLogfileAct(pCEServing, TagLogfileAct(pCEServing,
"%s detached", "%s detached",
pCLServing->acid-> pCLServing->acid->
string); string);
FindWrite(pCEServing);
} }
break; break;
@ -3724,6 +3738,7 @@ DoClientRead(pGE, pCLServing)
break; break;
default: /* unknown sequence */ default: /* unknown sequence */
unknownchar:
#if USE_EXTENDED_MESSAGES #if USE_EXTENDED_MESSAGES
FilePrint(pCLServing->fd, FLAGFALSE, FilePrint(pCLServing->fd, FLAGFALSE,
"unknown -- use `?'%s]\r\n", "unknown -- use `?'%s]\r\n",
@ -3992,7 +4007,6 @@ FlushConsole(pCEServing)
timers[T_CIDLE] = pCEServing->lastWrite + pCEServing->idletimeout; timers[T_CIDLE] = pCEServing->lastWrite + pCEServing->idletimeout;
} }
/* routine used by the child processes. (ksb/fine) /* routine used by the child processes. (ksb/fine)
* Most of it is escape sequence parsing. * Most of it is escape sequence parsing.
* fine: * fine:
@ -4189,6 +4203,7 @@ Kiddie(pGE, sfd)
pCEServing->stateTimer = (time_t)0; pCEServing->stateTimer = (time_t)0;
if (pCEServing->ioState != INCONNECT) if (pCEServing->ioState != INCONNECT)
continue; continue;
SendIWaitClientsMsg(pCEServing, "down]\r\n");
Error("[%s] connect timeout: forcing down", Error("[%s] connect timeout: forcing down",
pCEServing->server); pCEServing->server);
/* can't use ConsoleError() here otherwise we could reinit /* can't use ConsoleError() here otherwise we could reinit
@ -4334,6 +4349,7 @@ Kiddie(pGE, sfd)
pCEServing->server, cofile, pCEServing->server, cofile,
strerror(errno)); strerror(errno));
/* no ConsoleError() for same reason as above */ /* no ConsoleError() for same reason as above */
SendIWaitClientsMsg(pCEServing, "down]\r\n");
ConsDown(pCEServing, FLAGTRUE, FLAGTRUE); ConsDown(pCEServing, FLAGTRUE, FLAGTRUE);
break; break;
} }
@ -4342,6 +4358,7 @@ Kiddie(pGE, sfd)
pCEServing->server, cofile, pCEServing->server, cofile,
strerror(flags)); strerror(flags));
/* no ConsoleError() for same reason as above */ /* no ConsoleError() for same reason as above */
SendIWaitClientsMsg(pCEServing, "down]\r\n");
ConsDown(pCEServing, FLAGTRUE, FLAGTRUE); ConsDown(pCEServing, FLAGTRUE, FLAGTRUE);
break; break;
} }
@ -4368,6 +4385,11 @@ Kiddie(pGE, sfd)
timers[T_CIDLE] = timers[T_CIDLE] =
pCEServing->lastWrite + pCEServing->lastWrite +
pCEServing->idletimeout; pCEServing->idletimeout;
if (pCEServing->downHard == FLAGTRUE) {
Msg("[%s] console up", pCEServing->server);
pCEServing->downHard = FLAGFALSE;
}
SendIWaitClientsMsg(pCEServing, "up]\r\n");
StartInit(pCEServing); StartInit(pCEServing);
} }
break; break;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: group.h,v 5.46 2004/05/25 00:38:15 bryan Exp $ * $Id: group.h,v 5.47 2004/10/10 18:46:15 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -81,6 +81,7 @@ extern int ClientAccess PARAMS((CONSENT *, char *));
extern void DestroyClient PARAMS((CONSCLIENT *)); extern void DestroyClient PARAMS((CONSCLIENT *));
extern int CheckPasswd PARAMS((CONSCLIENT *, char *)); extern int CheckPasswd PARAMS((CONSCLIENT *, char *));
extern void DeUtmp PARAMS((GRPENT *, int)); extern void DeUtmp PARAMS((GRPENT *, int));
extern void ClientWantsWrite PARAMS((CONSCLIENT *));
#if HAVE_OPENSSL #if HAVE_OPENSSL
extern int AttemptSSL PARAMS((CONSCLIENT *)); extern int AttemptSSL PARAMS((CONSCLIENT *));
#endif #endif

View File

@ -1,5 +1,5 @@
/* /*
* $Id: readcfg.c,v 5.180 2004/07/14 05:28:42 bryan Exp $ * $Id: readcfg.c,v 5.181 2004/10/25 07:18:19 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -3003,8 +3003,7 @@ ConsoleDestroy()
"[Conserver reconfigured - r/w access removed]\r\n", "[Conserver reconfigured - r/w access removed]\r\n",
-1); -1);
if (pCL->fwr) { if (pCL->fwr) {
pCL->fwr = 0; BumpClient(pCE, (char *)0);
pCL->fwantwr = 0;
TagLogfileAct(pCE, "%s detached", TagLogfileAct(pCE, "%s detached",
pCL->acid->string); pCL->acid->string);
if (pCE->nolog) { if (pCE->nolog) {
@ -3012,7 +3011,6 @@ ConsoleDestroy()
TagLogfile(pCE, TagLogfile(pCE,
"Console logging restored (bumped)"); "Console logging restored (bumped)");
} }
pCE->pCLwr = (CONSCLIENT *)0;
FindWrite(pCE); FindWrite(pCE);
} }
} else { } else {

View File

@ -1,5 +1,5 @@
/* /*
* $Id: version.h,v 1.66 2004/09/21 23:47:14 bryan Exp $ * $Id: version.h,v 1.70 2004/11/09 08:24:01 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -14,4 +14,4 @@
@(#) Copyright 2000 conserver.com.\n\ @(#) Copyright 2000 conserver.com.\n\
All rights reserved.\n" All rights reserved.\n"
#define THIS_VERSION "conserver.com version 8.1.10" #define THIS_VERSION "conserver.com version 8.1.11"

View File

@ -1,5 +1,5 @@
/* /*
* $Id: console.c,v 5.168 2004/09/21 23:45:53 bryan Exp $ * $Id: console.c,v 5.169 2004/10/25 07:18:20 bryan Exp $
* *
* Copyright conserver.com, 2000 * Copyright conserver.com, 2000
* *
@ -1394,6 +1394,13 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
} }
} }
/* try to grok the state of the console */
FilePrint(pcf, FLAGFALSE, "%c%c=", chAttn, chEsc);
r = ReadReply(pcf, 0);
if (strncmp(r, "[unknown", 8) != 0 &&
strncmp(r, "[up]", 4) != 0)
FileWrite(cfstdout, FLAGFALSE, r, -1);
printf("[Enter `"); printf("[Enter `");
PutCtlc(chAttn, stdout); PutCtlc(chAttn, stdout);
PutCtlc(chEsc, stdout); PutCtlc(chEsc, stdout);

View File

@ -1,5 +1,5 @@
.\" $Id: console.man,v 1.55 2004/07/14 05:28:42 bryan Exp $ .\" $Id: console.man,v 1.55 2004/07/14 05:28:42 bryan Exp $
.TH CONSOLE 1 "2004/07/14" "conserver-8.1.10" "conserver" .TH CONSOLE 1 "2004/07/14" "conserver-8.1.11" "conserver"
.SH NAME .SH NAME
console \- console server client program console \- console server client program
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -4,7 +4,7 @@
# #
%define pkg conserver %define pkg conserver
%define ver 8.1.10 %define ver 8.1.11
# define the name of the machine on which the main conserver # define the name of the machine on which the main conserver
# daemon will be running if you don't want to use the default # daemon will be running if you don't want to use the default

View File

@ -1,7 +1,7 @@
PKG="conserver" PKG="conserver"
NAME="Console server and client" NAME="Console server and client"
CATEGORY="system" CATEGORY="system"
VERSION="8.1.10" VERSION="8.1.11"
DESC="Console server and client" DESC="Console server and client"
CLASSES=none CLASSES=none
ARCH=sparc ARCH=sparc

View File

@ -33,7 +33,7 @@ dotest()
mv test.out results/test$testnum mv test.out results/test$testnum
else else
if [ -f results/test$testnum ]; then if [ -f results/test$testnum ]; then
if diff -i test.out results/test$testnum >test$testnum.diff 2>&1; then if diff -i results/test$testnum >test$testnum.diff test.out 2>&1; then
echo "succeeded" echo "succeeded"
rm -f test$testnum.diff rm -f test$testnum.diff
else else
@ -89,7 +89,7 @@ dotest EVAL "../console/console -n -C /dev/null -M 127.0.0.1 -p 7777 -u | sed -e
dotest 'c?c.' dotest 'c?c.'
dotest 'cl?c.' dotest 'cl?c.'
dotest 'cdc.' dotest 'cdc.'
dotest 'coc.' dotest 'cocacoc.'
dotest EVAL "echo 'tu.' | ../console/console -n -C /dev/null -M 127.0.0.1 -p 7777 -e 'tu' shell" dotest EVAL "echo 'tu.' | ../console/console -n -C /dev/null -M 127.0.0.1 -p 7777 -e 'tu' shell"
dotest EVAL "../console/console -n -C /dev/null -M 127.0.0.1 -p 7777 -R | sed -e 's/ [^ ]*$//'" dotest EVAL "../console/console -n -C /dev/null -M 127.0.0.1 -p 7777 -R | sed -e 's/ [^ ]*$//'"

View File

@ -1,4 +1,6 @@
console: shell is down [`shell' -- console is down]
[Enter `^Ec?' for help] [Enter `^Ec?' for help]
[up -- attached] [up]
[ok]
[up]
[disconnect] [disconnect]

View File

@ -1,4 +1,4 @@
console: shell is down [`shell' -- console is down]
[Enter `^Ec?' for help] [Enter `^Ec?' for help]
[up -- attached] [up]
[disconnect] [disconnect]