Imported from conserver-8.0.6.tar.gz

This commit is contained in:
Bryan Stansell 2003-11-16 11:33:39 -08:00
parent 92cf41a9f2
commit eafae7c27d
51 changed files with 2163 additions and 1026 deletions

34
CHANGES
View File

@ -1,7 +1,37 @@
CHANGES
=======
version 8.0.5 (Oct 31,2003):
version 8.0.6 (Nov 16, 2003):
- code was missing regarding the 'setproctitle' option - patch
by Dmitry Morozovsky <marck@rinet.ru>
- fixed the order of access list checking when
--with-trustrevdns is used
- fixed various spelling errors - patches by Matt Selsky
<selsky@columbia.edu>
- added console 'idletimeout' and 'idlestring' options to
trigger the sending of 'idlestring' after a lack of activity
for 'idletimeout' seconds - suggested by Ian Potts
<ian.potts@db.com>
- added console 'portbase' and 'portinc' options to allow
specifying a formula for referencing ports - inspired by Todd
Stansell <todd@stansell.org>
- fixed problem where console 'port' option didn't take port
names (manpage said it did)
- added server -U option and configuration option 'unifiedlog'
to allow a copy of all console activity to go to a single file
- removed all sprintf() calls
- added 'devicesubst' and 'execsubst' console options for doing
replacements with calculated port numbers on the 'device' and
'exec' values
- NULL characters in console data caused data loss because of
strlen() usage - reported by Toby Gerhart <toby.gerhart@eds.com>
- fixed a couple errors in contrib/redhat-rpm/conserver.spec -
reported by Martin Evans <m.d.t.evans@qmul.ac.uk>
- added capability to use '!' in user access lists to prevent a
user from having access - suggested by Matt Selsky
<selsky@columbia.edu>
version 8.0.5 (Oct 31, 2003):
- added 'loghostnames' config option (default is on) to log
client hostnames instead of ip addresses (like pre-8.0.0) -
suggested by Han Pilmeyer <han@zk3.dec.com>
@ -586,5 +616,5 @@ before version 6.05:
and enhancements of various types were applied.
#
# $Id: CHANGES,v 1.120 2003-10-31 10:04:12-08 bryan Exp $
# $Id: CHANGES,v 1.131 2003/11/15 23:57:18 bryan Exp $
#

2
FAQ
View File

@ -186,5 +186,5 @@ directed to faq@conserver.com. The FAQ answers the following questions:
through the same problem?
#
# $Id: FAQ,v 1.9 2003-08-23 12:27:10-07 bryan Exp $
# $Id: FAQ,v 1.9 2003/08/23 19:27:10 bryan Exp $
#

View File

@ -255,5 +255,5 @@ Other Information And Gotchas
#
# $Id: INSTALL,v 1.34 2003-10-03 10:52:31-07 bryan Exp $
# $Id: INSTALL,v 1.34 2003/10/03 17:52:31 bryan Exp $
#

2
README
View File

@ -55,5 +55,5 @@ Contributions
http://www.columbia.edu/acis/sy/unixdev/zinc
#
# $Id: README,v 1.22 2003-08-23 12:34:24-07 bryan Exp $
# $Id: README,v 1.22 2003/08/23 19:34:24 bryan Exp $
#

11
TODO
View File

@ -10,9 +10,6 @@ Bryan Stansell
---------------------------------------------------------------------------
- Singular logging so that swatch/logsurfer can watch for errors across
the board - unloved output comes close
- Telnet protocol should be improved
- Not even RFC 854 compliant
- Option negotiation ignored - should we negotiate anything?
@ -83,6 +80,12 @@ Bryan Stansell
- redefine client escape sequence in conserver.cf : Toby Gerhart
<toby.gerhart@eds.com>
- send a string when connected to a console, so you can set the
xterm title, for example : Richard Threadgill <richardt@tellme.com>
- allows for very long replays (hundres of lines) : John Stoffel
<stoffel@lucent.com>
#
# $Id: TODO,v 1.38 2003-10-31 09:53:46-08 bryan Exp $
# $Id: TODO,v 1.42 2003/11/15 17:08:15 bryan Exp $
#

View File

