Imported from conserver-8.1.5.tar.gz

This commit is contained in:
Bryan Stansell 2004-05-07 09:05:25 -07:00
parent 8cd506c093
commit 5c430d220b
19 changed files with 1055 additions and 315 deletions

16
CHANGES
View File

@ -1,6 +1,20 @@
CHANGES
=======
version 8.1.5 (May 7, 2004):
- changed remaining O_NDELAY flags to O_NONBLOCK
- added PROTOCOLS file to describe the client/server protocol
- added '#include' capability to conserver.cf file
- added '@group' syntax to conserver.cf file to support use of
system groups
- added -U client option to allow client to ask for encryption
but fall back to non-encrypted connections otherwise -
suggested by Mike Hendon <mike.hendon@uk.nomura.com>
- fixed bug where socket not properly deleted on exit - reported
by William P LePera <lepera@us.ibm.com>
- added 'initdelay' option for throttling startup of consoles -
suggested by Jay McCanta <mccantaj@amgen.com>
version 8.1.4 (Apr 13, 2004):
- fixed macro use in manpages to hopefully be more compatible
- removed extra newline of --MARK-- range output
@ -708,5 +722,5 @@ before version 6.05:
and enhancements of various types were applied.
#
# $Id: CHANGES,v 1.167 2004/04/13 19:40:07 bryan Exp $
# $Id: CHANGES,v 1.174 2004/05/07 16:04:58 bryan Exp $
#

290
PROTOCOL Normal file
View File

