mirror of
https://github.com/bstansell/conserver.git
synced 2025-01-02 02:56:41 +00:00
Imported from conserver-8.1.5.tar.gz
This commit is contained in:
parent
8cd506c093
commit
5c430d220b
16
CHANGES
16
CHANGES
@ -1,6 +1,20 @@
|
|||||||
CHANGES
|
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):
|
version 8.1.4 (Apr 13, 2004):
|
||||||
- fixed macro use in manpages to hopefully be more compatible
|
- fixed macro use in manpages to hopefully be more compatible
|
||||||
- removed extra newline of --MARK-- range output
|
- removed extra newline of --MARK-- range output
|
||||||
@ -708,5 +722,5 @@ before version 6.05:
|
|||||||
and enhancements of various types were applied.
|
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
290
PROTOCOL
Normal 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 $
|
||||||
|
#
|
@ -1,5 +1,5 @@
|
|||||||
.\" $Id: conserver.cf.man,v 1.61 2004/03/26 13:03:01 bryan Exp $
|
.\" $Id: conserver.cf.man,v 1.63 2004/05/07 03:42:51 bryan Exp $
|
||||||
.TH CONSERVER.CF 5 "2004/03/26" "conserver-8.1.4" "conserver"
|
.TH CONSERVER.CF 5 "2004/05/07" "conserver-8.1.5" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver.cf \- console configuration file for
|
conserver.cf \- console configuration file for
|
||||||
.BR conserver (8)
|
.BR conserver (8)
|
||||||
@ -107,6 +107,24 @@ of things, we have:
|
|||||||
"defa"ult my\e defs { rw *; in\eclude "other defs" ; }
|
"defa"ult my\e defs { rw *; in\eclude "other defs" ; }
|
||||||
.fi
|
.fi
|
||||||
.ft
|
.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
|
.SH BLOCKS
|
||||||
.TP 8
|
.TP 8
|
||||||
.B access
|
.B access
|
||||||
@ -132,7 +150,18 @@ If
|
|||||||
matches a previously defined group name, all members of the previous
|
matches a previously defined group name, all members of the previous
|
||||||
group are applied to the admin list (with access reversed if prefixed
|
group are applied to the admin list (with access reversed if prefixed
|
||||||
with a `!').
|
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
|
If the null string (``""'') is used, any
|
||||||
users previously defined for the console servers's admin list are removed.
|
users previously defined for the console servers's admin list are removed.
|
||||||
.TP
|
.TP
|
||||||
@ -281,6 +310,33 @@ Set whether or not to become a daemon when run (see the
|
|||||||
.B \-d
|
.B \-d
|
||||||
command-line flag).
|
command-line flag).
|
||||||
.TP
|
.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
|
.B logfile
|
||||||
.I filename
|
.I filename
|
||||||
.br
|
.br
|
||||||
@ -882,8 +938,18 @@ If
|
|||||||
matches a previously defined group name, all members of the previous
|
matches a previously defined group name, all members of the previous
|
||||||
group are applied to the read-only access list (with access reversed
|
group are applied to the read-only access list (with access reversed
|
||||||
if prefixed with a `!').
|
if prefixed with a `!').
|
||||||
Otherwise, users will be granted (or denied if prefixed with `!')
|
If
|
||||||
read-only access.
|
.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
|
If the null string (``""'') is used, any
|
||||||
users previously defined for the console's read-only list are removed.
|
users previously defined for the console's read-only list are removed.
|
||||||
.TP
|
.TP
|
||||||
@ -898,8 +964,18 @@ If
|
|||||||
matches a previously defined group name, all members of the previous
|
matches a previously defined group name, all members of the previous
|
||||||
group are applied to the read-write access list (with access reversed
|
group are applied to the read-write access list (with access reversed
|
||||||
if prefixed with a `!').
|
if prefixed with a `!').
|
||||||
Otherwise, users will be granted (or denied if prefixed with `!')
|
If
|
||||||
read-write access.
|
.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
|
If the null string (``""'') is used, any
|
||||||
users previously defined for the console's read-write list are removed.
|
users previously defined for the console's read-write list are removed.
|
||||||
.TP
|
.TP
|
||||||
@ -976,8 +1052,18 @@ If
|
|||||||
matches a previously defined group name, all members of the previous
|
matches a previously defined group name, all members of the previous
|
||||||
group are applied to the current group (with access reversed
|
group are applied to the current group (with access reversed
|
||||||
if prefixed with a `!').
|
if prefixed with a `!').
|
||||||
Otherwise, users will be recorded with (or without if prefixed with `!')
|
If
|
||||||
access.
|
.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
|
If the null string (``""'') is used, any
|
||||||
users previously defined for this group are removed.
|
users previously defined for this group are removed.
|
||||||
.RE
|
.RE
|
||||||
|
@ -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.4" "conserver"
|
.TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.5" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver.passwd \- user access information for
|
conserver.passwd \- user access information for
|
||||||
.BR conserver (8)
|
.BR conserver (8)
|
||||||
|
@ -181,11 +181,11 @@
|
|||||||
|
|
||||||
<H3>Downloading</H3>
|
<H3>Downloading</H3>
|
||||||
|
|
||||||
<P>The current version, released on Apr 13, 2004, is <A
|
<P>The current version, released on May 7, 2004, is <A
|
||||||
href="8.1.4.tar.gz">8.1.4.tar.gz</A>. You can get it via
|
href="8.1.5.tar.gz">8.1.5.tar.gz</A>. You can get it via
|
||||||
<A href=
|
<A href=
|
||||||
"ftp://ftp.conserver.com/conserver/8.1.4.tar.gz">FTP</A>
|
"ftp://ftp.conserver.com/conserver/8.1.5.tar.gz">FTP</A>
|
||||||
or <A href="8.1.4.tar.gz">HTTP</A>. See the <A href=
|
or <A href="8.1.5.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>
|
||||||
|
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -817,7 +817,7 @@ ConsInit(pCE)
|
|||||||
break;
|
break;
|
||||||
case DEVICE:
|
case DEVICE:
|
||||||
if (-1 ==
|
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,
|
Error("[%s] open(%s): %s: forcing down", pCE->server,
|
||||||
pCE->device, strerror(errno));
|
pCE->device, strerror(errno));
|
||||||
|
@ -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.46 2004/04/13 18:19:26 bryan Exp $
|
.\" $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
|
.SH NAME
|
||||||
conserver \- console server daemon
|
conserver \- console server daemon
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -210,7 +210,7 @@ GetPseudoTTY(slave, slaveFD)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 > (fd = open(acMaster, O_RDWR | O_NDELAY, 0))) {
|
if (0 > (fd = open(acMaster, O_RDWR | O_NONBLOCK, 0))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
acSlave[iIndex] = *pcOne;
|
acSlave[iIndex] = *pcOne;
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -901,6 +901,75 @@ FlagReUp(sig)
|
|||||||
#endif
|
#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
|
static void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
ReUp(GRPENT *pGE, short automatic)
|
ReUp(GRPENT *pGE, short automatic)
|
||||||
@ -913,6 +982,9 @@ ReUp(pGE, automatic)
|
|||||||
CONSENT *pCE;
|
CONSENT *pCE;
|
||||||
int autoReUp;
|
int autoReUp;
|
||||||
time_t tyme;
|
time_t tyme;
|
||||||
|
short retry;
|
||||||
|
static short autoup = 0;
|
||||||
|
short wasAuto = 0;
|
||||||
|
|
||||||
if ((GRPENT *)0 == pGE)
|
if ((GRPENT *)0 == pGE)
|
||||||
return;
|
return;
|
||||||
@ -924,19 +996,49 @@ ReUp(pGE, automatic)
|
|||||||
(!config->reinitcheck || (tyme < timers[T_REINIT])))
|
(!config->reinitcheck || (tyme < timers[T_REINIT])))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
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) {
|
for (pCE = pGE->pCElist; pCE != (CONSENT *)0; pCE = pCE->pCEnext) {
|
||||||
|
short updateDelay = 0;
|
||||||
|
|
||||||
if (pCE->fup || pCE->ondemand == FLAGTRUE ||
|
if (pCE->fup || pCE->ondemand == FLAGTRUE ||
|
||||||
(automatic == 1 && !pCE->autoReUp))
|
(automatic == 1 && !pCE->autoReUp))
|
||||||
continue;
|
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;
|
autoReUp = pCE->autoReUp;
|
||||||
if (automatic)
|
if (automatic > 0 || wasAuto) {
|
||||||
Msg("[%s] automatic reinitialization", pCE->server);
|
Msg("[%s] automatic reinitialization", pCE->server);
|
||||||
|
autoup = 1;
|
||||||
|
}
|
||||||
ConsInit(pCE);
|
ConsInit(pCE);
|
||||||
|
if (updateDelay)
|
||||||
|
UpdateDelay(pCE);
|
||||||
if (pCE->fup)
|
if (pCE->fup)
|
||||||
FindWrite(pCE);
|
FindWrite(pCE);
|
||||||
else if (automatic)
|
else if (automatic > 0)
|
||||||
pCE->autoReUp = autoReUp;
|
pCE->autoReUp = autoReUp;
|
||||||
}
|
}
|
||||||
|
} while (retry);
|
||||||
|
|
||||||
/* update all the timers */
|
/* update all the timers */
|
||||||
if (automatic == 0 || automatic == 2) {
|
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)
|
/* on a TERM we have to cleanup utmp entries (ask ptyd to do it) (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
DeUtmp(GRPENT *pGE, int sfd)
|
DeUtmp(GRPENT *pGE, int sfd)
|
||||||
#else
|
#else
|
||||||
@ -4105,6 +4207,12 @@ Kiddie(pGE, sfd)
|
|||||||
time((time_t *)0) >= timers[T_MARK])
|
time((time_t *)0) >= timers[T_MARK])
|
||||||
Mark(pGE);
|
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 &&
|
if (timers[T_REINIT] != (time_t)0 &&
|
||||||
time((time_t *)0) >= timers[T_REINIT])
|
time((time_t *)0) >= timers[T_REINIT])
|
||||||
ReUp(pGE, 2);
|
ReUp(pGE, 2);
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -41,7 +41,8 @@
|
|||||||
#define T_REINIT 3
|
#define T_REINIT 3
|
||||||
#define T_AUTOUP 4
|
#define T_AUTOUP 4
|
||||||
#define T_ROLL 5
|
#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()
|
/* return values used by CheckPass()
|
||||||
*/
|
*/
|
||||||
@ -80,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 ExpandString PARAMS((char *, CONSENT *, short));
|
extern void ExpandString PARAMS((char *, CONSENT *, short));
|
||||||
|
extern void DeUtmp PARAMS((GRPENT *, int));
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
extern int AttemptSSL PARAMS((CONSCLIENT *));
|
extern int AttemptSSL PARAMS((CONSCLIENT *));
|
||||||
#endif
|
#endif
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -65,8 +65,7 @@ CONFIG *config = (CONFIG *)0;
|
|||||||
char *interface = (char *)0;
|
char *interface = (char *)0;
|
||||||
CONFIG defConfig =
|
CONFIG defConfig =
|
||||||
{ (STRING *)0, 'r', FLAGFALSE, LOGFILEPATH, PASSWDFILE, DEFPORT,
|
{ (STRING *)0, 'r', FLAGFALSE, LOGFILEPATH, PASSWDFILE, DEFPORT,
|
||||||
FLAGTRUE,
|
FLAGTRUE, FLAGTRUE, 0, DEFBASEPORT, (char *)0, 0
|
||||||
FLAGTRUE, 0, DEFBASEPORT, (char *)0
|
|
||||||
#if HAVE_SETPROCTITLE
|
#if HAVE_SETPROCTITLE
|
||||||
, FLAGFALSE
|
, FLAGFALSE
|
||||||
#endif
|
#endif
|
||||||
@ -1663,6 +1662,14 @@ main(argc, argv)
|
|||||||
if (config->unifiedlog == (char *)0)
|
if (config->unifiedlog == (char *)0)
|
||||||
OutOfMem();
|
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 HAVE_OPENSSL
|
||||||
if (optConf->sslrequired != FLAGUNKNOWN)
|
if (optConf->sslrequired != FLAGUNKNOWN)
|
||||||
config->sslrequired = optConf->sslrequired;
|
config->sslrequired = optConf->sslrequired;
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -571,6 +571,7 @@ DoNormalRead(pCLServing)
|
|||||||
if ((GRPENT *)0 != pGroups) {
|
if ((GRPENT *)0 != pGroups) {
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_UNIX_DOMAIN_SOCKETS
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, "@0");
|
FilePrint(pCLServing->fd, FLAGTRUE, "@0");
|
||||||
|
iSep = 0;
|
||||||
#else
|
#else
|
||||||
struct sockaddr_in lcl;
|
struct sockaddr_in lcl;
|
||||||
socklen_t so = sizeof(lcl);
|
socklen_t so = sizeof(lcl);
|
||||||
@ -582,23 +583,26 @@ DoNormalRead(pCLServing)
|
|||||||
-1);
|
-1);
|
||||||
Error("Master(): getsockname(%u): %s",
|
Error("Master(): getsockname(%u): %s",
|
||||||
FileFDNum(pCLServing->fd), strerror(errno));
|
FileFDNum(pCLServing->fd), strerror(errno));
|
||||||
Bye(EX_OSERR);
|
iSep = -1;
|
||||||
}
|
} else {
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
||||||
inet_ntoa(lcl.sin_addr));
|
inet_ntoa(lcl.sin_addr));
|
||||||
#endif
|
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (iSep >= 0) {
|
||||||
if (config->redirect == FLAGTRUE) {
|
if (config->redirect == FLAGTRUE) {
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
|
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
|
||||||
pRC = pRC->pRCuniq) {
|
pRC = pRC->pRCuniq) {
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, ":@%s" + iSep,
|
FilePrint(pCLServing->fd, FLAGTRUE,
|
||||||
pRC->rhost);
|
":@%s" + iSep, pRC->rhost);
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
|
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
|
||||||
|
}
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
strcmp(pcCmd, "pid") == 0) {
|
strcmp(pcCmd, "pid") == 0) {
|
||||||
FilePrint(pCLServing->fd, FLAGFALSE, "%lu\r\n",
|
FilePrint(pCLServing->fd, FLAGFALSE, "%lu\r\n",
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
|
#include <grp.h>
|
||||||
|
|
||||||
#include <cutil.h>
|
#include <cutil.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
@ -530,13 +532,25 @@ GroupItemUsers(id)
|
|||||||
|
|
||||||
for (token = strtok(id, ALLWORDSEP); token != (char *)0;
|
for (token = strtok(id, ALLWORDSEP); token != (char *)0;
|
||||||
token = strtok(NULL, ALLWORDSEP)) {
|
token = strtok(NULL, ALLWORDSEP)) {
|
||||||
int not;
|
short not;
|
||||||
if (token[0] == '!') {
|
if (token[0] == '!') {
|
||||||
token++;
|
token++;
|
||||||
not = 1;
|
not = 1;
|
||||||
} else
|
} else
|
||||||
not = 0;
|
not = 0;
|
||||||
if ((pg = GroupFind(token)) == (PARSERGROUP *)0) {
|
if ((pg = GroupFind(token)) == (PARSERGROUP *)0) {
|
||||||
|
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);
|
GroupAddUser(parserGroupTemp, token, not);
|
||||||
} else {
|
} else {
|
||||||
PARSERGROUPUSERS *pgu;
|
PARSERGROUPUSERS *pgu;
|
||||||
@ -1946,6 +1960,18 @@ ProcessRoRw(ppCU, id)
|
|||||||
} else
|
} else
|
||||||
not = 0;
|
not = 0;
|
||||||
if ((pg = GroupFind(token)) == (PARSERGROUP *)0) {
|
if ((pg = GroupFind(token)) == (PARSERGROUP *)0) {
|
||||||
|
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);
|
ConsentAddUser(ppCU, token, not);
|
||||||
} else {
|
} else {
|
||||||
PARSERGROUPUSERS *pgu;
|
PARSERGROUPUSERS *pgu;
|
||||||
@ -3088,7 +3114,7 @@ ConsoleDestroy()
|
|||||||
parserConsoles = parserConsoleTemp = (CONSENT *)0;
|
parserConsoles = parserConsoleTemp = (CONSENT *)0;
|
||||||
|
|
||||||
/* here we check on the client permissions and adjust accordingly */
|
/* here we check on the client permissions and adjust accordingly */
|
||||||
if (!isMaster) {
|
if (!isMaster && pGroups != (GRPENT *)0) {
|
||||||
CONSENT *pCE = (CONSENT *)0;
|
CONSENT *pCE = (CONSENT *)0;
|
||||||
CONSCLIENT *pCL = (CONSCLIENT *)0;
|
CONSCLIENT *pCL = (CONSCLIENT *)0;
|
||||||
CONSCLIENT *pCLnext = (CONSCLIENT *)0;
|
CONSCLIENT *pCLnext = (CONSCLIENT *)0;
|
||||||
@ -4081,6 +4107,8 @@ ConfigEnd()
|
|||||||
pConfig->loghostnames = parserConfigTemp->loghostnames;
|
pConfig->loghostnames = parserConfigTemp->loghostnames;
|
||||||
if (parserConfigTemp->reinitcheck != 0)
|
if (parserConfigTemp->reinitcheck != 0)
|
||||||
pConfig->reinitcheck = parserConfigTemp->reinitcheck;
|
pConfig->reinitcheck = parserConfigTemp->reinitcheck;
|
||||||
|
if (parserConfigTemp->initdelay != 0)
|
||||||
|
pConfig->initdelay = parserConfigTemp->initdelay;
|
||||||
if (parserConfigTemp->secondaryport != (char *)0) {
|
if (parserConfigTemp->secondaryport != (char *)0) {
|
||||||
if (pConfig->secondaryport != (char *)0)
|
if (pConfig->secondaryport != (char *)0)
|
||||||
free(pConfig->secondaryport);
|
free(pConfig->secondaryport);
|
||||||
@ -4335,6 +4363,36 @@ ConfigItemReinitcheck(id)
|
|||||||
parserConfigTemp->reinitcheck = atoi(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
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
ConfigItemSecondaryport(char *id)
|
ConfigItemSecondaryport(char *id)
|
||||||
@ -4508,6 +4566,7 @@ ITEM keyAccess[] = {
|
|||||||
ITEM keyConfig[] = {
|
ITEM keyConfig[] = {
|
||||||
{"defaultaccess", ConfigItemDefaultaccess},
|
{"defaultaccess", ConfigItemDefaultaccess},
|
||||||
{"daemonmode", ConfigItemDaemonmode},
|
{"daemonmode", ConfigItemDaemonmode},
|
||||||
|
{"initdelay", ConfigItemInitdelay},
|
||||||
{"logfile", ConfigItemLogfile},
|
{"logfile", ConfigItemLogfile},
|
||||||
{"loghostnames", ConfigItemLoghostnames},
|
{"loghostnames", ConfigItemLoghostnames},
|
||||||
{"passwdfile", ConfigItemPasswordfile},
|
{"passwdfile", ConfigItemPasswordfile},
|
||||||
@ -4575,7 +4634,8 @@ typedef enum tokens {
|
|||||||
LEFTBRACE,
|
LEFTBRACE,
|
||||||
RIGHTBRACE,
|
RIGHTBRACE,
|
||||||
SEMICOLON,
|
SEMICOLON,
|
||||||
WORD
|
WORD,
|
||||||
|
INCLUDE
|
||||||
} TOKEN;
|
} TOKEN;
|
||||||
|
|
||||||
TOKEN
|
TOKEN
|
||||||
@ -4595,14 +4655,60 @@ GetWord(fp, line, spaceok, word)
|
|||||||
short comment = 0;
|
short comment = 0;
|
||||||
short sawQuote = 0;
|
short sawQuote = 0;
|
||||||
short quotedBackslash = 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);
|
BuildString((char *)0, word);
|
||||||
while ((c = fgetc(fp)) != EOF) {
|
while ((c = fgetc(fp)) != EOF) {
|
||||||
if (c == '\n')
|
if (c == '\n') {
|
||||||
(*line)++;
|
(*line)++;
|
||||||
|
if (checkInc == -2)
|
||||||
|
checkInc = -1;
|
||||||
|
}
|
||||||
if (comment) {
|
if (comment) {
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
comment = 0;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
if (backslash) {
|
if (backslash) {
|
||||||
@ -4633,6 +4739,8 @@ GetWord(fp, line, spaceok, word)
|
|||||||
backslash = 1;
|
backslash = 1;
|
||||||
} else if (c == '#') {
|
} else if (c == '#') {
|
||||||
comment = 1;
|
comment = 1;
|
||||||
|
if (checkInc == -1)
|
||||||
|
checkInc = 0;
|
||||||
} else if (c == '"') {
|
} else if (c == '"') {
|
||||||
quote = 1;
|
quote = 1;
|
||||||
sawQuote = 1;
|
sawQuote = 1;
|
||||||
@ -4691,66 +4799,65 @@ GetWord(fp, line, spaceok, word)
|
|||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
ReadCfg(char *filename, FILE *fp)
|
ParseFile(char *filename, FILE *fp, int level)
|
||||||
#else
|
#else
|
||||||
ReadCfg(filename, fp)
|
ParseFile(filename, fp, level)
|
||||||
char *filename;
|
char *filename;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
int level;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
/* things that should be used between recursions */
|
||||||
|
static STATES state = START;
|
||||||
static STRING *word = (STRING *)0;
|
static STRING *word = (STRING *)0;
|
||||||
STATES state = START;
|
static short spaceok = 0;
|
||||||
int secIndex = 0;
|
static int secIndex = 0;
|
||||||
int keyIndex = 0;
|
static 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;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
|
/* other stuff that's local to each recursion */
|
||||||
dmallocMarkReadCfg = dmalloc_mark();
|
char *p;
|
||||||
#endif
|
TOKEN token = DONE;
|
||||||
isStartup = (pGroups == (GRPENT *)0 && pRCList == (REMOTE *)0);
|
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 */
|
/* initialize local things */
|
||||||
if (word == (STRING *)0)
|
if (word == (STRING *)0)
|
||||||
word = AllocString();
|
word = AllocString();
|
||||||
line = 1;
|
|
||||||
file = filename;
|
|
||||||
|
|
||||||
/* initialize the break lists */
|
|
||||||
for (i = 0; i < 9; i++) {
|
|
||||||
if (breakList[i].seq == (STRING *)0) {
|
|
||||||
breakList[i].seq = AllocString();
|
|
||||||
} else {
|
|
||||||
BuildString((char *)0, breakList[i].seq);
|
|
||||||
}
|
|
||||||
breakList[i].delay = BREAKDELAYDEFAULT;
|
|
||||||
}
|
|
||||||
BuildString("\\z", breakList[0].seq);
|
|
||||||
BuildString("\\r~^b", breakList[1].seq);
|
|
||||||
BuildString("#.", breakList[2].seq);
|
|
||||||
BuildString("\\r\\d~\\d^b", breakList[3].seq);
|
|
||||||
breakList[3].delay = 600;
|
|
||||||
|
|
||||||
/* initialize the user list */
|
|
||||||
DestroyUserList();
|
|
||||||
|
|
||||||
/* initialize the config set */
|
|
||||||
if (pConfig != (CONFIG *)0) {
|
|
||||||
DestroyConfig(pConfig);
|
|
||||||
pConfig = (CONFIG *)0;
|
|
||||||
}
|
|
||||||
if ((pConfig = (CONFIG *)calloc(1, sizeof(CONFIG)))
|
|
||||||
== (CONFIG *)0)
|
|
||||||
OutOfMem();
|
|
||||||
|
|
||||||
/* ready to read in the data */
|
|
||||||
while ((token = GetWord(fp, &nextline, spaceok, word)) != DONE) {
|
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) {
|
switch (state) {
|
||||||
case START:
|
case START:
|
||||||
switch (token) {
|
switch (token) {
|
||||||
@ -4780,6 +4887,7 @@ ReadCfg(filename, fp)
|
|||||||
word->string, file, line);
|
word->string, file, line);
|
||||||
break;
|
break;
|
||||||
case DONE: /* just shutting up gcc */
|
case DONE: /* just shutting up gcc */
|
||||||
|
case INCLUDE: /* just shutting up gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4802,6 +4910,7 @@ ReadCfg(filename, fp)
|
|||||||
word->string, file, line);
|
word->string, file, line);
|
||||||
break;
|
break;
|
||||||
case DONE: /* just shutting up gcc */
|
case DONE: /* just shutting up gcc */
|
||||||
|
case INCLUDE: /* just shutting up gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4828,6 +4937,7 @@ ReadCfg(filename, fp)
|
|||||||
word->string, file, line);
|
word->string, file, line);
|
||||||
break;
|
break;
|
||||||
case DONE: /* just shutting up gcc */
|
case DONE: /* just shutting up gcc */
|
||||||
|
case INCLUDE: /* just shutting up gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4839,7 +4949,8 @@ ReadCfg(filename, fp)
|
|||||||
sections[secIndex].items[keyIndex].id) !=
|
sections[secIndex].items[keyIndex].id) !=
|
||||||
(char *)0; keyIndex++) {
|
(char *)0; keyIndex++) {
|
||||||
if (strcasecmp(word->string, p) == 0) {
|
if (strcasecmp(word->string, p) == 0) {
|
||||||
CONDDEBUG((1, "got keyword '%s' [%s:%d]",
|
CONDDEBUG((1,
|
||||||
|
"got keyword '%s' [%s:%d]",
|
||||||
word->string, file, line));
|
word->string, file, line));
|
||||||
state = VALUE;
|
state = VALUE;
|
||||||
break;
|
break;
|
||||||
@ -4865,14 +4976,15 @@ ReadCfg(filename, fp)
|
|||||||
Error("premature token '%s' [%s:%d]",
|
Error("premature token '%s' [%s:%d]",
|
||||||
word->string, file, line);
|
word->string, file, line);
|
||||||
case DONE: /* just shutting up gcc */
|
case DONE: /* just shutting up gcc */
|
||||||
|
case INCLUDE: /* just shutting up gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
switch (token) {
|
switch (token) {
|
||||||
case WORD:
|
case WORD:
|
||||||
(*sections[secIndex].items[keyIndex].reg) (word->
|
(*sections[secIndex].items[keyIndex].
|
||||||
string);
|
reg) (word->string);
|
||||||
state = SEMI;
|
state = SEMI;
|
||||||
break;
|
break;
|
||||||
case SEMICOLON:
|
case SEMICOLON:
|
||||||
@ -4894,6 +5006,7 @@ ReadCfg(filename, fp)
|
|||||||
word->string, file, line);
|
word->string, file, line);
|
||||||
break;
|
break;
|
||||||
case DONE: /* just shutting up gcc */
|
case DONE: /* just shutting up gcc */
|
||||||
|
case INCLUDE: /* just shutting up gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4920,6 +5033,7 @@ ReadCfg(filename, fp)
|
|||||||
word->string, file, line);
|
word->string, file, line);
|
||||||
break;
|
break;
|
||||||
case DONE: /* just shutting up gcc */
|
case DONE: /* just shutting up gcc */
|
||||||
|
case INCLUDE: /* just shutting up gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4936,9 +5050,11 @@ ReadCfg(filename, fp)
|
|||||||
spaceok = 0;
|
spaceok = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
line = nextline;
|
line = nextline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (level == 0) {
|
||||||
/* check for proper ending of file and do any cleanup */
|
/* check for proper ending of file and do any cleanup */
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case START:
|
case START:
|
||||||
@ -4954,11 +5070,62 @@ ReadCfg(filename, fp)
|
|||||||
Error("premature EOF seen [%s:%d]", file, line);
|
Error("premature EOF seen [%s:%d]", file, line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
#if PROTOTYPES
|
||||||
|
ReadCfg(char *filename, FILE *fp)
|
||||||
|
#else
|
||||||
|
ReadCfg(filename, fp)
|
||||||
|
char *filename;
|
||||||
|
FILE *fp;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
int i;
|
||||||
|
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
|
||||||
|
unsigned long dmallocMarkReadCfg = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
|
||||||
|
dmallocMarkReadCfg = dmalloc_mark();
|
||||||
|
#endif
|
||||||
|
isStartup = (pGroups == (GRPENT *)0 && pRCList == (REMOTE *)0);
|
||||||
|
|
||||||
|
/* initialize the break lists */
|
||||||
|
for (i = 0; i < 9; i++) {
|
||||||
|
if (breakList[i].seq == (STRING *)0) {
|
||||||
|
breakList[i].seq = AllocString();
|
||||||
|
} else {
|
||||||
|
BuildString((char *)0, breakList[i].seq);
|
||||||
|
}
|
||||||
|
breakList[i].delay = BREAKDELAYDEFAULT;
|
||||||
|
}
|
||||||
|
BuildString("\\z", breakList[0].seq);
|
||||||
|
BuildString("\\r~^b", breakList[1].seq);
|
||||||
|
BuildString("#.", breakList[2].seq);
|
||||||
|
BuildString("\\r\\d~\\d^b", breakList[3].seq);
|
||||||
|
breakList[3].delay = 600;
|
||||||
|
|
||||||
|
/* initialize the user list */
|
||||||
|
DestroyUserList();
|
||||||
|
|
||||||
|
/* initialize the config set */
|
||||||
|
if (pConfig != (CONFIG *)0) {
|
||||||
|
DestroyConfig(pConfig);
|
||||||
|
pConfig = (CONFIG *)0;
|
||||||
|
}
|
||||||
|
if ((pConfig = (CONFIG *)calloc(1, sizeof(CONFIG)))
|
||||||
|
== (CONFIG *)0)
|
||||||
|
OutOfMem();
|
||||||
|
|
||||||
|
/* ready to read in the data */
|
||||||
|
ParseFile(filename, fp, 0);
|
||||||
|
|
||||||
/* now clean up all the temporary space used */
|
/* now clean up all the temporary space used */
|
||||||
for (nextline = 0; (p = sections[nextline].id) != (char *)0;
|
for (i = 0; (p = sections[i].id) != (char *)0; i++) {
|
||||||
nextline++) {
|
(*sections[i].destroy) ();
|
||||||
(*sections[nextline].destroy) ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
|
#if HAVE_DMALLOC && DMALLOC_MARK_READCFG
|
||||||
@ -5002,7 +5169,7 @@ ReReadCfg(fd)
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Error("no consoles to manage after reconfiguration - exiting");
|
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;
|
config->reinitcheck = pConfig->reinitcheck;
|
||||||
/* gets used on-the-fly */
|
/* 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 HAVE_OPENSSL
|
||||||
if (optConf->sslrequired == FLAGUNKNOWN) {
|
if (optConf->sslrequired == FLAGUNKNOWN) {
|
||||||
if (pConfig->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");
|
Msg("warning: `daemonmode' config option changed - you must restart for it to take effect");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if !USE_UNIX_DOMAIN_SOCKETS
|
||||||
if (optConf->primaryport == (char *)0) {
|
if (optConf->primaryport == (char *)0) {
|
||||||
char *p;
|
char *p;
|
||||||
if (pConfig->primaryport == (char *)0)
|
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");
|
Msg("warning: `secondaryport' config option changed - you must restart for it to take effect");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
if (optConf->sslcredentials == (char *)0) {
|
if (optConf->sslcredentials == (char *)0) {
|
||||||
if (pConfig->sslcredentials == (char *)0) {
|
if (pConfig->sslcredentials == (char *)0) {
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -20,6 +20,7 @@ typedef struct config {
|
|||||||
int reinitcheck;
|
int reinitcheck;
|
||||||
char *secondaryport;
|
char *secondaryport;
|
||||||
char *unifiedlog;
|
char *unifiedlog;
|
||||||
|
int initdelay;
|
||||||
#if HAVE_SETPROCTITLE
|
#if HAVE_SETPROCTITLE
|
||||||
FLAG setproctitle;
|
FLAG setproctitle;
|
||||||
#endif
|
#endif
|
||||||
|
@ -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
|
* 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.4"
|
#define THIS_VERSION "conserver.com version 8.1.5"
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -42,8 +42,10 @@
|
|||||||
|
|
||||||
|
|
||||||
int fReplay = 0, fVersion = 0, fStrip = 0;
|
int fReplay = 0, fVersion = 0, fStrip = 0;
|
||||||
|
int showExecData = 1;
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
int fReqEncryption = 1;
|
int fReqEncryption = 1;
|
||||||
|
int fAllowUnencrypted = 0;
|
||||||
char *pcCredFile = (char *)0;
|
char *pcCredFile = (char *)0;
|
||||||
#endif
|
#endif
|
||||||
int chAttn = -1, chEsc = -1;
|
int chAttn = -1, chEsc = -1;
|
||||||
@ -217,6 +219,11 @@ Usage(wantfull)
|
|||||||
"s(S) spy on a console (and replay)",
|
"s(S) spy on a console (and replay)",
|
||||||
"t send a text message to [user][@console]",
|
"t send a text message to [user][@console]",
|
||||||
"u show users on the various consoles",
|
"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 be more verbose",
|
||||||
"V show version information",
|
"V show version information",
|
||||||
"w(W) show who is on which console (on master)",
|
"w(W) show who is on which console (on master)",
|
||||||
@ -225,12 +232,13 @@ Usage(wantfull)
|
|||||||
};
|
};
|
||||||
|
|
||||||
fprintf(stderr,
|
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);
|
progname);
|
||||||
fprintf(stderr,
|
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);
|
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);
|
progname);
|
||||||
|
|
||||||
if (wantfull) {
|
if (wantfull) {
|
||||||
@ -889,6 +897,7 @@ DoExec(pcf)
|
|||||||
CONSFILE *pcf;
|
CONSFILE *pcf;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
showExecData = 1;
|
||||||
FileWrite(cfstdout, FLAGFALSE, "exec: ", 6);
|
FileWrite(cfstdout, FLAGFALSE, "exec: ", 6);
|
||||||
|
|
||||||
GetUserInput(execCmd);
|
GetUserInput(execCmd);
|
||||||
@ -1086,10 +1095,12 @@ Interact(pcf, pcMach)
|
|||||||
for (i = 0; i < l; ++i)
|
for (i = 0; i < l; ++i)
|
||||||
acMesg[i] &= 127;
|
acMesg[i] &= 127;
|
||||||
}
|
}
|
||||||
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
|
|
||||||
if (execCmdFile != (CONSFILE *)0) {
|
if (execCmdFile != (CONSFILE *)0) {
|
||||||
FileWrite(execCmdFile, FLAGFALSE, acMesg, l);
|
FileWrite(execCmdFile, FLAGFALSE, acMesg, l);
|
||||||
}
|
if (showExecData)
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
|
||||||
|
} else
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
|
||||||
nc -= l;
|
nc -= l;
|
||||||
MemMove(acMesg, acMesg + l, nc);
|
MemMove(acMesg, acMesg + l, nc);
|
||||||
}
|
}
|
||||||
@ -1133,6 +1144,11 @@ Interact(pcf, pcMach)
|
|||||||
FilePrint(cfstdout, FLAGFALSE,
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
"[local command sent SIGKILL - pid %lu]\r\n",
|
"[local command sent SIGKILL - pid %lu]\r\n",
|
||||||
execCmdPid);
|
execCmdPid);
|
||||||
|
} else if (acMesg[i] == 'o' || acMesg[i] == 'O') {
|
||||||
|
showExecData = !showExecData;
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command data %s]\r\n",
|
||||||
|
showExecData ? "on" : "off");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1375,13 +1391,18 @@ DoCmds(master, pports, cmdi)
|
|||||||
t = ReadReply(pcf, 0);
|
t = ReadReply(pcf, 0);
|
||||||
if (strcmp(t, "ok\r\n") == 0) {
|
if (strcmp(t, "ok\r\n") == 0) {
|
||||||
AttemptSSL(pcf);
|
AttemptSSL(pcf);
|
||||||
}
|
|
||||||
if (FileGetType(pcf) != SSLSocket) {
|
if (FileGetType(pcf) != SSLSocket) {
|
||||||
Error("Encryption not supported by server `%s'",
|
Error("Encryption not supported by server `%s'",
|
||||||
serverName);
|
serverName);
|
||||||
FileClose(&pcf);
|
FileClose(&pcf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else if (fAllowUnencrypted == 0) {
|
||||||
|
Error("Encryption not supported by server `%s'",
|
||||||
|
serverName);
|
||||||
|
FileClose(&pcf);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1569,7 +1590,7 @@ main(argc, argv)
|
|||||||
int opt;
|
int opt;
|
||||||
int fLocal;
|
int fLocal;
|
||||||
static STRING *acPorts = (STRING *)0;
|
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 optind;
|
||||||
extern int optopt;
|
extern int optopt;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
@ -1714,6 +1735,12 @@ main(argc, argv)
|
|||||||
pcCmd = textMsg->string;
|
pcCmd = textMsg->string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'U':
|
||||||
|
#if HAVE_OPENSSL
|
||||||
|
fAllowUnencrypted = 1;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
case 'u':
|
case 'u':
|
||||||
pcCmd = "hosts";
|
pcCmd = "hosts";
|
||||||
break;
|
break;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
.\" $Id: console.man,v 1.46 2004/03/23 18:32:09 bryan Exp $
|
.\" $Id: console.man,v 1.48 2004/04/20 01:30:13 bryan Exp $
|
||||||
.TH CONSOLE 1 "2004/03/23" "conserver-8.1.4" "conserver"
|
.TH CONSOLE 1 "2004/04/20" "conserver-8.1.5" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
console \- console server client program
|
console \- console server client program
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B console
|
.B console
|
||||||
.RB [ \-aAEfFsS ]
|
.RB [ \-aAfFsS ]
|
||||||
.RB [ \-7Dv ]
|
.RB [ \-7DEUv ]
|
||||||
.RB [ \-c
|
.RB [ \-c
|
||||||
.IR cred ]
|
.IR cred ]
|
||||||
.BR [ \-M
|
.BR [ \-M
|
||||||
@ -20,7 +20,9 @@ console \- console server client program
|
|||||||
.br
|
.br
|
||||||
.B console
|
.B console
|
||||||
.RB [ \-hiIPrRuVwWx ]
|
.RB [ \-hiIPrRuVwWx ]
|
||||||
.RB [ \-7Dv ]
|
.RB [ \-7DEUv ]
|
||||||
|
.RB [ \-c
|
||||||
|
.IR cred ]
|
||||||
.RB [ \-M
|
.RB [ \-M
|
||||||
.IR mach ]
|
.IR mach ]
|
||||||
.RB [ \-p
|
.RB [ \-p
|
||||||
@ -35,7 +37,9 @@ console \- console server client program
|
|||||||
.br
|
.br
|
||||||
.B console
|
.B console
|
||||||
.RB [ \-qQ ]
|
.RB [ \-qQ ]
|
||||||
.RB [ \-7Dv ]
|
.RB [ \-7DEUv ]
|
||||||
|
.RB [ \-c
|
||||||
|
.IR cred ]
|
||||||
.RB [ \-M
|
.RB [ \-M
|
||||||
.IR mach ]
|
.IR mach ]
|
||||||
.RB [ \-p
|
.RB [ \-p
|
||||||
@ -150,9 +154,13 @@ The default value is
|
|||||||
.B \-E
|
.B \-E
|
||||||
If encryption has been built into the code
|
If encryption has been built into the code
|
||||||
.RB ( --with-openssl ),
|
.RB ( --with-openssl ),
|
||||||
encrypted client connections are a requirement.
|
encrypted client connections are, by default, a requirement.
|
||||||
This option allows the client to connect to a console
|
This option disables any attempt at creating an
|
||||||
over a non-encrypted connection.
|
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
|
.TP
|
||||||
.B \-f
|
.B \-f
|
||||||
Same as
|
Same as
|
||||||
@ -264,6 +272,18 @@ and attached users
|
|||||||
.RI ( user @ host
|
.RI ( user @ host
|
||||||
if attached read-write, `<spies>' if only users in spy mode, or `<none>').
|
if attached read-write, `<spies>' if only users in spy mode, or `<none>').
|
||||||
.TP
|
.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
|
.B \-v
|
||||||
Be more verbose when building the connection(s).
|
Be more verbose when building the connection(s).
|
||||||
Use this option in combination with any of `show' options (below)
|
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.
|
options have the same effect as their lower-case variants.
|
||||||
In addition, they each request the last 20 lines of the console output after
|
In addition, they each request the last 20 lines of the console output after
|
||||||
making the connection (as if
|
making the connection (as if
|
||||||
.RB ` ^Ecr '
|
.RB `` ^Ecr ''
|
||||||
were typed).
|
were typed).
|
||||||
.PP
|
.PP
|
||||||
The
|
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 details regarding the logging for the console.
|
||||||
The comma-separated
|
The comma-separated
|
||||||
values will be the logfile, ``log'' or ``nolog'' (if logging is on
|
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
|
enabled or not - the `a' timestamp option), the timestamp interval, and
|
||||||
the file descriptor of the logfile.
|
the file descriptor of the logfile.
|
||||||
.TP
|
.TP
|
||||||
@ -493,12 +513,16 @@ In the
|
|||||||
output, the login ``<none>'' indicates no one is
|
output, the login ``<none>'' indicates no one is
|
||||||
viewing that console, and the login ``<spies>'' indicates that
|
viewing that console, and the login ``<spies>'' indicates that
|
||||||
no one has a full two-way attachment.
|
no one has a full two-way attachment.
|
||||||
When no one is attached to
|
.PP
|
||||||
a console its output is cloned to the stdout of the server process if
|
When running a local command via
|
||||||
.B conserver
|
.RB `` ^Ec| '',
|
||||||
was started with the
|
you can type
|
||||||
.B \-u
|
.B ^C
|
||||||
option.
|
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
|
.SH EXAMPLES
|
||||||
.TP 15
|
.TP 15
|
||||||
console \-u
|
console \-u
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
%define pkg conserver
|
%define pkg conserver
|
||||||
%define ver 8.1.4
|
%define ver 8.1.5
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -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.4"
|
VERSION="8.1.5"
|
||||||
DESC="Console server and client"
|
DESC="Console server and client"
|
||||||
CLASSES=none
|
CLASSES=none
|
||||||
ARCH=sparc
|
ARCH=sparc
|
||||||
|
Loading…
Reference in New Issue
Block a user