@ -1,4 +1,4 @@
# $Id: INSTALL,v 1.3 94/07/11 12:38:19 ksb Exp $
# $Id: INSTALL.old,v 1.1 2003/11/04 02:36:24 bryan Exp $
To install this program you need root access and access to the physical
console of the machine (either through the console server or via the physical

View File

@ -17,5 +17,5 @@ Good luck.
Bryan Stansell
#
# $Id: README,v 1.2 2002-09-23 14:08:42-07 bryan Exp $
# $Id: README,v 1.2 2002/09/23 21:08:42 bryan Exp $
#

View File

@ -1,4 +1,4 @@
# $Id: README,v 1.3 93/04/21 16:13:37 ksb Exp $
# $Id: README.old,v 1.1 2003/11/04 02:36:24 bryan Exp $
This program can be used to put a root shell on the console at boot time.
See the manual page.

View File

@ -69,7 +69,7 @@
*/
#ifndef lint
char *rcsid = "$Id: autologin.c,v 1.23 2002-09-20 23:29:39-07 bryan Exp $";
char *rcsid = "$Id: autologin.c,v 1.23 2002/09/21 06:29:39 bryan Exp $";
#endif /* not lint */
extern char *progname;
gid_t awGrps[NGROUPS_MAX];

View File

@ -1,7 +1,7 @@
# mkcmd parser for autologin program
%%
static char *rcsid =
"$Id: autologin.m,v 1.2 92/07/28 13:18:34 ksb Exp $";
"$Id: autologin.m,v 1.1 2003/11/04 02:36:24 bryan Exp $";
%%
integer variable "iErrs" {

View File

@ -1,4 +1,4 @@
.\" $Id: autologin.man,v 1.3 93/03/16 16:41:45 ksb Exp $
.\" $Id: autologin.man,v 1.1 2003/11/04 02:36:24 bryan Exp $
.TH AUTOLOGIN 8L PUCC
.SH NAME
autologin \- create an automatic login session from /etc/inittab

View File

@ -80,7 +80,7 @@ char **nargv, *ostr;
#endif /* ! HAVE_GETOPT */
char
*progname = "$Id$",
*progname = "$Id: main.c,v 1.1 2003/11/04 02:36:24 bryan Exp $",
*au_terse[] = {
" [-u] [-c cmd] [-e env=value] [-g group] [-l login] [-t tty]",
" -h",
@ -111,7 +111,7 @@ int
#endif
static char *rcsid =
"$Id: autologin.m,v 1.2 92/07/28 13:18:34 ksb Exp $";
"$Id: main.c,v 1.1 2003/11/04 02:36:24 bryan Exp $";
/*
* parser

26
config.guess vendored
View File

@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2003-08-18'
timestamp='2003-10-16'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -221,6 +221,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pegasos:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@ -307,6 +310,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
@ -742,6 +748,11 @@ EOF
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
@ -751,7 +762,7 @@ EOF
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
*:FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@ -763,7 +774,7 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
# GNU/FreeBSD systems have a "k" prefix to indicate we are using
# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
# FreeBSD's kernel, but not the complete OS.
case ${LIBC} in gnu) kernel_only='k' ;; esac
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
@ -799,8 +810,13 @@ EOF
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
@ -1052,7 +1068,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@ -1167,7 +1183,7 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)

31
config.sub vendored
View File

@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2003-08-18'
timestamp='2003-11-03'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -118,7 +118,8 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@ -248,6 +249,7 @@ case $basic_machine in
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
@ -320,6 +322,7 @@ case $basic_machine in
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
@ -741,6 +744,10 @@ case $basic_machine in
basic_machine=or32-unknown
os=-coff
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
@ -961,6 +968,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
@ -1129,13 +1140,13 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
@ -1180,6 +1191,9 @@ case $os in
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
@ -1223,6 +1237,9 @@ case $os in
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
@ -1471,9 +1488,15 @@ case $basic_machine in
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;

View File

@ -7,5 +7,5 @@ files with enough detail to get you going.
That's about it. Good luck.
#
# $Id: INSTALL,v 1.3 2003-07-04 11:21:21-07 bryan Exp $
# $Id: INSTALL,v 1.3 2003/07/04 18:21:21 bryan Exp $
#

View File

@ -1,54 +1,67 @@
#
# $Id: conserver.cf,v 1.5 2003-07-04 11:05:04-07 bryan Exp $
# Sample conserver.cf file, to give you ideas of what you can do with
# the various configuration items.
#
# The character '&' in logfile names are substituted with the console
# name.
#
default full {
rw *;
}
### set up global access
default full { rw *; }
### define some terminal server specifics
# we set portbase and portinc so we can reference the ports in a
# physical representation and let conserver do the math to figure
# out the actual socket address
default cisco { type host; portbase 2000; portinc 1; }
default xyplex { type host; portbase 2000; portinc 100; }
default iolan { type host; portbase 10000; portinc 1; }
### set the defaults for all the consoles
# these get applied before anything else
default * {
# The '&' character is substituted with the console name
logfile /var/consoles/&;
timestamp "";
timestamp 1hab;
include full;
}
#
# list of consoles we serve
#
console tweety {
master localhost;
type host;
host ts1;
port 2002;
}
console bambam {
master localhost;
type host;
host ts1;
port 2003;
### define the first terminal server
default ts1.conserver.com {
include xyplex;
host ts1.conserver.com;
initcmd /usr/local/sbin/login-xyplex;
}
console shell {
master localhost;
logfile /dev/null;
# now define the consoles on ts1.conserver.com
console web1.conserver.com { include ts1.conserver.com; port 2; }
console ns1.conserver.com { include ts1.conserver.com; port 10; }
console ns2.conserver.com { include ts1.conserver.com; port 8; }
### define the second terminal server
default ts2.conserver.com { include cisco; host ts2.conserver.com; }
# and the consoles
console ldap1.conserver.com { include ts2.conserver.com; port 7; }
### and now some one-off consoles
# a simple ssh invocation
console ssh {
type exec;
exec "";
}
console telnet {
master localhost;
logfile /dev/null;
type exec;
exec telnet host;
exec ssh localhost;
motd "just a simple ssh to localhost";
}
# connect to /dev/ttya
console ttya {
master localhost;
type device;
device /dev/ttya;
baud 9600;
parity none;
device /dev/ttya; parity none; baud 9600;
idlestring "#";
idletimeout 5m; # send a '#' every 5 minutes of idle
timestamp ""; # no timestamps on this console
}
#
# list of clients we allow
#
### list of clients we allow
access * {
allowed 127.0.0.1 gnac.com;
allowed 10.0.0.0/8 192.168.0.0/16;
allowed cs1.conserver.com cs2.conserver.com cs3.conserver.com;
trusted 127.0.0.1;
}

View File

@ -1,5 +1,5 @@
.\" $Id: conserver.cf.man,v 1.44 2003-10-31 09:54:19-08 bryan Exp $
.TH CONSERVER.CF 5 "2003-10-31" "conserver-8.0.5" "conserver"
.\" $Id: conserver.cf.man,v 1.51 2003/11/15 20:00:11 bryan Exp $
.TH CONSERVER.CF 5 "2003/11/15" "conserver-8.0.6" "conserver"
.SH NAME
conserver.cf \- console configuration file for
.BR conserver (8)
@ -65,12 +65,12 @@ The parser has six characters that it considers special.
These are: ``{'', ``}'', ``;'', ``#'', ``\e'', and ``"''.
The first three (hereby called tokens) define the format of the
configuration blocks and are used as word
seperators, the next is the comment character, and the last two are
separators, the next is the comment character, and the last two are
quoting characters.
.PP
Word seperation occurs when the parser encounters an unquoted token
Word separation occurs when the parser encounters an unquoted token
and, in certain cases, whitespace.
Whitespace is only used as a word seperator when the parser is
Whitespace is only used as a word separator when the parser is
looking for a block-type or keyword.
When it's looking for a block-name or value, whitespace is like any
other character, which allows you to embed whitespace in a block-name
@ -123,14 +123,16 @@ fashion (top down), so order is important.
.RS
.TP 15
.B admin
.RI [ " username" ,...
.RI "[ [\fB!\fP]" username ,...
| "" ]
.br
Define a list of users making up the admin list for the console server.
If
.I username
matches a previously defined group name, all members of the previous
group are added to the admin list.
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 the null string (``""'') is used, any
users previously defined for the console servers's admin list are removed.
.TP
@ -202,7 +204,9 @@ alert
backspace
.TP
.B \ed
0.33 second delay
delay specified by the
.B delay
option.
.TP
.B \ef
form-feed
@ -341,6 +345,15 @@ command-line flag).
Set whether or not encryption is required when talking to clients (see the
.B \-E
command-line flag).
.TP
.B unifiedlog
.I filename
.br
Set the location of the unified log to
.IR filename .
See the
.B \-U
command-line flag for details.
.RE
.TP 8
.B console
@ -370,7 +383,7 @@ Define a block of defaults identified as
If
.I name
is ``*'', the automatically applied default block is defined (basically
all consoles have an implicit ``include "*";'' at the begining
all consoles have an implicit ``include "*";'' at the beginning
of their definition).
.RS
.TP 15
@ -397,6 +410,36 @@ Assign the serial device
as the access to the console.
Only consoles of type ``device'' will use this value.
.TP
.B devicesubst
.RI [ " hp" [ n ] "f "
| "" ]
.br
Perform string substitutions on the
.B device
value.
.I h
is the character in
.B device
to replace with the
.B host
value and
.I p
is the character to replace with the
.B port
value.
The
.B port
value will be formatted to at least
.I n
characters, padded with 0s if
.I n
begins with a 0, and space characters otherwise.
.I f
must be either `d' or `x' or `X', specifying a decimal, lower-case
hexdecimal, or uppercase hexdecimal representation of
.BR port .
If the null string (``""'') is used, no replacements will be done.
.TP
.B exec
.RI [ " command "
| "" ]
@ -409,7 +452,37 @@ invoking ``/bin/sh -ce "\fIcommand\fP"''.
If the null string (``""'') is used or no
.B exec
keyword is specified, conserver will use the command ``/bin/sh -i''.
Only consoles of type ``device'' will use this value.
Only consoles of type ``exec'' will use this value.
.TP
.B execsubst
.RI [ " hp" [ n ] "f "
| "" ]
.br
Perform string substitutions on the
.B exec
value.
.I h
is the character in
.B exec
to replace with the
.B host
value and
.I p
is the character to replace with the
.B port
value.
The
.B port
value will be formatted to at least
.I n
characters, padded with 0s if
.I n
begins with a 0, and space characters otherwise.
.I f
must be either `d' or `x' or `X', specifying a decimal, lower-case
hexdecimal, or uppercase hexdecimal representation of
.BR port .
If the null string (``""'') is used, no replacements will be done.
.TP
.B host
.I hostname
@ -422,6 +495,35 @@ You must also set the
option as well.
Only consoles of type ``host'' will use this value.
.TP
.B idlestring
.RI [ " string "
| "" ]
.br
Assign the
.I string
that is sent to the console once the console is idle for an
.I idletimeout
amount of time.
If the null string (``""'') is used, the string is unset and
the default is used.
The string is interpreted just as a
.B break
string is interpreted (see the
.B break
configuration items for details) where all delays specified (via ``\ed'')
use the default delay time.
The default string is ``\en''.
.TP
.B idletimeout
.BR \fInumber\fP [ s | m | h ]
.br
Set the idle timeout of the console to
.I number
seconds. If an `s', `m', or `h' is used after
.IR number ,
the specified time is interpreted as seconds, minutes, or hours.
Set the timeout to zero to disable the idle timeout (the default).
.TP
.B include
.I default
.br
@ -451,7 +553,7 @@ nothing is invoked.
.br
Assign the logfile specified by
.I filename
to the console. Any occurance of ``&'' in
to the console. Any occurrence of ``&'' in
.I filename
will be replaced with the name of the console.
If the null string (``""'') is used, the logfile name is unset and
@ -606,17 +708,50 @@ Set the port used to access the console.
The port may be specified as a
.I number
or a
.IR name ,
in which case it will use
.IR name .
A
.I name
will cause a
.BR getservbyname (3)
to look up a port number.
call to look up the port number.
The
.BR port ,
.BR portbase ,
and
.B portinc
values are all used to calculate the final port number to connect to.
The formula used is
.IR finalport " = "
.BR portbase " + "
.BR portinc " * " port .
By using proper values in the formula, you can reference ports on a
terminal server by their physical numbering of 1 through
.IR n .
You must also set the
.B host
option as well.
Only consoles of type ``host'' will use this value.
.TP
.B portbase
.I number
.br
Set the base value for the port calculation formula.
The default is zero.
See
.B port
for the details of the formula.
.TP
.B portinc
.I number
.br
Set the increment value for the port calculation formula.
The default is one.
See
.B port
for the details of the formula.
.TP
.B ro
.RI [ " username" ,...
.RI "[ [\fB!\fP]" username ,...
| "" ]
.br
Define a list of users making up the read-only access list
@ -624,12 +759,15 @@ for the console.
If
.I username
matches a previously defined group name, all members of the previous
group are added to the read-only access list.
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 the null string (``""'') is used, any
users previously defined for the console's read-only list are removed.
.TP
.B rw
.RI [ " username" ,...
.RI "[ [\fB!\fP]" username ,...
| "" ]
.br
Define a list of users making up the read-write access list
@ -637,7 +775,10 @@ for the console.
If
.I username
matches a previously defined group name, all members of the previous
group are added to the read-write access list.
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 the null string (``""'') is used, any
users previously defined for the console's read-write list are removed.
.TP
@ -702,7 +843,7 @@ Define a user group identified as
.RS
.TP 15
.B users
.RI [ " username" ,...
.RI "[ [\fB!\fP]" username ,...
| "" ]
.br
Define a list of users making up the group
@ -710,7 +851,10 @@ Define a list of users making up the group
If
.I username
matches a previously defined group name, all members of the previous
group are added to the current group.
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 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.9 2003-07-04 13:20:52-07 bryan Exp $
.TH CONSERVER.PASSWD 5 "2003-07-04" "conserver-8.0.5" "conserver"
.\" $Id: conserver.passwd.man,v 1.9 2003/07/04 20:20:52 bryan Exp $
.TH CONSERVER.PASSWD 5 "2003/07/04" "conserver-8.0.6" "conserver"
.SH NAME
conserver.passwd \- user access information for
.BR conserver (8)

View File

@ -1,5 +1,5 @@
%!PS-Adobe-2.0 EPSF-1.2
%%$Id: label.ps,v 1.8 94/01/21 09:37:42 ksb Exp $
%%$Id: label.ps,v 1.1 2003/11/04 02:36:26 bryan Exp $
%%Title: RJ-11
%%Creator: A Braunsdorf
%%CreationDate:

View File

@ -1,6 +1,6 @@
# dummy conserver config file
#
# $Id: test.cf,v 1.2 2003-07-04 11:04:05-07 bryan Exp $
# $Id: test.cf,v 1.2 2003/07/04 18:04:05 bryan Exp $
#
default full {
rw *;

View File

@ -183,11 +183,11 @@
<H3>Downloading</H3>
<P>The current version, released on Oct 31,2003, is <A
href="8.0.5.tar.gz">8.0.5.tar.gz</A>. You can get it via
<P>The current version, released on Nov 16, 2003, is <A
href="8.0.6.tar.gz">8.0.6.tar.gz</A>. You can get it via
<A href=
"ftp://ftp.conserver.com/conserver/8.0.5.tar.gz">FTP</A>
or <A href="8.0.5.tar.gz">HTTP</A>. See the <A href=
"ftp://ftp.conserver.com/conserver/8.0.6.tar.gz">FTP</A>
or <A href="8.0.6.tar.gz">HTTP</A>. See the <A href=
"CHANGES">CHANGES</A> file for information on the latest
updates.</P>

View File

@ -1,4 +1,4 @@
# $Id: Sun-serial,v 2.1 93/02/09 11:45:12 ldv Exp $
# $Id: Sun-serial,v 1.1 2003/11/04 02:36:25 bryan Exp $
If you are going to be hooking Sun consoles to your console server, you
will run into a problem: The sun will halt whenever the cable is unplugged.

View File

@ -1,5 +1,5 @@
/*
* $Id: access.c,v 5.68 2003-10-19 22:52:21-07 bryan Exp $
* $Id: access.c,v 5.70 2003/11/04 19:41:00 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -137,28 +137,54 @@ AccType(addr, peername)
socklen_t so;
struct hostent *he = (struct hostent *)0;
int a;
char ret;
#if TRUST_REVERSE_DNS
char *pcName;
int wlen;
char *hname;
int len;
char **revNames = (char **)0;
#endif
CONDDEBUG((1, "AccType(): ip=%s", inet_ntoa(*addr)));
ret = config->defaultaccess;
so = sizeof(*addr);
#if TRUST_REVERSE_DNS
/* if we trust reverse dns, we get the names associated with
* the address we're checking and then check each of those
* against the access list entries (below).
*/
if ((he =
gethostbyaddr((char *)addr, so,
AF_INET)) == (struct hostent *)0) {
Error("AccType(): gethostbyaddr(%s): %s", inet_ntoa(*addr),
hstrerror(h_errno));
} else {
char *hname;
if (he->h_name != (char *)0) {
/* count up the number of names */
for (a = 0, hname = he->h_aliases[a]; hname != (char *)0;
hname = he->h_aliases[++a]);
a += 2; /* h_name + (char *)0 */
/* now duplicate them */
if ((revNames =
(char **)calloc(a, sizeof(char *))) != (char **)0) {
for (hname = he->h_name, a = 0; hname != (char *)0;
hname = he->h_aliases[a++]) {
if ((revNames[a] = StrDup(hname)) == (char *)0)
break;
CONDDEBUG((1,"AccType(): revNames[%d]='%s'", a, hname));
}
}
}
}
#endif
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
pACtmp->ctrust));
if (pACtmp->isCIDR != 0) {
if (AddrCmp(addr, pACtmp->pcwho) == 0) {
if (config->loghostnames == FLAGTRUE &&
(he =
gethostbyaddr((char *)addr, so,
AF_INET)) != (struct hostent *)0) {
*peername = he->h_name;
}
return pACtmp->ctrust;
ret = pACtmp->ctrust;
goto common_ret;
}
continue;
}
@ -166,82 +192,83 @@ AccType(addr, peername)
if ((he = gethostbyname(pACtmp->pcwho)) == (struct hostent *)0) {
Error("AccType(): gethostbyname(%s): %s", pACtmp->pcwho,
hstrerror(h_errno));
continue;
}
if (4 != he->h_length || AF_INET != he->h_addrtype) {
} else if (4 != he->h_length || AF_INET != he->h_addrtype) {
Error
("AccType(): gethostbyname(%s): wrong address size (4 != %d) or address family (%d != %d)",
pACtmp->pcwho, he->h_length, AF_INET, he->h_addrtype);
continue;
}
for (a = 0; he->h_addr_list[a] != (char *)0; a++) {
CONDDEBUG((1, "AccType(): addr=%s",
inet_ntoa(*(struct in_addr *)
(he->h_addr_list[a]))));
if (
} else {
for (a = 0; he->h_addr_list[a] != (char *)0; a++) {
CONDDEBUG((1, "AccType(): addr=%s",
inet_ntoa(*(struct in_addr *)
(he->h_addr_list[a]))));
if (
#if HAVE_MEMCMP
memcmp(&(addr->s_addr), he->h_addr_list[a],
he->h_length)
memcmp(&(addr->s_addr), he->h_addr_list[a],
he->h_length)
#else
bcmp(&(addr->s_addr), he->h_addr_list[a], he->h_length)
bcmp(&(addr->s_addr), he->h_addr_list[a],
he->h_length)
#endif
== 0) {
if (config->loghostnames == FLAGTRUE &&
(he =
gethostbyaddr((char *)addr, so,
AF_INET)) != (struct hostent *)0) {
*peername = he->h_name;
== 0) {
ret = pACtmp->ctrust;
goto common_ret;
}
return pACtmp->ctrust;
}
}
#if TRUST_REVERSE_DNS
/* we chop bits off client names so that we can put domain
* names in access lists or even top-level domains.
* allowed conserver.com, net;
* this allows anything from conserver.com and anything in
* the .net top-level. without TRUST_REVERSE_DNS, those names
* better map to ip addresses for them to take effect.
*/
if (revNames != (char **)0) {
char *pcName;
int wlen;
int len;
wlen = strlen(pACtmp->pcwho);
for (a = 0; revNames[a] != (char *)0; a++) {
for (pcName = revNames[a], len = strlen(pcName);
len >= wlen; len = strlen(++pcName)) {
CONDDEBUG((1, "AccType(): name=%s", pcName));
if (strcasecmp(pcName, pACtmp->pcwho) == 0) {
if (peername != (char **)0)
*peername = StrDup(revNames[a]);
ret = pACtmp->ctrust;
goto common_ret2;
}
pcName = strchr(pcName, '.');
if (pcName == (char *)0)
break;
}
}
}
#endif
}
common_ret:
if (config->loghostnames == FLAGTRUE && peername != (char **)0) {
#if TRUST_REVERSE_DNS
/* if we trust reverse dns, we get the names associated with
* the address we're checking and then check each of those
* against the access list entries.
* we chop bits off client names so that we can put domain
* names in access lists or even top-level domains.
* allowed conserver.com, net;
* this allows anything from conserver.com and anything in
* the .net top-level. without TRUST_REVERSE_DNS, those names
* better map to ip addresses for them to take effect.
*/
if ((he =
gethostbyaddr((char *)addr, so,
AF_INET)) == (struct hostent *)0) {
Error("AccType(): gethostbyaddr(%s): %s", inet_ntoa(*addr),
hstrerror(h_errno));
return config->defaultaccess;
}
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
if (pACtmp->isCIDR != 0)
continue;
wlen = strlen(pACtmp->pcwho);
for (hname = he->h_name, a = 0; hname != (char *)0;
hname = he->h_aliases[a++]) {
for (pcName = hname, len = strlen(pcName); len >= wlen;
len = strlen(++pcName)) {
CONDDEBUG((1, "AccType(): name=%s", pcName));
if (strcasecmp(pcName, pACtmp->pcwho) == 0) {
*peername = hname;
return pACtmp->ctrust;
}
pcName = strchr(pcName, '.');
if (pcName == (char *)0)
break;
}
if (revNames != (char **)0 && revNames[0] != (char *)0)
*peername = StrDup(revNames[0]);
#else
if ((he =
gethostbyaddr((char *)addr, so,
AF_INET)) != (struct hostent *)0) {
*peername = StrDup(he->h_name);
}
#endif
}
#if TRUST_REVERSE_DNS
common_ret2:
if (revNames != (char **)0) {
for (a = 0; revNames[a] != (char *)0; a++)
free(revNames[a]);
free(revNames);
}
#endif
if (config->loghostnames == FLAGTRUE &&
(he =
gethostbyaddr((char *)addr, so,
AF_INET)) != (struct hostent *)0) {
*peername = he->h_name;
}
return config->defaultaccess;
return ret;
}
void

View File

@ -1,5 +1,5 @@
/*
* $Id: access.h,v 5.26 2003-08-10 11:11:20-07 bryan Exp $
* $Id: access.h,v 5.26 2003/08/10 18:11:20 bryan Exp $
*
* Copyright conserver.com, 2000
*

View File

@ -1,5 +1,5 @@
/*
* $Id: client.c,v 5.72 2003-10-02 18:49:13-07 bryan Exp $
* $Id: client.c,v 5.75 2003/11/16 15:35:33 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -246,8 +246,9 @@ Replay(fdLog, fdOut, iBack)
InitString(lines[ln].line);
} else {
BuildString((char *)0, lines[ln - 1].line);
BuildString(lines[ln].line->string,
lines[ln - 1].line);
BuildStringN(lines[ln].line->string,
lines[ln].line->used - 1,
lines[ln - 1].line);
BuildString((char *)0, lines[ln].line);
}
ln--;
@ -313,8 +314,9 @@ Replay(fdLog, fdOut, iBack)
if ((char *)0 != s) {
*s = '\000';
}
FileWrite(fdOut, FLAGTRUE, lines[i].line->string, -1);
FileWrite(fdOut, FLAGTRUE, " .. ", -1);
FileWrite(fdOut, FLAGTRUE, lines[i].line->string,
lines[i].line->used - 1);
FileWrite(fdOut, FLAGTRUE, " .. ", 4);
/* build the end string by removing the leading "[-- MARK -- "
* and replacing "]\r\n" on the end with " -- MARK --]\r\n"
@ -331,7 +333,8 @@ Replay(fdLog, fdOut, iBack)
u = lines[i].mark_end->used;
s = lines[i].mark_end->string;
} else
FileWrite(fdOut, FLAGFALSE, lines[i].line->string, -1);
FileWrite(fdOut, FLAGFALSE, lines[i].line->string,
lines[i].line->used - 1);
}
common_exit:
@ -399,7 +402,6 @@ static HELP aHLTable[] = {
{WHEN_ALWAYS, "^R replay the last line"},
{WHEN_ATTACH, "\\ooo send character by octal code"},
{WHEN_EXPERT, "^I toggle tab expansion"},
{WHEN_EXPERT, "; change to another console"},
{WHEN_EXPERT, "+(-) do (not) drop line"},
{WHEN_VT100, "PF1 print this message"},
{WHEN_VT100, "PF2 disconnect"},
@ -449,12 +451,14 @@ HelpUser(pCL)
}
BuildString(aHLTable[i].actext, acLine);
BuildString(acEoln, acLine);
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
acLine->used - 1);
BuildString((char *)0, acLine);
continue;
} else {
BuildString(acEoln, acLine);
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
acLine->used - 1);
BuildString((char *)0, acLine);
}
}
@ -463,14 +467,15 @@ HelpUser(pCL)
BuildString(aHLTable[i].actext, acLine);
if (acLine->used > HALFLINE) {
BuildString(acEoln, acLine);
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
acLine->used - 1);
BuildString((char *)0, acLine);
}
}
}
if (acLine->used != 0) {
BuildString(acEoln, acLine);
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
FileWrite(pCL->fd, FLAGTRUE, acLine->string, acLine->used - 1);
}
FileWrite(pCL->fd, FLAGFALSE, (char *)0, 0);
}
@ -530,5 +535,7 @@ ClientAccessOk(pCL)
else
BuildString("<unknown>", pCL->peername);
}
if (peername != (char *)0)
free(peername);
return retval;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: client.h,v 5.33 2003-10-10 03:28:49-07 bryan Exp $
* $Id: client.h,v 5.33 2003/10/10 10:28:49 bryan Exp $
*
* Copyright conserver.com, 2000
*

View File

@ -1,5 +1,5 @@
/*
* $Id: consent.c,v 5.128 2003-09-30 13:14:04-07 bryan Exp $
* $Id: consent.c,v 5.130 2003/11/08 05:16:36 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -792,6 +792,9 @@ ConsInit(pCE)
} else {
pCE->ioState = INCONNECT;
pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT;
if (timers[T_STATE] == (time_t)0 ||
timers[T_STATE] > pCE->stateTimer)
timers[T_STATE] = pCE->stateTimer;
pCE->fup = 1;
}
break;
@ -843,9 +846,18 @@ ConsInit(pCE)
if (maxfd < cofile + 1)
maxfd = cofile + 1;
tyme = time((time_t *)0);
if (pCE->ioState == ISNORMAL) {
pCE->lastWrite = tyme;
if (pCE->idletimeout != (time_t)0 &&
(timers[T_IDLE] == (time_t)0 ||
timers[T_IDLE] > pCE->lastWrite + pCE->idletimeout))
timers[T_IDLE] = pCE->lastWrite + pCE->idletimeout;
}
/* If we have marks, adjust the next one so that it's in the future */
if (pCE->nextMark > 0) {
tyme = time((time_t *)0);
if (tyme >= pCE->nextMark) {
/* Add as many pCE->mark values as necessary so that we move
* beyond the current time.
@ -856,7 +868,10 @@ ConsInit(pCE)
}
if (pCE->downHard == FLAGTRUE) {
Msg("[%s] console up", pCE->server);
if (pCE->ioState == ISNORMAL)
Msg("[%s] console up", pCE->server);
else
Msg("[%s] console inititalizing", pCE->server);
pCE->downHard = FLAGFALSE;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: consent.h,v 5.48 2003-10-02 18:49:03-07 bryan Exp $
* $Id: consent.h,v 5.52 2003/11/15 20:00:08 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -65,6 +65,7 @@ typedef struct names {
typedef struct consentUsers {
NAMES *user;
short not;
struct consentUsers *next;
} CONSENTUSERS;
@ -78,6 +79,7 @@ typedef struct consent { /* console information */
NAMES *aliases; /* aliases for server name */
/* type == DEVICE */
char *device; /* device file */
char *devicesubst; /* device substitution pattern */
BAUD *baud; /* the baud on this console port */
PARITY *parity; /* the parity on this line */
FLAG hupcl; /* use HUPCL */
@ -90,15 +92,20 @@ typedef struct consent { /* console information */
#endif
/* type == HOST */
char *host; /* hostname */
unsigned short port; /* port number */
unsigned short port; /* port number socket = portbase + */
unsigned short portbase; /* port base portinc * port */
unsigned short portinc; /* port increment */
/* type == EXEC */
char *exec; /* exec command */
char *execsubst; /* exec substitution pattern */
/* global stuff */
char *master; /* master hostname */
unsigned short breakNum; /* break type [1-9] */
char *logfile; /* logfile */
char *initcmd; /* initcmd command */
char *motd; /* motd */
time_t idletimeout; /* idle timeout */
char *idlestring; /* string to print when idle */
/* timestamp stuff */
int mark; /* Mark (chime) interval */
long nextMark; /* Next mark (chime) time */
@ -123,6 +130,7 @@ typedef struct consent { /* console information */
int wbufIAC; /* next IAC location in wbuf */
IOSTATE ioState; /* state of the socket */
time_t stateTimer; /* timer for ioState states */
time_t lastWrite; /* time of last data sent to console */
/*** state information ***/
char acline[132 * 2 + 2]; /* max chars we will call a line */

View File

@ -1,6 +1,6 @@
.\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine
.\" $Id: conserver.man,v 1.38 2003-09-22 08:33:41-07 bryan Exp $
.TH CONSERVER 8 "2003-09-22" "conserver-8.0.5" "conserver"
.\" $Id: conserver.man,v 1.40 2003/11/10 15:37:24 bryan Exp $
.TH CONSERVER 8 "2003/11/10" "conserver-8.0.6" "conserver"
.SH NAME
conserver \- console server daemon
.SH SYNOPSIS
@ -26,6 +26,8 @@ conserver \- console server daemon
.IR logfile ]
.RB [ \-O
.IR min ]
.RB [ \-U
.IR logfile ]
.SH DESCRIPTION
.B Conserver
is the daemon that manages
@ -93,7 +95,7 @@ Close all connections and exit.
.TP
SIGHUP
Reread the configuration file.
New consoles are managed by forking off new childen, deleted
New consoles are managed by forking off new children, deleted
consoles (and their clients) are dropped,
and changes to consoles are done "in place", resetting the console
port (bringing it down and up) only when necessary.
@ -147,7 +149,7 @@ the signing certificate must be properly trusted, which usually means
the public portion is in
.IB OPENSSL_ROOT /ssl/certs
(on both the client and server sides).
See the sample self-signing certficate making script
See the sample self-signing certificate making script
.B contrib/maketestcerts
for further clues.
To allow
@ -332,6 +334,17 @@ independent of whether logging of individual consoles is enabled via
.B conserver.cf
entries.
.TP
.BI \-U logfile
Copy all console data to the ``unified''
.IR logfile .
The output is the same as the
.B \-u
output, but all consoles, not
just those without a user, are logged.
Each line of output is prefixed with the console name.
If a user is attached read/write, a `*' is appended to the console name,
to allow log watching utilites to ignore potential user-introduced alarms.
.TP
.B \-v
Echo the configuration as it is being read (be verbose).
.TP

View File

@ -1,4 +0,0 @@
bryan:r71mXjfALB5Ak:any
djs:r71mXjfALB5Ak:login
chogan:*passwd*:foobar,login,shell
hogan:*passwd*:any

View File

@ -1,5 +1,5 @@
/*
* $Id: convert.c,v 1.7 2003-08-15 14:24:39-07 bryan Exp $
* $Id: convert.c,v 1.7 2003/08/15 21:24:39 bryan Exp $
*
* Copyright conserver.com, 2000
*

View File

@ -1,5 +1,5 @@
/*
* $Id: fallback.c,v 5.59 2003-10-03 06:32:34-07 bryan Exp $
* $Id: fallback.c,v 5.59 2003/10/03 13:32:34 bryan Exp $
*
* Copyright conserver.com, 2000
*

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* $Id: group.h,v 5.38 2003-09-19 08:58:18-07 bryan Exp $
* $Id: group.h,v 5.41 2003/11/15 20:00:09 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -34,6 +34,14 @@
* 4. This notice may not be removed or altered.
*/
/* timers used to have various things happen */
#define T_STATE 0
#define T_IDLE 1
#define T_MARK 2
#define T_REINIT 3
#define T_AUTOUP 4
#define T_MAX 5 /* T_MAX *must* be last */
/* return values used by CheckPass()
*/
#define AUTH_SUCCESS 0 /* ok */
@ -52,22 +60,25 @@ typedef struct grpent { /* group info */
struct grpent *pGEnext; /* next group entry */
} GRPENT;
extern time_t timers[];
extern void Spawn PARAMS((GRPENT *));
extern int CheckPass PARAMS((char *, char *));
extern void TagLogfile PARAMS((const CONSENT *, char *, ...));
extern void TagLogfileAct PARAMS((const CONSENT *, char *, ...));
extern void CleanupBreak PARAMS((short));
extern void DestroyGroup PARAMS((GRPENT *));
extern void DestroyConsent PARAMS((GRPENT *, CONSENT *));
extern void SendClientsMsg PARAMS((CONSENT *, char *));
extern void ResetMark PARAMS((void));
extern void DestroyConsentUsers PARAMS((CONSENTUSERS **));
extern CONSENTUSERS *ConsentFindUser PARAMS((CONSENTUSERS *, char *));
extern int ConsentUserOk PARAMS((CONSENTUSERS *, char *));
extern void DisconnectClient
PARAMS((GRPENT *, CONSCLIENT *, char *, FLAG));
extern int ClientAccess PARAMS((CONSENT *, char *));
extern void DestroyClient PARAMS((CONSCLIENT *));
extern int CheckPasswd PARAMS((CONSCLIENT *, char *));
extern void ExpandString PARAMS((char *, CONSENT *, short));
#if HAVE_OPENSSL
extern int AttemptSSL PARAMS((CONSCLIENT *));
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: main.c,v 5.163 2003-10-31 09:55:04-08 bryan Exp $
* $Id: main.c,v 5.171 2003/11/16 19:29:20 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -65,7 +65,7 @@ char *interface = (char *)0;
CONFIG defConfig =
{ (STRING *)0, 'r', FLAGFALSE, LOGFILEPATH, PASSWDFILE, DEFPORT,
FLAGTRUE,
FLAGTRUE, 0, DEFBASEPORT
FLAGTRUE, 0, DEFBASEPORT, (char *)0
#if HAVE_SETPROCTITLE
, FLAGFALSE
#endif
@ -75,6 +75,7 @@ CONFIG defConfig =
};
struct sockaddr_in in_port;
CONSFILE *unifiedlog = (CONSFILE *)0;
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
unsigned long dmallocMarkMain = 0;
@ -424,6 +425,31 @@ ReopenLogfile()
tag = 0;
}
void
#if PROTOTYPES
ReopenUnifiedlog(void)
#else
ReopenUnifiedlog()
#endif
{
/* close any existing */
if (unifiedlog != (CONSFILE *)0)
FileClose(&unifiedlog);
/* return if we aren't opening again */
if (config->unifiedlog == (char *)0)
return;
/* open a new one */
if ((unifiedlog =
FileOpen(config->unifiedlog, O_WRONLY | O_CREAT | O_APPEND,
0644)) == (CONSFILE *)0) {
Error("ReopenUnifiedlog(): open(%s): %s", config->unifiedlog,
strerror(errno));
return;
}
}
/* become a daemon (ksb)
*/
static void
@ -497,7 +523,7 @@ Usage(wantfull)
#endif
{
static char u_terse[] =
"[-7dDEFhinoRSuvV] [-a type] [-m max] [-M addr] [-p port] [-b port] [-c cred] [-C config] [-P passwd] [-L logfile] [-O min]";
"[-7dDEFhinoRSuvV] [-a type] [-m max] [-M addr] [-p port] [-b port] [-c cred] [-C config] [-P passwd] [-L logfile] [-O min] [-U logfile]";
static char *full[] = {
"7 strip the high bit off all console data",
"a type set the default access type",
@ -529,6 +555,7 @@ Usage(wantfull)
"R disable automatic client redirection",
"S syntax check of configuration file",
"u copy \"unloved\" console data to stdout",
"U logfile copy all console data to the \"unified\" logfile",
"v be verbose on startup",
"V output version info",
(char *)0
@ -565,6 +592,9 @@ Version()
#endif
#if HAVE_PAM
"pam",
#endif
#if TRUST_REVERSE_DNS
"trustrevdns",
#endif
(char *)0
};
@ -727,6 +757,10 @@ SummarizeDataStructures()
size += strlen(pCE->initcmd);
if (pCE->execSlave != (char *)0)
size += strlen(pCE->execSlave);
if (pCE->motd != (char *)0)
size += strlen(pCE->motd);
if (pCE->idlestring != (char *)0)
size += strlen(pCE->idlestring);
if (pCE->fdlog != (CONSFILE *)0)
size += sizeof(CONSFILE);
if (pCE->cofile != (CONSFILE *)0)
@ -903,18 +937,22 @@ DumpDataStructures()
"DumpDataStructures(): initpid=%lu, initcmd=%s, initfile=%d",
(unsigned long)pCE->initpid, EMPTYSTR(pCE->initcmd),
FileFDNum(pCE->initfile)));
CONDDEBUG((1,
"DumpDataStructures(): motd=%s, idletimeout=%d, idlestring=%s",
EMPTYSTR(pCE->motd), pCE->idletimeout,
EMPTYSTR(pCE->idlestring)));
if (pCE->ro) {
CONSENTUSERS *u;
for (u = pCE->ro; u != (CONSENTUSERS *)0; u = u->next) {
CONDDEBUG((1, "DumpDataStructures(): ro=%s",
u->user->name));
CONDDEBUG((1, "DumpDataStructures(): ro=%s%s",
(u->not ? "!" : ""), u->user->name));
}
}
if (pCE->rw) {
CONSENTUSERS *u;
for (u = pCE->rw; u != (CONSENTUSERS *)0; u = u->next) {
CONDDEBUG((1, "DumpDataStructures(): rw=%s",
u->user->name));
CONDDEBUG((1, "DumpDataStructures(): rw=%s%s",
(u->not ? "!" : ""), u->user->name));
}
}
CONDDEBUG((1, "DumpDataStructures(): ------"));
@ -1133,7 +1171,7 @@ main(argc, argv)
{
int i;
FILE *fpConfig = (FILE *)0;
static char acOpts[] = "7a:b:c:C:dDEFhiL:m:M:noO:p:P:RSuVv";
static char acOpts[] = "7a:b:c:C:dDEFhiL:m:M:noO:p:P:RSuU:Vv";
extern int optopt;
extern char *optarg;
struct passwd *pwd;
@ -1278,6 +1316,10 @@ main(argc, argv)
case 'u':
fAll = 1;
break;
case 'U':
if ((optConf->unifiedlog = StrDup(optarg)) == (char *)0)
OutOfMem();
break;
case 'V':
fVersion = 1;
break;
@ -1368,6 +1410,9 @@ main(argc, argv)
}
ProbeInterfaces();
/* initialize the timers */
for (i = 0; i < T_MAX; i++)
timers[i] = (time_t)0;
/* read the config file */
if ((FILE *)0 == (fpConfig = fopen(pcConfig, "r"))) {
@ -1400,8 +1445,7 @@ main(argc, argv)
struct servent *pSE;
if ((struct servent *)0 ==
(pSE = getservbyname(config->primaryport, "tcp"))) {
Error("getservbyname(%s): %s", config->primaryport,
strerror(errno));
Error("getservbyname(%s) failed", config->primaryport);
Bye(EX_OSERR);
} else {
bindPort = ntohs((unsigned short)pSE->s_port);
@ -1431,8 +1475,7 @@ main(argc, argv)
struct servent *pSE;
if ((struct servent *)0 ==
(pSE = getservbyname(config->secondaryport, "tcp"))) {
Error("getservbyname(%s): %s", config->secondaryport,
strerror(errno));
Error("getservbyname(%s) failed", config->secondaryport);
Bye(EX_OSERR);
} else {
bindBasePort = ntohs((unsigned short)pSE->s_port);
@ -1492,6 +1535,19 @@ main(argc, argv)
else
config->loghostnames = defConfig.loghostnames;
if (optConf->unifiedlog != (char *)0) {
config->unifiedlog = StrDup(optConf->unifiedlog);
if (config->unifiedlog == (char *)0)
OutOfMem();
} else if (pConfig->unifiedlog != (char *)0) {
config->unifiedlog = StrDup(pConfig->unifiedlog);
if (config->unifiedlog == (char *)0)
OutOfMem();
} else if (defConfig.unifiedlog != (char *)0) {
config->unifiedlog = StrDup(defConfig.unifiedlog);
if (config->unifiedlog == (char *)0)
OutOfMem();
}
#if HAVE_OPENSSL
if (optConf->sslrequired != FLAGUNKNOWN)
config->sslrequired = optConf->sslrequired;
@ -1508,6 +1564,15 @@ main(argc, argv)
config->sslcredentials = StrDup(defConfig.sslcredentials);
#endif
#if HAVE_SETPROCTITLE
if (optConf->setproctitle != FLAGUNKNOWN)
config->setproctitle = optConf->setproctitle;
else if (pConfig->setproctitle != FLAGUNKNOWN)
config->setproctitle = pConfig->setproctitle;
else
config->setproctitle = defConfig.setproctitle;
#endif
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
dmallocMarkMain = dmalloc_mark();
#endif
@ -1523,6 +1588,8 @@ main(argc, argv)
if (config->daemonmode == FLAGTRUE)
Daemonize();
ReopenUnifiedlog();
/* if no one can use us we need to come up with a default
*/
if (pACList == (ACCESS *)0)
@ -1584,6 +1651,9 @@ main(argc, argv)
SignalKids(SIGTERM);
}
if (unifiedlog != (CONSFILE *)0)
FileClose(&unifiedlog);
DumpDataStructures();
Msg("terminated");

View File

@ -1,5 +1,5 @@
/*
* $Id: main.h,v 5.50 2003-10-19 22:52:37-07 bryan Exp $
* $Id: main.h,v 5.51 2003/11/10 15:37:24 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -48,8 +48,10 @@ extern int isMaster;
extern CONFIG *optConf;
extern CONFIG *config;
extern CONFIG defConfig;
extern CONSFILE *unifiedlog;
#if HAVE_OPENSSL
extern SSL_CTX *ctx;
#endif
extern void ReopenLogfile PARAMS((void));
extern void ReopenUnifiedlog PARAMS((void));
extern void DumpDataStructures PARAMS((void));

View File

@ -1,5 +1,5 @@
/*
* $Id: master.c,v 5.118 2003-10-10 03:29:21-07 bryan Exp $
* $Id: master.c,v 5.122 2003/11/16 19:29:20 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -466,7 +466,7 @@ DoNormalRead(pCLServing)
return;
}
Verbose("<master> login %s", pCLServing->acid->string);
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", -1);
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", 4);
pCLServing->iState = S_NORMAL;
BuildString((char *)0, pCLServing->accmd);
continue;
@ -549,7 +549,7 @@ DoNormalRead(pCLServing)
pCLServing->iState = S_NORMAL;
Verbose("<master> login %s",
pCLServing->acid->string);
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", -1);
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", 4);
} else {
FilePrint(pCLServing->fd, FLAGFALSE,
"passwd? %s\r\n", myHostname);
@ -599,9 +599,7 @@ DoNormalRead(pCLServing)
THIS_VERSION);
} else if (pCLServing->iState == S_NORMAL &&
strcmp(pcCmd, "quit") == 0) {
if (ConsentFindUser(pADList, pCLServing->username->string) !=
(CONSENTUSERS *)0 ||
ConsentFindUser(pADList, "*") != (CONSENTUSERS *)0) {
if (ConsentUserOk(pADList, pCLServing->username->string) == 1) {
Verbose("quit command by %s", pCLServing->acid->string);
FileWrite(pCLServing->fd, FLAGFALSE,
"ok -- terminated\r\n", -1);
@ -613,9 +611,7 @@ DoNormalRead(pCLServing)
"unauthorized command\r\n", -1);
} else if (pCLServing->iState == S_NORMAL &&
strcmp(pcCmd, "restart") == 0) {
if (ConsentFindUser(pADList, pCLServing->username->string) !=
(CONSENTUSERS *)0 ||
ConsentFindUser(pADList, "*") != (CONSENTUSERS *)0) {
if (ConsentUserOk(pADList, pCLServing->username->string) == 1) {
FileWrite(pCLServing->fd, FLAGFALSE,
"ok -- restarting\r\n", -1);
Verbose("restart command by %s", pCLServing->acid->string);
@ -635,7 +631,7 @@ DoNormalRead(pCLServing)
pGE->port);
iSep = 0;
}
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", 2);
} else if (pCLServing->iState == S_NORMAL &&
strcmp(pcCmd, "call") == 0) {
if (pcArgs == (char *)0)
@ -762,6 +758,7 @@ Master()
fSawHUP = 0;
Msg("processing SIGHUP");
ReopenLogfile();
ReopenUnifiedlog();
SignalKids(SIGHUP);
ReReadCfg(msfd);
/* fix up the client descriptors since ReReadCfg() doesn't
@ -783,6 +780,7 @@ Master()
fSawUSR2 = 0;
Msg("processing SIGUSR2");
ReopenLogfile();
ReopenUnifiedlog();
SignalKids(SIGUSR2);
}
if (fSawQuit) { /* Something above set the quit flag */
@ -925,11 +923,13 @@ Master()
if (ClientAccessOk(pCL)) {
pCL->ioState = ISNORMAL;
/* say hi to start */
FileWrite(pCL->fd, FLAGFALSE, "ok\r\n", -1);
FileWrite(pCL->fd, FLAGFALSE, "ok\r\n", 4);
} else
DropMasterClient(pCL, FLAGFALSE);
}
close(msfd);
/* clean up the free list */
while (pCLmfree != (CONSCLIENT *)0) {
pCL = pCLmfree->pCLnext;

View File

@ -1,5 +1,5 @@
/*
* $Id: master.h,v 5.17 2003-10-03 07:23:37-07 bryan Exp $
* $Id: master.h,v 5.17 2003/10/03 14:23:37 bryan Exp $
*
* Copyright conserver.com, 2000
*

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,13 @@
/*
* $Id: readcfg.h,v 5.36 2003-10-31 09:54:44-08 bryan Exp $
* $Id: readcfg.h,v 5.38 2003/11/10 15:37:24 bryan Exp $
*
* Copyright conserver.com, 2000
*
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
*/
#define BREAKDELAYDEFAULT 250
typedef struct config {
STRING *name;
char defaultaccess;
@ -17,6 +19,7 @@ typedef struct config {
FLAG loghostnames;
int reinitcheck;
char *secondaryport;
char *unifiedlog;
#if HAVE_SETPROCTITLE
FLAG setproctitle;
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: util.c,v 1.102 2003-10-03 06:32:34-07 bryan Exp $
* $Id: util.c,v 1.105 2003/11/15 16:31:51 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -143,7 +143,10 @@ BuildString(str, msg)
CONDDEBUG((3, "BuildString(): 0x%lx reset", (void *)msg));
return msg->string;
}
len = strlen(str) + 1;
if (msg->used) /* string or string + null? */
len = strlen(str);
else
len = strlen(str) + 1;
if (msg->used + len >= msg->allocated) {
if (0 == msg->allocated) {
msg->allocated =
@ -161,13 +164,19 @@ BuildString(str, msg)
if (msg->string == (char *)0)
OutOfMem();
}
/* if msg->used, then len = strlen(), so we need to copy len + 1 to
* get the NULL which we overwrote with the copy */
#if HAVE_MEMCPY
memcpy(msg->string + (msg->used ? msg->used - 1 : 0), str, len);
#else
bcopy(str, msg->string + (msg->used ? msg->used - 1 : 0), len);
#endif
if (msg->used)
len--;
memcpy(msg->string + msg->used - 1, str, len + 1);
else
memcpy(msg->string, str, len);
#else
if (msg->used)
bcopy(str, msg->string + msg->used - 1, len + 1);
else
bcopy(str, msg->string, len);
#endif
msg->used += len;
CONDDEBUG((3, "BuildString(): 0x%lx added %d chars (%d/%d now)",
(void *)msg, len, msg->used, msg->allocated));
@ -195,12 +204,10 @@ BuildStringN(str, n, msg)
}
if (n <= 0)
return msg->string;
len = strlen(str) + 1;
if (len > n) { /* if we're a substring */
if (msg->used)
len = n;
if (str[n - 1] != '\000') /* if we aren't copying a '\000', */
len++; /* we need to add one at the end */
}
else
len = n + 1;
if (msg->used + len >= msg->allocated) {
if (0 == msg->allocated) {
msg->allocated =
@ -219,14 +226,12 @@ BuildStringN(str, n, msg)
OutOfMem();
}
#if HAVE_MEMCPY
memcpy(msg->string + (msg->used ? msg->used - 1 : 0), str, len);
memcpy(msg->string + (msg->used ? msg->used - 1 : 0), str, n);
#else
bcopy(str, msg->string + (msg->used ? msg->used - 1 : 0), len);
bcopy(str, msg->string + (msg->used ? msg->used - 1 : 0), n);
#endif
if (len > n) /* we need to terminate the string */
msg->string[(msg->used ? msg->used - 1 : 0) + len - 1] = '\000';
if (msg->used)
len--;
/* add a NULL */
msg->string[(msg->used ? msg->used - 1 : 0) + n] = '\000';
msg->used += len;
CONDDEBUG((3, "BuildStringN(): 0x%lx added %d chars (%d/%d now)",
(void *)msg, len, msg->used, msg->allocated));
@ -1281,9 +1286,13 @@ VWrite(cfp, bufferonly, str, fmt, ap)
{
int s, l, e;
char c;
int fmtlen = 0;
int fmtpre = 0;
short padzero = 0;
short sawdot = 0;
static STRING *msg = (STRING *)0;
static STRING *output = (STRING *)0;
static short flong, fneg;
short flong = 0, fneg = 0, fminus = 0;
if (fmt == (char *)0 || (cfp == (CONSFILE *)0 && str == (STRING *)0))
return;
@ -1295,18 +1304,12 @@ VWrite(cfp, bufferonly, str, fmt, ap)
BuildString((char *)0, output);
fneg = flong = 0;
for (e = s = l = 0; (c = fmt[s + l]) != '\000'; l++) {
if (c == '%') {
if (e) {
e = 0;
BuildStringChar('%', output);
} else {
e = 1;
BuildStringN(fmt + s, l, output);
s += l;
l = 0;
}
if (e == 0 && c == '%') {
e = 1;
BuildStringN(fmt + s, l, output);
s += l;
l = 0;
continue;
}
if (e) {
@ -1314,64 +1317,170 @@ VWrite(cfp, bufferonly, str, fmt, ap)
int u;
char *p;
char cc;
switch (c) {
case 'h':
/* noop since shorts are promoted to int in va_arg */
continue;
case 'l':
flong = 1;
continue;
case 'c':
cc = (char)va_arg(ap, int);
BuildStringChar(cc, output);
break;
case 's':
p = va_arg(ap, char *);
BuildString(p, output);
break;
case 'd':
i = (flong ? va_arg(ap, long) : (long)va_arg(ap, int));
if ((long)i < 0) {
fneg = 1;
i = -i;
}
goto number;
case 'u':
i = (flong ? va_arg(ap, unsigned long)
: (unsigned long)va_arg(ap, unsigned int));
number:
BuildString((char *)0, msg);
while (i >= 10) {
BuildStringChar((i % 10) + '0', msg);
i /= 10;
}
BuildStringChar(i + '0', msg);
/* reverse the text to put it in forward order
*/
u = msg->used - 1;
for (i = 0; i < u / 2; i++) {
char temp;
if (c >= '0' && c <= '9') {
if (sawdot == 0) {
if (c == '0' && fmtlen == 0)
padzero = 1;
fmtlen = fmtlen * 10 + (c - '0');
} else {
fmtpre = fmtpre * 10 + (c - '0');
}
} else {
switch (c) {
case '.':
sawdot = 1;
continue;
case '-':
fminus = 1;
continue;
case 'h':
/* noop since shorts are promoted to int in va_arg */
continue;
case 'l':
flong = 1;
continue;
case '%':
BuildStringChar('%', output);
break;
case 'c':
cc = (char)va_arg(ap, int);
BuildStringChar(cc, output);
break;
case 's':
p = va_arg(ap, char *);
{
int l = strlen(p);
int c;
if (fmtpre > 0 && fmtpre < l)
l = fmtpre;
if (fminus != 0)
BuildStringN(p, l, output);
for (c = l; c < fmtlen; c++)
BuildStringChar(' ', output);
if (fminus == 0)
BuildStringN(p, l, output);
}
break;
case 'd':
i = (flong ? va_arg(ap, long) : (long)
va_arg(ap, int));
if ((long)i < 0) {
fneg = 1;
i = -i;
}
goto number;
case 'u':
i = (flong ? va_arg(ap, unsigned long)
: (unsigned long)va_arg(ap, unsigned int));
number:
BuildString((char *)0, msg);
while (i >= 10) {
BuildStringChar((i % 10) + '0', msg);
i /= 10;
}
BuildStringChar(i + '0', msg);
if (fneg)
BuildStringChar('-', msg);
temp = msg->string[i];
msg->string[i]
= msg->string[u - i - 1];
msg->string[u - i - 1] = temp;
}
if (fneg) {
BuildStringChar('-', output);
fneg = 0;
}
BuildString(msg->string, output);
break;
default:
Error
("VWrite(): unknown conversion character `%c' in `%s'",
c, fmt);
break;
if (fmtpre > 0) {
padzero = 0;
if (fmtpre > fmtlen)
fmtlen = fmtpre;
while (msg->used - 1 < fmtpre)
BuildStringChar('0', msg);
}
/* reverse the text to put it in forward order
*/
u = msg->used - 1;
for (i = 0; i < u / 2; i++) {
char temp;
temp = msg->string[i];
msg->string[i]
= msg->string[u - i - 1];
msg->string[u - i - 1] = temp;
}
{
int l = msg->used - 1;
if (fminus != 0)
BuildString(msg->string, output);
for (; l < fmtlen; l++) {
if (padzero == 0 || fminus != 0)
BuildStringChar(' ', output);
else
BuildStringChar('0', output);
}
if (fminus == 0)
BuildString(msg->string, output);
}
break;
case 'X':
case 'x':
i = (flong ? va_arg(ap, unsigned long)
: (unsigned long)va_arg(ap, unsigned int));
BuildString((char *)0, msg);
while (i >= 16) {
if (i % 16 >= 10)
BuildStringChar((i % 16) - 10 +
(c == 'x' ? 'a' : 'A'),
msg);
else
BuildStringChar((i % 16) + '0', msg);
i /= 16;
}
if (i >= 10)
BuildStringChar(i - 10 +
(c == 'x' ? 'a' : 'A'), msg);
else
BuildStringChar(i + '0', msg);
if (fmtpre > 0) {
padzero = 0;
if (fmtpre > fmtlen)
fmtlen = fmtpre;
while (msg->used - 1 < fmtpre)
BuildStringChar('0', msg);
}
/* reverse the text to put it in forward order
*/
u = msg->used - 1;
for (i = 0; i < u / 2; i++) {
char temp;
temp = msg->string[i];
msg->string[i]
= msg->string[u - i - 1];
msg->string[u - i - 1] = temp;
}
{
int l = msg->used - 1;
if (fminus != 0)
BuildString(msg->string, output);
for (; l < fmtlen; l++) {
if (padzero == 0 || fminus != 0)
BuildStringChar(' ', output);
else
BuildStringChar('0', output);
}
if (fminus == 0)
BuildString(msg->string, output);
}
break;
default:
Error
("VWrite(): unknown conversion character `%c' in `%s'",
c, fmt);
break;
}
s += l + 1;
l = -1;
e = flong = fneg = fminus = 0;
fmtlen = fmtpre = sawdot = padzero = 0;
}
s += l + 1;
l = -1;
e = flong = 0;
}
}
if (l)
@ -1412,6 +1521,28 @@ BuildStringPrint(str, fmt, va_alist)
return str->string;
}
char *
#if PROTOTYPES
BuildTmpStringPrint(char *fmt, ...)
#else
BuildTmpStringPrint(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;
#if PROTOTYPES
va_start(ap, fmt);
#else
va_start(ap);
#endif
if (mymsg == (STRING *)0)
mymsg = AllocString();
VWrite((CONSFILE *)0, FLAGFALSE, mymsg, fmt, ap);
va_end(ap);
return mymsg->string;
}
void
#if PROTOTYPES
FileVWrite(CONSFILE *cfp, FLAG bufferonly, char *fmt, va_list ap)