@ -0,0 +1,290 @@
Conserver Protocol
==================
What Is This?
-------------
The following is an attempt to describe the client/server protocol used
between the server (conserver) and the client (console). This document
bases it's information on conserver version 8.1.4, as it's the release
currently available. If there are changes to the client/server
protocol, the INSTALL file should reference them and, ideally, this
document will be updated.
The information is looked at from the point of the server, since it's
the server that controls all information and triggers actions on the
client (like a suspend). The client's perspective should be obvious
from this information.
SSL
---
The client and server can negotiate an SSL connection. As far as the
code is concerned, the SSL "layer" is transparent. Data is sent and
received just as if it was unencrypted. Therefore, aside bringing up
the SSL connection, the SSL bits are unimportant from a protocol
standpoint. The client and server still send and receive the same
information - it just happens to be encrypted to everyone else.
"On-The-Wire" Data
------------------
The low-level, "on-the-wire" data is encapsulated similar to the telnet
protocol. All data is sent "as-is" with the exception of 0xFF. 0xFF is
used as a "command character" and both the client and server expect to
see a predefined option after it. The possible options are: 0xFF, 'E',
'G', 'Z', and '.'.
The 0xFF option says to use the literal character 0xFF. So, if there is
a 0xFF character in the data stream to be sent, the code will send two
0xFF characters (it's similar to using '\\' in C strings to embed a
'\').
The other options are used in various contexts, which will be described
in detail below.
Life As A Server
----------------
There are three different interfaces presented to clients by the server.
I'm going to name the three modes "master", "group", and "console". The
first two are line-based, and the third is character-based.
To understand the differences, I must outline how conserver manages
consoles. When conserver starts, it reads the configuration file,
listens on the master socket, and, for each group of consoles it must
manage (where the group size is set by -m), it forks off a copy of
itself. Those child processes are what actually connect to the consoles
and they each listen on a new socket for client connections. So, you
end up with a parent process (that knows about all consoles) that
manages the child processes (that know only about consoles it manages),
and everyone is listening on an individual socket for connections from
clients.
The parent process interacts with clients in "master" mode. That mode
expects line-based commands and responds similarly. Because it's the
master, it understands a certain set of commands that are different than
in "group" mode.
The child processes interact with clients in "group" mode first, and
negotiate a change to "console" mode when a client requests a connection
to a specific console.
"master" Mode
-------------
When parent process gets a connection from a client, it either sends an
"ok" string to signal it's ready or an error message (like "access from
your host is refused") and the connection is dropped. At this point,
there are a small number of commands recognized by the server, since
most are restricted to "logged in" clients. Here's the list of
available commands:
exit disconnect
help this help message
login log in
ssl start ssl session
An "exit" is sent a "goodbye" response and the connection is dropped. A
"help" is sent the list above. A "ssl" is sent an "ok" response and
then the server expects the client to negotiate an ssl connection. A
"login" requires one argument (the username) and is either sent an "ok",
meaning the client is logged in, or a "passwd?" followed by the local
hostname, asking for the user's password, which it expects next. If the
client sends a valid password, an "ok" is sent, otherwise an error
message and the connection is dropped.
Upon successful login, the commands available are:
call provide port for given console
exit disconnect
groups provide ports for group leaders
help this help message
master provide a list of master servers
pid provide pid of master process
quit* terminate conserver (SIGTERM)
restart* restart conserver (SIGHUP)
version provide version info for server
* = requires admin privileges
"exit" and "help" are the same as before the client logged login.
The "call" command expects one argument, the console name to connect to.
The server will respond with either a port number (if it's a locally
managed console), an "@hostname" where hostname is the name of the
remote conserver host managing the console (if it's a remotely managed
console), or an error message (possibly multi-line). The client is not
disconnected, whatever the response.
The "groups" command responds with a colon-separated list of port
numbers, which correspond to each of the child processes running on the
local host. The client is not disconnected.
The "master" command responds with a colon-separated list of "@hostname"
names. The list includes any hosts (including the possibility of the
local host) which have locally managed consoles. The client is not
disconnected.
The "pid" command responds with the pid of the master process (in this
case, the one the client is talking to). The client is not
disconnected.
The "quit" command will shut down conserver, assuming the user has
administrative access. It responds with a message starting with "ok" if
successful, and an error message otherwise (like "unauthorized
command"). The client is disconnected if it's successful.
The "restart" command will shut down conserver, assuming the user has
administrative access. It responds with a message starting with "ok" if
successful, and an error message otherwise (like "unauthorized
command"). The client is not disconnected.
The "version" command responds with the version string. The client is
not disconnected.
"group" Mode
------------
When a child process gets a connection from a client, it either sends an
"ok" string to signal it's ready or an error message (like "access from
your host is refused") and the connection is dropped. At this point,
"group" mode acts just like "master" mode. Once the client successfully
logs in, however, "group" mode has the recognizes the following
commands:
broadcast send broadcast message
call connect to given console
disconnect* disconnect the given user(s)
examine examine port and baud rates
exit disconnect
group show users in this group
help this help message
hosts show host status and user
info show console information
textmsg send a text message
* = requires admin privileges
The "exit" and "help" commands are like the others documented above.
The "broadcast" command expects a text string of the message to be sent
to all users connected to this process. An "ok" is sent as a response.
The "call" command expects one argument, the console name to connect to,
just like in "master" mode. The difference here is that this requests
the server to attach the client to the console and go into "console"
mode. If the attachment is successful, the response will begin with a
'[' character. If not, an error message is returned. The success
responses are:
[console is read-only] - console is read only
[read-only -- initializing] - console is initializing, and
read-only for the time being
[line to console is down] - console is down
[attached] - attached read-write
[spy] - attached read-only
The "disconnect" command expects an argument of the form "user@console"
where either the "user" or "@console" part may be omitted. Upon
success, a response of the form "ok -- disconnected X users" is sent,
where X is the number of users disconnected. If a user is unauthorized
or some other problem occurs, an error message (like "unauthorized
command") is sent.
The "examine" command returns a list of console information of the form
that 'console -x' shows.
The "group" command returns a list of console information of the form
that 'console -w' shows.
The "hosts" command returns a list of console information of the form
that 'console -u' shows.
The "info" command returns a list of console information of the form
that 'console -i' shows.
The "textmsg" command expects two arguments, the first being the
recipient of the message in the form "user@console" (again, where the
"user" or "@console" portion may be omitted) and the second being the
string, like the "broadcast" command. The server returns "ok".
"console" Mode
--------------
As mentioned above, "console" mode is obtained by using the "call"
command when connected to a child processes operating in "group" mode.
"console" mode should look very familiar to a user of conserver, as it's
what the user interacts with when connected to a console. There's
really nothings special here. Each character received from the client
is compared to the escape sequence, and if it matches, an action occurs
on the server side. If it doesn't match the escape sequence, the data
is sent on to the console. All data received from the console is sent
to the client(s). Of course, there are certain exceptions to these
rules, based on the state of the console and the state of the client.
And, certain escape sequences cause special behaviors to occur.
Most escape sequences cause the server to send information back to the
user. Stuff like "^Ecw", "^Eci", and "^Ecu" are examples. The escape
sequence is absorbed by the server, the server sends the client a
variety of information, and things continue as before.
The more "interesting" escape sequences are the following.
"^Ec;" The server sends a 0xFF,'G' command sequence to the client, to
signal a wish to move to a new console. The client then gets
put into the same state as the "^Ecz" sequence (paused), which
gives the client a chance to either resume the connection or
disconnect.
"^Ec|" The server sends a 0xFF,'E' command sequence to the client, to
signal a wish to have the client program interact with a
program, as opposed to the user. The server discards all data
until it receives one of the following command sequences from
the client:
0xFF,'E' Signals successful redirection of interaction to
a program. The server then responds with "[rw]"
or "[ro]" to tell the client whether or not they
have read-write access. If not, the client
should abort the program and send the abort
command sequence below, as other data received by
the server will just get dropped.
0xFF,'.' Abort the operation. The server assumes the
redirection didn't happen and returns the client
to it's normal mode.
The server keeps the client in the "redirected" state until it
receives a 0xFF,'.' command sequence from the client (which
usually occurs when the client command terminates).
If the client is "bumped" from read-write to read-only by
another user, the server will send the client a 0xFF,'.' command
sequence to tell it to abort the redirection and return control
back to the user.
"^Ecz" The server sends a 0xFF,'Z' command sequence to the client, to
signal a wish to suspend to client process. The client is then
put into a "paused" state where it receives no more data from
the server. When the client is ready to resume receiving data,
it sends a character of data to the server, at which point the
server discards the character and sends back a status message of
the form " -- MSG]". The current set of possible messages are:
" -- line down]"
" -- read-only]"
" -- attached (nologging)]"
" -- attached]"
" -- spy mode]"
#
# $Id: PROTOCOL,v 1.1 2004/04/16 16:50:55 bryan Exp $
#

View File

@ -1,5 +1,5 @@
.\" $Id: conserver.cf.man,v 1.61 2004/03/26 13:03:01 bryan Exp $
.TH CONSERVER.CF 5 "2004/03/26" "conserver-8.1.4" "conserver"
.\" $Id: conserver.cf.man,v 1.63 2004/05/07 03:42:51 bryan Exp $
.TH CONSERVER.CF 5 "2004/05/07" "conserver-8.1.5" "conserver"
.SH NAME
conserver.cf \- console configuration file for
.BR conserver (8)
@ -107,6 +107,24 @@ of things, we have:
"defa"ult my\e defs { rw *; in\eclude "other defs" ; }
.fi
.ft
.PP
There is one special line the parser recognizes: a ``#include'' statement.
It is of the form:
.IP
.B #include
.I filename
.PP
Any whitespace around
.I filename
is ignored, but whitespace embedded inside is preserved.
Everything in
.I filename
is taken literally, so none of the normal parser quoting applies.
The
.B #include
must begin in ``column 0'' - no whitespace is allowed between it and
the start of the physical line.
There is an include file depth limit of 10 to prevent infinite recursion.
.SH BLOCKS
.TP 8
.B access
@ -132,7 +150,18 @@ If
matches a previously defined group name, all members of the previous
group are applied to the admin list (with access reversed if prefixed
with a `!').
Otherwise, users will be granted (or denied if prefixed with `!') access.
If
.I username
doesn't match a previously defined group and
.I username
begins with `@', the name (minus the `@') is checked against the
host's group database.
All users found in the group will be granted (or denied, if prefixed
with `!') access.
If
.I username
doesn't match a previous group and doesn't begin with `@', the users
will be granted (or denied, if prefixed with `!') access.
If the null string (``""'') is used, any
users previously defined for the console servers's admin list are removed.
.TP
@ -281,6 +310,33 @@ Set whether or not to become a daemon when run (see the
.B \-d
command-line flag).
.TP
.B initdelay
.I number
.br
Set the number of seconds between console initializations.
All consoles with the same
.B host
value will be throttled as a group (those without a
.B host
value are their own group).
In other words, each console within a group will only be initialized after
.I number
seconds passes from the previous initialization of a console in that group.
Different throttle groups are initialized simultaneously.
One warning: since consoles are split up and managed by seperate conserver
processes, it's possible for more than one conserver process to
have a throttle group based on a particular
.B host
value.
If this happens, each conserver process will throttle their groups
independently of the other conserver processes, which results in a
more rapid initialization (per
.B host
value) than one might otherwise expect.
If
.I number
is zero, all consoles are initialized without delay.
.TP
.B logfile
.I filename
.br
@ -882,8 +938,18 @@ If
matches a previously defined group name, all members of the previous
group are applied to the read-only access list (with access reversed
if prefixed with a `!').
Otherwise, users will be granted (or denied if prefixed with `!')
read-only access.
If
.I username
doesn't match a previously defined group and
.I username
begins with `@', the name (minus the `@') is checked against the
host's group database.
All users found in the group will be granted (or denied, if prefixed
with `!') read-only access.
If
.I username
doesn't match a previous group and doesn't begin with `@', the users
will be granted (or denied, if prefixed with `!') read-only access.
If the null string (``""'') is used, any
users previously defined for the console's read-only list are removed.
.TP
@ -898,8 +964,18 @@ If
matches a previously defined group name, all members of the previous
group are applied to the read-write access list (with access reversed
if prefixed with a `!').
Otherwise, users will be granted (or denied if prefixed with `!')
read-write access.
If
.I username
doesn't match a previously defined group and
.I username
begins with `@', the name (minus the `@') is checked against the
host's group database.
All users found in the group will be granted (or denied, if prefixed
with `!') read-write access.
If
.I username
doesn't match a previous group and doesn't begin with `@', the users
will be granted (or denied, if prefixed with `!') read-write access.
If the null string (``""'') is used, any
users previously defined for the console's read-write list are removed.
.TP
@ -976,8 +1052,18 @@ If
matches a previously defined group name, all members of the previous
group are applied to the current group (with access reversed
if prefixed with a `!').
Otherwise, users will be recorded with (or without if prefixed with `!')
access.
If
.I username
doesn't match a previously defined group and
.I username
begins with `@', the name (minus the `@') is checked against the
host's group database.
All users found in the group will be recorded with (or without, if prefixed
with `!') access.
If
.I username
doesn't match a previous group and doesn't begin with `@', the users
will be recorded with (or without, if prefixed with `!') access.
If the null string (``""'') is used, any
users previously defined for this group are removed.
.RE

View File

@ -1,5 +1,5 @@
.\" $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.4" "conserver"
.TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.5" "conserver"
.SH NAME
conserver.passwd \- user access information for
.BR conserver (8)

View File

@ -181,11 +181,11 @@
<H3>Downloading</H3>
<P>The current version, released on Apr 13, 2004, is <A
href="8.1.4.tar.gz">8.1.4.tar.gz</A>. You can get it via
<P>The current version, released on May 7, 2004, is <A
href="8.1.5.tar.gz">8.1.5.tar.gz</A>. You can get it via
<A href=
"ftp://ftp.conserver.com/conserver/8.1.4.tar.gz">FTP</A>
or <A href="8.1.4.tar.gz">HTTP</A>. See the <A href=
"ftp://ftp.conserver.com/conserver/8.1.5.tar.gz">FTP</A>
or <A href="8.1.5.tar.gz">HTTP</A>. See the <A href=
"CHANGES">CHANGES</A> file for information on the latest
updates.</P>

View File

@ -1,5 +1,5 @@
/*
* $Id: consent.c,v 5.137 2004/02/20 14:58:13 bryan Exp $
* $Id: consent.c,v 5.138 2004/04/16 16:58:09 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -817,7 +817,7 @@ ConsInit(pCE)
break;
case DEVICE:
if (-1 ==
(cofile = open(pCE->device, O_RDWR | O_NDELAY, 0600))) {
(cofile = open(pCE->device, O_RDWR | O_NONBLOCK, 0600))) {
Error("[%s] open(%s): %s: forcing down", pCE->server,
pCE->device, strerror(errno));

View File

@ -1,6 +1,6 @@
.\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine
.\" $Id: conserver.man,v 1.46 2004/04/13 18:19:26 bryan Exp $
.TH CONSERVER 8 "2004/04/13" "conserver-8.1.4" "conserver"
.TH CONSERVER 8 "2004/04/13" "conserver-8.1.5" "conserver"
.SH NAME
conserver \- console server daemon
.SH SYNOPSIS

View File

@ -1,5 +1,5 @@
/*
* $Id: fallback.c,v 5.60 2003/11/20 13:56:38 bryan Exp $
* $Id: fallback.c,v 5.61 2004/04/16 16:58:09 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -210,7 +210,7 @@ GetPseudoTTY(slave, slaveFD)
continue;
}
if (0 > (fd = open(acMaster, O_RDWR | O_NDELAY, 0))) {
if (0 > (fd = open(acMaster, O_RDWR | O_NONBLOCK, 0))) {
continue;
}
acSlave[iIndex] = *pcOne;

View File

@ -1,5 +1,5 @@
/*
* $Id: group.c,v 5.293 2004/04/13 18:12:00 bryan Exp $
* $Id: group.c,v 5.298 2004/05/07 15:39:51 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -901,6 +901,75 @@ FlagReUp(sig)
#endif
}
static struct delay {
char *host;
time_t last;
struct delay *next;
} *delays = (struct delay *)0;
/* returns zero if the delay has been reached, otherwise returns
* the time when the next init should happen
*/
static time_t
#if PROTOTYPES
InitDelay(CONSENT *pCE)
#else
InitDelay(pCE)
CONSENT *pCE;
#endif
{
char *l;
struct delay *d;
if (pCE->host != (char *)0)
l = pCE->host;
else
l = "";
for (d = delays; d != (struct delay *)0; d = d->next) {
if (strcmp(l, d->host) == 0) {
if ((time((time_t *)0) - d->last) >= config->initdelay) {
return (time_t)0;
} else
return d->last + config->initdelay;
}
}
return (time_t)0;
}
static void
#if PROTOTYPES
UpdateDelay(CONSENT *pCE)
#else
UpdateDelay(pCE)
CONSENT *pCE;
#endif
{
char *l;
struct delay *d;
if (pCE->host != (char *)0)
l = pCE->host;
else
l = "";
for (d = delays; d != (struct delay *)0; d = d->next) {
if (strcmp(l, d->host) == 0) {
d->last = time((time_t *)0);
return;
}
}
if ((d =
(struct delay *)malloc(sizeof(struct delay))) ==
(struct delay *)0)
OutOfMem();
if ((d->host = StrDup(l)) == (char *)0)
OutOfMem();
d->last = time((time_t *)0);
d->next = delays;
delays = d;
}
static void
#if PROTOTYPES
ReUp(GRPENT *pGE, short automatic)
@ -913,6 +982,9 @@ ReUp(pGE, automatic)
CONSENT *pCE;
int autoReUp;
time_t tyme;
short retry;
static short autoup = 0;
short wasAuto = 0;
if ((GRPENT *)0 == pGE)
return;
@ -924,19 +996,49 @@ ReUp(pGE, automatic)
(!config->reinitcheck || (tyme < timers[T_REINIT])))
return;
for (pCE = pGE->pCElist; pCE != (CONSENT *)0; pCE = pCE->pCEnext) {
if (pCE->fup || pCE->ondemand == FLAGTRUE ||
(automatic == 1 && !pCE->autoReUp))
continue;
autoReUp = pCE->autoReUp;
if (automatic)
Msg("[%s] automatic reinitialization", pCE->server);
ConsInit(pCE);
if (pCE->fup)
FindWrite(pCE);
else if (automatic)
pCE->autoReUp = autoReUp;
}
if (automatic == -1)
wasAuto = autoup;
autoup = 0;
/* we loop here 'cause the init process could take a bit of time
* (depending on how many things we init in the run through the
* consoles) and we might be able to then initialize more stuff.
* we'll eventually run through too fast, run out of consoles, or
* have a big enough delay to go back to the main loop.
*/
do {
retry = 0;
for (pCE = pGE->pCElist; pCE != (CONSENT *)0; pCE = pCE->pCEnext) {
short updateDelay = 0;
if (pCE->fup || pCE->ondemand == FLAGTRUE ||
(automatic == 1 && !pCE->autoReUp))
continue;
if (config->initdelay > 0) {
time_t t;
if ((t = InitDelay(pCE)) > 0) {
if (timers[T_INITDELAY] == (time_t)0 ||
timers[T_INITDELAY] > t)
timers[T_INITDELAY] = t;
continue;
} else {
updateDelay = retry = 1;
}
}
autoReUp = pCE->autoReUp;
if (automatic > 0 || wasAuto) {
Msg("[%s] automatic reinitialization", pCE->server);
autoup = 1;
}
ConsInit(pCE);
if (updateDelay)
UpdateDelay(pCE);
if (pCE->fup)
FindWrite(pCE);
else if (automatic > 0)
pCE->autoReUp = autoReUp;
}
} while (retry);
/* update all the timers */
if (automatic == 0 || automatic == 2) {
@ -1255,7 +1357,7 @@ FlagReapVirt(sig)
/* on a TERM we have to cleanup utmp entries (ask ptyd to do it) (ksb)
*/
static void
void
#if PROTOTYPES
DeUtmp(GRPENT *pGE, int sfd)
#else
@ -2710,7 +2812,7 @@ DoClientRead(pGE, pCLServing)
"help this help message\r\n",
"hosts show host status and user\r\n",
"info show console information\r\n",
"textmsg send a text message\r\n",
"textmsg send a text message\r\n",
"* = requires admin privileges\r\n",
(char *)0
};
@ -4105,6 +4207,12 @@ Kiddie(pGE, sfd)
time((time_t *)0) >= timers[T_MARK])
Mark(pGE);
if (timers[T_INITDELAY] != (time_t)0 &&
time((time_t *)0) >= timers[T_INITDELAY]) {
timers[T_INITDELAY] = (time_t)0;
ReUp(pGE, -1);
}
if (timers[T_REINIT] != (time_t)0 &&
time((time_t *)0) >= timers[T_REINIT])
ReUp(pGE, 2);

View File

@ -1,5 +1,5 @@
/*
* $Id: group.h,v 5.43 2003/12/20 06:11:53 bryan Exp $
* $Id: group.h,v 5.45 2004/05/07 03:42:49 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -41,7 +41,8 @@
#define T_REINIT 3
#define T_AUTOUP 4
#define T_ROLL 5
#define T_MAX 6 /* T_MAX *must* be last */
#define T_INITDELAY 6
#define T_MAX 7 /* T_MAX *must* be last */
/* return values used by CheckPass()
*/
@ -80,6 +81,7 @@ extern int ClientAccess PARAMS((CONSENT *, char *));
extern void DestroyClient PARAMS((CONSCLIENT *));
extern int CheckPasswd PARAMS((CONSCLIENT *, char *));
extern void ExpandString PARAMS((char *, CONSENT *, short));
extern void DeUtmp PARAMS((GRPENT *, int));
#if HAVE_OPENSSL
extern int AttemptSSL PARAMS((CONSCLIENT *));
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: main.c,v 5.179 2004/04/13 18:12:00 bryan Exp $
* $Id: main.c,v 5.180 2004/05/07 03:42:49 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -65,8 +65,7 @@ CONFIG *config = (CONFIG *)0;
char *interface = (char *)0;
CONFIG defConfig =
{ (STRING *)0, 'r', FLAGFALSE, LOGFILEPATH, PASSWDFILE, DEFPORT,
FLAGTRUE,
FLAGTRUE, 0, DEFBASEPORT, (char *)0
FLAGTRUE, FLAGTRUE, 0, DEFBASEPORT, (char *)0, 0
#if HAVE_SETPROCTITLE
, FLAGFALSE
#endif
@ -1663,6 +1662,14 @@ main(argc, argv)
if (config->unifiedlog == (char *)0)
OutOfMem();
}
if (optConf->initdelay != 0)
config->initdelay = optConf->initdelay;
else if (pConfig->initdelay != 0)
config->initdelay = pConfig->initdelay;
else
config->initdelay = defConfig.initdelay;
#if HAVE_OPENSSL
if (optConf->sslrequired != FLAGUNKNOWN)
config->sslrequired = optConf->sslrequired;

View File

@ -1,5 +1,5 @@
/*
* $Id: master.c,v 5.125 2004/04/13 18:12:00 bryan Exp $
* $Id: master.c,v 5.126 2004/05/06 02:09:07 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -571,6 +571,7 @@ DoNormalRead(pCLServing)
if ((GRPENT *)0 != pGroups) {
#if USE_UNIX_DOMAIN_SOCKETS
FilePrint(pCLServing->fd, FLAGTRUE, "@0");
iSep = 0;
#else
struct sockaddr_in lcl;
socklen_t so = sizeof(lcl);
@ -582,23 +583,26 @@ DoNormalRead(pCLServing)
-1);
Error("Master(): getsockname(%u): %s",
FileFDNum(pCLServing->fd), strerror(errno));
Bye(EX_OSERR);
}
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
inet_ntoa(lcl.sin_addr));
#endif
iSep = 0;
}
if (config->redirect == FLAGTRUE) {
REMOTE *pRC;
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
pRC = pRC->pRCuniq) {
FilePrint(pCLServing->fd, FLAGTRUE, ":@%s" + iSep,
pRC->rhost);
iSep = -1;
} else {
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
inet_ntoa(lcl.sin_addr));
iSep = 0;
}
#endif
}
if (iSep >= 0) {
if (config->redirect == FLAGTRUE) {
REMOTE *pRC;
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
pRC = pRC->pRCuniq) {
FilePrint(pCLServing->fd, FLAGTRUE,
":@%s" + iSep, pRC->rhost);
iSep = 0;
}
}
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
}
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
} else if (pCLServing->iState == S_NORMAL &&
strcmp(pcCmd, "pid") == 0) {
FilePrint(pCLServing->fd, FLAGFALSE, "%lu\r\n",

View File

@ -1,5 +1,5 @@
/*
* $Id: readcfg.c,v 5.169 2004/04/13 18:12:01 bryan Exp $
* $Id: readcfg.c,v 5.173 2004/05/07 03:42:49 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -25,6 +25,8 @@
#include <compat.h>
#include <grp.h>
#include <cutil.h>
#include <consent.h>
#include <client.h>
@ -530,14 +532,26 @@ GroupItemUsers(id)
for (token = strtok(id, ALLWORDSEP); token != (char *)0;
token = strtok(NULL, ALLWORDSEP)) {
int not;
short not;
if (token[0] == '!') {
token++;
not = 1;
} else
not = 0;
if ((pg = GroupFind(token)) == (PARSERGROUP *)0) {
GroupAddUser(parserGroupTemp, token, not);
if (token[0] == '@' && token[1] != '\000') {
struct group *g;
if ((g = getgrnam(token + 1)) == (struct group *)0) {
if (isMaster)
Error("unknown group name `%s': %s [%s:%d]",
token + 1, strerror(errno), file, line);
} else if (g->gr_mem != (char **)0) {
char **m;
for (m = g->gr_mem; *m != (char *)0; m++)
GroupAddUser(parserGroupTemp, *m, not);
}
} else
GroupAddUser(parserGroupTemp, token, not);
} else {
PARSERGROUPUSERS *pgu;
for (pgu = pg->users; pgu != (PARSERGROUPUSERS *)0;
@ -1946,7 +1960,19 @@ ProcessRoRw(ppCU, id)
} else
not = 0;
if ((pg = GroupFind(token)) == (PARSERGROUP *)0) {
ConsentAddUser(ppCU, token, not);
if (token[0] == '@' && token[1] != '\000') {
struct group *g;
if ((g = getgrnam(token + 1)) == (struct group *)0) {
if (isMaster)
Error("unknown group name `%s': %s [%s:%d]",
token + 1, strerror(errno), file, line);
} else if (g->gr_mem != (char **)0) {
char **m;
for (m = g->gr_mem; *m != (char *)0; m++)
ConsentAddUser(ppCU, *m, not);
}
} else
ConsentAddUser(ppCU, token, not);
} else {
PARSERGROUPUSERS *pgu;
for (pgu = pg->users; pgu != (PARSERGROUPUSERS *)0;
@ -3088,7 +3114,7 @@ ConsoleDestroy()
parserConsoles = parserConsoleTemp = (CONSENT *)0;
/* here we check on the client permissions and adjust accordingly */
if (!isMaster) {
if (!isMaster && pGroups != (GRPENT *)0) {
CONSENT *pCE = (CONSENT *)0;
CONSCLIENT *pCL = (CONSCLIENT *)0;
CONSCLIENT *pCLnext = (CONSCLIENT *)0;
@ -4081,6 +4107,8 @@ ConfigEnd()
pConfig->loghostnames = parserConfigTemp->loghostnames;
if (parserConfigTemp->reinitcheck != 0)
pConfig->reinitcheck = parserConfigTemp->reinitcheck;
if (parserConfigTemp->initdelay != 0)
pConfig->initdelay = parserConfigTemp->initdelay;
if (parserConfigTemp->secondaryport != (char *)0) {
if (pConfig->secondaryport != (char *)0)
free(pConfig->secondaryport);
@ -4335,6 +4363,36 @@ ConfigItemReinitcheck(id)
parserConfigTemp->reinitcheck = atoi(id);
}
void
#if PROTOTYPES
ConfigItemInitdelay(char *id)
#else
ConfigItemInitdelay(id)
char *id;
#endif
{
char *p;
CONDDEBUG((1, "ConfigItemInitdelay(%s) [%s:%d]", id, file, line));
if ((id == (char *)0) || (*id == '\000')) {
parserConfigTemp->initdelay = 0;
return;
}
for (p = id; *p != '\000'; p++)
if (!isdigit((int)(*p)))
break;
/* if it wasn't a number or the number was zero */
if (*p != '\000') {
if (isMaster)
Error("invalid initdelay value `%s' [%s:%d]", id, file, line);
return;
}
parserConfigTemp->initdelay = atoi(id);
}
void
#if PROTOTYPES
ConfigItemSecondaryport(char *id)
@ -4508,6 +4566,7 @@ ITEM keyAccess[] = {
ITEM keyConfig[] = {
{"defaultaccess", ConfigItemDefaultaccess},
{"daemonmode", ConfigItemDaemonmode},
{"initdelay", ConfigItemInitdelay},
{"logfile", ConfigItemLogfile},
{"loghostnames", ConfigItemLoghostnames},
{"passwdfile", ConfigItemPasswordfile},
@ -4575,7 +4634,8 @@ typedef enum tokens {
LEFTBRACE,
RIGHTBRACE,
SEMICOLON,
WORD
WORD,
INCLUDE
} TOKEN;
TOKEN
@ -4595,14 +4655,60 @@ GetWord(fp, line, spaceok, word)
short comment = 0;
short sawQuote = 0;
short quotedBackslash = 0;
char *include = "include";
short checkInc = -1;
/* checkInc == -3, saw #include
* == -2, saw nothin'
* == -1, saw \n or start of file
* == 0, saw "\n#"
*/
BuildString((char *)0, word);
while ((c = fgetc(fp)) != EOF) {
if (c == '\n')
if (c == '\n') {
(*line)++;
if (checkInc == -2)
checkInc = -1;
}
if (comment) {
if (c == '\n')
comment = 0;
if (checkInc >= 0) {
if (include[checkInc] == '\000') {
if (isspace(c))
checkInc = -3;
} else if (c == include[checkInc])
checkInc++;
else
checkInc = -2;
} else if (checkInc == -3) {
static STRING *fname = (STRING *)0;
if (fname == (STRING *)0)
fname = AllocString();
if (fname->used != 0 || !isspace(c)) {
if (c == '\n') {
if (fname->used > 0) {
while (fname->used > 1 && isspace((int)
(fname->
string
[fname->
used -
2])))
fname->used--;
if (fname->used > 0)
fname->string[fname->used - 1] = '\000';
}
checkInc = -2;
if (fname->used > 0) {
BuildString((char *)0, word);
BuildString(fname->string, word);
BuildString((char *)0, fname);
return INCLUDE;
}
} else
BuildStringChar(c, fname);
}
}
continue;
}
if (backslash) {
@ -4633,6 +4739,8 @@ GetWord(fp, line, spaceok, word)
backslash = 1;
} else if (c == '#') {
comment = 1;
if (checkInc == -1)
checkInc = 0;
} else if (c == '"') {
quote = 1;
sawQuote = 1;
@ -4689,6 +4797,282 @@ GetWord(fp, line, spaceok, word)
return DONE;
}
void
#if PROTOTYPES
ParseFile(char *filename, FILE *fp, int level)
#else
ParseFile(filename, fp, level)
char *filename;
FILE *fp;
int level;
#endif
{
/* things that should be used between recursions */
static STATES state = START;
static STRING *word = (STRING *)0;
static short spaceok = 0;
static int secIndex = 0;
static int keyIndex = 0;
/* other stuff that's local to each recursion */
char *p;
TOKEN token = DONE;
int nextline = 1; /* "next" line number */
if (level >= 10) {
if (isMaster)
Error("ParseFile(): nesting too deep, not parsing `%s'",
filename);
return;
}
/* set some globals */
line = 1;
file = filename;
/* if we're parsing the base file, set static vars */
if (level == 0) {
state = START;
spaceok = 0;
secIndex = 0;
keyIndex = 0;
}
/* initialize local things */
if (word == (STRING *)0)
word = AllocString();
while ((token = GetWord(fp, &nextline, spaceok, word)) != DONE) {
if (token == INCLUDE) {
FILE *lfp;
if ((FILE *)0 == (lfp = fopen(word->string, "r"))) {
if (isMaster)
Error("ParseFile(): fopen(%s): %s", word->string,
strerror(errno));
} else {
char *fname;
/* word gets destroyed, so save the name */
fname = StrDup(word->string);
ParseFile(fname, lfp, level + 1);
fclose(lfp);
free(fname);
}
} else {
switch (state) {
case START:
switch (token) {
case WORD:
for (secIndex = 0;
(p = sections[secIndex].id) != (char *)0;
secIndex++) {
if (strcasecmp(word->string, p) == 0) {
CONDDEBUG((1,
"ReadCfg(): got keyword '%s' [%s:%d]",
word->string, file, line));
state = NAME;
break;
}
}
if (state == START) {
if (isMaster)
Error("invalid keyword '%s' [%s:%d]",
word->string, file, line);
}
break;
case LEFTBRACE:
case RIGHTBRACE:
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
case INCLUDE: /* just shutting up gcc */
break;
}
break;
case NAME:
switch (token) {
case WORD:
(*sections[secIndex].begin) (word->string);
state = LEFTB;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
state = START;
break;
case LEFTBRACE:
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
case INCLUDE: /* just shutting up gcc */
break;
}
break;
case LEFTB:
switch (token) {
case LEFTBRACE:
state = KEY;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
(*sections[secIndex].abort) ();
state = START;
break;
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case WORD:
if (isMaster)
Error("invalid word '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
case INCLUDE: /* just shutting up gcc */
break;
}
break;
case KEY:
switch (token) {
case WORD:
for (keyIndex = 0;
(p =
sections[secIndex].items[keyIndex].id) !=
(char *)0; keyIndex++) {
if (strcasecmp(word->string, p) == 0) {
CONDDEBUG((1,
"got keyword '%s' [%s:%d]",
word->string, file, line));
state = VALUE;
break;
}
}
if (state == KEY) {
if (isMaster)
Error("invalid keyword '%s' [%s:%d]",
word->string, file, line);
}
break;
case RIGHTBRACE:
(*sections[secIndex].end) ();
state = START;
break;
case LEFTBRACE:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case SEMICOLON:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
case DONE: /* just shutting up gcc */
case INCLUDE: /* just shutting up gcc */
break;
}
break;
case VALUE:
switch (token) {
case WORD:
(*sections[secIndex].items[keyIndex].
reg) (word->string);
state = SEMI;
break;
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
state = KEY;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
(*sections[secIndex].abort) ();
state = START;
break;
case LEFTBRACE:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
case INCLUDE: /* just shutting up gcc */
break;
}
break;
case SEMI:
switch (token) {
case SEMICOLON:
state = KEY;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
(*sections[secIndex].abort) ();
state = START;
break;
case LEFTBRACE:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case WORD:
if (isMaster)
Error("invalid word '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
case INCLUDE: /* just shutting up gcc */
break;
}
break;
}
switch (state) {
case NAME:
case VALUE:
spaceok = 1;
break;
case KEY:
case LEFTB:
case START:
case SEMI:
spaceok = 0;
break;
}
}
line = nextline;
}
if (level == 0) {
/* check for proper ending of file and do any cleanup */
switch (state) {
case START:
break;
case KEY:
case LEFTB:
case VALUE:
case SEMI:
(*sections[secIndex].abort) ();
/* fall through */
case NAME:
if (isMaster)
Error("premature EOF seen [%s:%d]", file, line);
break;
}
}
}
void
#if PROTOTYPES
ReadCfg(char *filename, FILE *fp)
@ -4698,14 +5082,7 @@ ReadCfg(filename, fp)
FILE *fp;
#endif
{
static STRING *word = (STRING *)0;
STATES state = START;
int secIndex = 0;
int keyIndex = 0;
TOKEN token = DONE;
short spaceok = 0;
char *p;
int nextline = 1; /* "next" line number */
int i;
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
unsigned long dmallocMarkReadCfg = 0;
@ -4716,12 +5093,6 @@ ReadCfg(filename, fp)
#endif
isStartup = (pGroups == (GRPENT *)0 && pRCList == (REMOTE *)0);
/* initialize local things */
if (word == (STRING *)0)
word = AllocString();
line = 1;
file = filename;
/* initialize the break lists */
for (i = 0; i < 9; i++) {
if (breakList[i].seq == (STRING *)0) {
@ -4750,215 +5121,11 @@ ReadCfg(filename, fp)
OutOfMem();
/* ready to read in the data */
while ((token = GetWord(fp, &nextline, spaceok, word)) != DONE) {
switch (state) {
case START:
switch (token) {
case WORD:
for (secIndex = 0;
(p = sections[secIndex].id) != (char *)0;
secIndex++) {
if (strcasecmp(word->string, p) == 0) {
CONDDEBUG((1,
"ReadCfg(): got keyword '%s' [%s:%d]",
word->string, file, line));
state = NAME;
break;
}
}
if (state == START) {
if (isMaster)
Error("invalid keyword '%s' [%s:%d]",
word->string, file, line);
}
break;
case LEFTBRACE:
case RIGHTBRACE:
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
break;
}
break;
case NAME:
switch (token) {
case WORD:
(*sections[secIndex].begin) (word->string);
state = LEFTB;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
state = START;
break;
case LEFTBRACE:
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
break;
}
break;
case LEFTB:
switch (token) {
case LEFTBRACE:
state = KEY;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
(*sections[secIndex].abort) ();
state = START;
break;
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case WORD:
if (isMaster)
Error("invalid word '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
break;
}
break;
case KEY:
switch (token) {
case WORD:
for (keyIndex = 0;
(p =
sections[secIndex].items[keyIndex].id) !=
(char *)0; keyIndex++) {
if (strcasecmp(word->string, p) == 0) {
CONDDEBUG((1, "got keyword '%s' [%s:%d]",
word->string, file, line));
state = VALUE;
break;
}
}
if (state == KEY) {
if (isMaster)
Error("invalid keyword '%s' [%s:%d]",
word->string, file, line);
}
break;
case RIGHTBRACE:
(*sections[secIndex].end) ();
state = START;
break;
case LEFTBRACE:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case SEMICOLON:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
case DONE: /* just shutting up gcc */
break;
}
break;
case VALUE:
switch (token) {
case WORD:
(*sections[secIndex].items[keyIndex].reg) (word->
string);
state = SEMI;
break;
case SEMICOLON:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
state = KEY;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
(*sections[secIndex].abort) ();
state = START;
break;
case LEFTBRACE:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
break;
}
break;
case SEMI:
switch (token) {
case SEMICOLON:
state = KEY;
break;
case RIGHTBRACE:
if (isMaster)
Error("premature token '%s' [%s:%d]",
word->string, file, line);
(*sections[secIndex].abort) ();
state = START;
break;
case LEFTBRACE:
if (isMaster)
Error("invalid token '%s' [%s:%d]",
word->string, file, line);
break;
case WORD:
if (isMaster)
Error("invalid word '%s' [%s:%d]",
word->string, file, line);
break;
case DONE: /* just shutting up gcc */
break;
}
break;
}
switch (state) {
case NAME:
case VALUE:
spaceok = 1;
break;
case KEY:
case LEFTB:
case START:
case SEMI:
spaceok = 0;
break;
}
line = nextline;
}
/* check for proper ending of file and do any cleanup */
switch (state) {
case START:
break;
case KEY:
case LEFTB:
case VALUE:
case SEMI:
(*sections[secIndex].abort) ();
/* fall through */
case NAME:
if (isMaster)
Error("premature EOF seen [%s:%d]", file, line);
break;
}
ParseFile(filename, fp, 0);
/* now clean up all the temporary space used */
for (nextline = 0; (p = sections[nextline].id) != (char *)0;
nextline++) {
(*sections[nextline].destroy) ();
for (i = 0; (p = sections[i].id) != (char *)0; i++) {
(*sections[i].destroy) ();
}
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
@ -5002,7 +5169,7 @@ ReReadCfg(fd)
return;
} else {
Error("no consoles to manage after reconfiguration - exiting");
Bye(EX_OK);
DeUtmp((GRPENT *)0, fd);
}
}
@ -5095,6 +5262,14 @@ ReReadCfg(fd)
config->reinitcheck = pConfig->reinitcheck;
/* gets used on-the-fly */
}
if (optConf->initdelay == 0) {
if (pConfig->initdelay == 0)
config->initdelay = defConfig.initdelay;
else if (pConfig->initdelay != config->initdelay)
config->initdelay = pConfig->initdelay;
/* gets used on-the-fly */
}
#if HAVE_OPENSSL
if (optConf->sslrequired == FLAGUNKNOWN) {
if (pConfig->sslrequired == FLAGUNKNOWN)
@ -5127,6 +5302,7 @@ ReReadCfg(fd)
Msg("warning: `daemonmode' config option changed - you must restart for it to take effect");
}
}
#if !USE_UNIX_DOMAIN_SOCKETS
if (optConf->primaryport == (char *)0) {
char *p;
if (pConfig->primaryport == (char *)0)
@ -5159,6 +5335,7 @@ ReReadCfg(fd)
Msg("warning: `secondaryport' config option changed - you must restart for it to take effect");
}
}
#endif
#if HAVE_OPENSSL
if (optConf->sslcredentials == (char *)0) {
if (pConfig->sslcredentials == (char *)0) {

View File

@ -1,5 +1,5 @@
/*
* $Id: readcfg.h,v 5.38 2003/11/10 15:37:24 bryan Exp $
* $Id: readcfg.h,v 5.39 2004/05/07 03:42:49 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -20,6 +20,7 @@ typedef struct config {
int reinitcheck;
char *secondaryport;
char *unifiedlog;
int initdelay;
#if HAVE_SETPROCTITLE
FLAG setproctitle;
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: version.h,v 1.60 2004/04/03 15:44:49 bryan Exp $
* $Id: version.h,v 1.61 2004/04/16 16:58:09 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -14,4 +14,4 @@
@(#) Copyright 2000 conserver.com.\n\
All rights reserved.\n"
#define THIS_VERSION "conserver.com version 8.1.4"
#define THIS_VERSION "conserver.com version 8.1.5"

View File

@ -1,5 +1,5 @@
/*
* $Id: console.c,v 5.162 2004/04/13 18:12:03 bryan Exp $
* $Id: console.c,v 5.164 2004/04/20 01:30:13 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -42,8 +42,10 @@
int fReplay = 0, fVersion = 0, fStrip = 0;
int showExecData = 1;
#if HAVE_OPENSSL
int fReqEncryption = 1;
int fAllowUnencrypted = 0;
char *pcCredFile = (char *)0;
#endif
int chAttn = -1, chEsc = -1;
@ -217,6 +219,11 @@ Usage(wantfull)
"s(S) spy on a console (and replay)",
"t send a text message to [user][@console]",
"u show users on the various consoles",
#if HAVE_OPENSSL
"U allow unencrypted connections if SSL not available",
#else
"U ignored - encryption not compiled into code",
#endif
"v be more verbose",
"V show version information",
"w(W) show who is on which console (on master)",
@ -225,12 +232,13 @@ Usage(wantfull)
};
fprintf(stderr,
"usage: %s [-aAEfFsS] [-7Dv] [-c cred] [-M mach] [-p port] [-e esc] [-l username] console\n",
"usage: %s [-aAfFsS] [-7DEUv] [-c cred] [-M mach] [-p port] [-e esc] [-l username] console\n",
progname);
fprintf(stderr,
"usage: %s [-hiIPrRuVwWx] [-7Dv] [-M mach] [-p port] [-d [user][@console]] [-[bB] message] [-t [user][@console] message]\n",
" %s [-hiIPrRuVwWx] [-7DEUv] [-c cred] [-M mach] [-p port] [-d [user][@console]] [-[bB] message] [-t [user][@console] message]\n",
progname);
fprintf(stderr, "usage: %s [-qQ] [-7Dv] [-M mach] [-p port]\n",
fprintf(stderr,
" %s [-qQ] [-7DEUv] [-c cred] [-M mach] [-p port]\n",
progname);
if (wantfull) {
@ -889,6 +897,7 @@ DoExec(pcf)
CONSFILE *pcf;
#endif
{
showExecData = 1;
FileWrite(cfstdout, FLAGFALSE, "exec: ", 6);
GetUserInput(execCmd);
@ -1086,10 +1095,12 @@ Interact(pcf, pcMach)
for (i = 0; i < l; ++i)
acMesg[i] &= 127;
}
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
if (execCmdFile != (CONSFILE *)0) {
FileWrite(execCmdFile, FLAGFALSE, acMesg, l);
}
if (showExecData)
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
} else
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
nc -= l;
MemMove(acMesg, acMesg + l, nc);
}
@ -1133,6 +1144,11 @@ Interact(pcf, pcMach)
FilePrint(cfstdout, FLAGFALSE,
"[local command sent SIGKILL - pid %lu]\r\n",
execCmdPid);
} else if (acMesg[i] == 'o' || acMesg[i] == 'O') {
showExecData = !showExecData;
FilePrint(cfstdout, FLAGFALSE,
"[local command data %s]\r\n",
showExecData ? "on" : "off");
}
}
}
@ -1375,8 +1391,13 @@ DoCmds(master, pports, cmdi)
t = ReadReply(pcf, 0);
if (strcmp(t, "ok\r\n") == 0) {
AttemptSSL(pcf);
}
if (FileGetType(pcf) != SSLSocket) {
if (FileGetType(pcf) != SSLSocket) {
Error("Encryption not supported by server `%s'",
serverName);
FileClose(&pcf);
continue;
}
} else if (fAllowUnencrypted == 0) {
Error("Encryption not supported by server `%s'",
serverName);
FileClose(&pcf);
@ -1569,7 +1590,7 @@ main(argc, argv)
int opt;
int fLocal;
static STRING *acPorts = (STRING *)0;
static char acOpts[] = "7aAb:B:c:d:De:EfFhiIl:M:p:PqQrRsSt:uvVwWx";
static char acOpts[] = "7aAb:B:c:d:De:EfFhiIl:M:p:PqQrRsSt:uUvVwWx";
extern int optind;
extern int optopt;
extern char *optarg;
@ -1714,6 +1735,12 @@ main(argc, argv)
pcCmd = textMsg->string;
break;
case 'U':
#if HAVE_OPENSSL
fAllowUnencrypted = 1;
#endif
break;
case 'u':
pcCmd = "hosts";
break;

View File

@ -1,11 +1,11 @@
.\" $Id: console.man,v 1.46 2004/03/23 18:32:09 bryan Exp $
.TH CONSOLE 1 "2004/03/23" "conserver-8.1.4" "conserver"
.\" $Id: console.man,v 1.48 2004/04/20 01:30:13 bryan Exp $
.TH CONSOLE 1 "2004/04/20" "conserver-8.1.5" "conserver"
.SH NAME
console \- console server client program
.SH SYNOPSIS
.B console
.RB [ \-aAEfFsS ]
.RB [ \-7Dv ]
.RB [ \-aAfFsS ]
.RB [ \-7DEUv ]
.RB [ \-c
.IR cred ]
.BR [ \-M
@ -20,7 +20,9 @@ console \- console server client program
.br
.B console
.RB [ \-hiIPrRuVwWx ]
.RB [ \-7Dv ]
.RB [ \-7DEUv ]
.RB [ \-c
.IR cred ]
.RB [ \-M
.IR mach ]
.RB [ \-p
@ -35,7 +37,9 @@ console \- console server client program
.br
.B console
.RB [ \-qQ ]
.RB [ \-7Dv ]
.RB [ \-7DEUv ]
.RB [ \-c
.IR cred ]
.RB [ \-M
.IR mach ]
.RB [ \-p
@ -150,9 +154,13 @@ The default value is
.B \-E
If encryption has been built into the code
.RB ( --with-openssl ),
encrypted client connections are a requirement.
This option allows the client to connect to a console
over a non-encrypted connection.
encrypted client connections are, by default, a requirement.
This option disables any attempt at creating an
encrypted connection.
If you'd like to use encrypted connections when your server
supports it, but fallback to non-encrypted otherwise, the
.B \-U
option is what you want.
.TP
.B \-f
Same as
@ -264,6 +272,18 @@ and attached users
.RI ( user @ host
if attached read-write, `<spies>' if only users in spy mode, or `<none>').
.TP
.B \-U
If encryption has been built into the code
.RB ( --with-openssl ),
encrypted client connections are, by default, a requirement.
This option allows the client to attempt an encrypted connection
but fall back to a non-encrypted connection if the server doesn't
support encryption.
If the encryption handshake is failing, disabling encryption on the
client with the
.B \-E
option is probably what you want.
.TP
.B \-v
Be more verbose when building the connection(s).
Use this option in combination with any of `show' options (below)
@ -297,7 +317,7 @@ The
options have the same effect as their lower-case variants.
In addition, they each request the last 20 lines of the console output after
making the connection (as if
.RB ` ^Ecr '
.RB `` ^Ecr ''
were typed).
.PP
The
@ -349,7 +369,7 @@ that the server can open the file for read, but not write.
The details regarding the logging for the console.
The comma-separated
values will be the logfile, ``log'' or ``nolog'' (if logging is on
or not - toggled via ^EcL), ``act'' or ``noact'' (if activity logging is
or not - toggled via ``^EcL''), ``act'' or ``noact'' (if activity logging is
enabled or not - the `a' timestamp option), the timestamp interval, and
the file descriptor of the logfile.
.TP
@ -493,12 +513,16 @@ In the
output, the login ``<none>'' indicates no one is
viewing that console, and the login ``<spies>'' indicates that
no one has a full two-way attachment.
When no one is attached to
a console its output is cloned to the stdout of the server process if
.B conserver
was started with the
.B \-u
option.
.PP
When running a local command via
.RB `` ^Ec| '',
you can type
.B ^C
to send the command a SIGHUP,
.B ^\e
to send the command a SIGKILL, and
.B o
to toggle the display of the console data.
.SH EXAMPLES
.TP 15
console \-u

View File

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

View File

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