View File

@ -1,5 +1,5 @@
/*
* $Id: util.h,v 1.55 2003-10-03 06:32:34-07 bryan Exp $
* $Id: util.h,v 1.56 2003/11/10 20:38:25 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -114,6 +114,7 @@ extern int FileUnopen PARAMS((CONSFILE *));
extern void OutOfMem PARAMS(());
extern char *BuildTmpString PARAMS((const char *));
extern char *BuildTmpStringChar PARAMS((const char));
extern char *BuildTmpStringPrint PARAMS((char *, ...));
extern char *BuildString PARAMS((const char *, STRING *));
extern char *BuildStringChar PARAMS((const char, STRING *));
extern char *BuildStringPrint PARAMS((STRING *, char *, ...));

View File

@ -1,5 +1,5 @@
/*
* $Id: version.h,v 1.51 2003-10-31 10:04:19-08 bryan Exp $
* $Id: version.h,v 1.52 2003/11/07 20:54:49 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.0.5"
#define THIS_VERSION "conserver.com version 8.0.6"

View File

@ -1,5 +1,5 @@
/*
* $Id: console.c,v 5.147 2003-10-03 15:21:34-07 bryan Exp $
* $Id: console.c,v 5.150 2003/11/15 16:32:21 bryan Exp $
*
* Copyright conserver.com, 2000
*
@ -55,8 +55,6 @@ CONSFILE *cfstdout;
char *pcUser = (char *)0;
int disconnectCount = 0;
static char acMesg[8192]; /* the buffer for startup negotiation */
#if HAVE_OPENSSL
SSL_CTX *ctx = (SSL_CTX *)0;
@ -696,6 +694,7 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
int i;
int justProcessedUrg = 0;
char *r = (char *)0;
static char acMesg[8192];
if (fVerbose) {
Msg("%s to %s (on %s)", pcHow, pcMach, pcMaster);
@ -770,8 +769,8 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
/* tell the conserver to change escape sequences, assume OK
* (we'll find out soon enough)
*/
sprintf(acMesg, "%c%ce%c%c", DEFATTN, DEFESC, chAttn, chEsc);
FileWrite(pcf, FLAGFALSE, acMesg, 5);
FilePrint(pcf, FLAGFALSE, "%c%ce%c%c", DEFATTN, DEFESC, chAttn,
chEsc);
r = ReadReply(pcf, 0);
if (strncmp(r, "[redef:", 7) != 0) {
Error("protocol botch on redef of escape sequence");
@ -806,15 +805,12 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
Error("%s is read-only", pcMach);
}
} else if (fIn != (*pcHow == 'f' ? 'a' : *pcHow)) {
sprintf(acMesg, "%c%c%c", chAttn, chEsc, *pcHow);
FileWrite(pcf, FLAGFALSE, acMesg, 3);
FilePrint(pcf, FLAGFALSE, "%c%c%c", chAttn, chEsc, *pcHow);
}
if (fReplay) {
sprintf(acMesg, "%c%cr", chAttn, chEsc);
FileWrite(pcf, FLAGFALSE, acMesg, 3);
FilePrint(pcf, FLAGFALSE, "%c%cr", chAttn, chEsc);
} else if (fVerbose) {
sprintf(acMesg, "%c%c\022", chAttn, chEsc);
FileWrite(pcf, FLAGFALSE, acMesg, 3);
FilePrint(pcf, FLAGFALSE, "%c%c\022", chAttn, chEsc);
}
}
fflush(stdout);
@ -972,11 +968,7 @@ DoCmds(master, ports, cmdi)
}
#endif
BuildTmpString((char *)0);
BuildTmpString("login ");
BuildTmpString(pcUser);
t = BuildTmpString("\r\n");
FileWrite(pcf, FLAGFALSE, t, -1);
FilePrint(pcf, FLAGFALSE, "login %s\r\n", pcUser);
t = ReadReply(pcf, 0);
if (strncmp(t, "passwd?", 7) == 0) {
@ -994,15 +986,16 @@ DoCmds(master, ports, cmdi)
tmpString = AllocString();
if (tmpString->used <= 1) {
char *pass;
sprintf(acMesg, "Enter %s@%s's password: ", pcUser,
hostname);
pass = GetPassword(acMesg);
BuildStringPrint(tmpString, "Enter %s@%s's password: ",
pcUser, hostname);
pass = GetPassword(tmpString->string);
if (pass == (char *)0) {
Error("could not get password from tty for `%s'",
server);
FileClose(&pcf);
continue;
}
BuildString((char *)0, tmpString);
BuildString(pass, tmpString);
BuildString("\r\n", tmpString);
}
@ -1367,7 +1360,7 @@ main(argc, argv)
/* non-numeric only */
struct servent *pSE;
if ((pSE = getservbyname(pcPort, "tcp")) == (struct servent *)0) {
Error("getservbyname(%s): %s", pcPort, strerror(errno));
Error("getservbyname(%s) failed", pcPort);
Bye(EX_UNAVAILABLE);
} else {
bindPort = ntohs((u_short) pSE->s_port);

View File

@ -1,5 +1,5 @@
.\" $Id: console.man,v 1.37 2003-10-02 19:00:45-07 bryan Exp $
.TH CONSOLE 1 "2003-10-02" "conserver-8.0.5" "conserver"
.\" $Id: console.man,v 1.40 2003/11/16 15:35:45 bryan Exp $
.TH CONSOLE 1 "2003/11/16" "conserver-8.0.6" "conserver"
.SH NAME
console \- console server client program
.SH SYNOPSIS
@ -302,7 +302,7 @@ were typed).
.PP
The
.B \-i
option outputs information regarding each console in 13 colon-separated fields.
option outputs information regarding each console in 15 colon-separated fields.
.TP
.I name
The name of the console.
@ -318,7 +318,7 @@ a command, or `!' for a remote port.
.TP
.I console-details
The details regarding the console.
The values here (all comma seperated) depend on the type of the console.
The values here (all comma separated) depend on the type of the console.
Local devices will have values of the device file, baud rate, and
file descriptor for the device.
Commands will have values of the command, the command's pid, the
@ -329,11 +329,11 @@ and file descriptor for the socket connection.
.I users-list
The details of each user connected to the console.
The details for each
user are an `@' seperated list of `w', `r', or `s' (for read-write, read-only,
user are an `@' separated list of `w', `r', or `s' (for read-write, read-only,
or suspended), username, hostname the user is on, the user's idle time,
and (for `r' and `s' users only) ``rw'' or ``ro'' (if the user wants
read-write mode or not).
Each user bundle is seperated by commas.
Each user bundle is separated by commas.
.TP
.I state
The state of the console.
@ -347,7 +347,7 @@ that the server can open the file for read, but not write.
.TP
.I logfile-details
The details regarding the logging for the console.
The comma seperated
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
enabled or not - the `a' timestamp option), the timestamp interval, and
@ -362,13 +362,19 @@ is at work, it will have the value of ``autoup'', otherwise it
will be ``noautoup''.
.TP
.I aliases
The console aliases are presented in a comma seperated list.
The console aliases are presented in a comma separated list.
.TP
.I options
The active options for the console are presented in a comma seperated list.
The active options for the console are presented in a comma separated list.
.TP
.I initcmd
The initcmd configuration option for the console.
.TP
.I idletimeout
The idletimeout configuration option for the console.
.TP
.I idlestring
The idlestring configuration option for the console.
.SH "ESCAPE SEQUENCES"
The connection can be controlled by a two-character escape sequence, followed
by a command.
@ -402,6 +408,9 @@ forcibly attach read-write
.B g
group info
.TP
.B i
information dump
.TP
.B L
toggle logging on/off
.TP

View File

@ -1,5 +1,5 @@
/*
* $Id: getpassword.c,v 1.7 2003-09-28 12:29:17-07 bryan Exp $
* $Id: getpassword.c,v 1.7 2003/09/28 19:29:17 bryan Exp $
*
* Copyright conserver.com, 2000
*

View File

@ -1,5 +1,5 @@
/*
* $Id: getpassword.h,v 1.3 2003-09-11 02:10:58-07 bryan Exp $
* $Id: getpassword.h,v 1.3 2003/09/11 09:10:58 bryan Exp $
*
* Copyright conserver.com, 2000
*

View File

@ -24,5 +24,5 @@ will be helpful.
Bryan Stansell
#
# $Id: README,v 1.4 2003-09-29 07:29:37-07 bryan Exp $
# $Id: README,v 1.4 2003/09/29 14:29:37 bryan Exp $
#

View File

@ -4,7 +4,7 @@
#
%define pkg conserver
%define ver conserver-8.0.5
%define ver 8.0.6
# define the name of the machine on which the main conserver
# daemon will be running if you don't want to use the default
@ -17,7 +17,7 @@
Summary: Serial console server daemon/client
Name: %{pkg}
Version: %{ver}
Release: 1.%{distver}x
Release: 1.%{distver}
Copyright: distributable
Group: System Environment/Daemons
URL: http://www.conserver.com/
@ -100,4 +100,6 @@ fi
%{prefix}/share/man/man8/conserver.8.gz
%{prefix}/share/man/man5/conserver.cf.5.gz
%{prefix}/share/man/man5/conserver.passwd.5.gz
%{prefix}/share/examples/conserver/conserver.cf
%{prefix}/share/examples/conserver/conserver.passwd
%{prefix}/sbin/conserver

View File

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

View File

@ -33,7 +33,7 @@ dotest()
else
if [ -f results/test$testnum ]; then
if diff -i test.out results/test$testnum >test$testnum.diff 2>&1; then
echo "succeded"
echo "succeeded"
rm -f test$testnum.diff
else
echo "failed (diffs in test$testnum.diff)"