mirror of
https://github.com/bstansell/conserver.git
synced 2025-06-25 01:59:08 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
29b909ee59 | |||
aea0e2a547 | |||
9eed9f2d8f | |||
25a4dcb0fd | |||
75cfd02f7a | |||
ad7a90dd69 | |||
691c3102c9 | |||
eafae7c27d |
116
CHANGES
116
CHANGES
@ -1,7 +1,119 @@
|
|||||||
CHANGES
|
CHANGES
|
||||||
=======
|
=======
|
||||||
|
|
||||||
version 8.0.5 (Oct 31,2003):
|
version 8.1.3 (Mar 22, 2004):
|
||||||
|
- fixed small memory and file descriptor leak in client when
|
||||||
|
using '^Ec;'
|
||||||
|
- '^Ec;' now only disconnects from the previous console only
|
||||||
|
after a successfully move to a new console, allowing you to
|
||||||
|
abort the move - suggested by Christopher T. Beers
|
||||||
|
<ctbeers@syr.edu>
|
||||||
|
|
||||||
|
version 8.1.2 (Mar 11, 2004):
|
||||||
|
- better handling of client command (^Ec|) when user is bumped,
|
||||||
|
conserver is reconfigured, etc
|
||||||
|
- added 'initsubst' option for 'initcmd' substitutions like
|
||||||
|
'devicesubst' and 'execsubst' - based on patch by Bill
|
||||||
|
Sommerfeld <sommerfeld@east.sun.com>
|
||||||
|
- modified and added to *subst (initsubst, etc) syntax to allow
|
||||||
|
for flexibility and future enhancement
|
||||||
|
- changed 'port' and 'portinc' minimums from 1 to 0 - it allows
|
||||||
|
more flexibility and helps with 0-based counting
|
||||||
|
- removed unportable sys/cdefs.h from contrib/chat/chat.c -
|
||||||
|
patch by Bill Sommerfeld <sommerfeld@east.sun.com>
|
||||||
|
- added --with-extmsgs configure switch to enable entertaining
|
||||||
|
messages
|
||||||
|
- marked various undocumented client commands as deprecated so
|
||||||
|
that they can be removed in a future version
|
||||||
|
- added ability to "move" to a new console via '^Ec;' -
|
||||||
|
suggested by Christopher T. Beers <ctbeers@syr.edu>
|
||||||
|
- added a dump of console information when -S is used twice -
|
||||||
|
suggested by Todd Stansell <todd@stansell.org>
|
||||||
|
|
||||||
|
version 8.1.1 (Feb 10, 2004):
|
||||||
|
- fixed mistake in Makefiles where rpmbuild fails - reported by
|
||||||
|
Martin Evans <m.d.t.evans@qmul.ac.uk>
|
||||||
|
- fixed a couple typos - reported by Matt Selsky
|
||||||
|
<selsky@columbia.edu>
|
||||||
|
|
||||||
|
version 8.1.0 (Jan 18, 2004):
|
||||||
|
- fixes for HP-UX compilation - patch by Petter Reinholdtsen
|
||||||
|
<pere@hungry.com>
|
||||||
|
- fixes for compilation under various operating systems -
|
||||||
|
patch by Albert Chin <conserver-users@mlists.thewrittenword.com>
|
||||||
|
- added a 'protocol' option for either 'telnet' or 'raw' socket
|
||||||
|
communication - also reflected in -i output
|
||||||
|
- changed the client/server protocol to use 0xff as a command
|
||||||
|
character for sending control commands - similiar to the
|
||||||
|
telnet protocol - improves the ^Ec| interaction
|
||||||
|
- client -E option now disables ssl encryption attempts, useful
|
||||||
|
for broken SSL environents - suggested by Graydon Dodson
|
||||||
|
<grdodson@lexmark.com>
|
||||||
|
- bad error message connecting non-ssl client with ssl-required
|
||||||
|
server - reported by Graydon Dodson <grdodson@lexmark.com>
|
||||||
|
- added note about pam configuration to conserver.passwd.man -
|
||||||
|
suggested by Erik Sjolund <erik.sjolund@sbc.su.se>
|
||||||
|
- improved telnet protocol option handling such that connections
|
||||||
|
to standard telnet ports should work properly
|
||||||
|
|
||||||
|
version 8.0.9 (Dec 10, 2003):
|
||||||
|
- fixed major bug in connect() handling which causes most
|
||||||
|
socket-based consoles to timeout after 10 seconds - reported
|
||||||
|
by Tom Rataski <trataski@intlsteel.com>
|
||||||
|
- added a couple details to the 'logfilemax' manpage entry
|
||||||
|
|
||||||
|
version 8.0.8 (Dec 2, 2003):
|
||||||
|
- added client ^Ec| sequence for running a command on the client
|
||||||
|
and having it's I/O directed to the console - inspired by
|
||||||
|
discussions with David Williamson
|
||||||
|
<david+conserver@williamsons.net> years ago ;-)
|
||||||
|
- touched up Makefiles to test against .h files
|
||||||
|
- fixed inability to replay the console log while the console is
|
||||||
|
down - reported by Matt Selsky <selsky@columbia.edu>
|
||||||
|
- added a console 'logfilemax' option for rotating the console
|
||||||
|
logfile once the file is greater than the specified size
|
||||||
|
- added sample configuration files to conserver.cf/samples
|
||||||
|
- tweaked some failure messages and initcmd notifications
|
||||||
|
|
||||||
|
version 8.0.7 (Nov 20, 2003):
|
||||||
|
- renamed util.[ch] to cutil.[ch] to prevent name conflict with
|
||||||
|
system util.h, reordered some #includes, and fixed a configure
|
||||||
|
test for sys/proc.h to build on OpenBSD 3.4 (and probably
|
||||||
|
others) - reported by Kurt Raschke <kurt@raschke.net>
|
||||||
|
- fixed missing semi-colon for cygwin build - reported by
|
||||||
|
Raymond Richmond <raymond.richmond@ualberta.ca>
|
||||||
|
|
||||||
|
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
|
- added 'loghostnames' config option (default is on) to log
|
||||||
client hostnames instead of ip addresses (like pre-8.0.0) -
|
client hostnames instead of ip addresses (like pre-8.0.0) -
|
||||||
suggested by Han Pilmeyer <han@zk3.dec.com>
|
suggested by Han Pilmeyer <han@zk3.dec.com>
|
||||||
@ -586,5 +698,5 @@ before version 6.05:
|
|||||||
and enhancements of various types were applied.
|
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.162 2004/03/23 00:55:04 bryan Exp $
|
||||||
#
|
#
|
||||||
|
2
FAQ
2
FAQ
@ -186,5 +186,5 @@ directed to faq@conserver.com. The FAQ answers the following questions:
|
|||||||
through the same problem?
|
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 $
|
||||||
#
|
#
|
||||||
|
21
INSTALL
21
INSTALL
@ -10,6 +10,25 @@ Upgrading?
|
|||||||
new features added to the client if you're considering *not*
|
new features added to the client if you're considering *not*
|
||||||
upgrading.
|
upgrading.
|
||||||
|
|
||||||
|
Version 8.1.3
|
||||||
|
- The '^Ec;' sequence won't work correctly with 8.1.2 (where it
|
||||||
|
was introduced).
|
||||||
|
|
||||||
|
Version 8.1.2
|
||||||
|
- The 'devicesubst' and 'execsubst' formats have changed from
|
||||||
|
8.1.1. It's fairly simple to update your config file to the
|
||||||
|
new format...just check the conserver.cf manpage. Sorry for
|
||||||
|
having to change things, but it's for a good reason (I should
|
||||||
|
have though ahead when designing the original format).
|
||||||
|
|
||||||
|
Version 8.1.0
|
||||||
|
|
||||||
|
- The client/server protocol has changed to better protect 8-bit
|
||||||
|
data and to allow programs invoked with '^Ec|' not have to
|
||||||
|
worry about accidentally sending the escape sequence to the
|
||||||
|
server. Though it will look like things are mostly
|
||||||
|
backward-compatible, don't count on it and just upgrade.
|
||||||
|
|
||||||
Version 8.0.2
|
Version 8.0.2
|
||||||
|
|
||||||
- I've added a '^Ec;' sequence to allow the client to signal the
|
- I've added a '^Ec;' sequence to allow the client to signal the
|
||||||
@ -255,5 +274,5 @@ Other Information And Gotchas
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# $Id: INSTALL,v 1.34 2003-10-03 10:52:31-07 bryan Exp $
|
# $Id: INSTALL,v 1.37 2004/03/23 00:55:04 bryan Exp $
|
||||||
#
|
#
|
||||||
|
2
README
2
README
@ -55,5 +55,5 @@ Contributions
|
|||||||
http://www.columbia.edu/acis/sy/unixdev/zinc
|
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 $
|
||||||
#
|
#
|
||||||
|
45
TODO
45
TODO
@ -10,17 +10,11 @@ Bryan Stansell
|
|||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
- Singular logging so that swatch/logsurfer can watch for errors across
|
|
||||||
the board - unloved output comes close
|
|
||||||
|
|
||||||
- Telnet protocol should be improved
|
- Telnet protocol should be improved
|
||||||
- Not even RFC 854 compliant
|
- Not even RFC 854 compliant...or maybe it is (as of 8.1.0)
|
||||||
- Option negotiation ignored - should we negotiate anything?
|
- Option negotiation semi-ignored - should we negotiate anything more?
|
||||||
- Others?
|
- Others?
|
||||||
|
|
||||||
- better shadow file support
|
|
||||||
- what does this mean? i've forgotten.
|
|
||||||
|
|
||||||
- syslog?
|
- syslog?
|
||||||
Daniel E. Singer <des@cs.duke.edu> would like to see it - especially
|
Daniel E. Singer <des@cs.duke.edu> would like to see it - especially
|
||||||
in regards to --use-libwrap code
|
in regards to --use-libwrap code
|
||||||
@ -30,14 +24,20 @@ Bryan Stansell
|
|||||||
- hpux has bigcrypt() also, which we support, so maybe we're covered
|
- hpux has bigcrypt() also, which we support, so maybe we're covered
|
||||||
|
|
||||||
- config file examples for various configurations
|
- config file examples for various configurations
|
||||||
|
- sample conserver.cf has some...but it's not explained well
|
||||||
|
|
||||||
- per-line timestamps
|
- per-line timestamps
|
||||||
- only when not connected?
|
- only when not connected?
|
||||||
|
|
||||||
- pipe input/output (console <-> program) via 'console'
|
- pipe input/output (console <-> program) via 'console'
|
||||||
- some apps (net-ups thing, gdb) might need to talk to user
|
- some apps (net-ups thing, gdb) might need to talk to user
|
||||||
|
- ^Ec| does this, but the interact with user bits might not work
|
||||||
|
- actually, ^Ec| does work right with 8.1.0...one change that might
|
||||||
|
be nice is the ability to NOT watch the i/o pass to the local
|
||||||
|
command - try sending a big file to the local host with xmodem.
|
||||||
|
|
||||||
- autologout? setting per console? gack, would have to interpret data.
|
- autologout? setting per console? gack, would have to interpret data.
|
||||||
|
- this will never happen...i don't want to interpret data
|
||||||
|
|
||||||
- "listen" capability (watch all/multiple consoles)
|
- "listen" capability (watch all/multiple consoles)
|
||||||
|
|
||||||
@ -50,6 +50,7 @@ Bryan Stansell
|
|||||||
- passphrase...hmmm..could really use some sort of send/expect
|
- passphrase...hmmm..could really use some sort of send/expect
|
||||||
thing here. you could write a wrapper script of sorts, but it
|
thing here. you could write a wrapper script of sorts, but it
|
||||||
really would be nice to have a raw socket and do the right thing.
|
really would be nice to have a raw socket and do the right thing.
|
||||||
|
- this does work, using the 'initcmd' option, so, all done?
|
||||||
|
|
||||||
- cyclades ts1000/2000 port : "Moses, Joel" <jmoses@deloitte.com>
|
- cyclades ts1000/2000 port : "Moses, Joel" <jmoses@deloitte.com>
|
||||||
|
|
||||||
@ -61,8 +62,7 @@ Bryan Stansell
|
|||||||
|
|
||||||
- server -M flag should accept multiple addresses (comma separated)
|
- server -M flag should accept multiple addresses (comma separated)
|
||||||
- should client as well?
|
- should client as well?
|
||||||
|
- this may never happen...does anyone really need it?
|
||||||
- logfile rotation based on size
|
|
||||||
|
|
||||||
- automatic log rotation in general : Egan Ford <egan@us.ibm.com>
|
- automatic log rotation in general : Egan Ford <egan@us.ibm.com>
|
||||||
|
|
||||||
@ -73,6 +73,7 @@ Bryan Stansell
|
|||||||
|
|
||||||
- suggestions by Trevor Fiatal <trevor@seven.com>
|
- suggestions by Trevor Fiatal <trevor@seven.com>
|
||||||
- include server hostname on 'console -x' output
|
- include server hostname on 'console -x' output
|
||||||
|
- i think the -i output covers it, but maybe not
|
||||||
|
|
||||||
- ability to configure strings to be sent to a console periodically :
|
- ability to configure strings to be sent to a console periodically :
|
||||||
Greg A. Woods <woods@planix.com>
|
Greg A. Woods <woods@planix.com>
|
||||||
@ -82,7 +83,29 @@ Bryan Stansell
|
|||||||
|
|
||||||
- redefine client escape sequence in conserver.cf : Toby Gerhart
|
- redefine client escape sequence in conserver.cf : Toby Gerhart
|
||||||
<toby.gerhart@eds.com>
|
<toby.gerhart@eds.com>
|
||||||
|
- not even sure if this is possible w/o confusing the client,
|
||||||
|
but maybe with the new 8.1.0 client-server protocol, we can!
|
||||||
|
|
||||||
|
- send a string when connected to a console, so you can set the
|
||||||
|
xterm title, for example : Richard Threadgill <richardt@tellme.com>
|
||||||
|
- this probably requires a client config file, so could play well
|
||||||
|
with the client config file requirement above
|
||||||
|
|
||||||
|
- allow for very long replays (hundres of lines) : John Stoffel
|
||||||
|
<stoffel@lucent.com>
|
||||||
|
|
||||||
|
- log rotation by date : Tom Pachla <tom.pachla@nlc-bnc.ca>
|
||||||
|
|
||||||
|
- client config file (for -M, etc?) : Erik Sjolund
|
||||||
|
<erik.sjolund@sbc.su.se>
|
||||||
|
|
||||||
|
- strict file permission checks on conserver.passwd/conserver.cf : Erik
|
||||||
|
Sjolund <erik.sjolund@sbc.su.se>
|
||||||
|
|
||||||
|
- embedded startup delays per remote host...or "group" of consoles in
|
||||||
|
some way 'cause some ssh connections to console servers need
|
||||||
|
significant throttling : Jay McCanta <mccantaj@amgen.com>
|
||||||
|
|
||||||
#
|
#
|
||||||
# $Id: TODO,v 1.38 2003-10-31 09:53:46-08 bryan Exp $
|
# $Id: TODO,v 1.47 2004/03/12 17:34:49 bryan Exp $
|
||||||
#
|
#
|
||||||
|
@ -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
|
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
|
console of the machine (either through the console server or via the physical
|
||||||
|
@ -31,6 +31,8 @@ ALL = autologin
|
|||||||
|
|
||||||
all: $(ALL)
|
all: $(ALL)
|
||||||
|
|
||||||
|
$(AUTOLOGIN_OBJS): $(AUTOLOGIN_HDRS)
|
||||||
|
|
||||||
autologin: $(AUTOLOGIN_OBJS)
|
autologin: $(AUTOLOGIN_OBJS)
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o autologin $(AUTOLOGIN_OBJS) $(LIBS)
|
$(CC) $(CFLAGS) $(LDFLAGS) -o autologin $(AUTOLOGIN_OBJS) $(LIBS)
|
||||||
|
|
||||||
|
@ -17,5 +17,5 @@ Good luck.
|
|||||||
Bryan Stansell
|
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 $
|
||||||
#
|
#
|
||||||
|
@ -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.
|
This program can be used to put a root shell on the console at boot time.
|
||||||
See the manual page.
|
See the manual page.
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#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 */
|
#endif /* not lint */
|
||||||
extern char *progname;
|
extern char *progname;
|
||||||
gid_t awGrps[NGROUPS_MAX];
|
gid_t awGrps[NGROUPS_MAX];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# mkcmd parser for autologin program
|
# mkcmd parser for autologin program
|
||||||
%%
|
%%
|
||||||
static char *rcsid =
|
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" {
|
integer variable "iErrs" {
|
||||||
|
@ -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
|
.TH AUTOLOGIN 8L PUCC
|
||||||
.SH NAME
|
.SH NAME
|
||||||
autologin \- create an automatic login session from /etc/inittab
|
autologin \- create an automatic login session from /etc/inittab
|
||||||
|
@ -80,7 +80,7 @@ char **nargv, *ostr;
|
|||||||
#endif /* ! HAVE_GETOPT */
|
#endif /* ! HAVE_GETOPT */
|
||||||
|
|
||||||
char
|
char
|
||||||
*progname = "$Id$",
|
*progname = "$Id: main.c,v 1.1 2003/11/04 02:36:24 bryan Exp $",
|
||||||
*au_terse[] = {
|
*au_terse[] = {
|
||||||
" [-u] [-c cmd] [-e env=value] [-g group] [-l login] [-t tty]",
|
" [-u] [-c cmd] [-e env=value] [-g group] [-l login] [-t tty]",
|
||||||
" -h",
|
" -h",
|
||||||
@ -111,7 +111,7 @@ int
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *rcsid =
|
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
|
* parser
|
||||||
|
6
compat.h
6
compat.h
@ -7,8 +7,8 @@
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -287,6 +287,10 @@ typedef int socklen_t;
|
|||||||
#define ONLRET 0
|
#define ONLRET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEEK_SET
|
||||||
|
#define SEEK_SET L_SET
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef PARAMS
|
#ifndef PARAMS
|
||||||
# if PROTOTYPES
|
# if PROTOTYPES
|
||||||
# define PARAMS(protos) protos
|
# define PARAMS(protos) protos
|
||||||
|
65
config.guess
vendored
65
config.guess
vendored
@ -3,7 +3,7 @@
|
|||||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
|
|
||||||
timestamp='2003-08-18'
|
timestamp='2004-03-12'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
@ -197,12 +197,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||||
echo "${machine}-${os}${release}"
|
echo "${machine}-${os}${release}"
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
amd64:OpenBSD:*:*)
|
||||||
|
echo x86_64-unknown-openbsd${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
amiga:OpenBSD:*:*)
|
amiga:OpenBSD:*:*)
|
||||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
arc:OpenBSD:*:*)
|
arc:OpenBSD:*:*)
|
||||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
cats:OpenBSD:*:*)
|
||||||
|
echo arm-unknown-openbsd${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
hp300:OpenBSD:*:*)
|
hp300:OpenBSD:*:*)
|
||||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -221,6 +227,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
mvmeppc:OpenBSD:*:*)
|
mvmeppc:OpenBSD:*:*)
|
||||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
pegasos:OpenBSD:*:*)
|
||||||
|
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
pmax:OpenBSD:*:*)
|
pmax:OpenBSD:*:*)
|
||||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -236,10 +245,24 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
*:OpenBSD:*:*)
|
*:OpenBSD:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
*:ekkoBSD:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
|
macppc:MirBSD:*:*)
|
||||||
|
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
|
*:MirBSD:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
alpha:OSF1:*:*)
|
alpha:OSF1:*:*)
|
||||||
if test $UNAME_RELEASE = "V4.0"; then
|
case $UNAME_RELEASE in
|
||||||
|
*4.0)
|
||||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||||
fi
|
;;
|
||||||
|
*5.*)
|
||||||
|
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||||
# OSF/1 and Tru64 systems produced since 1995. I hope that
|
# OSF/1 and Tru64 systems produced since 1995. I hope that
|
||||||
# covers most systems running today. This code pipes the CPU
|
# covers most systems running today. This code pipes the CPU
|
||||||
@ -277,11 +300,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
"EV7.9 (21364A)")
|
"EV7.9 (21364A)")
|
||||||
UNAME_MACHINE="alphaev79" ;;
|
UNAME_MACHINE="alphaev79" ;;
|
||||||
esac
|
esac
|
||||||
|
# A Pn.n version is a patched version.
|
||||||
# A Vn.n version is a released version.
|
# A Vn.n version is a released version.
|
||||||
# A Tn.n version is a released field test version.
|
# A Tn.n version is a released field test version.
|
||||||
# A Xn.n version is an unreleased experimental baselevel.
|
# A Xn.n version is an unreleased experimental baselevel.
|
||||||
# 1.2 uses "1.2" for uname -r.
|
# 1.2 uses "1.2" for uname -r.
|
||||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
Alpha*:OpenVMS:*:*)
|
Alpha*:OpenVMS:*:*)
|
||||||
echo alpha-hp-vms
|
echo alpha-hp-vms
|
||||||
@ -307,6 +331,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
*:OS/390:*:*)
|
*:OS/390:*:*)
|
||||||
echo i370-ibm-openedition
|
echo i370-ibm-openedition
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
*:OS400:*:*)
|
||||||
|
echo powerpc-ibm-os400
|
||||||
|
exit 0 ;;
|
||||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||||
exit 0;;
|
exit 0;;
|
||||||
@ -399,6 +426,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
m68k:machten:*:*)
|
||||||
|
echo m68k-apple-machten${UNAME_RELEASE}
|
||||||
|
exit 0 ;;
|
||||||
powerpc:machten:*:*)
|
powerpc:machten:*:*)
|
||||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -742,6 +772,11 @@ EOF
|
|||||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||||
exit 0 ;;
|
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:*:*)
|
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -751,7 +786,7 @@ EOF
|
|||||||
*:BSD/OS:*:*)
|
*:BSD/OS:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
*:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
|
*:FreeBSD:*:*)
|
||||||
# Determine whether the default compiler uses glibc.
|
# Determine whether the default compiler uses glibc.
|
||||||
eval $set_cc_for_build
|
eval $set_cc_for_build
|
||||||
sed 's/^ //' << EOF >$dummy.c
|
sed 's/^ //' << EOF >$dummy.c
|
||||||
@ -763,7 +798,7 @@ EOF
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
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.
|
# FreeBSD's kernel, but not the complete OS.
|
||||||
case ${LIBC} in gnu) kernel_only='k' ;; esac
|
case ${LIBC} in gnu) kernel_only='k' ;; esac
|
||||||
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||||
@ -799,8 +834,13 @@ EOF
|
|||||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
*:GNU:*:*)
|
*:GNU:*:*)
|
||||||
|
# the GNU system
|
||||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||||
exit 0 ;;
|
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:*:*)
|
i*86:Minix:*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-minix
|
echo ${UNAME_MACHINE}-pc-minix
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -813,6 +853,9 @@ EOF
|
|||||||
ia64:Linux:*:*)
|
ia64:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
m32r*:Linux:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
|
exit 0 ;;
|
||||||
m68*:Linux:*:*)
|
m68*:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -981,6 +1024,9 @@ EOF
|
|||||||
i*86:atheos:*:*)
|
i*86:atheos:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-atheos
|
echo ${UNAME_MACHINE}-unknown-atheos
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
i*86:syllable:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-pc-syllable
|
||||||
|
exit 0 ;;
|
||||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
@ -1052,7 +1098,7 @@ EOF
|
|||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
M68*:*:R3V[567]*:*)
|
M68*:*:R3V[567]*:*)
|
||||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
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=''
|
OS_REL=''
|
||||||
test -r /etc/.relid \
|
test -r /etc/.relid \
|
||||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||||
@ -1167,7 +1213,7 @@ EOF
|
|||||||
*:QNX:*:4*)
|
*:QNX:*:4*)
|
||||||
echo i386-pc-qnx
|
echo i386-pc-qnx
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
|
NSR-?:NONSTOP_KERNEL:*:*)
|
||||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
*:NonStop-UX:*:*)
|
*:NonStop-UX:*:*)
|
||||||
@ -1211,6 +1257,9 @@ EOF
|
|||||||
SEI:*:*:SEIUX)
|
SEI:*:*:SEIUX)
|
||||||
echo mips-sei-seiux${UNAME_RELEASE}
|
echo mips-sei-seiux${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
*:DragonFly:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||||
|
exit 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||||
|
@ -207,6 +207,9 @@
|
|||||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||||
#undef HAVE_SYS_IOCTL_H
|
#undef HAVE_SYS_IOCTL_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||||
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/proc.h> header file. */
|
/* Define to 1 if you have the <sys/proc.h> header file. */
|
||||||
#undef HAVE_SYS_PROC_H
|
#undef HAVE_SYS_PROC_H
|
||||||
|
|
||||||
@ -321,6 +324,9 @@
|
|||||||
/* Defined if we trust reverse DNS */
|
/* Defined if we trust reverse DNS */
|
||||||
#undef TRUST_REVERSE_DNS
|
#undef TRUST_REVERSE_DNS
|
||||||
|
|
||||||
|
/* Defined if we produce extended messages */
|
||||||
|
#undef USE_EXTENDED_MESSAGES
|
||||||
|
|
||||||
/* use tcp_wrappers libwrap */
|
/* use tcp_wrappers libwrap */
|
||||||
#undef USE_LIBWRAP
|
#undef USE_LIBWRAP
|
||||||
|
|
||||||
@ -345,3 +351,6 @@
|
|||||||
|
|
||||||
/* Define if <signal.h> does not define sig_atomic_t */
|
/* Define if <signal.h> does not define sig_atomic_t */
|
||||||
#undef sig_atomic_t
|
#undef sig_atomic_t
|
||||||
|
|
||||||
|
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||||
|
#undef size_t
|
||||||
|
63
config.sub
vendored
63
config.sub
vendored
@ -3,7 +3,7 @@
|
|||||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
|
|
||||||
timestamp='2003-08-18'
|
timestamp='2004-03-12'
|
||||||
|
|
||||||
# This file is (in principle) common to ALL GNU software.
|
# This file is (in principle) common to ALL GNU software.
|
||||||
# The presence of a machine in this file suggests that SOME 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.
|
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||||
case $maybe_os in
|
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
|
os=-$maybe_os
|
||||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||||
;;
|
;;
|
||||||
@ -236,7 +237,7 @@ case $basic_machine in
|
|||||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||||
| i370 | i860 | i960 | ia64 \
|
| i370 | i860 | i960 | ia64 \
|
||||||
| ip2k | iq2000 \
|
| ip2k | iq2000 \
|
||||||
| m32r | m68000 | m68k | m88k | mcore \
|
| m32r | m32rle | m68000 | m68k | m88k | mcore \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||||
| mips16 \
|
| mips16 \
|
||||||
| mips64 | mips64el \
|
| mips64 | mips64el \
|
||||||
@ -248,6 +249,7 @@ case $basic_machine in
|
|||||||
| mipsisa32 | mipsisa32el \
|
| mipsisa32 | mipsisa32el \
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
| mipsisa32r2 | mipsisa32r2el \
|
||||||
| mipsisa64 | mipsisa64el \
|
| mipsisa64 | mipsisa64el \
|
||||||
|
| mipsisa64r2 | mipsisa64r2el \
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
| mipsisa64sb1 | mipsisa64sb1el \
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||||
| mipstx39 | mipstx39el \
|
| mipstx39 | mipstx39el \
|
||||||
@ -260,7 +262,7 @@ case $basic_machine in
|
|||||||
| pyramid \
|
| pyramid \
|
||||||
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||||
| sh64 | sh64le \
|
| sh64 | sh64le \
|
||||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
|
||||||
| strongarm \
|
| strongarm \
|
||||||
| tahoe | thumb | tic4x | tic80 | tron \
|
| tahoe | thumb | tic4x | tic80 | tron \
|
||||||
| v850 | v850e \
|
| v850 | v850e \
|
||||||
@ -306,7 +308,7 @@ case $basic_machine in
|
|||||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||||
| i*86-* | i860-* | i960-* | ia64-* \
|
| i*86-* | i860-* | i960-* | ia64-* \
|
||||||
| ip2k-* | iq2000-* \
|
| ip2k-* | iq2000-* \
|
||||||
| m32r-* \
|
| m32r-* | m32rle-* \
|
||||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||||
| m88110-* | m88k-* | mcore-* \
|
| m88110-* | m88k-* | mcore-* \
|
||||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||||
@ -320,6 +322,7 @@ case $basic_machine in
|
|||||||
| mipsisa32-* | mipsisa32el-* \
|
| mipsisa32-* | mipsisa32el-* \
|
||||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||||
| mipsisa64-* | mipsisa64el-* \
|
| mipsisa64-* | mipsisa64el-* \
|
||||||
|
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||||
| mipstx39-* | mipstx39el-* \
|
| mipstx39-* | mipstx39el-* \
|
||||||
@ -333,7 +336,7 @@ case $basic_machine in
|
|||||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||||
| tahoe-* | thumb-* \
|
| tahoe-* | thumb-* \
|
||||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||||
| tron-* \
|
| tron-* \
|
||||||
@ -360,6 +363,9 @@ case $basic_machine in
|
|||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
os=-udi
|
||||||
;;
|
;;
|
||||||
|
abacus)
|
||||||
|
basic_machine=abacus-unknown
|
||||||
|
;;
|
||||||
adobe68k)
|
adobe68k)
|
||||||
basic_machine=m68010-adobe
|
basic_machine=m68010-adobe
|
||||||
os=-scout
|
os=-scout
|
||||||
@ -377,6 +383,9 @@ case $basic_machine in
|
|||||||
amd64)
|
amd64)
|
||||||
basic_machine=x86_64-pc
|
basic_machine=x86_64-pc
|
||||||
;;
|
;;
|
||||||
|
amd64-*)
|
||||||
|
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
;;
|
||||||
amdahl)
|
amdahl)
|
||||||
basic_machine=580-amdahl
|
basic_machine=580-amdahl
|
||||||
os=-sysv
|
os=-sysv
|
||||||
@ -436,12 +445,20 @@ case $basic_machine in
|
|||||||
basic_machine=j90-cray
|
basic_machine=j90-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
|
cr16c)
|
||||||
|
basic_machine=cr16c-unknown
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
crds | unos)
|
crds | unos)
|
||||||
basic_machine=m68k-crds
|
basic_machine=m68k-crds
|
||||||
;;
|
;;
|
||||||
cris | cris-* | etrax*)
|
cris | cris-* | etrax*)
|
||||||
basic_machine=cris-axis
|
basic_machine=cris-axis
|
||||||
;;
|
;;
|
||||||
|
crx)
|
||||||
|
basic_machine=crx-unknown
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
da30 | da30-*)
|
da30 | da30-*)
|
||||||
basic_machine=m68k-da30
|
basic_machine=m68k-da30
|
||||||
;;
|
;;
|
||||||
@ -741,6 +758,10 @@ case $basic_machine in
|
|||||||
basic_machine=or32-unknown
|
basic_machine=or32-unknown
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
|
os400)
|
||||||
|
basic_machine=powerpc-ibm
|
||||||
|
os=-os400
|
||||||
|
;;
|
||||||
OSE68000 | ose68000)
|
OSE68000 | ose68000)
|
||||||
basic_machine=m68000-ericsson
|
basic_machine=m68000-ericsson
|
||||||
os=-ose
|
os=-ose
|
||||||
@ -961,6 +982,10 @@ case $basic_machine in
|
|||||||
tower | tower-32)
|
tower | tower-32)
|
||||||
basic_machine=m68k-ncr
|
basic_machine=m68k-ncr
|
||||||
;;
|
;;
|
||||||
|
tpf)
|
||||||
|
basic_machine=s390x-ibm
|
||||||
|
os=-tpf
|
||||||
|
;;
|
||||||
udi29k)
|
udi29k)
|
||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
os=-udi
|
||||||
@ -1056,7 +1081,7 @@ case $basic_machine in
|
|||||||
sh64)
|
sh64)
|
||||||
basic_machine=sh64-unknown
|
basic_machine=sh64-unknown
|
||||||
;;
|
;;
|
||||||
sparc | sparcv9 | sparcv9b)
|
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||||
basic_machine=sparc-sun
|
basic_machine=sparc-sun
|
||||||
;;
|
;;
|
||||||
cydra)
|
cydra)
|
||||||
@ -1129,19 +1154,20 @@ case $os in
|
|||||||
| -aos* \
|
| -aos* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
|
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||||
|
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -chorusos* | -chorusrdb* \
|
| -chorusos* | -chorusrdb* \
|
||||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -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* \
|
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
|
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
-qnx*)
|
-qnx*)
|
||||||
@ -1180,6 +1206,9 @@ case $os in
|
|||||||
-opened*)
|
-opened*)
|
||||||
os=-openedition
|
os=-openedition
|
||||||
;;
|
;;
|
||||||
|
-os400*)
|
||||||
|
os=-os400
|
||||||
|
;;
|
||||||
-wince*)
|
-wince*)
|
||||||
os=-wince
|
os=-wince
|
||||||
;;
|
;;
|
||||||
@ -1201,6 +1230,9 @@ case $os in
|
|||||||
-atheos*)
|
-atheos*)
|
||||||
os=-atheos
|
os=-atheos
|
||||||
;;
|
;;
|
||||||
|
-syllable*)
|
||||||
|
os=-syllable
|
||||||
|
;;
|
||||||
-386bsd)
|
-386bsd)
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
@ -1223,6 +1255,9 @@ case $os in
|
|||||||
-sinix*)
|
-sinix*)
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
|
-tpf*)
|
||||||
|
os=-tpf
|
||||||
|
;;
|
||||||
-triton*)
|
-triton*)
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
@ -1471,9 +1506,15 @@ case $basic_machine in
|
|||||||
-mvs* | -opened*)
|
-mvs* | -opened*)
|
||||||
vendor=ibm
|
vendor=ibm
|
||||||
;;
|
;;
|
||||||
|
-os400*)
|
||||||
|
vendor=ibm
|
||||||
|
;;
|
||||||
-ptx*)
|
-ptx*)
|
||||||
vendor=sequent
|
vendor=sequent
|
||||||
;;
|
;;
|
||||||
|
-tpf*)
|
||||||
|
vendor=ibm
|
||||||
|
;;
|
||||||
-vxsim* | -vxworks* | -windiss*)
|
-vxsim* | -vxworks* | -windiss*)
|
||||||
vendor=wrs
|
vendor=wrs
|
||||||
;;
|
;;
|
||||||
|
23
configure.in
23
configure.in
@ -16,6 +16,7 @@ AH_TEMPLATE([HAVE_OPENSSL], [have openssl support])
|
|||||||
AH_TEMPLATE([HAVE_DMALLOC], [have dmalloc support])
|
AH_TEMPLATE([HAVE_DMALLOC], [have dmalloc support])
|
||||||
AH_TEMPLATE([HAVE_SA_LEN],[Defined if sa_len member exists in struct sockaddr])
|
AH_TEMPLATE([HAVE_SA_LEN],[Defined if sa_len member exists in struct sockaddr])
|
||||||
AH_TEMPLATE([TRUST_REVERSE_DNS],[Defined if we trust reverse DNS])
|
AH_TEMPLATE([TRUST_REVERSE_DNS],[Defined if we trust reverse DNS])
|
||||||
|
AH_TEMPLATE([USE_EXTENDED_MESSAGES],[Defined if we produce extended messages])
|
||||||
|
|
||||||
dnl ### Normal initialization. ######################################
|
dnl ### Normal initialization. ######################################
|
||||||
AC_INIT
|
AC_INIT
|
||||||
@ -215,6 +216,19 @@ AC_ARG_WITH(trustrevdns,
|
|||||||
;;
|
;;
|
||||||
esac],[AC_MSG_RESULT(no)])
|
esac],[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(whether to display extended messages)
|
||||||
|
AC_ARG_WITH(extmsgs,
|
||||||
|
AC_HELP_STRING([--with-extmsgs],[Produce extended messages]),
|
||||||
|
[case "$withval" in
|
||||||
|
yes)
|
||||||
|
AC_DEFINE(USE_EXTENDED_MESSAGES)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
;;
|
||||||
|
esac],[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
dnl ### Check for compiler et al. ###################################
|
dnl ### Check for compiler et al. ###################################
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
@ -244,12 +258,19 @@ if test "$ac_cv_sys_posix_termios" != "yes"; then
|
|||||||
AC_MSG_ERROR([POSIX termios interface required])
|
AC_MSG_ERROR([POSIX termios interface required])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_HEADERS(unistd.h getopt.h sys/vlimit.h sys/resource.h ttyent.h sys/ttold.h sys/uio.h sys/proc.h sys/ioctl_compat.h usersec.h sys/select.h stropts.h sys/audit.h shadow.h sys/time.h crypt.h sysexits.h types.h sys/sockio.h)
|
AC_CHECK_HEADERS(unistd.h getopt.h sys/vlimit.h sys/resource.h ttyent.h sys/ttold.h sys/uio.h sys/ioctl_compat.h usersec.h sys/select.h stropts.h sys/audit.h shadow.h sys/time.h crypt.h sysexits.h types.h sys/sockio.h sys/param.h)
|
||||||
|
dnl sys/proc.h needs sys/param.h on openbsd, apparently
|
||||||
|
AC_CHECK_HEADERS(sys/proc.h, [], [],
|
||||||
|
[#if HAVE_SYS_PARAM_H
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
])
|
||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_TYPE_MODE_T
|
AC_TYPE_MODE_T
|
||||||
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
|
AC_TYPE_SIZE_T
|
||||||
|
|
||||||
AC_CHECK_TYPE([sig_atomic_t],,
|
AC_CHECK_TYPE([sig_atomic_t],,
|
||||||
AC_DEFINE(sig_atomic_t, volatile int,
|
AC_DEFINE(sig_atomic_t, volatile int,
|
||||||
|
@ -7,5 +7,5 @@ files with enough detail to get you going.
|
|||||||
That's about it. Good luck.
|
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 $
|
||||||
#
|
#
|
||||||
|
@ -3,7 +3,8 @@ srcdir = @srcdir@
|
|||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
exampledir = $(prefix)/share/examples/conserver
|
datadir = @datadir@
|
||||||
|
exampledir = $(datadir)/examples/conserver
|
||||||
|
|
||||||
### Installation programs and flags
|
### Installation programs and flags
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
|
@ -1,54 +1,114 @@
|
|||||||
#
|
#
|
||||||
# $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.
|
### set up global access
|
||||||
#
|
default full { rw *; }
|
||||||
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 up some custom break sequences
|
||||||
|
break 4 { string "+\d+\d+"; delay 300; }
|
||||||
|
break 5 { string "\033c"; }
|
||||||
|
|
||||||
|
### set the defaults for all the consoles
|
||||||
|
# these get applied before anything else
|
||||||
default * {
|
default * {
|
||||||
|
# The '&' character is substituted with the console name
|
||||||
logfile /var/consoles/&;
|
logfile /var/consoles/&;
|
||||||
timestamp "";
|
# timestamps every hour with activity and break logging
|
||||||
|
timestamp 1hab;
|
||||||
|
# include the 'full' default
|
||||||
include full;
|
include full;
|
||||||
}
|
# master server is localhost
|
||||||
#
|
|
||||||
# list of consoles we serve
|
|
||||||
#
|
|
||||||
console tweety {
|
|
||||||
master localhost;
|
master localhost;
|
||||||
type host;
|
|
||||||
host ts1;
|
|
||||||
port 2002;
|
|
||||||
}
|
}
|
||||||
console bambam {
|
|
||||||
master localhost;
|
### define the first terminal server
|
||||||
type host;
|
default ts1.conserver.com {
|
||||||
host ts1;
|
# use the xyplex defaults
|
||||||
port 2003;
|
include xyplex;
|
||||||
|
# host to connect to is ts1.conserver.com
|
||||||
|
host ts1.conserver.com;
|
||||||
|
# run login-xyplex when connecting to the term server
|
||||||
|
initcmd /usr/local/sbin/login-xyplex;
|
||||||
}
|
}
|
||||||
console shell {
|
|
||||||
master localhost;
|
# now define the consoles on ts1.conserver.com
|
||||||
logfile /dev/null;
|
# bryan isn't allowed on web1.conserver.com
|
||||||
|
console web1.conserver.com { include ts1.conserver.com; port 2; rw !bryan; }
|
||||||
|
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
|
||||||
|
# this one is a cisco, with simple socket connections
|
||||||
|
default ts2.conserver.com { include cisco; host ts2.conserver.com; }
|
||||||
|
|
||||||
|
# and the consoles on ts2.conserver.com
|
||||||
|
console ldap1.conserver.com { include ts2.conserver.com; port 7; }
|
||||||
|
|
||||||
|
### and now some one-off consoles
|
||||||
|
# we still inherit the '*' default set
|
||||||
|
# a simple ssh invocation
|
||||||
|
console ssh {
|
||||||
type exec;
|
type exec;
|
||||||
exec "";
|
exec ssh localhost;
|
||||||
}
|
# provide a 'message-of-the-day'
|
||||||
console telnet {
|
motd "just a simple ssh to localhost";
|
||||||
master localhost;
|
|
||||||
logfile /dev/null;
|
|
||||||
type exec;
|
|
||||||
exec telnet host;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# connect to /dev/ttya
|
||||||
console ttya {
|
console ttya {
|
||||||
master localhost;
|
|
||||||
type device;
|
type device;
|
||||||
device /dev/ttya;
|
device /dev/ttya; parity none; baud 9600;
|
||||||
|
idlestring "#";
|
||||||
|
idletimeout 5m; # send a '#' every 5 minutes of idle
|
||||||
|
timestamp ""; # no timestamps on this console
|
||||||
|
}
|
||||||
|
|
||||||
|
### define a group of users
|
||||||
|
group sysadmin {
|
||||||
|
users bryan, todd;
|
||||||
|
users dave;
|
||||||
|
}
|
||||||
|
|
||||||
|
### reset the defaults for the next set of consoles
|
||||||
|
# again, these get applied before anything else
|
||||||
|
default * {
|
||||||
|
# The '&' character is substituted with the console name
|
||||||
|
logfile /var/consoles/&;
|
||||||
|
timestamp 5m;
|
||||||
|
rw sysadmin; # use the group defined above
|
||||||
|
master localhost;
|
||||||
|
}
|
||||||
|
|
||||||
|
default cyclades {
|
||||||
|
# sets up /dev/ttyC0 through /dev/ttyC31, for a 32 port card
|
||||||
|
# referenced as ports 1 through 32
|
||||||
|
type device;
|
||||||
|
device /dev/ttyC.;
|
||||||
|
devicesubst .=Pd;
|
||||||
|
portbase -1;
|
||||||
|
portinc 1;
|
||||||
|
host none; # not really used, since devicesubst doesn't use it
|
||||||
baud 9600;
|
baud 9600;
|
||||||
parity none;
|
parity none;
|
||||||
}
|
}
|
||||||
#
|
|
||||||
# list of clients we allow
|
console modem1.conserver.com { include cyclades; port 2; break 4; }
|
||||||
#
|
# todd isn't allowed on modem2.conserver.com
|
||||||
|
console modem2.conserver.com { include cyclades; port 6; rw !todd; }
|
||||||
|
|
||||||
|
### list of clients we allow
|
||||||
access * {
|
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;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" $Id: conserver.cf.man,v 1.44 2003-10-31 09:54:19-08 bryan Exp $
|
.\" $Id: conserver.cf.man,v 1.58 2004/02/24 02:59:36 bryan Exp $
|
||||||
.TH CONSERVER.CF 5 "2003-10-31" "conserver-8.0.5" "conserver"
|
.TH CONSERVER.CF 5 "2004/02/24" "conserver-8.1.3" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver.cf \- console configuration file for
|
conserver.cf \- console configuration file for
|
||||||
.BR conserver (8)
|
.BR conserver (8)
|
||||||
@ -65,12 +65,12 @@ The parser has six characters that it considers special.
|
|||||||
These are: ``{'', ``}'', ``;'', ``#'', ``\e'', and ``"''.
|
These are: ``{'', ``}'', ``;'', ``#'', ``\e'', and ``"''.
|
||||||
The first three (hereby called tokens) define the format of the
|
The first three (hereby called tokens) define the format of the
|
||||||
configuration blocks and are used as word
|
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.
|
quoting characters.
|
||||||
.PP
|
.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.
|
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.
|
looking for a block-type or keyword.
|
||||||
When it's looking for a block-name or value, whitespace is like any
|
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
|
other character, which allows you to embed whitespace in a block-name
|
||||||
@ -123,14 +123,16 @@ fashion (top down), so order is important.
|
|||||||
.RS
|
.RS
|
||||||
.TP 15
|
.TP 15
|
||||||
.B admin
|
.B admin
|
||||||
.RI [ " username" ,...
|
.RI "[ [\fB!\fP]" username ,...
|
||||||
| "" ]
|
| "" ]
|
||||||
.br
|
.br
|
||||||
Define a list of users making up the admin list for the console server.
|
Define a list of users making up the admin list for the console server.
|
||||||
If
|
If
|
||||||
.I username
|
.I username
|
||||||
matches a previously defined group name, all members of the previous
|
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
|
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
|
||||||
@ -202,7 +204,9 @@ alert
|
|||||||
backspace
|
backspace
|
||||||
.TP
|
.TP
|
||||||
.B \ed
|
.B \ed
|
||||||
0.33 second delay
|
delay specified by the
|
||||||
|
.B delay
|
||||||
|
option.
|
||||||
.TP
|
.TP
|
||||||
.B \ef
|
.B \ef
|
||||||
form-feed
|
form-feed
|
||||||
@ -341,6 +345,15 @@ command-line flag).
|
|||||||
Set whether or not encryption is required when talking to clients (see the
|
Set whether or not encryption is required when talking to clients (see the
|
||||||
.B \-E
|
.B \-E
|
||||||
command-line flag).
|
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
|
.RE
|
||||||
.TP 8
|
.TP 8
|
||||||
.B console
|
.B console
|
||||||
@ -370,7 +383,7 @@ Define a block of defaults identified as
|
|||||||
If
|
If
|
||||||
.I name
|
.I name
|
||||||
is ``*'', the automatically applied default block is defined (basically
|
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).
|
of their definition).
|
||||||
.RS
|
.RS
|
||||||
.TP 15
|
.TP 15
|
||||||
@ -397,6 +410,76 @@ Assign the serial device
|
|||||||
as the access to the console.
|
as the access to the console.
|
||||||
Only consoles of type ``device'' will use this value.
|
Only consoles of type ``device'' will use this value.
|
||||||
.TP
|
.TP
|
||||||
|
.B devicesubst
|
||||||
|
.RI [ c = t [ n ] f "[,...]"
|
||||||
|
| "" ]
|
||||||
|
.br
|
||||||
|
Perform character substitutions on the
|
||||||
|
.B device
|
||||||
|
value.
|
||||||
|
A series of replacements can be defined by specifying a
|
||||||
|
comma-separated list of
|
||||||
|
.IR c = t [ n ] f
|
||||||
|
sequences where
|
||||||
|
.I c
|
||||||
|
is any printable character,
|
||||||
|
.I t
|
||||||
|
specifies the replacement value,
|
||||||
|
.I n
|
||||||
|
is a field length (optional),
|
||||||
|
and
|
||||||
|
.I f
|
||||||
|
is the format string.
|
||||||
|
.I t
|
||||||
|
can be one of the characters below, catagorized as a string replacement
|
||||||
|
or a numeric replacement, which dictates the use of the
|
||||||
|
.I n
|
||||||
|
and
|
||||||
|
.I f
|
||||||
|
fields.
|
||||||
|
.RS
|
||||||
|
.RS
|
||||||
|
.sp
|
||||||
|
.PD 0
|
||||||
|
.TP
|
||||||
|
String Replacement
|
||||||
|
.TP
|
||||||
|
.B h
|
||||||
|
.B host
|
||||||
|
value
|
||||||
|
.TP
|
||||||
|
.B c
|
||||||
|
console name
|
||||||
|
.sp
|
||||||
|
.PP
|
||||||
|
Numeric Replacement
|
||||||
|
.TP
|
||||||
|
.B p
|
||||||
|
config
|
||||||
|
.B port
|
||||||
|
value
|
||||||
|
.TP
|
||||||
|
.B P
|
||||||
|
calculated port value
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.RE
|
||||||
|
.IP
|
||||||
|
For string replacements, if the replacement isn't at least
|
||||||
|
.I n
|
||||||
|
characters, it will be padded with space characters on the left.
|
||||||
|
.I f
|
||||||
|
must be `s'.
|
||||||
|
For numeric replacements, the 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', `x' or `X', specifying a decimal, lower-case
|
||||||
|
hexadecimal, or an uppercase hexadecimal conversion.
|
||||||
|
If the null string (``""'') is used, no replacements will be done.
|
||||||
|
.TP
|
||||||
.B exec
|
.B exec
|
||||||
.RI [ " command "
|
.RI [ " command "
|
||||||
| "" ]
|
| "" ]
|
||||||
@ -409,7 +492,19 @@ invoking ``/bin/sh -ce "\fIcommand\fP"''.
|
|||||||
If the null string (``""'') is used or no
|
If the null string (``""'') is used or no
|
||||||
.B exec
|
.B exec
|
||||||
keyword is specified, conserver will use the command ``/bin/sh -i''.
|
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 [ c = t [ n ] f "[,...]"
|
||||||
|
| "" ]
|
||||||
|
.br
|
||||||
|
Perform character substitutions on the
|
||||||
|
.B exec
|
||||||
|
value.
|
||||||
|
See the
|
||||||
|
.B devicesubst
|
||||||
|
option for an explanation of the format string.
|
||||||
|
If the null string (``""'') is used, no replacements will be done.
|
||||||
.TP
|
.TP
|
||||||
.B host
|
.B host
|
||||||
.I hostname
|
.I hostname
|
||||||
@ -420,7 +515,43 @@ as the host to connect to for accessing the console.
|
|||||||
You must also set the
|
You must also set the
|
||||||
.B port
|
.B port
|
||||||
option as well.
|
option as well.
|
||||||
Only consoles of type ``host'' will use this value.
|
Normally, only consoles of type ``host'' will use this value, however
|
||||||
|
if the
|
||||||
|
.BR devicesubst ,
|
||||||
|
.BR execsubst ,
|
||||||
|
or
|
||||||
|
.B initsubst
|
||||||
|
keywords are used in any console type, this value is used.
|
||||||
|
.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
|
.TP
|
||||||
.B include
|
.B include
|
||||||
.I default
|
.I default
|
||||||
@ -445,18 +576,65 @@ is passed as an argument to ``/bin/sh -ce''.
|
|||||||
If the null string (``""'') is used, the command is unset and
|
If the null string (``""'') is used, the command is unset and
|
||||||
nothing is invoked.
|
nothing is invoked.
|
||||||
.TP
|
.TP
|
||||||
|
.B initsubst
|
||||||
|
.RI [ c = t [ n ] f "[,...]"
|
||||||
|
| "" ]
|
||||||
|
.br
|
||||||
|
Perform character substitutions on the
|
||||||
|
.B initcmd
|
||||||
|
value.
|
||||||
|
See the
|
||||||
|
.B devicesubst
|
||||||
|
option for an explanation of the format string.
|
||||||
|
If the null string (``""'') is used, no replacements will be done.
|
||||||
|
.TP
|
||||||
.B logfile
|
.B logfile
|
||||||
.RI [ " filename "
|
.RI [ " filename "
|
||||||
| "" ]
|
| "" ]
|
||||||
.br
|
.br
|
||||||
Assign the logfile specified by
|
Assign the logfile specified by
|
||||||
.I filename
|
.I filename
|
||||||
to the console. Any occurance of ``&'' in
|
to the console.
|
||||||
|
Any occurrence of ``&'' in
|
||||||
.I filename
|
.I filename
|
||||||
will be replaced with the name of the console.
|
will be replaced with the name of the console.
|
||||||
If the null string (``""'') is used, the logfile name is unset and
|
If the null string (``""'') is used, the logfile name is unset and
|
||||||
no logging will occur.
|
no logging will occur.
|
||||||
.TP
|
.TP
|
||||||
|
.B logfilemax
|
||||||
|
.BR \fInumber\fP [ k | m ]
|
||||||
|
.br
|
||||||
|
Enable automatic rotation of
|
||||||
|
.B logfile
|
||||||
|
once it's size exceeds
|
||||||
|
.I number
|
||||||
|
bytes.
|
||||||
|
Specifying
|
||||||
|
.B k
|
||||||
|
or
|
||||||
|
.B m
|
||||||
|
interpret
|
||||||
|
.I number
|
||||||
|
as kilobytes and megabytes.
|
||||||
|
.I number
|
||||||
|
must be at least 2048 bytes.
|
||||||
|
A value of zero will turn off automatic rotation of
|
||||||
|
.BR logfile .
|
||||||
|
The
|
||||||
|
.B logfile
|
||||||
|
.I filename
|
||||||
|
will be renamed
|
||||||
|
.IR filename -\s-1YYYYMMDD\s0-\s-1HHMMSS\s0,
|
||||||
|
where the extension is the current GMT year, month, day, hour,
|
||||||
|
minute, and second (to prevent issues with clock rollbacks).
|
||||||
|
File sizes are checked every 5 minutes with an additional initial
|
||||||
|
pseudo-random delay of up to one minute (to help prevent all processes
|
||||||
|
checking all consoles simultaneously).
|
||||||
|
2.5% (minimum 100 bytes, maximum 4000 bytes) of the old
|
||||||
|
logfile is read from the end of the file.
|
||||||
|
All data past the first newline is moved (not copied) to the new logfile
|
||||||
|
so that a replay of the console works and starts on a line boundary.
|
||||||
|
.TP
|
||||||
.B master
|
.B master
|
||||||
.RI [ " hostname " | " ipaddr " ]
|
.RI [ " hostname " | " ipaddr " ]
|
||||||
.br
|
.br
|
||||||
@ -554,7 +732,7 @@ The conserver option
|
|||||||
.B \-7
|
.B \-7
|
||||||
will set this flag for all consoles.
|
will set this flag for all consoles.
|
||||||
Default is
|
Default is
|
||||||
.BR !stiphigh .
|
.BR !striphigh .
|
||||||
.TP
|
.TP
|
||||||
.B reinitoncc
|
.B reinitoncc
|
||||||
Automatically reinitialize (``bring up'') a downed console when a client
|
Automatically reinitialize (``bring up'') a downed console when a client
|
||||||
@ -606,17 +784,81 @@ Set the port used to access the console.
|
|||||||
The port may be specified as a
|
The port may be specified as a
|
||||||
.I number
|
.I number
|
||||||
or a
|
or a
|
||||||
.IR name ,
|
.IR name .
|
||||||
in which case it will use
|
A
|
||||||
|
.I name
|
||||||
|
will cause a
|
||||||
.BR getservbyname (3)
|
.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
|
||||||
|
.RI 0.. n
|
||||||
|
or
|
||||||
|
.RI 1.. n
|
||||||
|
(depending on if you like zero-based or one-based numbering).
|
||||||
|
Warning: you can generate a \-1 value with this formula,
|
||||||
|
which will become a very high numbered positive
|
||||||
|
value (since things are stored unsigned).
|
||||||
You must also set the
|
You must also set the
|
||||||
.B host
|
.B host
|
||||||
option as well.
|
option as well.
|
||||||
Only consoles of type ``host'' will use this value.
|
Normally, only consoles of type ``host'' will use this value, however
|
||||||
|
if the
|
||||||
|
.BR devicesubst ,
|
||||||
|
.BR execsubst ,
|
||||||
|
or
|
||||||
|
.B initsubst
|
||||||
|
keywords are used in any console type, this value is used.
|
||||||
|
.TP
|
||||||
|
.B portbase
|
||||||
|
.I number
|
||||||
|
.br
|
||||||
|
Set the base value for the port calculation formula.
|
||||||
|
.I number
|
||||||
|
must be 0 or greater.
|
||||||
|
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.
|
||||||
|
.I number
|
||||||
|
must be 0 or greater.
|
||||||
|
The default is one.
|
||||||
|
See
|
||||||
|
.B port
|
||||||
|
for the details of the formula.
|
||||||
|
.TP
|
||||||
|
.B protocol
|
||||||
|
.RB [ " telnet " | " raw " ]
|
||||||
|
.br
|
||||||
|
Set the protocol used to send and receive data from the console.
|
||||||
|
If
|
||||||
|
.B raw
|
||||||
|
is used, all data is sent ``as is'', unprotected by any protocol specification.
|
||||||
|
If
|
||||||
|
.B telnet
|
||||||
|
is used (which is the default), data is encapsulated in the telnet protocol.
|
||||||
|
The
|
||||||
|
.B striphigh
|
||||||
|
console option still applies when data is read by the server, and if enabled,
|
||||||
|
can impact the encapsulation process.
|
||||||
.TP
|
.TP
|
||||||
.B ro
|
.B ro
|
||||||
.RI [ " username" ,...
|
.RI "[ [\fB!\fP]" username ,...
|
||||||
| "" ]
|
| "" ]
|
||||||
.br
|
.br
|
||||||
Define a list of users making up the read-only access list
|
Define a list of users making up the read-only access list
|
||||||
@ -624,12 +866,15 @@ for the console.
|
|||||||
If
|
If
|
||||||
.I username
|
.I username
|
||||||
matches a previously defined group name, all members of the previous
|
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
|
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
|
||||||
.B rw
|
.B rw
|
||||||
.RI [ " username" ,...
|
.RI "[ [\fB!\fP]" username ,...
|
||||||
| "" ]
|
| "" ]
|
||||||
.br
|
.br
|
||||||
Define a list of users making up the read-write access list
|
Define a list of users making up the read-write access list
|
||||||
@ -637,7 +882,10 @@ for the console.
|
|||||||
If
|
If
|
||||||
.I username
|
.I username
|
||||||
matches a previously defined group name, all members of the previous
|
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
|
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
|
||||||
@ -676,7 +924,8 @@ can be specified to add logging of break sequences sent to the console.
|
|||||||
.B type
|
.B type
|
||||||
.RB [ " device " | " exec " | " host " ]
|
.RB [ " device " | " exec " | " host " ]
|
||||||
.br
|
.br
|
||||||
Set the type of console. The type
|
Set the type of console.
|
||||||
|
The type
|
||||||
.RB `` device ''
|
.RB `` device ''
|
||||||
should be used for local serial ports (also set the
|
should be used for local serial ports (also set the
|
||||||
.B device
|
.B device
|
||||||
@ -702,7 +951,7 @@ Define a user group identified as
|
|||||||
.RS
|
.RS
|
||||||
.TP 15
|
.TP 15
|
||||||
.B users
|
.B users
|
||||||
.RI [ " username" ,...
|
.RI "[ [\fB!\fP]" username ,...
|
||||||
| "" ]
|
| "" ]
|
||||||
.br
|
.br
|
||||||
Define a list of users making up the group
|
Define a list of users making up the group
|
||||||
@ -710,7 +959,10 @@ Define a list of users making up the group
|
|||||||
If
|
If
|
||||||
.I username
|
.I username
|
||||||
matches a previously defined group name, all members of the previous
|
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
|
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.9 2003-07-04 13:20:52-07 bryan Exp $
|
.\" $Id: conserver.passwd.man,v 1.10 2004/01/08 16:12:33 bryan Exp $
|
||||||
.TH CONSERVER.PASSWD 5 "2003-07-04" "conserver-8.0.5" "conserver"
|
.TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.3" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver.passwd \- user access information for
|
conserver.passwd \- user access information for
|
||||||
.BR conserver (8)
|
.BR conserver (8)
|
||||||
@ -59,7 +59,8 @@ in the system
|
|||||||
If PAM support has been enabled
|
If PAM support has been enabled
|
||||||
.RB ( --with-pam ),
|
.RB ( --with-pam ),
|
||||||
PAM lookups will be done instead of
|
PAM lookups will be done instead of
|
||||||
.BR passwd " (or " shadow ") lookups."
|
.BR passwd " (or " shadow ") lookups"
|
||||||
|
(you may need to edit /etc/pam.conf or create /etc/pam.d/conserver).
|
||||||
If this field is empty, password checking is bypassed for this user.
|
If this field is empty, password checking is bypassed for this user.
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
.TP 24
|
.TP 24
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
%!PS-Adobe-2.0 EPSF-1.2
|
%!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
|
%%Title: RJ-11
|
||||||
%%Creator: A Braunsdorf
|
%%Creator: A Braunsdorf
|
||||||
%%CreationDate:
|
%%CreationDate:
|
||||||
|
21
conserver.cf/samples/README
Normal file
21
conserver.cf/samples/README
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
I put together the sample configuration files in this directory in hopes
|
||||||
|
that it would help folks see some of the possibilities of the
|
||||||
|
configuration file format. Each of the files are syntatically correct,
|
||||||
|
but have never actually been used.
|
||||||
|
|
||||||
|
Each file is basically built upon the previous...theoretically, if not
|
||||||
|
actually. Hopefully they'll help show some of the cool things you can
|
||||||
|
do with the configuration file and help those trying to figure out how
|
||||||
|
they should even start.
|
||||||
|
|
||||||
|
simple.cf - A very simple, one console config file
|
||||||
|
|
||||||
|
basic.cf - A config with a couple consoles, mostly using defaults
|
||||||
|
|
||||||
|
average.cf - A config for many consoles, using breaks, user lists,
|
||||||
|
etc...bascially customizing each area
|
||||||
|
|
||||||
|
average-distributed.cf - Taking average.cf to multiple conserver
|
||||||
|
hosts with overrides on those hosts
|
||||||
|
|
||||||
|
Bryan Stansell
|
109
conserver.cf/samples/average-distributed.cf
Normal file
109
conserver.cf/samples/average-distributed.cf
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
#
|
||||||
|
# I took the average.cf file and expanded it to use a distributed
|
||||||
|
# conserver setup...two conserver hosts (conserver1 and conserver2), but
|
||||||
|
# the basic philosophy would hold for many more console and/or conserver
|
||||||
|
# hosts.
|
||||||
|
#
|
||||||
|
|
||||||
|
# ------ define a user group ------
|
||||||
|
group sysadmin {
|
||||||
|
users bryan, todd, dave;
|
||||||
|
}
|
||||||
|
# helpers is everyone but the sysadmin group
|
||||||
|
group helpers {
|
||||||
|
users *, !sysadmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ------ make sure breaks are the way we want --------
|
||||||
|
break 1 { string "\z"; }
|
||||||
|
break 2 { string "\r\d~\d^b"; delay 600; }
|
||||||
|
break 3 { string "#."; }
|
||||||
|
|
||||||
|
|
||||||
|
# ----- define some console types ------
|
||||||
|
# yeah, just setting a break doesn't quite seem worth it, but perhaps,
|
||||||
|
# some day, there will be more host-specific stuff.
|
||||||
|
default sun-std { break 1; }
|
||||||
|
default sun-alt { break 2; }
|
||||||
|
default sun-lom { break 3; }
|
||||||
|
|
||||||
|
|
||||||
|
# ------ defaults ------
|
||||||
|
# we set a 'global' default so we can reuse the bits below. we're going
|
||||||
|
# to set the '*' default, then define consoles, reset the '*' default,
|
||||||
|
# define more consoles, etc.
|
||||||
|
default global {
|
||||||
|
logfile /var/consoles/&; # '&' is replaced with console name
|
||||||
|
timestamp 1hab; # write timestamps
|
||||||
|
rw sysadmin; # allow sysadmins full access
|
||||||
|
ro helpers; # allow helpers to watch
|
||||||
|
include sun-std;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# --------- define our terminal attributes ----------
|
||||||
|
# simple tcp connections are "easy"
|
||||||
|
default cisco { type host; portbase 2000; portinc 1; }
|
||||||
|
default xyplex { type host; portbase 2000; portinc 100; }
|
||||||
|
|
||||||
|
# this is a cyclades card referenced with /dev/ttyC0 through /dev/ttyC31
|
||||||
|
# (referenced as ports 1 through 32 in conserver.cf)
|
||||||
|
# we set the various port calculation bits and pattern substitution to
|
||||||
|
# come up with a generic definition
|
||||||
|
default cyclades { type device; device /dev/ttyC&; baud 9600; parity none;
|
||||||
|
devicesubst &=Pd; portbase -1; portinc 1; host unused; }
|
||||||
|
|
||||||
|
## this is a term server accessed with an ssh command
|
||||||
|
# it too uses pattern substitution and such to get the job done
|
||||||
|
default ciscossh { type exec; portbase 2000; portinc 1;
|
||||||
|
exec /usr/local/bin/ssh -p P -l tsuser H;
|
||||||
|
execsubst H=hs,P=Pd; }
|
||||||
|
|
||||||
|
|
||||||
|
# ------- set the global default for the first conserver host -------
|
||||||
|
# the consoles below (until the default is reset) are managed
|
||||||
|
# by conserver1.conserver.com
|
||||||
|
default * { include global; master conserver1.conserver.com; }
|
||||||
|
|
||||||
|
# ------- define the consoles on ts1.conserver.com --------
|
||||||
|
default ts1.conserver.com { include cisco; host ts1.conserver.com; }
|
||||||
|
console web1.conserver.com { include ts1.conserver.com; port 2; }
|
||||||
|
console ns1.conserver.com { include ts1.conserver.com; port 10; }
|
||||||
|
|
||||||
|
# ------- define the consoles on ts2.conserver.com --------
|
||||||
|
default ts2.conserver.com { include xyplex; host ts2.conserver.com; }
|
||||||
|
console web2.conserver.com { include ts2.conserver.com; port 4; }
|
||||||
|
console ns2.conserver.com { include ts2.conserver.com; port 22; }
|
||||||
|
|
||||||
|
# ------- set the global default for the second conserver host -------
|
||||||
|
# the following consoles are managed by conserver2.conserver.com
|
||||||
|
default * { include global; master conserver2.conserver.com; }
|
||||||
|
|
||||||
|
# ------- define the consoles on ts3.conserver.com --------
|
||||||
|
default ts3.conserver.com { include ciscossh; host ts3.conserver.com; }
|
||||||
|
console ftp1.conserver.com { include ts3.conserver.com; include sun-lom;
|
||||||
|
port 7; }
|
||||||
|
|
||||||
|
# ------- set up the an access list to avoid the default -------
|
||||||
|
# anything *not* matched here will fallback to the default access mode
|
||||||
|
access * {
|
||||||
|
trusted 127.0.0.1;
|
||||||
|
allowed 10.0.0.0/8;
|
||||||
|
}
|
||||||
|
|
||||||
|
# conserver2 has an extra leg that is trusted
|
||||||
|
access conserver2.conserver.com { trusted 192.168.0.0/16; }
|
||||||
|
|
||||||
|
# ------- do some server configuration ---------
|
||||||
|
# both conserver1.conserver.com and conserver2.conserver.com use the same
|
||||||
|
# set of defaults
|
||||||
|
config * {
|
||||||
|
defaultaccess rejected;
|
||||||
|
daemonmode on;
|
||||||
|
logfile /var/log/conserver;
|
||||||
|
}
|
||||||
|
|
||||||
|
# we're going to set the default access on conserver2 to allowed, because
|
||||||
|
# it's in a higher-trust network
|
||||||
|
config conserver2.conserver.com { defaultaccess allowed; }
|
91
conserver.cf/samples/average.cf
Normal file
91
conserver.cf/samples/average.cf
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
#
|
||||||
|
# This would be what i'd expect a more common configuration file would
|
||||||
|
# look like. There are consoles attached to multiple devices, simple
|
||||||
|
# access lists, etc.
|
||||||
|
#
|
||||||
|
|
||||||
|
# ------ define a user group ------
|
||||||
|
group sysadmin {
|
||||||
|
users bryan, todd, dave;
|
||||||
|
}
|
||||||
|
# helpers is everyone but the sysadmin group
|
||||||
|
group helpers {
|
||||||
|
users *, !sysadmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ------ make sure breaks are the way we want --------
|
||||||
|
break 1 { string "\z"; }
|
||||||
|
break 2 { string "\r\d~\d^b"; delay 600; }
|
||||||
|
break 3 { string "#."; }
|
||||||
|
|
||||||
|
|
||||||
|
# ----- define some console types ------
|
||||||
|
# yeah, just setting a break doesn't quite seem worth it, but perhaps,
|
||||||
|
# some day, there will be more host-specific stuff.
|
||||||
|
default sun-std { break 1; }
|
||||||
|
default sun-alt { break 2; }
|
||||||
|
default sun-lom { break 3; }
|
||||||
|
|
||||||
|
|
||||||
|
# ------ defaults ------
|
||||||
|
# now for some generic console defaults so that we don't have to
|
||||||
|
# duplicate them for each console.
|
||||||
|
default * {
|
||||||
|
logfile /var/consoles/&; # '&' is replaced with console name
|
||||||
|
timestamp 1hab; # write timestamps
|
||||||
|
rw sysadmin; # allow sysadmins full access
|
||||||
|
ro helpers; # allow helpers to watch
|
||||||
|
master localhost;
|
||||||
|
include sun-std;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# --------- define our terminal attributes ----------
|
||||||
|
# simple tcp connections are "easy"
|
||||||
|
default cisco { type host; portbase 2000; portinc 1; }
|
||||||
|
default xyplex { type host; portbase 2000; portinc 100; }
|
||||||
|
|
||||||
|
# this is a cyclades card referenced with /dev/ttyC0 through /dev/ttyC31
|
||||||
|
# (referenced as ports 1 through 32 in conserver.cf)
|
||||||
|
# we set the various port calculation bits and pattern substitution to
|
||||||
|
# come up with a generic definition
|
||||||
|
default cyclades { type device; device /dev/ttyC&; baud 9600; parity none;
|
||||||
|
devicesubst &=Pd; portbase -1; portinc 1; host unused; }
|
||||||
|
|
||||||
|
## this is a term server accessed with an ssh command
|
||||||
|
# it too uses pattern substitution and such to get the job done
|
||||||
|
default ciscossh { type exec; portbase 2000; portinc 1;
|
||||||
|
exec /usr/local/bin/ssh -p P -l tsuser H;
|
||||||
|
execsubst H=hs,P=Pd; }
|
||||||
|
|
||||||
|
|
||||||
|
# ------- define the consoles on ts1.conserver.com --------
|
||||||
|
default ts1.conserver.com { include cisco; host ts1.conserver.com; }
|
||||||
|
console web1.conserver.com { include ts1.conserver.com; port 2; }
|
||||||
|
console ns1.conserver.com { include ts1.conserver.com; port 10; }
|
||||||
|
|
||||||
|
# ------- define the consoles on ts2.conserver.com --------
|
||||||
|
default ts2.conserver.com { include xyplex; host ts2.conserver.com; }
|
||||||
|
console web2.conserver.com { include ts2.conserver.com; port 4; }
|
||||||
|
console ns2.conserver.com { include ts2.conserver.com; port 22; }
|
||||||
|
|
||||||
|
# ------- define the consoles on ts3.conserver.com --------
|
||||||
|
default ts3.conserver.com { include ciscossh; host ts3.conserver.com; }
|
||||||
|
console ftp1.conserver.com { include ts3.conserver.com; include sun-lom;
|
||||||
|
port 7; }
|
||||||
|
|
||||||
|
|
||||||
|
# ------- set up the an access list to avoid the default -------
|
||||||
|
# anything *not* matched here will fallback to the default access mode
|
||||||
|
access * {
|
||||||
|
trusted 127.0.0.1;
|
||||||
|
allowed 10.0.0.0/8;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ------- do some server configuration ---------
|
||||||
|
config * {
|
||||||
|
defaultaccess rejected;
|
||||||
|
daemonmode on;
|
||||||
|
logfile /var/log/conserver;
|
||||||
|
}
|
28
conserver.cf/samples/basic.cf
Normal file
28
conserver.cf/samples/basic.cf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#
|
||||||
|
# This is a fairly basic configuration file that interacts with one
|
||||||
|
# terminal server.
|
||||||
|
#
|
||||||
|
|
||||||
|
# first, we're going to set some generic console defaults so that we
|
||||||
|
# don't have to duplicate them for each console.
|
||||||
|
default * {
|
||||||
|
logfile /var/consoles/&; # '&' is replaced with console name
|
||||||
|
timestamp 1hab; # write timestamps
|
||||||
|
rw *; # allow all users
|
||||||
|
master localhost;
|
||||||
|
type host;
|
||||||
|
host ts1.conserver.com; # consoles on ts1.conserver.co
|
||||||
|
portbase 2000; # port numbers start at 2001 and
|
||||||
|
portinc 1; # go up by 1 (port #1 == 2001, etc)
|
||||||
|
}
|
||||||
|
|
||||||
|
# define two consoles on the terminal server
|
||||||
|
console web1.conserver.com { port 2; } # calculates to tcp port 2002
|
||||||
|
console ns1.conserver.com { port 10; } # calculates to tcp port 2010
|
||||||
|
|
||||||
|
# set up the an access list to avoid the default
|
||||||
|
# anything *not* matched here will fallback to the default access (-a)
|
||||||
|
# mode
|
||||||
|
access * {
|
||||||
|
trusted 127.0.0.1;
|
||||||
|
}
|
11
conserver.cf/samples/simple.cf
Normal file
11
conserver.cf/samples/simple.cf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# I believe this is the smallest configuration file that is also fully
|
||||||
|
# functional. You have to be happy with the default access type (-a)
|
||||||
|
# as well as the default access list that gets used.
|
||||||
|
#
|
||||||
|
|
||||||
|
console simple {
|
||||||
|
master localhost;
|
||||||
|
type exec;
|
||||||
|
rw *;
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
# dummy conserver config file
|
# 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 {
|
default full {
|
||||||
rw *;
|
rw *;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
<META name="author" content=
|
<META name="author" content=
|
||||||
"Bryan Stansell <bryan@conserver.com>">
|
"Bryan Stansell <bryan@conserver.com>">
|
||||||
<LINK rel="SHORTCUT ICON" href="conserver.ico">
|
<LINK rel="SHORTCUT ICON" href="conserver.ico">
|
||||||
|
<LINK rel="icon" href="conserver.ico">
|
||||||
|
|
||||||
<TITLE>Conserver</TITLE>
|
<TITLE>Conserver</TITLE>
|
||||||
|
|
||||||
@ -55,11 +56,11 @@
|
|||||||
<INPUT type="HIDDEN" name="method" value="and"> <INPUT
|
<INPUT type="HIDDEN" name="method" value="and"> <INPUT
|
||||||
type="HIDDEN" name="format" value="builtin-long">
|
type="HIDDEN" name="format" value="builtin-long">
|
||||||
<INPUT type="HIDDEN" name="sort" value="score"> <INPUT
|
<INPUT type="HIDDEN" name="sort" value="score"> <INPUT
|
||||||
type="HIDDEN" name="config" value="htdig"> <INPUT type=
|
type="HIDDEN" name="config" value="conserver.com">
|
||||||
"HIDDEN" name="restrict" value=""> <INPUT type="HIDDEN"
|
<INPUT type="HIDDEN" name="restrict" value=""> <INPUT
|
||||||
name="exclude" value=""> <INPUT type="TEXT" size="20"
|
type="HIDDEN" name="exclude" value=""> <INPUT type=
|
||||||
name="words" value=""> <INPUT type="SUBMIT" value=
|
"TEXT" size="20" name="words" value=""> <INPUT type=
|
||||||
"Search">
|
"SUBMIT" value="Search">
|
||||||
</FORM>
|
</FORM>
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
@ -159,35 +160,32 @@
|
|||||||
the website. Next, there's Kevin Braunsdorf's version at
|
the website. Next, there's Kevin Braunsdorf's version at
|
||||||
<A href=
|
<A href=
|
||||||
"ftp://ftp.physics.purdue.edu/pub/pundits/">ftp://ftp.physics.purdue.edu/pub/pundits/</A>.
|
"ftp://ftp.physics.purdue.edu/pub/pundits/">ftp://ftp.physics.purdue.edu/pub/pundits/</A>.
|
||||||
Kevin is semi-actively working on his thread. Doesn't
|
It doesn't look like Kevin is working on his thread ony
|
||||||
look like any new versions have been out since August
|
more either. No new versions have been out since August
|
||||||
2000 (version 8.5), but maybe this info will be out of
|
2000 (version 8.5), but maybe this info will be out of
|
||||||
date by the time you read this. Lastly, the conserver.com
|
date by the time you read this (I last checked Feb 10,
|
||||||
version is based on Kevin's "5.21-Beta" distribution, but
|
2004). Lastly, the conserver.com version is based on
|
||||||
since <B>HEAVILY</B> modified and enhanced (more details
|
Kevin's "5.21-Beta" distribution, but since
|
||||||
in the "Origin" section above).</P>
|
<B>HEAVILY</B> modified and enhanced (more details in the
|
||||||
|
"Origin" section above).</P>
|
||||||
|
|
||||||
<P>If I were looking for a conserver package I would
|
<P>If I were looking for a conserver package I would
|
||||||
either use Kevin's latest distribution or the
|
definitely use the conserver.com distribution. Why? It's
|
||||||
conserver.com distribution. Which one? Well, obviously
|
actively maintained, has many more features than the
|
||||||
I'm biased and believe the conserver.com distribution
|
other versions (see <A href="CHANGES">CHANGES</A> for a
|
||||||
should be your choice, but Kevin's does have UPS (serial
|
semi-scary history), and has an active user community.
|
||||||
port line toggling bits) that the conserver.com version
|
Kevin's version does have UPS support (basic serial port
|
||||||
doesn't have. What does the conserver.com distribution
|
line toggling bits) which is missing in the conserver.com
|
||||||
have? Well, in reality, too many things to list. You'll
|
version, but no one has asked me for it, so does anyone
|
||||||
have to look at the <A href="CHANGES">CHANGES</A> file
|
actually need it?</P>
|
||||||
and see the enhancements, bug fixes, and general
|
|
||||||
development since the original. Don't let the version
|
|
||||||
numbers fool you - you'll have to compare and contrast
|
|
||||||
for yourself.</P>
|
|
||||||
|
|
||||||
<H3>Downloading</H3>
|
<H3>Downloading</H3>
|
||||||
|
|
||||||
<P>The current version, released on Oct 31,2003, is <A
|
<P>The current version, released on Mar 22, 2004, is <A
|
||||||
href="8.0.5.tar.gz">8.0.5.tar.gz</A>. You can get it via
|
href="8.1.3.tar.gz">8.1.3.tar.gz</A>. You can get it via
|
||||||
<A href=
|
<A href=
|
||||||
"ftp://ftp.conserver.com/conserver/8.0.5.tar.gz">FTP</A>
|
"ftp://ftp.conserver.com/conserver/8.1.3.tar.gz">FTP</A>
|
||||||
or <A href="8.0.5.tar.gz">HTTP</A>. See the <A href=
|
or <A href="8.1.3.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>
|
||||||
|
|
||||||
@ -208,6 +206,11 @@
|
|||||||
<P>Check the <A href="INSTALL">INSTALL</A> file for
|
<P>Check the <A href="INSTALL">INSTALL</A> file for
|
||||||
instructions.</P>
|
instructions.</P>
|
||||||
|
|
||||||
|
<H3>Online Documentation</H3>
|
||||||
|
|
||||||
|
<P>I've put a small set of documentation <A href=
|
||||||
|
"docs/">here</A>. I'm hoping to expand it over time.</P>
|
||||||
|
|
||||||
<H3>Systems Tested</H3>
|
<H3>Systems Tested</H3>
|
||||||
|
|
||||||
<P>Here's a list of systems that I've been told can
|
<P>Here's a list of systems that I've been told can
|
||||||
|
@ -6,7 +6,8 @@ exec_prefix = @exec_prefix@
|
|||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
exampledir = $(prefix)/share/examples/conserver
|
datadir = @datadir@
|
||||||
|
exampledir = $(datadir)/examples/conserver
|
||||||
|
|
||||||
### Installation programs and flags
|
### Installation programs and flags
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
@ -27,21 +28,24 @@ LIBS = @LIBS@ @CONSLIBS@
|
|||||||
### Makefile rules - no user-servicable parts below
|
### Makefile rules - no user-servicable parts below
|
||||||
|
|
||||||
CONSERVER_OBJS = access.o client.o consent.o group.o main.o master.o \
|
CONSERVER_OBJS = access.o client.o consent.o group.o main.o master.o \
|
||||||
readcfg.o fallback.o util.o
|
readcfg.o fallback.o cutil.o
|
||||||
CONSERVER_HDRS = ../config.h $(top_srcdir)/compat.h $(srcdir)/access.h \
|
CONSERVER_HDRS = ../config.h $(top_srcdir)/compat.h $(srcdir)/access.h \
|
||||||
$(srcdir)/client.h $(srcdir)/consent.h $(srcdir)/group.h \
|
$(srcdir)/client.h $(srcdir)/consent.h $(srcdir)/cutil.h \
|
||||||
$(srcdir)/main.h $(srcdir)/master.h $(srcdir)/readcfg.h \
|
$(srcdir)/group.h $(srcdir)/main.h $(srcdir)/master.h \
|
||||||
$(srcdir)/util.h
|
$(srcdir)/readcfg.h $(srcdir)/version.h
|
||||||
|
|
||||||
ALL = conserver convert
|
ALL = conserver convert
|
||||||
|
|
||||||
|
|
||||||
all: $(ALL)
|
all: $(ALL)
|
||||||
|
|
||||||
|
$(CONSERVER_OBJS): $(CONSERVER_HDRS)
|
||||||
|
|
||||||
conserver: $(CONSERVER_OBJS)
|
conserver: $(CONSERVER_OBJS)
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o conserver $(CONSERVER_OBJS) $(LIBS)
|
$(CC) $(CFLAGS) $(LDFLAGS) -o conserver $(CONSERVER_OBJS) $(LIBS)
|
||||||
|
|
||||||
convert: convert.o util.o
|
convert: convert.o cutil.o
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o convert convert.o util.o $(LIBS)
|
$(CC) $(CFLAGS) $(LDFLAGS) -o convert convert.o cutil.o $(LIBS)
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
@ -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
|
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.
|
will run into a problem: The sun will halt whenever the cable is unplugged.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: access.c,v 5.68 2003-10-19 22:52:21-07 bryan Exp $
|
* $Id: access.c,v 5.71 2003/11/20 13:56:38 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <access.h>
|
#include <access.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
@ -137,28 +137,54 @@ AccType(addr, peername)
|
|||||||
socklen_t so;
|
socklen_t so;
|
||||||
struct hostent *he = (struct hostent *)0;
|
struct hostent *he = (struct hostent *)0;
|
||||||
int a;
|
int a;
|
||||||
|
char ret;
|
||||||
#if TRUST_REVERSE_DNS
|
#if TRUST_REVERSE_DNS
|
||||||
char *pcName;
|
char **revNames = (char **)0;
|
||||||
int wlen;
|
|
||||||
char *hname;
|
|
||||||
int len;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CONDDEBUG((1, "AccType(): ip=%s", inet_ntoa(*addr)));
|
CONDDEBUG((1, "AccType(): ip=%s", inet_ntoa(*addr)));
|
||||||
|
|
||||||
|
ret = config->defaultaccess;
|
||||||
so = sizeof(*addr);
|
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) {
|
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
||||||
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||||
pACtmp->ctrust));
|
pACtmp->ctrust));
|
||||||
if (pACtmp->isCIDR != 0) {
|
if (pACtmp->isCIDR != 0) {
|
||||||
if (AddrCmp(addr, pACtmp->pcwho) == 0) {
|
if (AddrCmp(addr, pACtmp->pcwho) == 0) {
|
||||||
if (config->loghostnames == FLAGTRUE &&
|
ret = pACtmp->ctrust;
|
||||||
(he =
|
goto common_ret;
|
||||||
gethostbyaddr((char *)addr, so,
|
|
||||||
AF_INET)) != (struct hostent *)0) {
|
|
||||||
*peername = he->h_name;
|
|
||||||
}
|
|
||||||
return pACtmp->ctrust;
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -166,82 +192,83 @@ AccType(addr, peername)
|
|||||||
if ((he = gethostbyname(pACtmp->pcwho)) == (struct hostent *)0) {
|
if ((he = gethostbyname(pACtmp->pcwho)) == (struct hostent *)0) {
|
||||||
Error("AccType(): gethostbyname(%s): %s", pACtmp->pcwho,
|
Error("AccType(): gethostbyname(%s): %s", pACtmp->pcwho,
|
||||||
hstrerror(h_errno));
|
hstrerror(h_errno));
|
||||||
continue;
|
} else if (4 != he->h_length || AF_INET != he->h_addrtype) {
|
||||||
}
|
|
||||||
if (4 != he->h_length || AF_INET != he->h_addrtype) {
|
|
||||||
Error
|
Error
|
||||||
("AccType(): gethostbyname(%s): wrong address size (4 != %d) or address family (%d != %d)",
|
("AccType(): gethostbyname(%s): wrong address size (4 != %d) or address family (%d != %d)",
|
||||||
pACtmp->pcwho, he->h_length, AF_INET, he->h_addrtype);
|
pACtmp->pcwho, he->h_length, AF_INET, he->h_addrtype);
|
||||||
continue;
|
} else {
|
||||||
}
|
for (a = 0; he->h_addr_list[a] != (char *)0; a++) {
|
||||||
for (a = 0; he->h_addr_list[a] != (char *)0; a++) {
|
CONDDEBUG((1, "AccType(): addr=%s",
|
||||||
CONDDEBUG((1, "AccType(): addr=%s",
|
inet_ntoa(*(struct in_addr *)
|
||||||
inet_ntoa(*(struct in_addr *)
|
(he->h_addr_list[a]))));
|
||||||
(he->h_addr_list[a]))));
|
if (
|
||||||
if (
|
|
||||||
#if HAVE_MEMCMP
|
#if HAVE_MEMCMP
|
||||||
memcmp(&(addr->s_addr), he->h_addr_list[a],
|
memcmp(&(addr->s_addr), he->h_addr_list[a],
|
||||||
he->h_length)
|
he->h_length)
|
||||||
#else
|
#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
|
#endif
|
||||||
== 0) {
|
== 0) {
|
||||||
if (config->loghostnames == FLAGTRUE &&
|
ret = pACtmp->ctrust;
|
||||||
(he =
|
goto common_ret;
|
||||||
gethostbyaddr((char *)addr, so,
|
|
||||||
AF_INET)) != (struct hostent *)0) {
|
|
||||||
*peername = he->h_name;
|
|
||||||
}
|
}
|
||||||
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 TRUST_REVERSE_DNS
|
||||||
/* if we trust reverse dns, we get the names associated with
|
if (revNames != (char **)0 && revNames[0] != (char *)0)
|
||||||
* the address we're checking and then check each of those
|
*peername = StrDup(revNames[0]);
|
||||||
* against the access list entries.
|
#else
|
||||||
* we chop bits off client names so that we can put domain
|
if ((he =
|
||||||
* names in access lists or even top-level domains.
|
gethostbyaddr((char *)addr, so,
|
||||||
* allowed conserver.com, net;
|
AF_INET)) != (struct hostent *)0) {
|
||||||
* this allows anything from conserver.com and anything in
|
*peername = StrDup(he->h_name);
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#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
|
#endif
|
||||||
if (config->loghostnames == FLAGTRUE &&
|
return ret;
|
||||||
(he =
|
|
||||||
gethostbyaddr((char *)addr, so,
|
|
||||||
AF_INET)) != (struct hostent *)0) {
|
|
||||||
*peername = he->h_name;
|
|
||||||
}
|
|
||||||
return config->defaultaccess;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: client.c,v 5.72 2003-10-02 18:49:13-07 bryan Exp $
|
* $Id: client.c,v 5.81 2004/03/20 14:40:40 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <access.h>
|
#include <access.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
@ -97,15 +97,15 @@ FindWrite(pCE)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
Replay(CONSFILE *fdLog, CONSFILE *fdOut, int iBack)
|
Replay(CONSENT *pCE, CONSFILE *fdOut, int iBack)
|
||||||
#else
|
#else
|
||||||
Replay(fdLog, fdOut, iBack)
|
Replay(pCE, fdOut, iBack)
|
||||||
CONSFILE *fdLog;
|
CONSENT *pCE;
|
||||||
CONSFILE *fdOut;
|
CONSFILE *fdOut;
|
||||||
int iBack;
|
int iBack;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
CONSFILE *fdLog = (CONSFILE *)0;
|
||||||
off_t file_pos;
|
off_t file_pos;
|
||||||
off_t buf_pos;
|
off_t buf_pos;
|
||||||
char *buf;
|
char *buf;
|
||||||
@ -130,7 +130,16 @@ Replay(fdLog, fdOut, iBack)
|
|||||||
unsigned long dmallocMarkReplay = 0;
|
unsigned long dmallocMarkReplay = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((CONSFILE *)0 == fdLog) {
|
if (pCE != (CONSENT *)0) {
|
||||||
|
fdLog = pCE->fdlog;
|
||||||
|
|
||||||
|
/* no logfile and down and logfile defined? try and open it */
|
||||||
|
if (fdLog == (CONSFILE *)0 && !pCE->fup &&
|
||||||
|
pCE->logfile != (char *)0)
|
||||||
|
fdLog = FileOpen(pCE->logfile, O_RDONLY, 0644);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fdLog == (CONSFILE *)0) {
|
||||||
FileWrite(fdOut, FLAGFALSE, "[no log file on this console]\r\n",
|
FileWrite(fdOut, FLAGFALSE, "[no log file on this console]\r\n",
|
||||||
-1);
|
-1);
|
||||||
return;
|
return;
|
||||||
@ -179,17 +188,9 @@ Replay(fdLog, fdOut, iBack)
|
|||||||
* the rest (as we work our way back in the file) should be
|
* the rest (as we work our way back in the file) should be
|
||||||
*/
|
*/
|
||||||
buf_pos = (file_pos / BUFSIZ) * BUFSIZ;
|
buf_pos = (file_pos / BUFSIZ) * BUFSIZ;
|
||||||
#if defined(SEEK_SET)
|
|
||||||
/* PTX and maybe other Posix systems
|
|
||||||
*/
|
|
||||||
if (FileSeek(fdLog, buf_pos, SEEK_SET) < 0) {
|
if (FileSeek(fdLog, buf_pos, SEEK_SET) < 0) {
|
||||||
goto common_exit;
|
goto common_exit;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (FileSeek(fdLog, buf_pos, L_SET) < 0) {
|
|
||||||
goto common_exit;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if ((r = FileRead(fdLog, buf, BUFSIZ)) < 0) {
|
if ((r = FileRead(fdLog, buf, BUFSIZ)) < 0) {
|
||||||
goto common_exit;
|
goto common_exit;
|
||||||
}
|
}
|
||||||
@ -246,8 +247,9 @@ Replay(fdLog, fdOut, iBack)
|
|||||||
InitString(lines[ln].line);
|
InitString(lines[ln].line);
|
||||||
} else {
|
} else {
|
||||||
BuildString((char *)0, lines[ln - 1].line);
|
BuildString((char *)0, lines[ln - 1].line);
|
||||||
BuildString(lines[ln].line->string,
|
BuildStringN(lines[ln].line->string,
|
||||||
lines[ln - 1].line);
|
lines[ln].line->used - 1,
|
||||||
|
lines[ln - 1].line);
|
||||||
BuildString((char *)0, lines[ln].line);
|
BuildString((char *)0, lines[ln].line);
|
||||||
}
|
}
|
||||||
ln--;
|
ln--;
|
||||||
@ -313,8 +315,9 @@ Replay(fdLog, fdOut, iBack)
|
|||||||
if ((char *)0 != s) {
|
if ((char *)0 != s) {
|
||||||
*s = '\000';
|
*s = '\000';
|
||||||
}
|
}
|
||||||
FileWrite(fdOut, FLAGTRUE, lines[i].line->string, -1);
|
FileWrite(fdOut, FLAGTRUE, lines[i].line->string,
|
||||||
FileWrite(fdOut, FLAGTRUE, " .. ", -1);
|
lines[i].line->used - 1);
|
||||||
|
FileWrite(fdOut, FLAGTRUE, " .. ", 4);
|
||||||
|
|
||||||
/* build the end string by removing the leading "[-- MARK -- "
|
/* build the end string by removing the leading "[-- MARK -- "
|
||||||
* and replacing "]\r\n" on the end with " -- MARK --]\r\n"
|
* and replacing "]\r\n" on the end with " -- MARK --]\r\n"
|
||||||
@ -331,11 +334,16 @@ Replay(fdLog, fdOut, iBack)
|
|||||||
u = lines[i].mark_end->used;
|
u = lines[i].mark_end->used;
|
||||||
s = lines[i].mark_end->string;
|
s = lines[i].mark_end->string;
|
||||||
} else
|
} else
|
||||||
FileWrite(fdOut, FLAGFALSE, lines[i].line->string, -1);
|
FileWrite(fdOut, FLAGFALSE, lines[i].line->string,
|
||||||
|
lines[i].line->used - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
common_exit:
|
common_exit:
|
||||||
|
|
||||||
|
/* if we opened the logfile, close it */
|
||||||
|
if (fdLog != pCE->fdlog)
|
||||||
|
FileClose(&fdLog);
|
||||||
|
|
||||||
if ((struct lines *)0 != lines) {
|
if ((struct lines *)0 != lines) {
|
||||||
for (i = 0; i < n_lines; i++) {
|
for (i = 0; i < n_lines; i++) {
|
||||||
DestroyString(lines[i].mark_end);
|
DestroyString(lines[i].mark_end);
|
||||||
@ -359,8 +367,7 @@ Replay(fdLog, fdOut, iBack)
|
|||||||
*/
|
*/
|
||||||
#define WHEN_SPY 0x01
|
#define WHEN_SPY 0x01
|
||||||
#define WHEN_ATTACH 0x02
|
#define WHEN_ATTACH 0x02
|
||||||
#define WHEN_VT100 0x04
|
#define WHEN_EXPERT 0x04 /* ZZZ no way to set his yet */
|
||||||
#define WHEN_EXPERT 0x08 /* ZZZ no way to set his yet */
|
|
||||||
#define WHEN_ALWAYS 0x40
|
#define WHEN_ALWAYS 0x40
|
||||||
|
|
||||||
#define HALFLINE 40
|
#define HALFLINE 40
|
||||||
@ -372,6 +379,7 @@ typedef struct HLnode {
|
|||||||
|
|
||||||
static HELP aHLTable[] = {
|
static HELP aHLTable[] = {
|
||||||
{WHEN_ALWAYS, ". disconnect"},
|
{WHEN_ALWAYS, ". disconnect"},
|
||||||
|
{WHEN_ALWAYS, "; move to another console"},
|
||||||
{WHEN_ALWAYS, "a attach read/write"},
|
{WHEN_ALWAYS, "a attach read/write"},
|
||||||
{WHEN_ALWAYS, "b send broadcast message"},
|
{WHEN_ALWAYS, "b send broadcast message"},
|
||||||
{WHEN_ATTACH, "c toggle flow control"},
|
{WHEN_ATTACH, "c toggle flow control"},
|
||||||
@ -394,17 +402,13 @@ static HELP aHLTable[] = {
|
|||||||
{WHEN_ALWAYS, "w who is on this console"},
|
{WHEN_ALWAYS, "w who is on this console"},
|
||||||
{WHEN_ALWAYS, "x show console baud info"},
|
{WHEN_ALWAYS, "x show console baud info"},
|
||||||
{WHEN_ALWAYS, "z suspend the connection"},
|
{WHEN_ALWAYS, "z suspend the connection"},
|
||||||
{WHEN_ALWAYS, "<cr> ignore/abort command"},
|
{WHEN_ATTACH, "| attach local command"},
|
||||||
{WHEN_ALWAYS, "? print this message"},
|
{WHEN_ALWAYS, "? print this message"},
|
||||||
|
{WHEN_ALWAYS, "<cr> ignore/abort command"},
|
||||||
{WHEN_ALWAYS, "^R replay the last line"},
|
{WHEN_ALWAYS, "^R replay the last line"},
|
||||||
{WHEN_ATTACH, "\\ooo send character by octal code"},
|
{WHEN_ATTACH, "\\ooo send character by octal code"},
|
||||||
{WHEN_EXPERT, "^I toggle tab expansion"},
|
{WHEN_EXPERT, "^I toggle tab expansion"},
|
||||||
{WHEN_EXPERT, "; change to another console"},
|
|
||||||
{WHEN_EXPERT, "+(-) do (not) drop line"},
|
{WHEN_EXPERT, "+(-) do (not) drop line"},
|
||||||
{WHEN_VT100, "PF1 print this message"},
|
|
||||||
{WHEN_VT100, "PF2 disconnect"},
|
|
||||||
{WHEN_VT100, "PF3 replay the last 20 lines"},
|
|
||||||
{WHEN_VT100, "PF4 spy read only"}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* list the commands we know for the user (ksb)
|
/* list the commands we know for the user (ksb)
|
||||||
@ -433,9 +437,6 @@ HelpUser(pCL)
|
|||||||
} else {
|
} else {
|
||||||
FileWrite(pCL->fd, FLAGTRUE, acH2, sizeof(acH2) - 1);
|
FileWrite(pCL->fd, FLAGTRUE, acH2, sizeof(acH2) - 1);
|
||||||
}
|
}
|
||||||
if ('\033' == pCL->ic[0] && 'O' == pCL->ic[1]) {
|
|
||||||
iCmp |= WHEN_VT100;
|
|
||||||
}
|
|
||||||
|
|
||||||
BuildString((char *)0, acLine);
|
BuildString((char *)0, acLine);
|
||||||
for (i = 0; i < sizeof(aHLTable) / sizeof(HELP); ++i) {
|
for (i = 0; i < sizeof(aHLTable) / sizeof(HELP); ++i) {
|
||||||
@ -449,12 +450,14 @@ HelpUser(pCL)
|
|||||||
}
|
}
|
||||||
BuildString(aHLTable[i].actext, acLine);
|
BuildString(aHLTable[i].actext, acLine);
|
||||||
BuildString(acEoln, acLine);
|
BuildString(acEoln, acLine);
|
||||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
|
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
|
||||||
|
acLine->used - 1);
|
||||||
BuildString((char *)0, acLine);
|
BuildString((char *)0, acLine);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
BuildString(acEoln, acLine);
|
BuildString(acEoln, acLine);
|
||||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
|
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
|
||||||
|
acLine->used - 1);
|
||||||
BuildString((char *)0, acLine);
|
BuildString((char *)0, acLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -463,14 +466,15 @@ HelpUser(pCL)
|
|||||||
BuildString(aHLTable[i].actext, acLine);
|
BuildString(aHLTable[i].actext, acLine);
|
||||||
if (acLine->used > HALFLINE) {
|
if (acLine->used > HALFLINE) {
|
||||||
BuildString(acEoln, acLine);
|
BuildString(acEoln, acLine);
|
||||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string, -1);
|
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
|
||||||
|
acLine->used - 1);
|
||||||
BuildString((char *)0, acLine);
|
BuildString((char *)0, acLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (acLine->used != 0) {
|
if (acLine->used != 0) {
|
||||||
BuildString(acEoln, acLine);
|
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);
|
FileWrite(pCL->fd, FLAGFALSE, (char *)0, 0);
|
||||||
}
|
}
|
||||||
@ -530,5 +534,7 @@ ClientAccessOk(pCL)
|
|||||||
else
|
else
|
||||||
BuildString("<unknown>", pCL->peername);
|
BuildString("<unknown>", pCL->peername);
|
||||||
}
|
}
|
||||||
|
if (peername != (char *)0)
|
||||||
|
free(peername);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: client.h,v 5.33 2003-10-10 03:28:49-07 bryan Exp $
|
* $Id: client.h,v 5.36 2003/12/25 19:22:00 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -46,7 +46,9 @@ typedef enum clientState {
|
|||||||
S_IDENT, /* probational connection (who is this) */
|
S_IDENT, /* probational connection (who is this) */
|
||||||
S_PASSWD, /* still needs a passwd to connect */
|
S_PASSWD, /* still needs a passwd to connect */
|
||||||
S_QUOTE, /* send any character we can spell */
|
S_QUOTE, /* send any character we can spell */
|
||||||
S_BCAST /* send a broadcast message to all clients */
|
S_BCAST, /* send a broadcast message to all clients */
|
||||||
|
S_CWAIT, /* wait for client */
|
||||||
|
S_CEXEC /* client execing a program */
|
||||||
} CLIENTSTATE;
|
} CLIENTSTATE;
|
||||||
|
|
||||||
typedef struct client { /* Connection Information: */
|
typedef struct client { /* Connection Information: */
|
||||||
@ -82,7 +84,7 @@ typedef struct client { /* Connection Information: */
|
|||||||
cnct_port; /* where from */
|
cnct_port; /* where from */
|
||||||
} CONSCLIENT;
|
} CONSCLIENT;
|
||||||
|
|
||||||
extern void Replay PARAMS((CONSFILE *, CONSFILE *, int));
|
extern void Replay PARAMS((CONSENT *, CONSFILE *, int));
|
||||||
extern void HelpUser PARAMS((CONSCLIENT *));
|
extern void HelpUser PARAMS((CONSCLIENT *));
|
||||||
extern void FindWrite PARAMS((CONSENT *));
|
extern void FindWrite PARAMS((CONSENT *));
|
||||||
extern int ClientAccessOk PARAMS((CONSCLIENT *));
|
extern int ClientAccessOk PARAMS((CONSCLIENT *));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: consent.c,v 5.128 2003-09-30 13:14:04-07 bryan Exp $
|
* $Id: consent.c,v 5.137 2004/02/20 14:58:13 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
#include <group.h>
|
#include <group.h>
|
||||||
@ -236,6 +236,23 @@ TtyDev(pCE)
|
|||||||
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (fDebug >= 2) {
|
||||||
|
int i;
|
||||||
|
Debug(2, "TtyDev(): [%s] termp.c_iflag=%lu", pCE->server,
|
||||||
|
(unsigned long)termp.c_iflag);
|
||||||
|
Debug(2, "TtyDev(): [%s] termp.c_oflag=%lu", pCE->server,
|
||||||
|
(unsigned long)termp.c_oflag);
|
||||||
|
Debug(2, "TtyDev(): [%s] termp.c_cflag=%lu", pCE->server,
|
||||||
|
(unsigned long)termp.c_cflag);
|
||||||
|
Debug(2, "TtyDev(): [%s] termp.c_lflag=%lu", pCE->server,
|
||||||
|
(unsigned long)termp.c_lflag);
|
||||||
|
#if defined(NCCS)
|
||||||
|
for (i = 0; i < NCCS; i++) {
|
||||||
|
Debug(2, "TtyDev(): [%s] termp.c_cc[%d]=%lu", pCE->server, i,
|
||||||
|
(unsigned long)termp.c_cc[i]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
# if HAVE_STROPTS_H
|
# if HAVE_STROPTS_H
|
||||||
/*
|
/*
|
||||||
* eat all the streams modules upto and including ttcompat
|
* eat all the streams modules upto and including ttcompat
|
||||||
@ -261,12 +278,12 @@ StopInit(pCE)
|
|||||||
|
|
||||||
if (pCE->initpid != 0) {
|
if (pCE->initpid != 0) {
|
||||||
kill(pCE->initpid, SIGHUP);
|
kill(pCE->initpid, SIGHUP);
|
||||||
pCE->initpid = 0;
|
|
||||||
Verbose("[%s] initcmd terminated: pid %lu", pCE->server,
|
|
||||||
(unsigned long)pCE->initpid);
|
|
||||||
TagLogfileAct(pCE, "initcmd terminated");
|
|
||||||
CONDDEBUG((1, "StopInit(): sending initcmd pid %lu signal %d",
|
CONDDEBUG((1, "StopInit(): sending initcmd pid %lu signal %d",
|
||||||
(unsigned long)pCE->initpid, SIGHUP));
|
(unsigned long)pCE->initpid, SIGHUP));
|
||||||
|
Msg("[%s] initcmd terminated: pid %lu", pCE->server,
|
||||||
|
(unsigned long)pCE->initpid);
|
||||||
|
TagLogfileAct(pCE, "initcmd terminated");
|
||||||
|
pCE->initpid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pCE->initfile != (CONSFILE *)0) {
|
if (pCE->initfile != (CONSFILE *)0) {
|
||||||
@ -359,8 +376,8 @@ StartInit(pCE)
|
|||||||
pCE->initpid = 0;
|
pCE->initpid = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Verbose("[%s] initcmd started: pid %lu", pCE->server,
|
Msg("[%s] initcmd started: pid %lu", pCE->server,
|
||||||
(unsigned long)pCE->initpid);
|
(unsigned long)pCE->initpid);
|
||||||
TagLogfileAct(pCE, "initcmd started");
|
TagLogfileAct(pCE, "initcmd started");
|
||||||
FD_SET(pin[0], &rinit);
|
FD_SET(pin[0], &rinit);
|
||||||
if (maxfd < pin[0] + 1)
|
if (maxfd < pin[0] + 1)
|
||||||
@ -691,7 +708,7 @@ ConsInit(pCE)
|
|||||||
TagLogfile(pCE, "Console up");
|
TagLogfile(pCE, "Console up");
|
||||||
|
|
||||||
switch (pCE->type) {
|
switch (pCE->type) {
|
||||||
case UNKNOWN: /* shut up gcc */
|
case UNKNOWNTYPE: /* shut up gcc */
|
||||||
break;
|
break;
|
||||||
case EXEC:
|
case EXEC:
|
||||||
if ((cofile =
|
if ((cofile =
|
||||||
@ -741,7 +758,7 @@ ConsInit(pCE)
|
|||||||
hp->h_length);
|
hp->h_length);
|
||||||
#endif
|
#endif
|
||||||
port.sin_family = hp->h_addrtype;
|
port.sin_family = hp->h_addrtype;
|
||||||
port.sin_port = htons(pCE->port);
|
port.sin_port = htons(pCE->netport);
|
||||||
|
|
||||||
if ((cofile = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
if ((cofile = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||||
Error
|
Error
|
||||||
@ -792,6 +809,9 @@ ConsInit(pCE)
|
|||||||
} else {
|
} else {
|
||||||
pCE->ioState = INCONNECT;
|
pCE->ioState = INCONNECT;
|
||||||
pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT;
|
pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT;
|
||||||
|
if (timers[T_STATE] == (time_t)0 ||
|
||||||
|
timers[T_STATE] > pCE->stateTimer)
|
||||||
|
timers[T_STATE] = pCE->stateTimer;
|
||||||
pCE->fup = 1;
|
pCE->fup = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -823,14 +843,14 @@ ConsInit(pCE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (pCE->type) {
|
switch (pCE->type) {
|
||||||
case UNKNOWN: /* shut up gcc */
|
case UNKNOWNTYPE: /* shut up gcc */
|
||||||
break;
|
break;
|
||||||
case EXEC:
|
case EXEC:
|
||||||
Verbose("[%s] pid %lu on %s", pCE->server, pCE->ipid,
|
Verbose("[%s] pid %lu on %s", pCE->server, pCE->ipid,
|
||||||
pCE->execSlave);
|
pCE->execSlave);
|
||||||
break;
|
break;
|
||||||
case HOST:
|
case HOST:
|
||||||
Verbose("[%s] port %hu on %s", pCE->server, pCE->port,
|
Verbose("[%s] port %hu on %s", pCE->server, pCE->netport,
|
||||||
pCE->host);
|
pCE->host);
|
||||||
break;
|
break;
|
||||||
case DEVICE:
|
case DEVICE:
|
||||||
@ -839,13 +859,28 @@ ConsInit(pCE)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_SET(cofile, &rinit);
|
/* if we're waiting for connect() to finish, watch the
|
||||||
|
* write bit, otherwise watch for the read bit
|
||||||
|
*/
|
||||||
|
if (pCE->ioState == INCONNECT)
|
||||||
|
FD_SET(cofile, &winit);
|
||||||
|
else
|
||||||
|
FD_SET(cofile, &rinit);
|
||||||
if (maxfd < cofile + 1)
|
if (maxfd < cofile + 1)
|
||||||
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_CIDLE] == (time_t)0 ||
|
||||||
|
timers[T_CIDLE] > pCE->lastWrite + pCE->idletimeout))
|
||||||
|
timers[T_CIDLE] = pCE->lastWrite + pCE->idletimeout;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we have marks, adjust the next one so that it's in the future */
|
/* If we have marks, adjust the next one so that it's in the future */
|
||||||
if (pCE->nextMark > 0) {
|
if (pCE->nextMark > 0) {
|
||||||
tyme = time((time_t *)0);
|
|
||||||
if (tyme >= pCE->nextMark) {
|
if (tyme >= pCE->nextMark) {
|
||||||
/* Add as many pCE->mark values as necessary so that we move
|
/* Add as many pCE->mark values as necessary so that we move
|
||||||
* beyond the current time.
|
* beyond the current time.
|
||||||
@ -856,7 +891,10 @@ ConsInit(pCE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pCE->downHard == FLAGTRUE) {
|
if (pCE->downHard == FLAGTRUE) {
|
||||||
Msg("[%s] console up", pCE->server);
|
if (pCE->ioState == ISNORMAL)
|
||||||
|
Msg("[%s] console up", pCE->server);
|
||||||
|
else
|
||||||
|
Msg("[%s] console initializing", pCE->server);
|
||||||
pCE->downHard = FLAGFALSE;
|
pCE->downHard = FLAGFALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: consent.h,v 5.48 2003-10-02 18:49:03-07 bryan Exp $
|
* $Id: consent.h,v 5.56 2004/02/20 14:58:14 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -52,7 +52,7 @@ typedef struct parity { /* a parity bits table */
|
|||||||
} PARITY;
|
} PARITY;
|
||||||
|
|
||||||
typedef enum consType {
|
typedef enum consType {
|
||||||
UNKNOWN = 0,
|
UNKNOWNTYPE = 0,
|
||||||
DEVICE,
|
DEVICE,
|
||||||
EXEC,
|
EXEC,
|
||||||
HOST
|
HOST
|
||||||
@ -65,6 +65,7 @@ typedef struct names {
|
|||||||
|
|
||||||
typedef struct consentUsers {
|
typedef struct consentUsers {
|
||||||
NAMES *user;
|
NAMES *user;
|
||||||
|
short not;
|
||||||
struct consentUsers *next;
|
struct consentUsers *next;
|
||||||
} CONSENTUSERS;
|
} CONSENTUSERS;
|
||||||
|
|
||||||
@ -78,6 +79,7 @@ typedef struct consent { /* console information */
|
|||||||
NAMES *aliases; /* aliases for server name */
|
NAMES *aliases; /* aliases for server name */
|
||||||
/* type == DEVICE */
|
/* type == DEVICE */
|
||||||
char *device; /* device file */
|
char *device; /* device file */
|
||||||
|
char *devicesubst; /* device substitution pattern */
|
||||||
BAUD *baud; /* the baud on this console port */
|
BAUD *baud; /* the baud on this console port */
|
||||||
PARITY *parity; /* the parity on this line */
|
PARITY *parity; /* the parity on this line */
|
||||||
FLAG hupcl; /* use HUPCL */
|
FLAG hupcl; /* use HUPCL */
|
||||||
@ -90,15 +92,24 @@ typedef struct consent { /* console information */
|
|||||||
#endif
|
#endif
|
||||||
/* type == HOST */
|
/* type == HOST */
|
||||||
char *host; /* hostname */
|
char *host; /* hostname */
|
||||||
unsigned short port; /* port number */
|
unsigned short netport; /* final port | netport = portbase + */
|
||||||
|
unsigned short port; /* port number | portinc * port */
|
||||||
|
unsigned short portbase; /* port base */
|
||||||
|
unsigned short portinc; /* port increment */
|
||||||
|
unsigned short raw; /* raw or telnet protocol? */
|
||||||
/* type == EXEC */
|
/* type == EXEC */
|
||||||
char *exec; /* exec command */
|
char *exec; /* exec command */
|
||||||
|
char *execsubst; /* exec substitution pattern */
|
||||||
/* global stuff */
|
/* global stuff */
|
||||||
char *master; /* master hostname */
|
char *master; /* master hostname */
|
||||||
unsigned short breakNum; /* break type [1-9] */
|
unsigned short breakNum; /* break type [1-9] */
|
||||||
char *logfile; /* logfile */
|
char *logfile; /* logfile */
|
||||||
|
off_t logfilemax; /* size limit for rolling logfile */
|
||||||
char *initcmd; /* initcmd command */
|
char *initcmd; /* initcmd command */
|
||||||
|
char *initsubst; /* initcmd substitution pattern */
|
||||||
char *motd; /* motd */
|
char *motd; /* motd */
|
||||||
|
time_t idletimeout; /* idle timeout */
|
||||||
|
char *idlestring; /* string to print when idle */
|
||||||
/* timestamp stuff */
|
/* timestamp stuff */
|
||||||
int mark; /* Mark (chime) interval */
|
int mark; /* Mark (chime) interval */
|
||||||
long nextMark; /* Next mark (chime) time */
|
long nextMark; /* Next mark (chime) time */
|
||||||
@ -123,6 +134,7 @@ typedef struct consent { /* console information */
|
|||||||
int wbufIAC; /* next IAC location in wbuf */
|
int wbufIAC; /* next IAC location in wbuf */
|
||||||
IOSTATE ioState; /* state of the socket */
|
IOSTATE ioState; /* state of the socket */
|
||||||
time_t stateTimer; /* timer for ioState states */
|
time_t stateTimer; /* timer for ioState states */
|
||||||
|
time_t lastWrite; /* time of last data sent to console */
|
||||||
|
|
||||||
/*** state information ***/
|
/*** state information ***/
|
||||||
char acline[132 * 2 + 2]; /* max chars we will call a line */
|
char acline[132 * 2 + 2]; /* max chars we will call a line */
|
||||||
|
@ -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.38 2003-09-22 08:33:41-07 bryan Exp $
|
.\" $Id: conserver.man,v 1.43 2004/03/23 01:02:29 bryan Exp $
|
||||||
.TH CONSERVER 8 "2003-09-22" "conserver-8.0.5" "conserver"
|
.TH CONSERVER 8 "2004/03/23" "conserver-8.1.3" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver \- console server daemon
|
conserver \- console server daemon
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -26,6 +26,8 @@ conserver \- console server daemon
|
|||||||
.IR logfile ]
|
.IR logfile ]
|
||||||
.RB [ \-O
|
.RB [ \-O
|
||||||
.IR min ]
|
.IR min ]
|
||||||
|
.RB [ \-U
|
||||||
|
.IR logfile ]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B Conserver
|
.B Conserver
|
||||||
is the daemon that manages
|
is the daemon that manages
|
||||||
@ -93,7 +95,7 @@ Close all connections and exit.
|
|||||||
.TP
|
.TP
|
||||||
SIGHUP
|
SIGHUP
|
||||||
Reread the configuration file.
|
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,
|
consoles (and their clients) are dropped,
|
||||||
and changes to consoles are done "in place", resetting the console
|
and changes to consoles are done "in place", resetting the console
|
||||||
port (bringing it down and up) only when necessary.
|
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
|
the public portion is in
|
||||||
.IB OPENSSL_ROOT /ssl/certs
|
.IB OPENSSL_ROOT /ssl/certs
|
||||||
(on both the client and server sides).
|
(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
|
.B contrib/maketestcerts
|
||||||
for further clues.
|
for further clues.
|
||||||
To allow
|
To allow
|
||||||
@ -322,6 +324,37 @@ connect to remote consoles will result in an informative message to the user.
|
|||||||
.B \-S
|
.B \-S
|
||||||
Do not run the server, just perform a syntax check of configuration file and
|
Do not run the server, just perform a syntax check of configuration file and
|
||||||
exit with a non-zero value if there is an error.
|
exit with a non-zero value if there is an error.
|
||||||
|
Using more than one
|
||||||
|
.B \-S
|
||||||
|
will cause conserver to output various information about each console in 5
|
||||||
|
colon-separated fields, enclosed in curly-braces.
|
||||||
|
The philosophy behind the output is to provide information to allow external
|
||||||
|
detection of multiple consoles access the same physical port.
|
||||||
|
Since this is
|
||||||
|
.I highly
|
||||||
|
environment-specific, conserver cannot do the check internally.
|
||||||
|
.RS
|
||||||
|
.TP 9
|
||||||
|
.I name
|
||||||
|
The name of the console.
|
||||||
|
.TP
|
||||||
|
.I master
|
||||||
|
The hostname of the master conserver host for the console.
|
||||||
|
.TP
|
||||||
|
.I aliases
|
||||||
|
The console aliases in a comma-separated list.
|
||||||
|
.TP
|
||||||
|
.I type
|
||||||
|
The type of console.
|
||||||
|
Values will be a `/' for a local device, `|' for
|
||||||
|
a command, or `!' for a remote port.
|
||||||
|
.TP
|
||||||
|
.I details
|
||||||
|
Multiple values are comma-separated and depend on the type of the console.
|
||||||
|
Local devices will have the values of the device file and baud rate/parity.
|
||||||
|
Commands will have string to invoke.
|
||||||
|
Remote ports will have the values of the remote hostname and port number.
|
||||||
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B \-u
|
.B \-u
|
||||||
Send unloved console output to
|
Send unloved console output to
|
||||||
@ -332,6 +365,17 @@ independent of whether logging of individual consoles is enabled via
|
|||||||
.B conserver.cf
|
.B conserver.cf
|
||||||
entries.
|
entries.
|
||||||
.TP
|
.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
|
.B \-v
|
||||||
Echo the configuration as it is being read (be verbose).
|
Echo the configuration as it is being read (be verbose).
|
||||||
.TP
|
.TP
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
bryan:r71mXjfALB5Ak:any
|
|
||||||
djs:r71mXjfALB5Ak:login
|
|
||||||
chogan:*passwd*:foobar,login,shell
|
|
||||||
hogan:*passwd*:any
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: convert.c,v 1.7 2003-08-15 14:24:39-07 bryan Exp $
|
* $Id: convert.c,v 1.8 2003/11/20 13:56:38 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
#include <group.h>
|
#include <group.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: util.c,v 1.102 2003-10-03 06:32:34-07 bryan Exp $
|
* $Id: cutil.c,v 1.116 2004/03/19 05:23:21 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
@ -143,7 +143,10 @@ BuildString(str, msg)
|
|||||||
CONDDEBUG((3, "BuildString(): 0x%lx reset", (void *)msg));
|
CONDDEBUG((3, "BuildString(): 0x%lx reset", (void *)msg));
|
||||||
return msg->string;
|
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 (msg->used + len >= msg->allocated) {
|
||||||
if (0 == msg->allocated) {
|
if (0 == msg->allocated) {
|
||||||
msg->allocated =
|
msg->allocated =
|
||||||
@ -161,13 +164,19 @@ BuildString(str, msg)
|
|||||||
if (msg->string == (char *)0)
|
if (msg->string == (char *)0)
|
||||||
OutOfMem();
|
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
|
#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)
|
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;
|
msg->used += len;
|
||||||
CONDDEBUG((3, "BuildString(): 0x%lx added %d chars (%d/%d now)",
|
CONDDEBUG((3, "BuildString(): 0x%lx added %d chars (%d/%d now)",
|
||||||
(void *)msg, len, msg->used, msg->allocated));
|
(void *)msg, len, msg->used, msg->allocated));
|
||||||
@ -195,12 +204,10 @@ BuildStringN(str, n, msg)
|
|||||||
}
|
}
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
return msg->string;
|
return msg->string;
|
||||||
len = strlen(str) + 1;
|
if (msg->used)
|
||||||
if (len > n) { /* if we're a substring */
|
|
||||||
len = n;
|
len = n;
|
||||||
if (str[n - 1] != '\000') /* if we aren't copying a '\000', */
|
else
|
||||||
len++; /* we need to add one at the end */
|
len = n + 1;
|
||||||
}
|
|
||||||
if (msg->used + len >= msg->allocated) {
|
if (msg->used + len >= msg->allocated) {
|
||||||
if (0 == msg->allocated) {
|
if (0 == msg->allocated) {
|
||||||
msg->allocated =
|
msg->allocated =
|
||||||
@ -219,20 +226,47 @@ BuildStringN(str, n, msg)
|
|||||||
OutOfMem();
|
OutOfMem();
|
||||||
}
|
}
|
||||||
#if HAVE_MEMCPY
|
#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
|
#else
|
||||||
bcopy(str, msg->string + (msg->used ? msg->used - 1 : 0), len);
|
bcopy(str, msg->string + (msg->used ? msg->used - 1 : 0), n);
|
||||||
#endif
|
#endif
|
||||||
if (len > n) /* we need to terminate the string */
|
/* add a NULL */
|
||||||
msg->string[(msg->used ? msg->used - 1 : 0) + len - 1] = '\000';
|
msg->string[(msg->used ? msg->used - 1 : 0) + n] = '\000';
|
||||||
if (msg->used)
|
|
||||||
len--;
|
|
||||||
msg->used += len;
|
msg->used += len;
|
||||||
CONDDEBUG((3, "BuildStringN(): 0x%lx added %d chars (%d/%d now)",
|
CONDDEBUG((3, "BuildStringN(): 0x%lx added %d chars (%d/%d now)",
|
||||||
(void *)msg, len, msg->used, msg->allocated));
|
(void *)msg, len, msg->used, msg->allocated));
|
||||||
return msg->string;
|
return msg->string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
#if PROTOTYPES
|
||||||
|
MemMove(void *dest, void *src, size_t n)
|
||||||
|
#else
|
||||||
|
MemMove(void *dest, void *src, size_t n)
|
||||||
|
void *dest;
|
||||||
|
void *src;
|
||||||
|
size_t n;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
#if HAVE_MEMMOVE
|
||||||
|
return memmove(dest, src, n);
|
||||||
|
#else
|
||||||
|
char *s = src;
|
||||||
|
char *d = dest;
|
||||||
|
|
||||||
|
if (s < d) {
|
||||||
|
/* Moving from low mem to hi mem; start at end. */
|
||||||
|
for (s += n, d += n; n > 0; --n)
|
||||||
|
*--d = *--s;
|
||||||
|
} else if (s != d) {
|
||||||
|
/* Moving from hi mem to low mem; start at beginning. */
|
||||||
|
for (; n > 0; --n)
|
||||||
|
*d++ = *s++;
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
ShiftString(STRING *msg, int n)
|
ShiftString(STRING *msg, int n)
|
||||||
@ -245,17 +279,8 @@ ShiftString(msg, n)
|
|||||||
if (msg == (STRING *)0 || n <= 0 || n > msg->used - 1)
|
if (msg == (STRING *)0 || n <= 0 || n > msg->used - 1)
|
||||||
return (char *)0;
|
return (char *)0;
|
||||||
|
|
||||||
#if HAVE_MEMMOVE
|
MemMove(msg->string, msg->string + n, msg->used - n);
|
||||||
memmove(msg->string, msg->string + n, msg->used - n);
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
char *s, *e;
|
|
||||||
int len;
|
|
||||||
for (s = msg->string, e = s + n, len = msg->used - n; len > 0;
|
|
||||||
len--)
|
|
||||||
*s++ = *e++;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
msg->used -= n;
|
msg->used -= n;
|
||||||
return msg->string;
|
return msg->string;
|
||||||
}
|
}
|
||||||
@ -725,6 +750,27 @@ FileOpenFD(fd, type)
|
|||||||
cfp->ssl = (SSL *)0;
|
cfp->ssl = (SSL *)0;
|
||||||
cfp->waitForRead = cfp->waitForWrite = FLAGFALSE;
|
cfp->waitForRead = cfp->waitForWrite = FLAGFALSE;
|
||||||
#endif
|
#endif
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
sprintf(buf, "CONSFILE-%s-%lu-%d.w", progname,
|
||||||
|
(unsigned long)thepid, fd);
|
||||||
|
if ((cfp->debugwfd =
|
||||||
|
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
|
||||||
|
sprintf(buf, "[---- STARTED - %s ----]\n",
|
||||||
|
StrTime((time_t *)0));
|
||||||
|
write(cfp->debugwfd, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
sprintf(buf, "CONSFILE-%s-%lu-%d.r", progname,
|
||||||
|
(unsigned long)thepid, fd);
|
||||||
|
if ((cfp->debugrfd =
|
||||||
|
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
|
||||||
|
sprintf(buf, "[---- STARTED - %s ----]\n",
|
||||||
|
StrTime((time_t *)0));
|
||||||
|
write(cfp->debugrfd, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CONDDEBUG((2, "FileOpenFD(): encapsulated fd %d type %d", fd, type));
|
CONDDEBUG((2, "FileOpenFD(): encapsulated fd %d type %d", fd, type));
|
||||||
return cfp;
|
return cfp;
|
||||||
@ -755,6 +801,27 @@ FileOpenPipe(fd, fdout)
|
|||||||
cfp->ssl = (SSL *)0;
|
cfp->ssl = (SSL *)0;
|
||||||
cfp->waitForRead = cfp->waitForWrite = FLAGFALSE;
|
cfp->waitForRead = cfp->waitForWrite = FLAGFALSE;
|
||||||
#endif
|
#endif
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
sprintf(buf, "CONSFILE-%s-%lu-%d.w", progname,
|
||||||
|
(unsigned long)thepid, fdout);
|
||||||
|
if ((cfp->debugwfd =
|
||||||
|
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
|
||||||
|
sprintf(buf, "[---- STARTED - %s ----]\n",
|
||||||
|
StrTime((time_t *)0));
|
||||||
|
write(cfp->debugwfd, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
sprintf(buf, "CONSFILE-%s-%lu-%d.r", progname,
|
||||||
|
(unsigned long)thepid, fd);
|
||||||
|
if ((cfp->debugrfd =
|
||||||
|
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
|
||||||
|
sprintf(buf, "[---- STARTED - %s ----]\n",
|
||||||
|
StrTime((time_t *)0));
|
||||||
|
write(cfp->debugrfd, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CONDDEBUG((2, "FileOpenPipe(): encapsulated pipe pair fd %d and fd %d",
|
CONDDEBUG((2, "FileOpenPipe(): encapsulated pipe pair fd %d and fd %d",
|
||||||
fd, fdout));
|
fd, fdout));
|
||||||
@ -772,6 +839,9 @@ FileUnopen(cfp)
|
|||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
|
if (cfp == (CONSFILE *)0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
switch (cfp->ftype) {
|
switch (cfp->ftype) {
|
||||||
case simpleFile:
|
case simpleFile:
|
||||||
retval = cfp->fd;
|
retval = cfp->fd;
|
||||||
@ -793,6 +863,12 @@ FileUnopen(cfp)
|
|||||||
}
|
}
|
||||||
CONDDEBUG((2, "FileUnopen(): unopened fd %d", cfp->fd));
|
CONDDEBUG((2, "FileUnopen(): unopened fd %d", cfp->fd));
|
||||||
DestroyString(cfp->wbuf);
|
DestroyString(cfp->wbuf);
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
if (cfp->debugwfd != -1)
|
||||||
|
close(cfp->debugwfd);
|
||||||
|
if (cfp->debugrfd != -1)
|
||||||
|
close(cfp->debugrfd);
|
||||||
|
#endif
|
||||||
free(cfp);
|
free(cfp);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
@ -828,6 +904,27 @@ FileOpen(path, flag, mode)
|
|||||||
cfp->ssl = (SSL *)0;
|
cfp->ssl = (SSL *)0;
|
||||||
cfp->waitForRead = cfp->waitForWrite = FLAGFALSE;
|
cfp->waitForRead = cfp->waitForWrite = FLAGFALSE;
|
||||||
#endif
|
#endif
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
sprintf(buf, "CONSFILE-%s-%lu-%d.w", progname,
|
||||||
|
(unsigned long)thepid, fd);
|
||||||
|
if ((cfp->debugwfd =
|
||||||
|
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
|
||||||
|
sprintf(buf, "[---- STARTED - %s ----]\n",
|
||||||
|
StrTime((time_t *)0));
|
||||||
|
write(cfp->debugwfd, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
sprintf(buf, "CONSFILE-%s-%lu-%d.r", progname,
|
||||||
|
(unsigned long)thepid, fd);
|
||||||
|
if ((cfp->debugrfd =
|
||||||
|
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
|
||||||
|
sprintf(buf, "[---- STARTED - %s ----]\n",
|
||||||
|
StrTime((time_t *)0));
|
||||||
|
write(cfp->debugrfd, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CONDDEBUG((2, "FileOpen(): opened `%s' as fd %d", path, fd));
|
CONDDEBUG((2, "FileOpen(): opened `%s' as fd %d", path, fd));
|
||||||
return cfp;
|
return cfp;
|
||||||
@ -874,15 +971,15 @@ FileClose(pcfp)
|
|||||||
/* flush out the client socket - set it to blocking,
|
/* flush out the client socket - set it to blocking,
|
||||||
* then write to it
|
* then write to it
|
||||||
*/
|
*/
|
||||||
SetFlags(cfp->fd, 0, O_NONBLOCK)
|
SetFlags(cfp->fd, 0, O_NONBLOCK);
|
||||||
|
|
||||||
/* sent it a byte - guaranteed to block - ensure delivery
|
/* sent it a byte - guaranteed to block - ensure delivery
|
||||||
* of prior data yeah - this is a bit paranoid - try
|
* of prior data yeah - this is a bit paranoid - try
|
||||||
* without this at first
|
* without this at first
|
||||||
*/
|
*/
|
||||||
/* write(cfp->fd, "\n", 1); */
|
/* write(cfp->fd, "\n", 1); */
|
||||||
/* this is the guts of the workaround for Winsock close bug */
|
/* this is the guts of the workaround for Winsock close bug */
|
||||||
shutdown(cfp->fd, 1);
|
shutdown(cfp->fd, 1);
|
||||||
|
|
||||||
/* enable lingering */
|
/* enable lingering */
|
||||||
lingeropt.l_onoff = 1;
|
lingeropt.l_onoff = 1;
|
||||||
@ -916,8 +1013,19 @@ FileClose(pcfp)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
CONDDEBUG((2, "FileClose(): closed fd %d", cfp->fd));
|
if (cfp->ftype == simplePipe) {
|
||||||
|
CONDDEBUG((2, "FileClose(): closed fd %d/%d", cfp->fd,
|
||||||
|
cfp->fdout));
|
||||||
|
} else {
|
||||||
|
CONDDEBUG((2, "FileClose(): closed fd %d", cfp->fd));
|
||||||
|
}
|
||||||
DestroyString(cfp->wbuf);
|
DestroyString(cfp->wbuf);
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
if (cfp->debugwfd != -1)
|
||||||
|
close(cfp->debugwfd);
|
||||||
|
if (cfp->debugrfd != -1)
|
||||||
|
close(cfp->debugrfd);
|
||||||
|
#endif
|
||||||
free(cfp);
|
free(cfp);
|
||||||
*pcfp = (CONSFILE *)0;
|
*pcfp = (CONSFILE *)0;
|
||||||
|
|
||||||
@ -959,6 +1067,10 @@ FileRead(cfp, buf, len)
|
|||||||
retval = -1;
|
retval = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
if (cfp->debugrfd != -1)
|
||||||
|
write(cfp->debugrfd, buf, retval);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
@ -997,6 +1109,10 @@ FileRead(cfp, buf, len)
|
|||||||
cfp->ftype = simpleSocket;
|
cfp->ftype = simpleSocket;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
if (cfp->debugrfd != -1)
|
||||||
|
write(cfp->debugrfd, buf, retval);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
@ -1070,9 +1186,23 @@ FileWrite(cfp, bufferonly, buf, len)
|
|||||||
tmpString->string, fdout));
|
tmpString->string, fdout));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save the data */
|
/* save the data */
|
||||||
if (len > 0 && buf != (char *)0)
|
if (len > 0 && buf != (char *)0) {
|
||||||
BuildStringN(buf, len, cfp->wbuf);
|
if (cfp->quoteiac == FLAGTRUE) {
|
||||||
|
int l, o;
|
||||||
|
for (o = l = 0; l < len; l++) {
|
||||||
|
if (buf[l] == (char)OB_IAC) {
|
||||||
|
BuildStringN(buf + o, l + 1 - o, cfp->wbuf);
|
||||||
|
BuildStringChar((char)OB_IAC, cfp->wbuf);
|
||||||
|
o = l + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (o < len)
|
||||||
|
BuildStringN(buf + o, len - o, cfp->wbuf);
|
||||||
|
} else
|
||||||
|
BuildStringN(buf, len, cfp->wbuf);
|
||||||
|
}
|
||||||
|
|
||||||
if (bufferonly == FLAGTRUE)
|
if (bufferonly == FLAGTRUE)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1103,12 +1233,29 @@ FileWrite(cfp, bufferonly, buf, len)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
retval = -1;
|
retval = -1;
|
||||||
|
/* i believe, as of 8.0.8, we need to just ignore
|
||||||
|
* this and actually produce the error message
|
||||||
|
* below. perhaps we'll have a lot of extra
|
||||||
|
* FileWrite() errors, perhaps not. things shouldn't
|
||||||
|
* just close down and cause errors in normal cases,
|
||||||
|
* right?!? -bryan
|
||||||
|
* maybe not right now, actually. i'm going to check
|
||||||
|
* the return code of FileWrite() on the "important"
|
||||||
|
* things and let the others silently fail and have
|
||||||
|
* the FileRead() catch problems - like it has been
|
||||||
|
* doing. i really should be checking all the return
|
||||||
|
* codes...and i'm sure i'll get there eventually.
|
||||||
|
*/
|
||||||
if (errno == EPIPE)
|
if (errno == EPIPE)
|
||||||
break;
|
break;
|
||||||
Error("FileWrite(): fd %d: %s", fdout,
|
Error("FileWrite(): fd %d: %s", fdout,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
if (cfp->debugwfd != -1)
|
||||||
|
write(cfp->debugwfd, buf, retval);
|
||||||
|
#endif
|
||||||
buf += retval;
|
buf += retval;
|
||||||
len -= retval;
|
len -= retval;
|
||||||
len_out += retval;
|
len_out += retval;
|
||||||
@ -1153,6 +1300,10 @@ FileWrite(cfp, bufferonly, buf, len)
|
|||||||
}
|
}
|
||||||
if (retval <= 0)
|
if (retval <= 0)
|
||||||
break;
|
break;
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
if (cfp->debugwfd != -1)
|
||||||
|
write(cfp->debugwfd, buf, retval);
|
||||||
|
#endif
|
||||||
buf += retval;
|
buf += retval;
|
||||||
len -= retval;
|
len -= retval;
|
||||||
len_out += retval;
|
len_out += retval;
|
||||||
@ -1281,9 +1432,13 @@ VWrite(cfp, bufferonly, str, fmt, ap)
|
|||||||
{
|
{
|
||||||
int s, l, e;
|
int s, l, e;
|
||||||
char c;
|
char c;
|
||||||
|
int fmtlen = 0;
|
||||||
|
int fmtpre = 0;
|
||||||
|
short padzero = 0;
|
||||||
|
short sawdot = 0;
|
||||||
static STRING *msg = (STRING *)0;
|
static STRING *msg = (STRING *)0;
|
||||||
static STRING *output = (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))
|
if (fmt == (char *)0 || (cfp == (CONSFILE *)0 && str == (STRING *)0))
|
||||||
return;
|
return;
|
||||||
@ -1295,18 +1450,12 @@ VWrite(cfp, bufferonly, str, fmt, ap)
|
|||||||
|
|
||||||
BuildString((char *)0, output);
|
BuildString((char *)0, output);
|
||||||
|
|
||||||
fneg = flong = 0;
|
|
||||||
for (e = s = l = 0; (c = fmt[s + l]) != '\000'; l++) {
|
for (e = s = l = 0; (c = fmt[s + l]) != '\000'; l++) {
|
||||||
if (c == '%') {
|
if (e == 0 && c == '%') {
|
||||||
if (e) {
|
e = 1;
|
||||||
e = 0;
|
BuildStringN(fmt + s, l, output);
|
||||||
BuildStringChar('%', output);
|
s += l;
|
||||||
} else {
|
l = 0;
|
||||||
e = 1;
|
|
||||||
BuildStringN(fmt + s, l, output);
|
|
||||||
s += l;
|
|
||||||
l = 0;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
@ -1314,64 +1463,172 @@ VWrite(cfp, bufferonly, str, fmt, ap)
|
|||||||
int u;
|
int u;
|
||||||
char *p;
|
char *p;
|
||||||
char cc;
|
char cc;
|
||||||
switch (c) {
|
if (c >= '0' && c <= '9') {
|
||||||
case 'h':
|
if (sawdot == 0) {
|
||||||
/* noop since shorts are promoted to int in va_arg */
|
if (c == '0' && fmtlen == 0)
|
||||||
continue;
|
padzero = 1;
|
||||||
case 'l':
|
fmtlen = fmtlen * 10 + (c - '0');
|
||||||
flong = 1;
|
} else {
|
||||||
continue;
|
fmtpre = fmtpre * 10 + (c - '0');
|
||||||
case 'c':
|
}
|
||||||
cc = (char)va_arg(ap, int);
|
} else {
|
||||||
BuildStringChar(cc, output);
|
switch (c) {
|
||||||
break;
|
case '.':
|
||||||
case 's':
|
sawdot = 1;
|
||||||
p = va_arg(ap, char *);
|
continue;
|
||||||
BuildString(p, output);
|
case '-':
|
||||||
break;
|
fminus = 1;
|
||||||
case 'd':
|
continue;
|
||||||
i = (flong ? va_arg(ap, long) : (long)va_arg(ap, int));
|
case 'h':
|
||||||
if ((long)i < 0) {
|
/* noop since shorts are promoted to int in va_arg */
|
||||||
fneg = 1;
|
continue;
|
||||||
i = -i;
|
case 'l':
|
||||||
}
|
flong = 1;
|
||||||
goto number;
|
continue;
|
||||||
case 'u':
|
case '%':
|
||||||
i = (flong ? va_arg(ap, unsigned long)
|
BuildStringChar('%', output);
|
||||||
: (unsigned long)va_arg(ap, unsigned int));
|
break;
|
||||||
number:
|
case 'c':
|
||||||
BuildString((char *)0, msg);
|
cc = (char)va_arg(ap, int);
|
||||||
while (i >= 10) {
|
BuildStringChar(cc, output);
|
||||||
BuildStringChar((i % 10) + '0', msg);
|
break;
|
||||||
i /= 10;
|
case 's':
|
||||||
}
|
p = va_arg(ap, char *);
|
||||||
BuildStringChar(i + '0', msg);
|
if (p == (char *)0)
|
||||||
/* reverse the text to put it in forward order
|
p = "(null)";
|
||||||
*/
|
{
|
||||||
u = msg->used - 1;
|
int l = strlen(p);
|
||||||
for (i = 0; i < u / 2; i++) {
|
int c;
|
||||||
char temp;
|
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];
|
if (fmtpre > 0) {
|
||||||
msg->string[i]
|
padzero = 0;
|
||||||
= msg->string[u - i - 1];
|
if (fmtpre > fmtlen)
|
||||||
msg->string[u - i - 1] = temp;
|
fmtlen = fmtpre;
|
||||||
}
|
while (msg->used - 1 < fmtpre)
|
||||||
if (fneg) {
|
BuildStringChar('0', msg);
|
||||||
BuildStringChar('-', output);
|
}
|
||||||
fneg = 0;
|
|
||||||
}
|
/* reverse the text to put it in forward order
|
||||||
BuildString(msg->string, output);
|
*/
|
||||||
break;
|
u = msg->used - 1;
|
||||||
default:
|
for (i = 0; i < u / 2; i++) {
|
||||||
Error
|
char temp;
|
||||||
("VWrite(): unknown conversion character `%c' in `%s'",
|
|
||||||
c, fmt);
|
temp = msg->string[i];
|
||||||
break;
|
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)
|
if (l)
|
||||||
@ -1412,6 +1669,28 @@ BuildStringPrint(str, fmt, va_alist)
|
|||||||
return str->string;
|
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
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
FileVWrite(CONSFILE *cfp, FLAG bufferonly, char *fmt, va_list ap)
|
FileVWrite(CONSFILE *cfp, FLAG bufferonly, char *fmt, va_list ap)
|
||||||
@ -1608,6 +1887,71 @@ FileSetType(cfp, type)
|
|||||||
cfp->ftype = type;
|
cfp->ftype = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sets the file quoting method */
|
||||||
|
void
|
||||||
|
#if PROTOTYPES
|
||||||
|
FileSetQuoteIAC(CONSFILE *cfp, FLAG flag)
|
||||||
|
#else
|
||||||
|
FileSetQuoteIAC(cfp, flag)
|
||||||
|
CONSFILE *cfp;
|
||||||
|
FLAG flag;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
cfp->quoteiac = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
FLAG
|
||||||
|
#if PROTOTYPES
|
||||||
|
FileSawQuoteSusp(CONSFILE *cfp)
|
||||||
|
#else
|
||||||
|
FileSawQuoteSusp(cfp)
|
||||||
|
CONSFILE *cfp;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
FLAG r = cfp->sawiacsusp;
|
||||||
|
cfp->sawiacsusp = FLAGFALSE;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
FLAG
|
||||||
|
#if PROTOTYPES
|
||||||
|
FileSawQuoteExec(CONSFILE *cfp)
|
||||||
|
#else
|
||||||
|
FileSawQuoteExec(cfp)
|
||||||
|
CONSFILE *cfp;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
FLAG r = cfp->sawiacexec;
|
||||||
|
cfp->sawiacexec = FLAGFALSE;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
FLAG
|
||||||
|
#if PROTOTYPES
|
||||||
|
FileSawQuoteAbrt(CONSFILE *cfp)
|
||||||
|
#else
|
||||||
|
FileSawQuoteAbrt(cfp)
|
||||||
|
CONSFILE *cfp;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
FLAG r = cfp->sawiacabrt;
|
||||||
|
cfp->sawiacabrt = FLAGFALSE;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
FLAG
|
||||||
|
#if PROTOTYPES
|
||||||
|
FileSawQuoteGoto(CONSFILE *cfp)
|
||||||
|
#else
|
||||||
|
FileSawQuoteGoto(cfp)
|
||||||
|
CONSFILE *cfp;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
FLAG r = cfp->sawiacgoto;
|
||||||
|
cfp->sawiacgoto = FLAGFALSE;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
/* Get the SSL instance */
|
/* Get the SSL instance */
|
||||||
SSL *
|
SSL *
|
||||||
@ -1939,3 +2283,108 @@ StrDup(msg)
|
|||||||
#endif
|
#endif
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
#if PROTOTYPES
|
||||||
|
StringChar(STRING *msg, int offset, char c)
|
||||||
|
#else
|
||||||
|
StringChar(msg, offset, c)
|
||||||
|
STRING *msg;
|
||||||
|
int offset;
|
||||||
|
char c;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int o;
|
||||||
|
|
||||||
|
if (msg == (STRING *)0 || msg->used <= 1 || offset < 0 ||
|
||||||
|
offset > msg->used)
|
||||||
|
return (char *)0;
|
||||||
|
|
||||||
|
for (o = offset; o != msg->used; o++) {
|
||||||
|
if (msg->string[o] == c)
|
||||||
|
return &(msg->string[o]);
|
||||||
|
}
|
||||||
|
return (char *)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this takes a buffer, and returns the number of characters to use,
|
||||||
|
* which goes up to the first OB_IAC character sequence (that isn't
|
||||||
|
* OB_IAC/OB_IAC). if it is an OB_IAC sequence, it sets the flag and
|
||||||
|
* returns zero. if it's invalid args, we return -1.
|
||||||
|
* so <0 == no data, 0 == check flags, >0 number of chars to use
|
||||||
|
* this *WILL* modify the buffer (OB_IAC sequences get extracted/shrunk)
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
#if PROTOTYPES
|
||||||
|
ParseIACBuf(CONSFILE *cfp, void *msg, int *len)
|
||||||
|
#else
|
||||||
|
ParseIACBuf(cfp, msg, len)
|
||||||
|
CONSFILE *cfp;
|
||||||
|
void *msg;
|
||||||
|
int *len;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int l = 0;
|
||||||
|
unsigned char *b = msg;
|
||||||
|
|
||||||
|
if (*len <= 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (cfp->quoteiac != FLAGTRUE)
|
||||||
|
return *len;
|
||||||
|
|
||||||
|
/* split OB_IAC/char pair OR OB_IAC at start */
|
||||||
|
if (cfp->sawiac == FLAGTRUE || b[0] == OB_IAC) {
|
||||||
|
int i = 1;
|
||||||
|
|
||||||
|
if (cfp->sawiac == FLAGTRUE) {
|
||||||
|
i = 0;
|
||||||
|
cfp->sawiac = FLAGFALSE;
|
||||||
|
}
|
||||||
|
if (i == *len) { /* only thing is OB_IAC */
|
||||||
|
cfp->sawiac = FLAGTRUE;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b[i] == OB_SUSP)
|
||||||
|
cfp->sawiacsusp = FLAGTRUE;
|
||||||
|
else if (b[i] == OB_EXEC)
|
||||||
|
cfp->sawiacexec = FLAGTRUE;
|
||||||
|
else if (b[i] == OB_ABRT)
|
||||||
|
cfp->sawiacabrt = FLAGTRUE;
|
||||||
|
else if (b[i] == OB_GOTO)
|
||||||
|
cfp->sawiacgoto = FLAGTRUE;
|
||||||
|
else {
|
||||||
|
if (b[i] != OB_IAC)
|
||||||
|
Error
|
||||||
|
("ParseIACBuf(): fd %d: unrecognized quoted-OB_IAC char",
|
||||||
|
cfp->fd, strerror(errno));
|
||||||
|
l = 1;
|
||||||
|
}
|
||||||
|
*len = *len - i - 1 + l;
|
||||||
|
MemMove(b, b + i + 1 - l, *len);
|
||||||
|
if (l == 0)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (; l < *len; l++) {
|
||||||
|
if (b[l] == OB_IAC) {
|
||||||
|
if (l + 1 == *len)
|
||||||
|
return l;
|
||||||
|
else if (b[l + 1] == OB_SUSP)
|
||||||
|
return l;
|
||||||
|
else if (b[l + 1] == OB_EXEC)
|
||||||
|
return l;
|
||||||
|
else if (b[l + 1] == OB_ABRT)
|
||||||
|
return l;
|
||||||
|
else {
|
||||||
|
if (b[l + 1] != OB_IAC)
|
||||||
|
Error
|
||||||
|
("ParseIACBuf(): fd %d: unrecognized quoted-OB_IAC char",
|
||||||
|
cfp->fd, strerror(errno));
|
||||||
|
--(*len);
|
||||||
|
MemMove(b + l, b + l + 1, *len - l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return l;
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: util.h,v 1.55 2003-10-03 06:32:34-07 bryan Exp $
|
* $Id: cutil.h,v 1.61 2004/03/10 02:55:45 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -18,8 +18,11 @@
|
|||||||
|
|
||||||
/* communication constants
|
/* communication constants
|
||||||
*/
|
*/
|
||||||
|
#define OB_IAC 0xff /* quote char */
|
||||||
|
#define OB_EXEC 'E' /* exec a command on the client */
|
||||||
|
#define OB_GOTO 'G' /* goto next console */
|
||||||
#define OB_SUSP 'Z' /* suspended by server */
|
#define OB_SUSP 'Z' /* suspended by server */
|
||||||
#define OB_DROP '.' /* dropped by server */
|
#define OB_ABRT '.' /* abort */
|
||||||
|
|
||||||
/* Struct to wrap information about a "file"...
|
/* Struct to wrap information about a "file"...
|
||||||
* This can be a socket, local file, whatever. We do this so
|
* This can be a socket, local file, whatever. We do this so
|
||||||
@ -67,6 +70,12 @@ typedef struct consFile {
|
|||||||
int fd;
|
int fd;
|
||||||
int fdout; /* only used when a simplePipe */
|
int fdout; /* only used when a simplePipe */
|
||||||
STRING *wbuf;
|
STRING *wbuf;
|
||||||
|
FLAG quoteiac;
|
||||||
|
FLAG sawiac;
|
||||||
|
FLAG sawiacsusp;
|
||||||
|
FLAG sawiacexec;
|
||||||
|
FLAG sawiacabrt;
|
||||||
|
FLAG sawiacgoto;
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
/* SSL stuff */
|
/* SSL stuff */
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
@ -74,6 +83,10 @@ typedef struct consFile {
|
|||||||
FLAG waitForRead;
|
FLAG waitForRead;
|
||||||
#endif
|
#endif
|
||||||
/* Add crypto stuff to suit */
|
/* Add crypto stuff to suit */
|
||||||
|
#if DEBUG_CONSFILE_IO
|
||||||
|
int debugrfd;
|
||||||
|
int debugwfd;
|
||||||
|
#endif
|
||||||
} CONSFILE;
|
} CONSFILE;
|
||||||
|
|
||||||
extern int isMultiProc, fDebug, fVerbose, fErrorPrinted;
|
extern int isMultiProc, fDebug, fVerbose, fErrorPrinted;
|
||||||
@ -114,6 +127,7 @@ extern int FileUnopen PARAMS((CONSFILE *));
|
|||||||
extern void OutOfMem PARAMS(());
|
extern void OutOfMem PARAMS(());
|
||||||
extern char *BuildTmpString PARAMS((const char *));
|
extern char *BuildTmpString PARAMS((const char *));
|
||||||
extern char *BuildTmpStringChar PARAMS((const char));
|
extern char *BuildTmpStringChar PARAMS((const char));
|
||||||
|
extern char *BuildTmpStringPrint PARAMS((char *, ...));
|
||||||
extern char *BuildString PARAMS((const char *, STRING *));
|
extern char *BuildString PARAMS((const char *, STRING *));
|
||||||
extern char *BuildStringChar PARAMS((const char, STRING *));
|
extern char *BuildStringChar PARAMS((const char, STRING *));
|
||||||
extern char *BuildStringPrint PARAMS((STRING *, char *, ...));
|
extern char *BuildStringPrint PARAMS((STRING *, char *, ...));
|
||||||
@ -126,6 +140,11 @@ extern STRING *AllocString PARAMS((void));
|
|||||||
extern char *ReadLine PARAMS((FILE *, STRING *, int *));
|
extern char *ReadLine PARAMS((FILE *, STRING *, int *));
|
||||||
extern enum consFileType FileGetType PARAMS((CONSFILE *));
|
extern enum consFileType FileGetType PARAMS((CONSFILE *));
|
||||||
extern void FileSetType PARAMS((CONSFILE *, enum consFileType));
|
extern void FileSetType PARAMS((CONSFILE *, enum consFileType));
|
||||||
|
extern void FileSetQuoteIAC PARAMS((CONSFILE *, FLAG));
|
||||||
|
extern FLAG FileSawQuoteSusp PARAMS((CONSFILE *));
|
||||||
|
extern FLAG FileSawQuoteExec PARAMS((CONSFILE *));
|
||||||
|
extern FLAG FileSawQuoteAbrt PARAMS((CONSFILE *));
|
||||||
|
extern FLAG FileSawQuoteGoto PARAMS((CONSFILE *));
|
||||||
extern void Bye PARAMS((int));
|
extern void Bye PARAMS((int));
|
||||||
extern void DestroyDataStructures PARAMS((void));
|
extern void DestroyDataStructures PARAMS((void));
|
||||||
extern int IsMe PARAMS((char *));
|
extern int IsMe PARAMS((char *));
|
||||||
@ -135,6 +154,9 @@ extern int FileCanWrite PARAMS((CONSFILE *, fd_set *, fd_set *));
|
|||||||
extern int FileBufEmpty PARAMS((CONSFILE *));
|
extern int FileBufEmpty PARAMS((CONSFILE *));
|
||||||
extern int SetFlags PARAMS((int, int, int));
|
extern int SetFlags PARAMS((int, int, int));
|
||||||
extern char *StrDup PARAMS((char *));
|
extern char *StrDup PARAMS((char *));
|
||||||
|
extern int ParseIACBuf PARAMS((CONSFILE *, void *, int *));
|
||||||
|
extern void *MemMove PARAMS((void *, void *, size_t));
|
||||||
|
extern char *StringChar PARAMS((STRING *, int, char));
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
extern SSL *FileGetSSL PARAMS((CONSFILE *));
|
extern SSL *FileGetSSL PARAMS((CONSFILE *));
|
||||||
extern void FileSetSSL PARAMS((CONSFILE *, SSL *));
|
extern void FileSetSSL PARAMS((CONSFILE *, SSL *));
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: fallback.c,v 5.59 2003-10-03 06:32:34-07 bryan Exp $
|
* $Id: fallback.c,v 5.60 2003/11/20 13:56:38 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get a pty for the user
|
* get a pty for the user
|
||||||
|
3244
conserver/group.c
3244
conserver/group.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: group.h,v 5.38 2003-09-19 08:58:18-07 bryan Exp $
|
* $Id: group.h,v 5.43 2003/12/20 06:11:53 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -34,6 +34,15 @@
|
|||||||
* 4. This notice may not be removed or altered.
|
* 4. This notice may not be removed or altered.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* timers used to have various things happen */
|
||||||
|
#define T_STATE 0
|
||||||
|
#define T_CIDLE 1
|
||||||
|
#define T_MARK 2
|
||||||
|
#define T_REINIT 3
|
||||||
|
#define T_AUTOUP 4
|
||||||
|
#define T_ROLL 5
|
||||||
|
#define T_MAX 6 /* T_MAX *must* be last */
|
||||||
|
|
||||||
/* return values used by CheckPass()
|
/* return values used by CheckPass()
|
||||||
*/
|
*/
|
||||||
#define AUTH_SUCCESS 0 /* ok */
|
#define AUTH_SUCCESS 0 /* ok */
|
||||||
@ -52,22 +61,25 @@ typedef struct grpent { /* group info */
|
|||||||
struct grpent *pGEnext; /* next group entry */
|
struct grpent *pGEnext; /* next group entry */
|
||||||
} GRPENT;
|
} GRPENT;
|
||||||
|
|
||||||
|
extern time_t timers[];
|
||||||
|
|
||||||
extern void Spawn PARAMS((GRPENT *));
|
extern void Spawn PARAMS((GRPENT *));
|
||||||
extern int CheckPass PARAMS((char *, char *));
|
extern int CheckPass PARAMS((char *, char *));
|
||||||
extern void TagLogfile PARAMS((const CONSENT *, char *, ...));
|
extern void TagLogfile PARAMS((const CONSENT *, char *, ...));
|
||||||
extern void TagLogfileAct PARAMS((const CONSENT *, char *, ...));
|
extern void TagLogfileAct PARAMS((const CONSENT *, char *, ...));
|
||||||
extern void CleanupBreak PARAMS((short));
|
|
||||||
extern void DestroyGroup PARAMS((GRPENT *));
|
extern void DestroyGroup PARAMS((GRPENT *));
|
||||||
extern void DestroyConsent PARAMS((GRPENT *, CONSENT *));
|
extern void DestroyConsent PARAMS((GRPENT *, CONSENT *));
|
||||||
extern void SendClientsMsg PARAMS((CONSENT *, char *));
|
extern void SendClientsMsg PARAMS((CONSENT *, char *));
|
||||||
extern void ResetMark PARAMS((void));
|
extern void ResetMark PARAMS((void));
|
||||||
extern void DestroyConsentUsers PARAMS((CONSENTUSERS **));
|
extern void DestroyConsentUsers PARAMS((CONSENTUSERS **));
|
||||||
extern CONSENTUSERS *ConsentFindUser PARAMS((CONSENTUSERS *, char *));
|
extern CONSENTUSERS *ConsentFindUser PARAMS((CONSENTUSERS *, char *));
|
||||||
|
extern int ConsentUserOk PARAMS((CONSENTUSERS *, char *));
|
||||||
extern void DisconnectClient
|
extern void DisconnectClient
|
||||||
PARAMS((GRPENT *, CONSCLIENT *, char *, FLAG));
|
PARAMS((GRPENT *, CONSCLIENT *, char *, FLAG));
|
||||||
extern int ClientAccess PARAMS((CONSENT *, char *));
|
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));
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
extern int AttemptSSL PARAMS((CONSCLIENT *));
|
extern int AttemptSSL PARAMS((CONSCLIENT *));
|
||||||
#endif
|
#endif
|
||||||
|
115
conserver/main.c
115
conserver/main.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: main.c,v 5.163 2003-10-31 09:55:04-08 bryan Exp $
|
* $Id: main.c,v 5.178 2004/03/11 16:23:59 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
#include <group.h>
|
#include <group.h>
|
||||||
@ -65,7 +65,7 @@ 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
|
FLAGTRUE, 0, DEFBASEPORT, (char *)0
|
||||||
#if HAVE_SETPROCTITLE
|
#if HAVE_SETPROCTITLE
|
||||||
, FLAGFALSE
|
, FLAGFALSE
|
||||||
#endif
|
#endif
|
||||||
@ -75,6 +75,7 @@ CONFIG defConfig =
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct sockaddr_in in_port;
|
struct sockaddr_in in_port;
|
||||||
|
CONSFILE *unifiedlog = (CONSFILE *)0;
|
||||||
|
|
||||||
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
||||||
unsigned long dmallocMarkMain = 0;
|
unsigned long dmallocMarkMain = 0;
|
||||||
@ -424,6 +425,31 @@ ReopenLogfile()
|
|||||||
tag = 0;
|
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)
|
/* become a daemon (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -497,7 +523,7 @@ Usage(wantfull)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
static char u_terse[] =
|
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[] = {
|
static char *full[] = {
|
||||||
"7 strip the high bit off all console data",
|
"7 strip the high bit off all console data",
|
||||||
"a type set the default access type",
|
"a type set the default access type",
|
||||||
@ -529,6 +555,7 @@ Usage(wantfull)
|
|||||||
"R disable automatic client redirection",
|
"R disable automatic client redirection",
|
||||||
"S syntax check of configuration file",
|
"S syntax check of configuration file",
|
||||||
"u copy \"unloved\" console data to stdout",
|
"u copy \"unloved\" console data to stdout",
|
||||||
|
"U logfile copy all console data to the \"unified\" logfile",
|
||||||
"v be verbose on startup",
|
"v be verbose on startup",
|
||||||
"V output version info",
|
"V output version info",
|
||||||
(char *)0
|
(char *)0
|
||||||
@ -565,6 +592,9 @@ Version()
|
|||||||
#endif
|
#endif
|
||||||
#if HAVE_PAM
|
#if HAVE_PAM
|
||||||
"pam",
|
"pam",
|
||||||
|
#endif
|
||||||
|
#if TRUST_REVERSE_DNS
|
||||||
|
"trustrevdns",
|
||||||
#endif
|
#endif
|
||||||
(char *)0
|
(char *)0
|
||||||
};
|
};
|
||||||
@ -727,6 +757,10 @@ SummarizeDataStructures()
|
|||||||
size += strlen(pCE->initcmd);
|
size += strlen(pCE->initcmd);
|
||||||
if (pCE->execSlave != (char *)0)
|
if (pCE->execSlave != (char *)0)
|
||||||
size += strlen(pCE->execSlave);
|
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)
|
if (pCE->fdlog != (CONSFILE *)0)
|
||||||
size += sizeof(CONSFILE);
|
size += sizeof(CONSFILE);
|
||||||
if (pCE->cofile != (CONSFILE *)0)
|
if (pCE->cofile != (CONSFILE *)0)
|
||||||
@ -819,7 +853,7 @@ DumpDataStructures()
|
|||||||
|
|
||||||
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
|
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
"DumpDataStructures(): group: id=%u pid=%lu, port=%hu, imembers=%d",
|
"DumpDataStructures(): group: id=%u port=%hu, pid=%lu, imembers=%d",
|
||||||
pGE->id, pGE->port, (unsigned long)pGE->pid,
|
pGE->id, pGE->port, (unsigned long)pGE->pid,
|
||||||
pGE->imembers));
|
pGE->imembers));
|
||||||
|
|
||||||
@ -830,8 +864,9 @@ DumpDataStructures()
|
|||||||
"DumpDataStructures(): server=%s, type=DEVICE",
|
"DumpDataStructures(): server=%s, type=DEVICE",
|
||||||
EMPTYSTR(pCE->server)));
|
EMPTYSTR(pCE->server)));
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
"DumpDataStructures(): baud=%s, parity=%s",
|
"DumpDataStructures(): baud=%s, parity=%s, device=%s",
|
||||||
pCE->baud->acrate, pCE->parity->key));
|
pCE->baud->acrate, pCE->parity->key,
|
||||||
|
EMPTYSTR(pCE->device)));
|
||||||
break;
|
break;
|
||||||
case EXEC:
|
case EXEC:
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
@ -849,13 +884,13 @@ DumpDataStructures()
|
|||||||
"DumpDataStructures(): server=%s, type=HOST",
|
"DumpDataStructures(): server=%s, type=HOST",
|
||||||
EMPTYSTR(pCE->server)));
|
EMPTYSTR(pCE->server)));
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
"DumpDataStructures(): host=%s, port=%hu, telnetState=%d",
|
"DumpDataStructures(): host=%s, raw=%hu, netport=%hu, port=%hu, telnetState=%d",
|
||||||
EMPTYSTR(pCE->host), pCE->port,
|
EMPTYSTR(pCE->host), pCE->raw, pCE->netport,
|
||||||
pCE->telnetState));
|
pCE->port, pCE->telnetState));
|
||||||
break;
|
break;
|
||||||
case UNKNOWN:
|
case UNKNOWNTYPE:
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
"DumpDataStructures(): server=%s, type=UNKNOWN",
|
"DumpDataStructures(): server=%s, type=UNKNOWNTYPE",
|
||||||
EMPTYSTR(pCE->server)));
|
EMPTYSTR(pCE->server)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -903,18 +938,22 @@ DumpDataStructures()
|
|||||||
"DumpDataStructures(): initpid=%lu, initcmd=%s, initfile=%d",
|
"DumpDataStructures(): initpid=%lu, initcmd=%s, initfile=%d",
|
||||||
(unsigned long)pCE->initpid, EMPTYSTR(pCE->initcmd),
|
(unsigned long)pCE->initpid, EMPTYSTR(pCE->initcmd),
|
||||||
FileFDNum(pCE->initfile)));
|
FileFDNum(pCE->initfile)));
|
||||||
|
CONDDEBUG((1,
|
||||||
|
"DumpDataStructures(): motd=%s, idletimeout=%d, idlestring=%s",
|
||||||
|
EMPTYSTR(pCE->motd), pCE->idletimeout,
|
||||||
|
EMPTYSTR(pCE->idlestring)));
|
||||||
if (pCE->ro) {
|
if (pCE->ro) {
|
||||||
CONSENTUSERS *u;
|
CONSENTUSERS *u;
|
||||||
for (u = pCE->ro; u != (CONSENTUSERS *)0; u = u->next) {
|
for (u = pCE->ro; u != (CONSENTUSERS *)0; u = u->next) {
|
||||||
CONDDEBUG((1, "DumpDataStructures(): ro=%s",
|
CONDDEBUG((1, "DumpDataStructures(): ro=%s%s",
|
||||||
u->user->name));
|
(u->not ? "!" : ""), u->user->name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pCE->rw) {
|
if (pCE->rw) {
|
||||||
CONSENTUSERS *u;
|
CONSENTUSERS *u;
|
||||||
for (u = pCE->rw; u != (CONSENTUSERS *)0; u = u->next) {
|
for (u = pCE->rw; u != (CONSENTUSERS *)0; u = u->next) {
|
||||||
CONDDEBUG((1, "DumpDataStructures(): rw=%s",
|
CONDDEBUG((1, "DumpDataStructures(): rw=%s%s",
|
||||||
u->user->name));
|
(u->not ? "!" : ""), u->user->name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CONDDEBUG((1, "DumpDataStructures(): ------"));
|
CONDDEBUG((1, "DumpDataStructures(): ------"));
|
||||||
@ -1133,7 +1172,7 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
FILE *fpConfig = (FILE *)0;
|
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 int optopt;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
struct passwd *pwd;
|
struct passwd *pwd;
|
||||||
@ -1273,11 +1312,15 @@ main(argc, argv)
|
|||||||
optConf->redirect = FLAGFALSE;
|
optConf->redirect = FLAGFALSE;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
fSyntaxOnly = 1;
|
fSyntaxOnly++;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
fAll = 1;
|
fAll = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'U':
|
||||||
|
if ((optConf->unifiedlog = StrDup(optarg)) == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
fVersion = 1;
|
fVersion = 1;
|
||||||
break;
|
break;
|
||||||
@ -1368,6 +1411,9 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
ProbeInterfaces();
|
ProbeInterfaces();
|
||||||
|
|
||||||
|
/* initialize the timers */
|
||||||
|
for (i = 0; i < T_MAX; i++)
|
||||||
|
timers[i] = (time_t)0;
|
||||||
|
|
||||||
/* read the config file */
|
/* read the config file */
|
||||||
if ((FILE *)0 == (fpConfig = fopen(pcConfig, "r"))) {
|
if ((FILE *)0 == (fpConfig = fopen(pcConfig, "r"))) {
|
||||||
@ -1400,8 +1446,7 @@ main(argc, argv)
|
|||||||
struct servent *pSE;
|
struct servent *pSE;
|
||||||
if ((struct servent *)0 ==
|
if ((struct servent *)0 ==
|
||||||
(pSE = getservbyname(config->primaryport, "tcp"))) {
|
(pSE = getservbyname(config->primaryport, "tcp"))) {
|
||||||
Error("getservbyname(%s): %s", config->primaryport,
|
Error("getservbyname(%s) failed", config->primaryport);
|
||||||
strerror(errno));
|
|
||||||
Bye(EX_OSERR);
|
Bye(EX_OSERR);
|
||||||
} else {
|
} else {
|
||||||
bindPort = ntohs((unsigned short)pSE->s_port);
|
bindPort = ntohs((unsigned short)pSE->s_port);
|
||||||
@ -1431,8 +1476,7 @@ main(argc, argv)
|
|||||||
struct servent *pSE;
|
struct servent *pSE;
|
||||||
if ((struct servent *)0 ==
|
if ((struct servent *)0 ==
|
||||||
(pSE = getservbyname(config->secondaryport, "tcp"))) {
|
(pSE = getservbyname(config->secondaryport, "tcp"))) {
|
||||||
Error("getservbyname(%s): %s", config->secondaryport,
|
Error("getservbyname(%s) failed", config->secondaryport);
|
||||||
strerror(errno));
|
|
||||||
Bye(EX_OSERR);
|
Bye(EX_OSERR);
|
||||||
} else {
|
} else {
|
||||||
bindBasePort = ntohs((unsigned short)pSE->s_port);
|
bindBasePort = ntohs((unsigned short)pSE->s_port);
|
||||||
@ -1492,6 +1536,19 @@ main(argc, argv)
|
|||||||
else
|
else
|
||||||
config->loghostnames = defConfig.loghostnames;
|
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 HAVE_OPENSSL
|
||||||
if (optConf->sslrequired != FLAGUNKNOWN)
|
if (optConf->sslrequired != FLAGUNKNOWN)
|
||||||
config->sslrequired = optConf->sslrequired;
|
config->sslrequired = optConf->sslrequired;
|
||||||
@ -1508,6 +1565,15 @@ main(argc, argv)
|
|||||||
config->sslcredentials = StrDup(defConfig.sslcredentials);
|
config->sslcredentials = StrDup(defConfig.sslcredentials);
|
||||||
#endif
|
#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
|
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
||||||
dmallocMarkMain = dmalloc_mark();
|
dmallocMarkMain = dmalloc_mark();
|
||||||
#endif
|
#endif
|
||||||
@ -1523,6 +1589,8 @@ main(argc, argv)
|
|||||||
if (config->daemonmode == FLAGTRUE)
|
if (config->daemonmode == FLAGTRUE)
|
||||||
Daemonize();
|
Daemonize();
|
||||||
|
|
||||||
|
ReopenUnifiedlog();
|
||||||
|
|
||||||
/* if no one can use us we need to come up with a default
|
/* if no one can use us we need to come up with a default
|
||||||
*/
|
*/
|
||||||
if (pACList == (ACCESS *)0)
|
if (pACList == (ACCESS *)0)
|
||||||
@ -1584,6 +1652,9 @@ main(argc, argv)
|
|||||||
SignalKids(SIGTERM);
|
SignalKids(SIGTERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unifiedlog != (CONSFILE *)0)
|
||||||
|
FileClose(&unifiedlog);
|
||||||
|
|
||||||
DumpDataStructures();
|
DumpDataStructures();
|
||||||
|
|
||||||
Msg("terminated");
|
Msg("terminated");
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -48,8 +48,10 @@ extern int isMaster;
|
|||||||
extern CONFIG *optConf;
|
extern CONFIG *optConf;
|
||||||
extern CONFIG *config;
|
extern CONFIG *config;
|
||||||
extern CONFIG defConfig;
|
extern CONFIG defConfig;
|
||||||
|
extern CONSFILE *unifiedlog;
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
extern SSL_CTX *ctx;
|
extern SSL_CTX *ctx;
|
||||||
#endif
|
#endif
|
||||||
extern void ReopenLogfile PARAMS((void));
|
extern void ReopenLogfile PARAMS((void));
|
||||||
|
extern void ReopenUnifiedlog PARAMS((void));
|
||||||
extern void DumpDataStructures PARAMS((void));
|
extern void DumpDataStructures PARAMS((void));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: master.c,v 5.118 2003-10-10 03:29:21-07 bryan Exp $
|
* $Id: master.c,v 5.124 2003/12/25 19:22:00 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <consent.h>
|
#include <consent.h>
|
||||||
#include <client.h>
|
#include <client.h>
|
||||||
#include <group.h>
|
#include <group.h>
|
||||||
@ -433,7 +433,7 @@ DoNormalRead(pCLServing)
|
|||||||
{
|
{
|
||||||
char *pcCmd;
|
char *pcCmd;
|
||||||
char *pcArgs;
|
char *pcArgs;
|
||||||
int nr, i;
|
int nr, i, l;
|
||||||
unsigned char acIn[BUFSIZ];
|
unsigned char acIn[BUFSIZ];
|
||||||
|
|
||||||
/* read connection */
|
/* read connection */
|
||||||
@ -442,212 +442,221 @@ DoNormalRead(pCLServing)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nr; ++i) {
|
while ((l = ParseIACBuf(pCLServing->fd, acIn, &nr)) >= 0) {
|
||||||
if ('\n' != acIn[i]) {
|
if (l == 0) /* we ignore special OB_IAC stuff */
|
||||||
BuildStringChar(acIn[i], pCLServing->accmd);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
for (i = 0; i < l; ++i) {
|
||||||
if ((pCLServing->accmd->used > 1) &&
|
if ('\n' != acIn[i]) {
|
||||||
('\r' ==
|
BuildStringChar(acIn[i], pCLServing->accmd);
|
||||||
pCLServing->accmd->string[pCLServing->accmd->used - 2])) {
|
continue;
|
||||||
pCLServing->accmd->string[pCLServing->accmd->used - 2] =
|
}
|
||||||
'\000';
|
if ((pCLServing->accmd->used > 1) &&
|
||||||
pCLServing->accmd->used--;
|
('\r' ==
|
||||||
}
|
pCLServing->accmd->string[pCLServing->accmd->used - 2])) {
|
||||||
|
pCLServing->accmd->string[pCLServing->accmd->used - 2] =
|
||||||
|
'\000';
|
||||||
|
pCLServing->accmd->used--;
|
||||||
|
}
|
||||||
|
|
||||||
/* process password here...before we corrupt accmd */
|
/* process password here...before we corrupt accmd */
|
||||||
if (pCLServing->iState == S_PASSWD) {
|
if (pCLServing->iState == S_PASSWD) {
|
||||||
if (CheckPasswd(pCLServing, pCLServing->accmd->string) !=
|
if (CheckPasswd(pCLServing, pCLServing->accmd->string) !=
|
||||||
AUTH_SUCCESS) {
|
AUTH_SUCCESS) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
"invalid password\r\n", -1);
|
"invalid password\r\n", -1);
|
||||||
|
BuildString((char *)0, pCLServing->accmd);
|
||||||
|
DropMasterClient(pCLServing, FLAGFALSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Verbose("<master> login %s", pCLServing->acid->string);
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", 4);
|
||||||
|
pCLServing->iState = S_NORMAL;
|
||||||
BuildString((char *)0, pCLServing->accmd);
|
BuildString((char *)0, pCLServing->accmd);
|
||||||
DropMasterClient(pCLServing, FLAGFALSE);
|
continue;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
Verbose("<master> login %s", pCLServing->acid->string);
|
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", -1);
|
|
||||||
pCLServing->iState = S_NORMAL;
|
|
||||||
BuildString((char *)0, pCLServing->accmd);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((char *)0 != (pcArgs = strchr(pCLServing->accmd->string, ':'))) {
|
if ((char *)0 !=
|
||||||
*pcArgs++ = '\000';
|
(pcArgs = strchr(pCLServing->accmd->string, ':'))) {
|
||||||
} else if ((char *)0 !=
|
*pcArgs++ = '\000';
|
||||||
(pcArgs = strchr(pCLServing->accmd->string, ' '))) {
|
} else if ((char *)0 !=
|
||||||
*pcArgs++ = '\000';
|
(pcArgs = strchr(pCLServing->accmd->string, ' '))) {
|
||||||
}
|
*pcArgs++ = '\000';
|
||||||
if (pcArgs != (char *)0)
|
|
||||||
pcArgs = PruneSpace(pcArgs);
|
|
||||||
pcCmd = PruneSpace(pCLServing->accmd->string);
|
|
||||||
if (strcmp(pcCmd, "help") == 0) {
|
|
||||||
static char *apcHelp1[] = {
|
|
||||||
"exit disconnect\r\n",
|
|
||||||
"help this help message\r\n",
|
|
||||||
"login log in\r\n",
|
|
||||||
#if HAVE_OPENSSL
|
|
||||||
"ssl start ssl session\r\n",
|
|
||||||
#endif
|
|
||||||
(char *)0
|
|
||||||
};
|
|
||||||
static char *apcHelp2[] = {
|
|
||||||
"call provide port for given console\r\n",
|
|
||||||
"exit disconnect\r\n",
|
|
||||||
"groups provide ports for group leaders\r\n",
|
|
||||||
"help this help message\r\n",
|
|
||||||
"master provide a list of master servers\r\n",
|
|
||||||
"pid provide pid of master process\r\n",
|
|
||||||
"quit* terminate conserver (SIGTERM)\r\n",
|
|
||||||
"restart* restart conserver (SIGHUP)\r\n",
|
|
||||||
"version provide version info for server\r\n",
|
|
||||||
"* = requires admin privileges\r\n",
|
|
||||||
(char *)0
|
|
||||||
};
|
|
||||||
char **ppc;
|
|
||||||
for (ppc =
|
|
||||||
(pCLServing->iState == S_IDENT ? apcHelp1 : apcHelp2);
|
|
||||||
(char *)0 != *ppc; ++ppc) {
|
|
||||||
FileWrite(pCLServing->fd, FLAGTRUE, *ppc, -1);
|
|
||||||
}
|
}
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, (char *)0, 0);
|
if (pcArgs != (char *)0)
|
||||||
} else if (strcmp(pcCmd, "exit") == 0) {
|
pcArgs = PruneSpace(pcArgs);
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "goodbye\r\n", -1);
|
pcCmd = PruneSpace(pCLServing->accmd->string);
|
||||||
DropMasterClient(pCLServing, FLAGFALSE);
|
if (strcmp(pcCmd, "help") == 0) {
|
||||||
return;
|
static char *apcHelp1[] = {
|
||||||
|
"exit disconnect\r\n",
|
||||||
|
"help this help message\r\n",
|
||||||
|
"login log in\r\n",
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
} else if (pCLServing->iState == S_IDENT &&
|
"ssl start ssl session\r\n",
|
||||||
strcmp(pcCmd, "ssl") == 0) {
|
#endif
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", -1);
|
(char *)0
|
||||||
if (!AttemptSSL(pCLServing)) {
|
};
|
||||||
|
static char *apcHelp2[] = {
|
||||||
|
"call provide port for given console\r\n",
|
||||||
|
"exit disconnect\r\n",
|
||||||
|
"groups provide ports for group leaders\r\n",
|
||||||
|
"help this help message\r\n",
|
||||||
|
"master provide a list of master servers\r\n",
|
||||||
|
"pid provide pid of master process\r\n",
|
||||||
|
"quit* terminate conserver (SIGTERM)\r\n",
|
||||||
|
"restart* restart conserver (SIGHUP)\r\n",
|
||||||
|
"version provide version info for server\r\n",
|
||||||
|
"* = requires admin privileges\r\n",
|
||||||
|
(char *)0
|
||||||
|
};
|
||||||
|
char **ppc;
|
||||||
|
for (ppc =
|
||||||
|
(pCLServing->iState == S_IDENT ? apcHelp1 : apcHelp2);
|
||||||
|
(char *)0 != *ppc; ++ppc) {
|
||||||
|
FileWrite(pCLServing->fd, FLAGTRUE, *ppc, -1);
|
||||||
|
}
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE, (char *)0, 0);
|
||||||
|
} else if (strcmp(pcCmd, "exit") == 0) {
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE, "goodbye\r\n", -1);
|
||||||
DropMasterClient(pCLServing, FLAGFALSE);
|
DropMasterClient(pCLServing, FLAGFALSE);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else if (pCLServing->iState == S_IDENT &&
|
|
||||||
strcmp(pcCmd, "login") == 0) {
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
if (config->sslrequired == FLAGTRUE &&
|
} else if (pCLServing->iState == S_IDENT &&
|
||||||
FileGetType(pCLServing->fd) != SSLSocket) {
|
strcmp(pcCmd, "ssl") == 0) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", -1);
|
||||||
"encryption required\r\n", -1);
|
if (!AttemptSSL(pCLServing)) {
|
||||||
} else {
|
DropMasterClient(pCLServing, FLAGFALSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (pcArgs == (char *)0) {
|
} else if (pCLServing->iState == S_IDENT &&
|
||||||
|
strcmp(pcCmd, "login") == 0) {
|
||||||
|
#if HAVE_OPENSSL
|
||||||
|
if (config->sslrequired == FLAGTRUE &&
|
||||||
|
FileGetType(pCLServing->fd) != SSLSocket) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
"login requires argument\r\n", -1);
|
"encryption required\r\n", -1);
|
||||||
} else {
|
} else {
|
||||||
BuildString((char *)0, pCLServing->username);
|
|
||||||
BuildString((char *)0, pCLServing->acid);
|
|
||||||
BuildString(pcArgs, pCLServing->username);
|
|
||||||
BuildString(pcArgs, pCLServing->acid);
|
|
||||||
BuildStringChar('@', pCLServing->acid);
|
|
||||||
BuildString(pCLServing->peername->string,
|
|
||||||
pCLServing->acid);
|
|
||||||
if (pCLServing->caccess == 't' ||
|
|
||||||
CheckPasswd(pCLServing, "") == AUTH_SUCCESS) {
|
|
||||||
pCLServing->iState = S_NORMAL;
|
|
||||||
Verbose("<master> login %s",
|
|
||||||
pCLServing->acid->string);
|
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n", -1);
|
|
||||||
} else {
|
|
||||||
FilePrint(pCLServing->fd, FLAGFALSE,
|
|
||||||
"passwd? %s\r\n", myHostname);
|
|
||||||
pCLServing->iState = S_PASSWD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if HAVE_OPENSSL
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
if (pcArgs == (char *)0) {
|
||||||
strcmp(pcCmd, "master") == 0) {
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
int iSep = 1;
|
"login requires argument\r\n", -1);
|
||||||
|
} else {
|
||||||
if ((GRPENT *)0 != pGroups) {
|
BuildString((char *)0, pCLServing->username);
|
||||||
struct sockaddr_in lcl;
|
BuildString((char *)0, pCLServing->acid);
|
||||||
socklen_t so = sizeof(lcl);
|
BuildString(pcArgs, pCLServing->username);
|
||||||
if (-1 ==
|
BuildString(pcArgs, pCLServing->acid);
|
||||||
getsockname(FileFDNum(pCLServing->fd),
|
BuildStringChar('@', pCLServing->acid);
|
||||||
(struct sockaddr *)&lcl, &so)) {
|
BuildString(pCLServing->peername->string,
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
pCLServing->acid);
|
||||||
"getsockname failed, try again later\r\n",
|
if (pCLServing->caccess == 't' ||
|
||||||
-1);
|
CheckPasswd(pCLServing, "") == AUTH_SUCCESS) {
|
||||||
Error("Master(): getsockname(%u): %s",
|
pCLServing->iState = S_NORMAL;
|
||||||
FileFDNum(pCLServing->fd), strerror(errno));
|
Verbose("<master> login %s",
|
||||||
Bye(EX_OSERR);
|
pCLServing->acid->string);
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE, "ok\r\n",
|
||||||
|
4);
|
||||||
|
} else {
|
||||||
|
FilePrint(pCLServing->fd, FLAGFALSE,
|
||||||
|
"passwd? %s\r\n", myHostname);
|
||||||
|
pCLServing->iState = S_PASSWD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if HAVE_OPENSSL
|
||||||
}
|
}
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
#endif
|
||||||
inet_ntoa(lcl.sin_addr));
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
iSep = 0;
|
strcmp(pcCmd, "master") == 0) {
|
||||||
}
|
int iSep = 1;
|
||||||
if (config->redirect == FLAGTRUE) {
|
|
||||||
REMOTE *pRC;
|
if ((GRPENT *)0 != pGroups) {
|
||||||
for (pRC = pRCUniq; (REMOTE *)0 != pRC; pRC = pRC->pRCuniq) {
|
struct sockaddr_in lcl;
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, ":@%s" + iSep,
|
socklen_t so = sizeof(lcl);
|
||||||
pRC->rhost);
|
if (-1 ==
|
||||||
|
getsockname(FileFDNum(pCLServing->fd),
|
||||||
|
(struct sockaddr *)&lcl, &so)) {
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
|
"getsockname failed, try again later\r\n",
|
||||||
|
-1);
|
||||||
|
Error("Master(): getsockname(%u): %s",
|
||||||
|
FileFDNum(pCLServing->fd), strerror(errno));
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
}
|
||||||
|
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
||||||
|
inet_ntoa(lcl.sin_addr));
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
}
|
}
|
||||||
}
|
if (config->redirect == FLAGTRUE) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
|
REMOTE *pRC;
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
|
||||||
strcmp(pcCmd, "pid") == 0) {
|
pRC = pRC->pRCuniq) {
|
||||||
FilePrint(pCLServing->fd, FLAGFALSE, "%lu\r\n",
|
FilePrint(pCLServing->fd, FLAGTRUE, ":@%s" + iSep,
|
||||||
(unsigned long)thepid);
|
pRC->rhost);
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
iSep = 0;
|
||||||
strcmp(pcCmd, "version") == 0) {
|
}
|
||||||
FilePrint(pCLServing->fd, FLAGFALSE, "version `%s'\r\n",
|
}
|
||||||
THIS_VERSION);
|
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
strcmp(pcCmd, "quit") == 0) {
|
strcmp(pcCmd, "pid") == 0) {
|
||||||
if (ConsentFindUser(pADList, pCLServing->username->string) !=
|
FilePrint(pCLServing->fd, FLAGFALSE, "%lu\r\n",
|
||||||
(CONSENTUSERS *)0 ||
|
(unsigned long)thepid);
|
||||||
ConsentFindUser(pADList, "*") != (CONSENTUSERS *)0) {
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
Verbose("quit command by %s", pCLServing->acid->string);
|
strcmp(pcCmd, "version") == 0) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
FilePrint(pCLServing->fd, FLAGFALSE, "version `%s'\r\n",
|
||||||
"ok -- terminated\r\n", -1);
|
THIS_VERSION);
|
||||||
DropMasterClient(pCLServing, FLAGFALSE);
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
kill(thepid, SIGTERM);
|
strcmp(pcCmd, "quit") == 0) {
|
||||||
return;
|
if (ConsentUserOk(pADList, pCLServing->username->string) ==
|
||||||
} else
|
1) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
Verbose("quit command by %s",
|
||||||
"unauthorized command\r\n", -1);
|
pCLServing->acid->string);
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
strcmp(pcCmd, "restart") == 0) {
|
"ok -- terminated\r\n", -1);
|
||||||
if (ConsentFindUser(pADList, pCLServing->username->string) !=
|
DropMasterClient(pCLServing, FLAGFALSE);
|
||||||
(CONSENTUSERS *)0 ||
|
kill(thepid, SIGTERM);
|
||||||
ConsentFindUser(pADList, "*") != (CONSENTUSERS *)0) {
|
return;
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
} else
|
||||||
"ok -- restarting\r\n", -1);
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
Verbose("restart command by %s", pCLServing->acid->string);
|
"unauthorized command\r\n", -1);
|
||||||
kill(thepid, SIGHUP);
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
} else
|
strcmp(pcCmd, "restart") == 0) {
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
if (ConsentUserOk(pADList, pCLServing->username->string) ==
|
||||||
"unauthorized command\r\n", -1);
|
1) {
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
strcmp(pcCmd, "groups") == 0) {
|
"ok -- restarting\r\n", -1);
|
||||||
int iSep = 1;
|
Verbose("restart command by %s",
|
||||||
GRPENT *pGE;
|
pCLServing->acid->string);
|
||||||
|
kill(thepid, SIGHUP);
|
||||||
|
} else
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
|
"unauthorized command\r\n", -1);
|
||||||
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
|
strcmp(pcCmd, "groups") == 0) {
|
||||||
|
int iSep = 1;
|
||||||
|
GRPENT *pGE;
|
||||||
|
|
||||||
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
|
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
|
||||||
if (0 == pGE->imembers)
|
if (0 == pGE->imembers)
|
||||||
continue;
|
continue;
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, ":%hu" + iSep,
|
FilePrint(pCLServing->fd, FLAGTRUE, ":%hu" + iSep,
|
||||||
pGE->port);
|
pGE->port);
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
|
}
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", 2);
|
||||||
|
} else if (pCLServing->iState == S_NORMAL &&
|
||||||
|
strcmp(pcCmd, "call") == 0) {
|
||||||
|
if (pcArgs == (char *)0)
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE,
|
||||||
|
"call requires argument\r\n", -1);
|
||||||
|
else
|
||||||
|
CommandCall(pCLServing, pcArgs);
|
||||||
|
} else {
|
||||||
|
FileWrite(pCLServing->fd, FLAGFALSE, "unknown command\r\n",
|
||||||
|
-1);
|
||||||
}
|
}
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", -1);
|
BuildString((char *)0, pCLServing->accmd);
|
||||||
} else if (pCLServing->iState == S_NORMAL &&
|
|
||||||
strcmp(pcCmd, "call") == 0) {
|
|
||||||
if (pcArgs == (char *)0)
|
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE,
|
|
||||||
"call requires argument\r\n", -1);
|
|
||||||
else
|
|
||||||
CommandCall(pCLServing, pcArgs);
|
|
||||||
} else {
|
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "unknown command\r\n",
|
|
||||||
-1);
|
|
||||||
}
|
}
|
||||||
BuildString((char *)0, pCLServing->accmd);
|
nr -= l;
|
||||||
|
MemMove(acIn, acIn + l, nr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,6 +771,7 @@ Master()
|
|||||||
fSawHUP = 0;
|
fSawHUP = 0;
|
||||||
Msg("processing SIGHUP");
|
Msg("processing SIGHUP");
|
||||||
ReopenLogfile();
|
ReopenLogfile();
|
||||||
|
ReopenUnifiedlog();
|
||||||
SignalKids(SIGHUP);
|
SignalKids(SIGHUP);
|
||||||
ReReadCfg(msfd);
|
ReReadCfg(msfd);
|
||||||
/* fix up the client descriptors since ReReadCfg() doesn't
|
/* fix up the client descriptors since ReReadCfg() doesn't
|
||||||
@ -783,6 +793,7 @@ Master()
|
|||||||
fSawUSR2 = 0;
|
fSawUSR2 = 0;
|
||||||
Msg("processing SIGUSR2");
|
Msg("processing SIGUSR2");
|
||||||
ReopenLogfile();
|
ReopenLogfile();
|
||||||
|
ReopenUnifiedlog();
|
||||||
SignalKids(SIGUSR2);
|
SignalKids(SIGUSR2);
|
||||||
}
|
}
|
||||||
if (fSawQuit) { /* Something above set the quit flag */
|
if (fSawQuit) { /* Something above set the quit flag */
|
||||||
@ -874,9 +885,10 @@ Master()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set to non-blocking and wrap in a File object */
|
/* set to non-blocking and wrap in a File object */
|
||||||
if (SetFlags(cfd, O_NONBLOCK, 0))
|
if (SetFlags(cfd, O_NONBLOCK, 0)) {
|
||||||
pCLmfree->fd = FileOpenFD(cfd, simpleSocket);
|
pCLmfree->fd = FileOpenFD(cfd, simpleSocket);
|
||||||
else
|
FileSetQuoteIAC(pCLmfree->fd, FLAGTRUE);
|
||||||
|
} else
|
||||||
pCLmfree->fd = (CONSFILE *)0;
|
pCLmfree->fd = (CONSFILE *)0;
|
||||||
|
|
||||||
if ((CONSFILE *)0 == pCLmfree->fd) {
|
if ((CONSFILE *)0 == pCLmfree->fd) {
|
||||||
@ -925,11 +937,13 @@ Master()
|
|||||||
if (ClientAccessOk(pCL)) {
|
if (ClientAccessOk(pCL)) {
|
||||||
pCL->ioState = ISNORMAL;
|
pCL->ioState = ISNORMAL;
|
||||||
/* say hi to start */
|
/* say hi to start */
|
||||||
FileWrite(pCL->fd, FLAGFALSE, "ok\r\n", -1);
|
FileWrite(pCL->fd, FLAGFALSE, "ok\r\n", 4);
|
||||||
} else
|
} else
|
||||||
DropMasterClient(pCL, FLAGFALSE);
|
DropMasterClient(pCL, FLAGFALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close(msfd);
|
||||||
|
|
||||||
/* clean up the free list */
|
/* clean up the free list */
|
||||||
while (pCLmfree != (CONSCLIENT *)0) {
|
while (pCLmfree != (CONSCLIENT *)0) {
|
||||||
pCL = pCLmfree->pCLnext;
|
pCL = pCLmfree->pCLnext;
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
|
1130
conserver/readcfg.c
1130
conserver/readcfg.c
File diff suppressed because it is too large
Load Diff
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define BREAKDELAYDEFAULT 250
|
||||||
|
|
||||||
typedef struct config {
|
typedef struct config {
|
||||||
STRING *name;
|
STRING *name;
|
||||||
char defaultaccess;
|
char defaultaccess;
|
||||||
@ -17,6 +19,7 @@ typedef struct config {
|
|||||||
FLAG loghostnames;
|
FLAG loghostnames;
|
||||||
int reinitcheck;
|
int reinitcheck;
|
||||||
char *secondaryport;
|
char *secondaryport;
|
||||||
|
char *unifiedlog;
|
||||||
#if HAVE_SETPROCTITLE
|
#if HAVE_SETPROCTITLE
|
||||||
FLAG setproctitle;
|
FLAG setproctitle;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: version.h,v 1.51 2003-10-31 10:04:19-08 bryan Exp $
|
* $Id: version.h,v 1.59 2004/03/16 04:17:31 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.0.5"
|
#define THIS_VERSION "conserver.com version 8.1.3"
|
||||||
|
@ -15,7 +15,7 @@ MKDIR = @MKDIR@
|
|||||||
|
|
||||||
### Compiler and link options
|
### Compiler and link options
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS = @CFLAGS@ # -DPUCC -DSUN5
|
CFLAGS = @CFLAGS@
|
||||||
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\"
|
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||||
CPPFLAGS = -I.. -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/conserver $(DEFS) @CPPFLAGS@
|
CPPFLAGS = -I.. -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/conserver $(DEFS) @CPPFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
@ -25,18 +25,23 @@ LIBS = @LIBS@
|
|||||||
|
|
||||||
### Makefile rules - no user-servicable parts below
|
### Makefile rules - no user-servicable parts below
|
||||||
|
|
||||||
CONSOLE_OBJS = console.o getpassword.o ../conserver/util.o
|
CONSOLE_OBJS = console.o getpassword.o ../conserver/cutil.o
|
||||||
CONSOLE_HDRS = ../config.h $(top_srcdir)/compat.h $(top_srcdir)/conserver/port.h
|
CONSOLE_HDRS = ../config.h $(top_srcdir)/compat.h \
|
||||||
|
$(top_srcdir)/conserver/cutil.h \
|
||||||
|
$(top_srcdir)/conserver/version.h \
|
||||||
|
$(srcdir)/getpassword.h
|
||||||
ALL = console
|
ALL = console
|
||||||
|
|
||||||
|
|
||||||
all: $(ALL)
|
all: $(ALL)
|
||||||
|
|
||||||
|
$(CONSOLE_OBJS): $(CONSOLE_HDRS)
|
||||||
|
|
||||||
console: $(CONSOLE_OBJS)
|
console: $(CONSOLE_OBJS)
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o console $(CONSOLE_OBJS) $(LIBS)
|
$(CC) $(CFLAGS) $(LDFLAGS) -o console $(CONSOLE_OBJS) $(LIBS)
|
||||||
|
|
||||||
../conserver/util.o:
|
../conserver/cutil.o:
|
||||||
( cd ../conserver && $(MAKE) $(MAKE_FLAGS) util.o ) || exit 1;
|
( cd ../conserver && $(MAKE) $(MAKE_FLAGS) cutil.o ) || exit 1;
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: console.c,v 5.147 2003-10-03 15:21:34-07 bryan Exp $
|
* $Id: console.c,v 5.161 2004/03/20 14:40:42 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -32,7 +32,7 @@
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <getpassword.h>
|
#include <getpassword.h>
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
@ -54,8 +54,13 @@ unsigned short bindPort;
|
|||||||
CONSFILE *cfstdout;
|
CONSFILE *cfstdout;
|
||||||
char *pcUser = (char *)0;
|
char *pcUser = (char *)0;
|
||||||
int disconnectCount = 0;
|
int disconnectCount = 0;
|
||||||
|
STRING *execCmd = (STRING *)0;
|
||||||
static char acMesg[8192]; /* the buffer for startup negotiation */
|
CONSFILE *execCmdFile = (CONSFILE *)0;
|
||||||
|
pid_t execCmdPid = 0;
|
||||||
|
CONSFILE *gotoConsole = (CONSFILE *)0;
|
||||||
|
CONSFILE *prevConsole = (CONSFILE *)0;
|
||||||
|
char *gotoName = (char *)0;
|
||||||
|
char *prevName = (char *)0;
|
||||||
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
SSL_CTX *ctx = (SSL_CTX *)0;
|
SSL_CTX *ctx = (SSL_CTX *)0;
|
||||||
@ -192,7 +197,7 @@ Usage(wantfull)
|
|||||||
"D enable debug output, sent to stderr",
|
"D enable debug output, sent to stderr",
|
||||||
"e esc set the initial escape characters",
|
"e esc set the initial escape characters",
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
"E don't require encrypted connections",
|
"E don't attempt encrypted connections",
|
||||||
#else
|
#else
|
||||||
"E ignored - encryption not compiled into code",
|
"E ignored - encryption not compiled into code",
|
||||||
#endif
|
#endif
|
||||||
@ -551,6 +556,9 @@ DestroyDataStructures()
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
C2Cooked();
|
C2Cooked();
|
||||||
|
if (cfstdout != (CONSFILE *)0)
|
||||||
|
FileUnopen(cfstdout);
|
||||||
|
DestroyStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@ -572,6 +580,7 @@ ReadReply(fd)
|
|||||||
BuildString((char *)0, result);
|
BuildString((char *)0, result);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
int l;
|
||||||
switch (nr = FileRead(fd, buf, sizeof(buf))) {
|
switch (nr = FileRead(fd, buf, sizeof(buf))) {
|
||||||
case 0:
|
case 0:
|
||||||
/* fall through */
|
/* fall through */
|
||||||
@ -582,6 +591,13 @@ ReadReply(fd)
|
|||||||
Error("lost connection");
|
Error("lost connection");
|
||||||
Bye(EX_UNAVAILABLE);
|
Bye(EX_UNAVAILABLE);
|
||||||
default:
|
default:
|
||||||
|
while ((l = ParseIACBuf(fd, buf, &nr)) >= 0) {
|
||||||
|
if (l == 0)
|
||||||
|
continue;
|
||||||
|
BuildStringN(buf, l, result);
|
||||||
|
nr -= l;
|
||||||
|
MemMove(buf, buf + l, nr);
|
||||||
|
}
|
||||||
BuildStringN(buf, nr, result);
|
BuildStringN(buf, nr, result);
|
||||||
if (toEOF) /* if toEOF, read until EOF */
|
if (toEOF) /* if toEOF, read until EOF */
|
||||||
continue;
|
continue;
|
||||||
@ -603,84 +619,492 @@ ReadReply(fd)
|
|||||||
return result->string;
|
return result->string;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SawUrg = 0;
|
static void
|
||||||
|
|
||||||
/* when the conserver program gets the suspend sequence it will send us
|
|
||||||
* an out of band command to suspend ourself. We just tell the reader
|
|
||||||
* routine we saw one
|
|
||||||
*/
|
|
||||||
RETSIGTYPE
|
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
OOB(int sig)
|
ReapVirt(void)
|
||||||
#else
|
#else
|
||||||
OOB(sig)
|
ReapVirt()
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
pid_t pid;
|
||||||
|
int UWbuf;
|
||||||
|
|
||||||
|
while (-1 != (pid = waitpid(-1, &UWbuf, WNOHANG | WUNTRACED))) {
|
||||||
|
if (0 == pid)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* stopped child is just continued
|
||||||
|
*/
|
||||||
|
if (WIFSTOPPED(UWbuf) && 0 == kill(pid, SIGCONT)) {
|
||||||
|
Msg("child pid %lu: stopped, sending SIGCONT",
|
||||||
|
(unsigned long)pid);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WIFEXITED(UWbuf))
|
||||||
|
Verbose("child process %lu: exit(%d)", pid,
|
||||||
|
WEXITSTATUS(UWbuf));
|
||||||
|
if (WIFSIGNALED(UWbuf))
|
||||||
|
Verbose("child process %lu: signal(%d)", pid, WTERMSIG(UWbuf));
|
||||||
|
if (pid == execCmdPid) {
|
||||||
|
if (WIFEXITED(UWbuf))
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command terminated - pid %lu: exit(%d)]\r\n",
|
||||||
|
pid, WEXITSTATUS(UWbuf));
|
||||||
|
if (WIFSIGNALED(UWbuf))
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command terminated - pid %lu: signal(%d)]\r\n",
|
||||||
|
pid, WTERMSIG(UWbuf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static sig_atomic_t fSawReapVirt = 0;
|
||||||
|
|
||||||
|
#if HAVE_SIGACTION
|
||||||
|
static
|
||||||
|
#endif
|
||||||
|
RETSIGTYPE
|
||||||
|
#if PROTOTYPES
|
||||||
|
FlagReapVirt(int sig)
|
||||||
|
#else
|
||||||
|
FlagReapVirt(sig)
|
||||||
int sig;
|
int sig;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
++SawUrg;
|
fSawReapVirt = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
#if defined(SIGURG)
|
SimpleSignal(SIGCHLD, FlagReapVirt);
|
||||||
SimpleSignal(SIGURG, OOB);
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* invoke the execcmd command */
|
||||||
|
void
|
||||||
|
#if PROTOTYPES
|
||||||
|
ExecCmd(void)
|
||||||
|
#else
|
||||||
|
ExecCmd()
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
pid_t iNewGrp;
|
||||||
|
extern char **environ;
|
||||||
|
int pin[2];
|
||||||
|
int pout[2];
|
||||||
|
static char *apcArgv[] = {
|
||||||
|
"/bin/sh", "-ce", (char *)0, (char *)0
|
||||||
|
};
|
||||||
|
|
||||||
|
if (execCmd == (STRING *)0 || execCmd->used <= 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CONDDEBUG((1, "ExecCmd(): `%s'", execCmd->string));
|
||||||
|
|
||||||
|
/* pin[0] = parent read, pin[1] = child write */
|
||||||
|
if (pipe(pin) != 0) {
|
||||||
|
Error("ExecCmd(): pipe(): %s", strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* pout[0] = child read, pout[l] = parent write */
|
||||||
|
if (pipe(pout) != 0) {
|
||||||
|
close(pin[0]);
|
||||||
|
close(pin[1]);
|
||||||
|
Error("ExecCmd(): pipe(): %s", strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
switch (execCmdPid = fork()) {
|
||||||
|
case -1:
|
||||||
|
return;
|
||||||
|
case 0:
|
||||||
|
thepid = getpid();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
close(pout[0]);
|
||||||
|
close(pin[1]);
|
||||||
|
if ((execCmdFile =
|
||||||
|
FileOpenPipe(pin[0], pout[1])) == (CONSFILE *)0) {
|
||||||
|
Error("ExecCmd(): FileOpenPipe(%d,%d) failed", pin[0],
|
||||||
|
pout[1]);
|
||||||
|
close(pin[0]);
|
||||||
|
close(pout[1]);
|
||||||
|
kill(execCmdPid, SIGHUP);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command running - pid %lu]\r\n", execCmdPid);
|
||||||
|
FD_SET(pin[0], &rinit);
|
||||||
|
if (maxfd < pin[0] + 1)
|
||||||
|
maxfd = pin[0] + 1;
|
||||||
|
fflush(stderr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(pin[0]);
|
||||||
|
close(pout[1]);
|
||||||
|
|
||||||
|
/* put the signals back that we ignore (trapped auto-reset to default)
|
||||||
|
*/
|
||||||
|
SimpleSignal(SIGPIPE, SIG_DFL);
|
||||||
|
SimpleSignal(SIGCHLD, SIG_DFL);
|
||||||
|
|
||||||
|
/* setup new process with clean file descriptors
|
||||||
|
* stderr still goes to stderr...so user sees it
|
||||||
|
*/
|
||||||
|
i = GetMaxFiles();
|
||||||
|
for ( /* i above */ ; --i > 3;) {
|
||||||
|
if (i != pout[0] && i != pin[1])
|
||||||
|
close(i);
|
||||||
|
}
|
||||||
|
close(1);
|
||||||
|
close(0);
|
||||||
|
|
||||||
|
# if HAVE_SETSID
|
||||||
|
iNewGrp = setsid();
|
||||||
|
if (-1 == iNewGrp) {
|
||||||
|
Error("ExecCmd(): setsid(): %s", strerror(errno));
|
||||||
|
iNewGrp = thepid;
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
iNewGrp = thepid;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (dup(pout[0]) != 0 || dup(pin[1]) != 1) {
|
||||||
|
Error("ExecCmd(): fd sync error");
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
}
|
||||||
|
close(pout[0]);
|
||||||
|
close(pin[1]);
|
||||||
|
|
||||||
|
tcsetpgrp(0, iNewGrp);
|
||||||
|
|
||||||
|
apcArgv[2] = execCmd->string;
|
||||||
|
|
||||||
|
execve(apcArgv[0], apcArgv, environ);
|
||||||
|
Error("ExecCmd(): execve(%s): %s", apcArgv[2], strerror(errno));
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
ProcessUrgentData(int s)
|
GetUserInput(STRING *str)
|
||||||
#else
|
#else
|
||||||
ProcessUrgentData(s)
|
GetUserInput(str)
|
||||||
int s;
|
STRING *str;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
static char acCmd;
|
char c;
|
||||||
|
|
||||||
SawUrg = 0;
|
if (str == (STRING *)0)
|
||||||
|
return;
|
||||||
|
|
||||||
/* get the pending urgent message
|
BuildString((char *)0, str);
|
||||||
*/
|
|
||||||
while (recv(s, &acCmd, 1, MSG_OOB) < 0) {
|
for (;;) {
|
||||||
switch (errno) {
|
if (read(0, &c, 1) == 0)
|
||||||
case EWOULDBLOCK:
|
break;
|
||||||
/* clear any pending input to make room */
|
if (c == '\n' || c == '\r') {
|
||||||
read(s, &acCmd, 1);
|
break;
|
||||||
write(1, ".", 1);
|
}
|
||||||
continue;
|
if (c >= ' ' && c <= '~') {
|
||||||
case EINVAL:
|
BuildStringChar(c, str);
|
||||||
default:
|
FileWrite(cfstdout, FLAGFALSE, &c, 1);
|
||||||
Error("recv(%d): %s\r", s, strerror(errno));
|
} else if ((c == '\b' || c == 0x7f) && str->used > 1) {
|
||||||
sleep(1);
|
FileWrite(cfstdout, FLAGFALSE, "\b \b", 3);
|
||||||
continue;
|
str->string[str->used - 2] = '\000';
|
||||||
|
str->used--;
|
||||||
|
} else if ((c == 0x15) && str->used > 1) {
|
||||||
|
while (str->used > 1) {
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "\b \b", 3);
|
||||||
|
str->string[str->used - 2] = '\000';
|
||||||
|
str->used--;
|
||||||
|
}
|
||||||
|
} else if ((c == 0x17) && str->used > 1) {
|
||||||
|
while (str->used > 1 &&
|
||||||
|
isspace((int)(str->string[str->used - 2]))) {
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "\b \b", 3);
|
||||||
|
str->string[str->used - 2] = '\000';
|
||||||
|
str->used--;
|
||||||
|
}
|
||||||
|
while (str->used > 1 &&
|
||||||
|
!isspace((int)(str->string[str->used - 2]))) {
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "\b \b", 3);
|
||||||
|
str->string[str->used - 2] = '\000';
|
||||||
|
str->used--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (acCmd) {
|
}
|
||||||
case OB_SUSP:
|
|
||||||
#if defined(SIGSTOP)
|
void
|
||||||
write(1, "stop]", 5);
|
#if PROTOTYPES
|
||||||
C2Cooked();
|
DoExec(CONSFILE *pcf)
|
||||||
kill(getpid(), SIGSTOP);
|
|
||||||
C2Raw();
|
|
||||||
write(1, "[press any character to continue", 32);
|
|
||||||
#else
|
#else
|
||||||
write(1,
|
DoExec(pcf)
|
||||||
"stop not supported -- press any character to continue",
|
CONSFILE *pcf;
|
||||||
53);
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
{
|
||||||
case OB_DROP:
|
FileWrite(cfstdout, FLAGFALSE, "exec: ", 6);
|
||||||
write(1, "dropped by server]\r\n", 20);
|
|
||||||
C2Cooked();
|
GetUserInput(execCmd);
|
||||||
Bye(EX_UNAVAILABLE);
|
FileWrite(cfstdout, FLAGFALSE, "]\r\n", 3);
|
||||||
/*NOTREACHED*/ default:
|
|
||||||
Error("unknown out of band command `%c\'\r", acCmd);
|
if (execCmd != (STRING *)0 && execCmd->used > 1) {
|
||||||
fflush(stderr);
|
ExecCmd();
|
||||||
break;
|
BuildString((char *)0, execCmd);
|
||||||
|
if (execCmdFile == (CONSFILE *)0) { /* exec failed */
|
||||||
|
/* say forget it */
|
||||||
|
FileSetQuoteIAC(pcf, FLAGFALSE);
|
||||||
|
FilePrint(pcf, FLAGFALSE, "%c%c", OB_IAC, OB_ABRT);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
|
} else {
|
||||||
|
char *r;
|
||||||
|
/* go back to blocking mode */
|
||||||
|
SetFlags(FileFDNum(pcf), 0, O_NONBLOCK);
|
||||||
|
/* say we're ready */
|
||||||
|
FileSetQuoteIAC(pcf, FLAGFALSE);
|
||||||
|
FilePrint(pcf, FLAGFALSE, "%c%c", OB_IAC, OB_EXEC);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
|
r = ReadReply(pcf, 0);
|
||||||
|
/* now back to non-blocking, now that we've got reply */
|
||||||
|
SetFlags(FileFDNum(pcf), O_NONBLOCK, 0);
|
||||||
|
/* if we aren't still r/w, abort */
|
||||||
|
if (strncmp(r, "[rw]", 4) != 0) {
|
||||||
|
FileWrite(cfstdout, FLAGFALSE,
|
||||||
|
"[no longer read-write - aborting command]\r\n",
|
||||||
|
-1);
|
||||||
|
FD_CLR(FileFDNum(execCmdFile), &rinit);
|
||||||
|
FD_CLR(FileFDOutNum(execCmdFile), &winit);
|
||||||
|
FileClose(&execCmdFile);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGFALSE);
|
||||||
|
FilePrint(pcf, FLAGFALSE, "%c%c", OB_IAC, OB_ABRT);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
|
kill(execCmdPid, SIGHUP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* say forget it */
|
||||||
|
FileSetQuoteIAC(pcf, FLAGFALSE);
|
||||||
|
FilePrint(pcf, FLAGFALSE, "%c%c", OB_IAC, OB_ABRT);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
#if PROTOTYPES
|
||||||
|
Interact(CONSFILE *pcf, char *pcMach)
|
||||||
|
#else
|
||||||
|
Interact(pcf, pcMach)
|
||||||
|
CONSFILE *pcf;
|
||||||
|
char *pcMach;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int nc;
|
||||||
|
fd_set rmask, wmask;
|
||||||
|
int justSuspended = 0;
|
||||||
|
static char acMesg[8192];
|
||||||
|
|
||||||
|
/* if this is true, it means we successfully moved to a new console
|
||||||
|
* so we need to close the old one.
|
||||||
|
*/
|
||||||
|
if (prevConsole != (CONSFILE *)0)
|
||||||
|
FileClose(&prevConsole);
|
||||||
|
if (prevName != (char *)0) {
|
||||||
|
free(prevName);
|
||||||
|
prevName = (char *)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this is only true in other parts of the code iff pcf == gotoConsole */
|
||||||
|
if (gotoConsole != (CONSFILE *)0) {
|
||||||
|
gotoConsole = (CONSFILE *)0;
|
||||||
|
FilePrint(cfstdout, FLAGFALSE, "[returning to `%s'", pcMach);
|
||||||
|
FileWrite(pcf, FLAGFALSE, "\n", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
C2Raw();
|
||||||
|
|
||||||
|
/* set socket to non-blocking */
|
||||||
|
SetFlags(FileFDNum(pcf), O_NONBLOCK, 0);
|
||||||
|
|
||||||
|
/* read from stdin and the socket (non-blocking!).
|
||||||
|
* rmask indicates which descriptors to read from,
|
||||||
|
* the others are not used, nor is the result from
|
||||||
|
* select, read, or write.
|
||||||
|
*/
|
||||||
|
FD_ZERO(&rinit);
|
||||||
|
FD_ZERO(&winit);
|
||||||
|
FD_SET(FileFDNum(pcf), &rinit);
|
||||||
|
FD_SET(0, &rinit);
|
||||||
|
if (maxfd < FileFDNum(pcf) + 1)
|
||||||
|
maxfd = FileFDNum(pcf) + 1;
|
||||||
|
for (;;) {
|
||||||
|
justSuspended = 0;
|
||||||
|
if (fSawReapVirt) {
|
||||||
|
fSawReapVirt = 0;
|
||||||
|
ReapVirt();
|
||||||
|
}
|
||||||
|
/* reset read mask and select on it
|
||||||
|
*/
|
||||||
|
rmask = rinit;
|
||||||
|
wmask = winit;
|
||||||
|
if (-1 ==
|
||||||
|
select(maxfd, &rmask, &wmask, (fd_set *)0,
|
||||||
|
(struct timeval *)0)) {
|
||||||
|
if (errno != EINTR) {
|
||||||
|
Error("Master(): select(): %s", strerror(errno));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* anything from execCmd */
|
||||||
|
if (execCmdFile != (CONSFILE *)0) {
|
||||||
|
if (FileCanRead(execCmdFile, &rmask, &wmask)) {
|
||||||
|
if ((nc =
|
||||||
|
FileRead(execCmdFile, acMesg, sizeof(acMesg))) < 0) {
|
||||||
|
FD_CLR(FileFDNum(execCmdFile), &rinit);
|
||||||
|
FD_CLR(FileFDOutNum(execCmdFile), &winit);
|
||||||
|
FileClose(&execCmdFile);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGFALSE);
|
||||||
|
FilePrint(pcf, FLAGFALSE, "%c%c", OB_IAC, OB_ABRT);
|
||||||
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
|
} else {
|
||||||
|
if (fStrip) {
|
||||||
|
for (i = 0; i < nc; ++i)
|
||||||
|
acMesg[i] &= 127;
|
||||||
|
}
|
||||||
|
FileWrite(pcf, FLAGFALSE, acMesg, nc);
|
||||||
|
}
|
||||||
|
} else if (!FileBufEmpty(execCmdFile) &&
|
||||||
|
FileCanWrite(execCmdFile, &rmask, &wmask)) {
|
||||||
|
CONDDEBUG((1, "Interact(): flushing fd %d",
|
||||||
|
FileFDNum(execCmdFile)));
|
||||||
|
if (FileWrite(execCmdFile, FLAGFALSE, (char *)0, 0) < 0) {
|
||||||
|
/* -bryan */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* anything from socket? */
|
||||||
|
if (FileCanRead(pcf, &rmask, &wmask)) {
|
||||||
|
int l;
|
||||||
|
if ((nc = FileRead(pcf, acMesg, sizeof(acMesg))) < 0) {
|
||||||
|
/* if we got an error/eof after returning from suspend */
|
||||||
|
if (justSuspended) {
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
Error("lost connection");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
while ((l = ParseIACBuf(pcf, acMesg, &nc)) >= 0) {
|
||||||
|
if (l == 0) {
|
||||||
|
if (execCmdFile == (CONSFILE *)0) {
|
||||||
|
if (FileSawQuoteExec(pcf) == FLAGTRUE)
|
||||||
|
DoExec(pcf);
|
||||||
|
else if (FileSawQuoteSusp(pcf) == FLAGTRUE) {
|
||||||
|
justSuspended = 1;
|
||||||
|
#if defined(SIGSTOP)
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "stop]", 5);
|
||||||
|
C2Cooked();
|
||||||
|
kill(thepid, SIGSTOP);
|
||||||
|
C2Raw();
|
||||||
|
FileWrite(cfstdout, FLAGFALSE,
|
||||||
|
"[press any character to continue",
|
||||||
|
32);
|
||||||
|
#else
|
||||||
|
FileWrite(cfstdout, FLAGFALSE,
|
||||||
|
"stop not supported -- press any character to continue",
|
||||||
|
53);
|
||||||
|
#endif
|
||||||
|
} else if (FileSawQuoteGoto(pcf) == FLAGTRUE) {
|
||||||
|
gotoConsole = pcf;
|
||||||
|
if (gotoName != (char *)0)
|
||||||
|
free(gotoName);
|
||||||
|
if ((gotoName = StrDup(pcMach)) == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
C2Cooked();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (FileSawQuoteAbrt(pcf) == FLAGTRUE) {
|
||||||
|
FD_CLR(FileFDNum(execCmdFile), &rinit);
|
||||||
|
FD_CLR(FileFDOutNum(execCmdFile), &winit);
|
||||||
|
FileClose(&execCmdFile);
|
||||||
|
kill(execCmdPid, SIGHUP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (fStrip) {
|
||||||
|
for (i = 0; i < l; ++i)
|
||||||
|
acMesg[i] &= 127;
|
||||||
|
}
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, acMesg, l);
|
||||||
|
if (execCmdFile != (CONSFILE *)0) {
|
||||||
|
FileWrite(execCmdFile, FLAGFALSE, acMesg, l);
|
||||||
|
}
|
||||||
|
nc -= l;
|
||||||
|
MemMove(acMesg, acMesg + l, nc);
|
||||||
|
}
|
||||||
|
} else if (!FileBufEmpty(pcf) && FileCanWrite(pcf, &rmask, &wmask)) {
|
||||||
|
CONDDEBUG((1, "Interact(): flushing fd %d", FileFDNum(pcf)));
|
||||||
|
if (FileWrite(pcf, FLAGFALSE, (char *)0, 0) < 0) {
|
||||||
|
/* -bryan */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* anything from stdin? */
|
||||||
|
if (FD_ISSET(0, &rmask)) {
|
||||||
|
if ((nc = read(0, acMesg, sizeof(acMesg))) == 0) {
|
||||||
|
if (screwy)
|
||||||
|
break;
|
||||||
|
else {
|
||||||
|
FD_SET(0, &rinit);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (execCmdFile == (CONSFILE *)0) {
|
||||||
|
if (fStrip) {
|
||||||
|
for (i = 0; i < nc; ++i)
|
||||||
|
acMesg[i] &= 127;
|
||||||
|
}
|
||||||
|
FileWrite(pcf, FLAGFALSE, acMesg, nc);
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < nc; ++i) {
|
||||||
|
if (acMesg[i] == '\n' || acMesg[i] == '\r')
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command running - pid %lu]\r\n",
|
||||||
|
execCmdPid);
|
||||||
|
else if (acMesg[i] == 0x03) { /* ctrl-c */
|
||||||
|
kill(execCmdPid, SIGHUP);
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command sent SIGHUP - pid %lu]\r\n",
|
||||||
|
execCmdPid);
|
||||||
|
} else if (acMesg[i] == 0x1c) { /* ctrl-\ */
|
||||||
|
kill(execCmdPid, SIGKILL);
|
||||||
|
FilePrint(cfstdout, FLAGFALSE,
|
||||||
|
"[local command sent SIGKILL - pid %lu]\r\n",
|
||||||
|
execCmdPid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
C2Cooked();
|
||||||
|
if (fVerbose)
|
||||||
|
printf("Console %s closed.\n", pcMach);
|
||||||
|
}
|
||||||
|
|
||||||
/* interact with a group server (ksb)
|
/* interact with a group server (ksb)
|
||||||
*/
|
*/
|
||||||
static int
|
void
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
CallUp(CONSFILE *pcf, char *pcMaster, char *pcMach, char *pcHow,
|
CallUp(CONSFILE *pcf, char *pcMaster, char *pcMach, char *pcHow,
|
||||||
char *result)
|
char *result)
|
||||||
@ -690,11 +1114,7 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
char *pcMaster, *pcMach, *pcHow, *result;
|
char *pcMaster, *pcMach, *pcHow, *result;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int nc;
|
|
||||||
int fIn = '-';
|
int fIn = '-';
|
||||||
fd_set rmask, rinit;
|
|
||||||
int i;
|
|
||||||
int justProcessedUrg = 0;
|
|
||||||
char *r = (char *)0;
|
char *r = (char *)0;
|
||||||
|
|
||||||
if (fVerbose) {
|
if (fVerbose) {
|
||||||
@ -702,9 +1122,9 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
}
|
}
|
||||||
#if !defined(__CYGWIN__)
|
#if !defined(__CYGWIN__)
|
||||||
# if defined(F_SETOWN)
|
# if defined(F_SETOWN)
|
||||||
if (fcntl(FileFDNum(pcf), F_SETOWN, getpid()) == -1) {
|
if (fcntl(FileFDNum(pcf), F_SETOWN, thepid) == -1) {
|
||||||
Error("fcntl(F_SETOWN,%d): %d: %s", getpid(), FileFDNum(pcf),
|
Error("fcntl(F_SETOWN,%lu): %d: %s", (unsigned long)thepid,
|
||||||
strerror(errno));
|
FileFDNum(pcf), strerror(errno));
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
# if defined(SIOCSPGRP)
|
# if defined(SIOCSPGRP)
|
||||||
@ -712,7 +1132,7 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
int iTemp;
|
int iTemp;
|
||||||
/* on the HP-UX systems if different
|
/* on the HP-UX systems if different
|
||||||
*/
|
*/
|
||||||
iTemp = -getpid();
|
iTemp = -thepid;
|
||||||
if (ioctl(FileFDNum(pcf), SIOCSPGRP, &iTemp) == -1) {
|
if (ioctl(FileFDNum(pcf), SIOCSPGRP, &iTemp) == -1) {
|
||||||
Error("ioctl(%d,SIOCSPGRP): %s", FileFDNum(pcf),
|
Error("ioctl(%d,SIOCSPGRP): %s", FileFDNum(pcf),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
@ -721,9 +1141,7 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(SIGURG)
|
SimpleSignal(SIGCHLD, FlagReapVirt);
|
||||||
SimpleSignal(SIGURG, OOB);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* if we are going for a particular console
|
/* if we are going for a particular console
|
||||||
* send sign-on stuff, then wait for some indication of what mode
|
* send sign-on stuff, then wait for some indication of what mode
|
||||||
@ -770,8 +1188,8 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
/* tell the conserver to change escape sequences, assume OK
|
/* tell the conserver to change escape sequences, assume OK
|
||||||
* (we'll find out soon enough)
|
* (we'll find out soon enough)
|
||||||
*/
|
*/
|
||||||
sprintf(acMesg, "%c%ce%c%c", DEFATTN, DEFESC, chAttn, chEsc);
|
FilePrint(pcf, FLAGFALSE, "%c%ce%c%c", DEFATTN, DEFESC, chAttn,
|
||||||
FileWrite(pcf, FLAGFALSE, acMesg, 5);
|
chEsc);
|
||||||
r = ReadReply(pcf, 0);
|
r = ReadReply(pcf, 0);
|
||||||
if (strncmp(r, "[redef:", 7) != 0) {
|
if (strncmp(r, "[redef:", 7) != 0) {
|
||||||
Error("protocol botch on redef of escape sequence");
|
Error("protocol botch on redef of escape sequence");
|
||||||
@ -806,89 +1224,18 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
Error("%s is read-only", pcMach);
|
Error("%s is read-only", pcMach);
|
||||||
}
|
}
|
||||||
} else if (fIn != (*pcHow == 'f' ? 'a' : *pcHow)) {
|
} else if (fIn != (*pcHow == 'f' ? 'a' : *pcHow)) {
|
||||||
sprintf(acMesg, "%c%c%c", chAttn, chEsc, *pcHow);
|
FilePrint(pcf, FLAGFALSE, "%c%c%c", chAttn, chEsc, *pcHow);
|
||||||
FileWrite(pcf, FLAGFALSE, acMesg, 3);
|
|
||||||
}
|
}
|
||||||
if (fReplay) {
|
if (fReplay) {
|
||||||
sprintf(acMesg, "%c%cr", chAttn, chEsc);
|
FilePrint(pcf, FLAGFALSE, "%c%cr", chAttn, chEsc);
|
||||||
FileWrite(pcf, FLAGFALSE, acMesg, 3);
|
|
||||||
} else if (fVerbose) {
|
} else if (fVerbose) {
|
||||||
sprintf(acMesg, "%c%c\022", chAttn, chEsc);
|
FilePrint(pcf, FLAGFALSE, "%c%c\022", chAttn, chEsc);
|
||||||
FileWrite(pcf, FLAGFALSE, acMesg, 3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
C2Raw();
|
Interact(pcf, pcMach);
|
||||||
|
|
||||||
/* read from stdin and the socket (non-blocking!).
|
|
||||||
* rmask indicates which descriptors to read from,
|
|
||||||
* the others are not used, nor is the result from
|
|
||||||
* select, read, or write.
|
|
||||||
*/
|
|
||||||
FD_ZERO(&rinit);
|
|
||||||
FD_SET(FileFDNum(pcf), &rinit);
|
|
||||||
FD_SET(0, &rinit);
|
|
||||||
if (maxfd < FileFDNum(pcf) + 1)
|
|
||||||
maxfd = FileFDNum(pcf) + 1;
|
|
||||||
for (;;) {
|
|
||||||
justProcessedUrg = 0;
|
|
||||||
if (SawUrg) {
|
|
||||||
ProcessUrgentData(FileFDNum(pcf));
|
|
||||||
justProcessedUrg = 1;
|
|
||||||
}
|
|
||||||
/* reset read mask and select on it
|
|
||||||
*/
|
|
||||||
rmask = rinit;
|
|
||||||
if (-1 ==
|
|
||||||
select(maxfd, &rmask, (fd_set *)0, (fd_set *)0,
|
|
||||||
(struct timeval *)0)) {
|
|
||||||
if (errno != EINTR) {
|
|
||||||
Error("Master(): select(): %s", strerror(errno));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* anything from socket? */
|
|
||||||
if (FD_ISSET(FileFDNum(pcf), &rmask)) {
|
|
||||||
if ((nc = FileRead(pcf, acMesg, sizeof(acMesg))) < 0) {
|
|
||||||
/* if we got an error/eof after returning from suspend */
|
|
||||||
if (justProcessedUrg) {
|
|
||||||
fprintf(stderr, "\n");
|
|
||||||
Error("lost connection");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (fStrip) {
|
|
||||||
for (i = 0; i < nc; ++i)
|
|
||||||
acMesg[i] &= 127;
|
|
||||||
}
|
|
||||||
FileWrite(cfstdout, FLAGFALSE, acMesg, nc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* anything from stdin? */
|
|
||||||
if (FD_ISSET(0, &rmask)) {
|
|
||||||
if ((nc = read(0, acMesg, sizeof(acMesg))) == 0) {
|
|
||||||
if (screwy)
|
|
||||||
break;
|
|
||||||
else {
|
|
||||||
FD_SET(0, &rinit);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (fStrip) {
|
|
||||||
for (i = 0; i < nc; ++i)
|
|
||||||
acMesg[i] &= 127;
|
|
||||||
}
|
|
||||||
FileWrite(pcf, FLAGFALSE, acMesg, nc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
C2Cooked();
|
|
||||||
if (fVerbose)
|
|
||||||
printf("Console %s closed.\n", pcMach);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shouldn't need more than 3 levels of commands (but alloc 4 just 'cause)
|
/* shouldn't need more than 3 levels of commands (but alloc 4 just 'cause)
|
||||||
@ -906,11 +1253,11 @@ char *cmdarg = (char *)0;
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
DoCmds(char *master, char *ports, int cmdi)
|
DoCmds(char *master, char *pports, int cmdi)
|
||||||
#else
|
#else
|
||||||
DoCmds(master, ports, cmdi)
|
DoCmds(master, pports, cmdi)
|
||||||
char *master;
|
char *master;
|
||||||
char *ports;
|
char *pports;
|
||||||
int cmdi;
|
int cmdi;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -921,6 +1268,11 @@ DoCmds(master, ports, cmdi)
|
|||||||
unsigned short port;
|
unsigned short port;
|
||||||
char *result = (char *)0;
|
char *result = (char *)0;
|
||||||
int len;
|
int len;
|
||||||
|
char *ports;
|
||||||
|
char *pcopy;
|
||||||
|
|
||||||
|
if ((pcopy = ports = StrDup(pports)) == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
|
||||||
len = strlen(ports);
|
len = strlen(ports);
|
||||||
while (len > 0 && (ports[len - 1] == '\r' || ports[len - 1] == '\n'))
|
while (len > 0 && (ports[len - 1] == '\r' || ports[len - 1] == '\n'))
|
||||||
@ -953,6 +1305,8 @@ DoCmds(master, ports, cmdi)
|
|||||||
if ((pcf = GetPort(server, port)) == (CONSFILE *)0)
|
if ((pcf = GetPort(server, port)) == (CONSFILE *)0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
|
|
||||||
t = ReadReply(pcf, 0);
|
t = ReadReply(pcf, 0);
|
||||||
if (strcmp(t, "ok\r\n") != 0) {
|
if (strcmp(t, "ok\r\n") != 0) {
|
||||||
FileClose(&pcf);
|
FileClose(&pcf);
|
||||||
@ -960,23 +1314,21 @@ DoCmds(master, ports, cmdi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
FileWrite(pcf, FLAGFALSE, "ssl\r\n", 5);
|
if (fReqEncryption) {
|
||||||
t = ReadReply(pcf, 0);
|
FileWrite(pcf, FLAGFALSE, "ssl\r\n", 5);
|
||||||
if (strcmp(t, "ok\r\n") == 0) {
|
t = ReadReply(pcf, 0);
|
||||||
AttemptSSL(pcf);
|
if (strcmp(t, "ok\r\n") == 0) {
|
||||||
}
|
AttemptSSL(pcf);
|
||||||
if (fReqEncryption && FileGetType(pcf) != SSLSocket) {
|
}
|
||||||
Error("Encryption not supported by server `%s'", server);
|
if (FileGetType(pcf) != SSLSocket) {
|
||||||
FileClose(&pcf);
|
Error("Encryption not supported by server `%s'", server);
|
||||||
continue;
|
FileClose(&pcf);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BuildTmpString((char *)0);
|
FilePrint(pcf, FLAGFALSE, "login %s\r\n", pcUser);
|
||||||
BuildTmpString("login ");
|
|
||||||
BuildTmpString(pcUser);
|
|
||||||
t = BuildTmpString("\r\n");
|
|
||||||
FileWrite(pcf, FLAGFALSE, t, -1);
|
|
||||||
|
|
||||||
t = ReadReply(pcf, 0);
|
t = ReadReply(pcf, 0);
|
||||||
if (strncmp(t, "passwd?", 7) == 0) {
|
if (strncmp(t, "passwd?", 7) == 0) {
|
||||||
@ -994,15 +1346,16 @@ DoCmds(master, ports, cmdi)
|
|||||||
tmpString = AllocString();
|
tmpString = AllocString();
|
||||||
if (tmpString->used <= 1) {
|
if (tmpString->used <= 1) {
|
||||||
char *pass;
|
char *pass;
|
||||||
sprintf(acMesg, "Enter %s@%s's password: ", pcUser,
|
BuildStringPrint(tmpString, "Enter %s@%s's password: ",
|
||||||
hostname);
|
pcUser, hostname);
|
||||||
pass = GetPassword(acMesg);
|
pass = GetPassword(tmpString->string);
|
||||||
if (pass == (char *)0) {
|
if (pass == (char *)0) {
|
||||||
Error("could not get password from tty for `%s'",
|
Error("could not get password from tty for `%s'",
|
||||||
server);
|
server);
|
||||||
FileClose(&pcf);
|
FileClose(&pcf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
BuildString((char *)0, tmpString);
|
||||||
BuildString(pass, tmpString);
|
BuildString(pass, tmpString);
|
||||||
BuildString("\r\n", tmpString);
|
BuildString("\r\n", tmpString);
|
||||||
}
|
}
|
||||||
@ -1021,6 +1374,10 @@ DoCmds(master, ports, cmdi)
|
|||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
count = 0;
|
count = 0;
|
||||||
|
} else if (strcmp(t, "ok\r\n") != 0) {
|
||||||
|
FileClose(&pcf);
|
||||||
|
FilePrint(cfstdout, FLAGFALSE, "%s: %s", server, t);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now that we're logged in, we can do something */
|
/* now that we're logged in, we can do something */
|
||||||
@ -1039,6 +1396,8 @@ DoCmds(master, ports, cmdi)
|
|||||||
if (cmdi != 0) {
|
if (cmdi != 0) {
|
||||||
t = ReadReply(pcf, 0);
|
t = ReadReply(pcf, 0);
|
||||||
/* save the result */
|
/* save the result */
|
||||||
|
if (result != (char *)0)
|
||||||
|
free(result);
|
||||||
if ((result = StrDup(t)) == (char *)0)
|
if ((result = StrDup(t)) == (char *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
}
|
}
|
||||||
@ -1057,13 +1416,10 @@ DoCmds(master, ports, cmdi)
|
|||||||
FileClose(&pcf);
|
FileClose(&pcf);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
/* right now, we can only connect to one console, so it's ok
|
|
||||||
* to clear the password. if we were allowed to connect to
|
|
||||||
* multiple consoles (somehow), either in parallel or serial,
|
|
||||||
* we wouldn't want to do this here */
|
|
||||||
ClearPassword();
|
|
||||||
CallUp(pcf, server, cmdarg, cmds[0], result);
|
CallUp(pcf, server, cmdarg, cmds[0], result);
|
||||||
return 0;
|
if (pcf != gotoConsole)
|
||||||
|
FileClose(&pcf);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (cmds[cmdi][0] == 'q') {
|
} else if (cmds[cmdi][0] == 'q') {
|
||||||
t = ReadReply(pcf, 0);
|
t = ReadReply(pcf, 0);
|
||||||
@ -1080,6 +1436,8 @@ DoCmds(master, ports, cmdi)
|
|||||||
if (cmdi == 0) {
|
if (cmdi == 0) {
|
||||||
int len;
|
int len;
|
||||||
/* if we hit bottom, this is where we get our results */
|
/* if we hit bottom, this is where we get our results */
|
||||||
|
if (result != (char *)0)
|
||||||
|
free(result);
|
||||||
if ((result = StrDup(t)) == (char *)0)
|
if ((result = StrDup(t)) == (char *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
len = strlen(result);
|
len = strlen(result);
|
||||||
@ -1119,9 +1477,14 @@ DoCmds(master, ports, cmdi)
|
|||||||
DoCmds(server, result, cmdi);
|
DoCmds(server, result, cmdi);
|
||||||
else if (cmdi > 0)
|
else if (cmdi > 0)
|
||||||
DoCmds(server, result, cmdi - 1);
|
DoCmds(server, result, cmdi - 1);
|
||||||
free(result);
|
if (result != (char *)0)
|
||||||
|
free(result);
|
||||||
|
result = (char *)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result != (char *)0)
|
||||||
|
free(result);
|
||||||
|
free(pcopy);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1152,12 +1515,14 @@ main(argc, argv)
|
|||||||
extern int optopt;
|
extern int optopt;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
int i;
|
int i;
|
||||||
STRING *textMsg = (STRING *)0;
|
static STRING *textMsg = (STRING *)0;
|
||||||
int cmdi;
|
int cmdi;
|
||||||
int retval;
|
static STRING *consoleName = (STRING *)0;
|
||||||
|
|
||||||
isMultiProc = 0; /* make sure stuff DOESN'T have the pid */
|
isMultiProc = 0; /* make sure stuff DOESN'T have the pid */
|
||||||
|
|
||||||
|
thepid = getpid();
|
||||||
|
|
||||||
if (textMsg == (STRING *)0)
|
if (textMsg == (STRING *)0)
|
||||||
textMsg = AllocString();
|
textMsg = AllocString();
|
||||||
if (acPorts == (STRING *)0)
|
if (acPorts == (STRING *)0)
|
||||||
@ -1337,7 +1702,8 @@ main(argc, argv)
|
|||||||
Error("missing console name");
|
Error("missing console name");
|
||||||
Bye(EX_UNAVAILABLE);
|
Bye(EX_UNAVAILABLE);
|
||||||
}
|
}
|
||||||
cmdarg = argv[optind++];
|
if ((cmdarg = StrDup(argv[optind++])) == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
} else if (*pcCmd == 't') {
|
} else if (*pcCmd == 't') {
|
||||||
if (optind >= argc) {
|
if (optind >= argc) {
|
||||||
Error("missing message text");
|
Error("missing message text");
|
||||||
@ -1367,7 +1733,7 @@ main(argc, argv)
|
|||||||
/* non-numeric only */
|
/* non-numeric only */
|
||||||
struct servent *pSE;
|
struct servent *pSE;
|
||||||
if ((pSE = getservbyname(pcPort, "tcp")) == (struct servent *)0) {
|
if ((pSE = getservbyname(pcPort, "tcp")) == (struct servent *)0) {
|
||||||
Error("getservbyname(%s): %s", pcPort, strerror(errno));
|
Error("getservbyname(%s) failed", pcPort);
|
||||||
Bye(EX_UNAVAILABLE);
|
Bye(EX_UNAVAILABLE);
|
||||||
} else {
|
} else {
|
||||||
bindPort = ntohs((u_short) pSE->s_port);
|
bindPort = ntohs((u_short) pSE->s_port);
|
||||||
@ -1394,6 +1760,8 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (execCmd == (STRING *)0)
|
||||||
|
execCmd = AllocString();
|
||||||
|
|
||||||
SimpleSignal(SIGPIPE, SIG_IGN);
|
SimpleSignal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
@ -1423,12 +1791,54 @@ main(argc, argv)
|
|||||||
cmds[++cmdi] = "master";
|
cmds[++cmdi] = "master";
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = DoCmds(pcInMaster, acPorts->string, cmdi);
|
for (;;) {
|
||||||
|
if (gotoConsole == (CONSFILE *)0)
|
||||||
|
DoCmds(pcInMaster, acPorts->string, cmdi);
|
||||||
|
else
|
||||||
|
Interact(gotoConsole, gotoName);
|
||||||
|
|
||||||
|
/* if we didn't ask for another console, done */
|
||||||
|
if (gotoConsole == (CONSFILE *)0 && prevConsole == (CONSFILE *)0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (consoleName == (STRING *)0)
|
||||||
|
consoleName = AllocString();
|
||||||
|
C2Raw();
|
||||||
|
if (prevConsole == (CONSFILE *)0)
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "console: ", 9);
|
||||||
|
else
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "[console: ", 10);
|
||||||
|
GetUserInput(consoleName);
|
||||||
|
FileWrite(cfstdout, FLAGFALSE, "]\r\n", 3);
|
||||||
|
C2Cooked();
|
||||||
|
if (consoleName->used > 1) {
|
||||||
|
if (cmdarg != (char *)0)
|
||||||
|
free(cmdarg);
|
||||||
|
if ((cmdarg = StrDup(consoleName->string)) == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
if (prevConsole == (CONSFILE *)0) {
|
||||||
|
prevConsole = gotoConsole;
|
||||||
|
gotoConsole = (CONSFILE *)0;
|
||||||
|
prevName = gotoName;
|
||||||
|
gotoName = (char *)0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (prevConsole != (CONSFILE *)0) {
|
||||||
|
gotoConsole = prevConsole;
|
||||||
|
prevConsole = (CONSFILE *)0;
|
||||||
|
gotoName = prevName;
|
||||||
|
prevName = (char *)0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdarg != (char *)0)
|
||||||
|
free(cmdarg);
|
||||||
|
|
||||||
if (*pcCmd == 'd')
|
if (*pcCmd == 'd')
|
||||||
FilePrint(cfstdout, FLAGFALSE, "Disconnected %d users\n",
|
FilePrint(cfstdout, FLAGFALSE, "Disconnected %d users\n",
|
||||||
disconnectCount);
|
disconnectCount);
|
||||||
|
|
||||||
Bye(retval);
|
Bye(0);
|
||||||
return 0; /* noop - Bye() terminates us */
|
return 0; /* noop - Bye() terminates us */
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" $Id: console.man,v 1.37 2003-10-02 19:00:45-07 bryan Exp $
|
.\" $Id: console.man,v 1.45 2004/03/20 14:40:42 bryan Exp $
|
||||||
.TH CONSOLE 1 "2003-10-02" "conserver-8.0.5" "conserver"
|
.TH CONSOLE 1 "2004/03/20" "conserver-8.1.3" "conserver"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
console \- console server client program
|
console \- console server client program
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -302,7 +302,7 @@ were typed).
|
|||||||
.PP
|
.PP
|
||||||
The
|
The
|
||||||
.B \-i
|
.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
|
.TP
|
||||||
.I name
|
.I name
|
||||||
The name of the console.
|
The name of the console.
|
||||||
@ -318,22 +318,22 @@ a command, or `!' for a remote port.
|
|||||||
.TP
|
.TP
|
||||||
.I console-details
|
.I console-details
|
||||||
The details regarding the console.
|
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
|
Local devices will have values of the device file, baud rate/parity, and
|
||||||
file descriptor for the device.
|
file descriptor for the device.
|
||||||
Commands will have values of the command, the command's pid, the
|
Commands will have values of the command, the command's pid, the
|
||||||
pseudo-tty, and file descriptor for the pseudo-tty.
|
pseudo-tty, and file descriptor for the pseudo-tty.
|
||||||
Remote ports will have values of the remote hostname, remote port number,
|
Remote ports will have values of the remote hostname, remote port number,
|
||||||
and file descriptor for the socket connection.
|
``raw'' or ``telnet'' protocol, and file descriptor for the socket connection.
|
||||||
.TP
|
.TP
|
||||||
.I users-list
|
.I users-list
|
||||||
The details of each user connected to the console.
|
The details of each user connected to the console.
|
||||||
The details for each
|
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,
|
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
|
and (for `r' and `s' users only) ``rw'' or ``ro'' (if the user wants
|
||||||
read-write mode or not).
|
read-write mode or not).
|
||||||
Each user bundle is seperated by commas.
|
Each user bundle is separated by commas.
|
||||||
.TP
|
.TP
|
||||||
.I state
|
.I state
|
||||||
The state of the console.
|
The state of the console.
|
||||||
@ -347,7 +347,7 @@ that the server can open the file for read, but not write.
|
|||||||
.TP
|
.TP
|
||||||
.I logfile-details
|
.I logfile-details
|
||||||
The details regarding the logging for the console.
|
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
|
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
|
||||||
@ -362,13 +362,19 @@ is at work, it will have the value of ``autoup'', otherwise it
|
|||||||
will be ``noautoup''.
|
will be ``noautoup''.
|
||||||
.TP
|
.TP
|
||||||
.I aliases
|
.I aliases
|
||||||
The console aliases are presented in a comma seperated list.
|
The console aliases are presented in a comma-separated list.
|
||||||
.TP
|
.TP
|
||||||
.I options
|
.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
|
.TP
|
||||||
.I initcmd
|
.I initcmd
|
||||||
The initcmd configuration option for the console.
|
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"
|
.SH "ESCAPE SEQUENCES"
|
||||||
The connection can be controlled by a two-character escape sequence, followed
|
The connection can be controlled by a two-character escape sequence, followed
|
||||||
by a command.
|
by a command.
|
||||||
@ -381,6 +387,12 @@ Commands are:
|
|||||||
.sp
|
.sp
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP 13
|
.TP 13
|
||||||
|
.B \.
|
||||||
|
disconnect
|
||||||
|
.TP
|
||||||
|
.B ;
|
||||||
|
move to another console
|
||||||
|
.TP
|
||||||
.B a
|
.B a
|
||||||
attach read-write if nobody already is
|
attach read-write if nobody already is
|
||||||
.TP
|
.TP
|
||||||
@ -402,6 +414,9 @@ forcibly attach read-write
|
|||||||
.B g
|
.B g
|
||||||
group info
|
group info
|
||||||
.TP
|
.TP
|
||||||
|
.B i
|
||||||
|
information dump
|
||||||
|
.TP
|
||||||
.B L
|
.B L
|
||||||
toggle logging on/off
|
toggle logging on/off
|
||||||
.TP
|
.TP
|
||||||
@ -445,6 +460,9 @@ examine this group's devices and modes
|
|||||||
.B z
|
.B z
|
||||||
suspend this connection
|
suspend this connection
|
||||||
.TP
|
.TP
|
||||||
|
.B |
|
||||||
|
attach a local command to the console
|
||||||
|
.TP
|
||||||
.B ?
|
.B ?
|
||||||
display list of commands
|
display list of commands
|
||||||
.TP
|
.TP
|
||||||
@ -458,8 +476,6 @@ replay the last line only
|
|||||||
send character having octal code
|
send character having octal code
|
||||||
.IR ooo " (must"
|
.IR ooo " (must"
|
||||||
specify three octal digits)
|
specify three octal digits)
|
||||||
.IP \.
|
|
||||||
disconnect
|
|
||||||
.PD
|
.PD
|
||||||
.PP
|
.PP
|
||||||
If any other character is hit after the escape sequence, all three characters
|
If any other character is hit after the escape sequence, all three characters
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: getpassword.c,v 1.7 2003-09-28 12:29:17-07 bryan Exp $
|
* $Id: getpassword.c,v 1.8 2003/11/20 13:56:41 bryan Exp $
|
||||||
*
|
*
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <util.h>
|
#include <cutil.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
|
@ -24,5 +24,5 @@ will be helpful.
|
|||||||
Bryan Stansell
|
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 $
|
||||||
#
|
#
|
||||||
|
@ -88,15 +88,6 @@
|
|||||||
#define const
|
#define const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#ifndef __NetBSD__
|
|
||||||
#if 1
|
|
||||||
static const char rcsid[] = "Id: chat.c,v 1.26 1999/12/23 01:39:54 paulus Exp ";
|
|
||||||
#else
|
|
||||||
__RCSID("$NetBSD: chat.c,v 1.25 2001/09/24 13:22:38 wiz Exp $");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
%define pkg conserver
|
%define pkg conserver
|
||||||
%define ver conserver-8.0.5
|
%define ver 8.1.3
|
||||||
|
|
||||||
# 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
|
||||||
@ -17,7 +17,7 @@
|
|||||||
Summary: Serial console server daemon/client
|
Summary: Serial console server daemon/client
|
||||||
Name: %{pkg}
|
Name: %{pkg}
|
||||||
Version: %{ver}
|
Version: %{ver}
|
||||||
Release: 1.%{distver}x
|
Release: 1.%{distver}
|
||||||
Copyright: distributable
|
Copyright: distributable
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
URL: http://www.conserver.com/
|
URL: http://www.conserver.com/
|
||||||
@ -100,4 +100,6 @@ fi
|
|||||||
%{prefix}/share/man/man8/conserver.8.gz
|
%{prefix}/share/man/man8/conserver.8.gz
|
||||||
%{prefix}/share/man/man5/conserver.cf.5.gz
|
%{prefix}/share/man/man5/conserver.cf.5.gz
|
||||||
%{prefix}/share/man/man5/conserver.passwd.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
|
%{prefix}/sbin/conserver
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
PKG="conserver"
|
PKG="conserver"
|
||||||
NAME="Console server and client"
|
NAME="Console server and client"
|
||||||
CATEGORY="system"
|
CATEGORY="system"
|
||||||
VERSION="conserver-8.0.5"
|
VERSION="8.1.3"
|
||||||
DESC="Console server and client"
|
DESC="Console server and client"
|
||||||
CLASSES=none
|
CLASSES=none
|
||||||
ARCH=sparc
|
ARCH=sparc
|
||||||
|
@ -33,7 +33,7 @@ dotest()
|
|||||||
else
|
else
|
||||||
if [ -f results/test$testnum ]; then
|
if [ -f results/test$testnum ]; then
|
||||||
if diff -i test.out results/test$testnum >test$testnum.diff 2>&1; then
|
if diff -i test.out results/test$testnum >test$testnum.diff 2>&1; then
|
||||||
echo "succeded"
|
echo "succeeded"
|
||||||
rm -f test$testnum.diff
|
rm -f test$testnum.diff
|
||||||
else
|
else
|
||||||
echo "failed (diffs in test$testnum.diff)"
|
echo "failed (diffs in test$testnum.diff)"
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
[Enter `^Ec?' for help]
|
[Enter `^Ec?' for help]
|
||||||
[help]
|
[help]
|
||||||
. disconnect a attach read/write
|
. disconnect ; move to another console
|
||||||
b send broadcast message c toggle flow control
|
a attach read/write b send broadcast message
|
||||||
d down a console e change escape sequence
|
c toggle flow control d down a console
|
||||||
f force attach read/write g group info
|
e change escape sequence f force attach read/write
|
||||||
i information dump L toggle logging on/off
|
g group info i information dump
|
||||||
l? break sequence list l0 send break per config file
|
L toggle logging on/off l? break sequence list
|
||||||
l1-9 send specific break sequence m display the message of the day
|
l0 send break per config file l1-9 send specific break sequence
|
||||||
o (re)open the tty and log file p replay the last 60 lines
|
m display the message of the day o (re)open the tty and log file
|
||||||
r replay the last 20 lines s spy read only
|
p replay the last 60 lines r replay the last 20 lines
|
||||||
u show host status v show version info
|
s spy read only u show host status
|
||||||
w who is on this console x show console baud info
|
v show version info w who is on this console
|
||||||
z suspend the connection <cr> ignore/abort command
|
x show console baud info z suspend the connection
|
||||||
? print this message ^R replay the last line
|
| attach local command ? print this message
|
||||||
|
<cr> ignore/abort command ^R replay the last line
|
||||||
\ooo send character by octal code
|
\ooo send character by octal code
|
||||||
[disconnect]
|
[disconnect]
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
[Enter `^Ec?' for help]
|
[Enter `^Ec?' for help]
|
||||||
[help]
|
[help]
|
||||||
. disconnect a attach read/write
|
. disconnect ; move to another console
|
||||||
b send broadcast message c toggle flow control
|
a attach read/write b send broadcast message
|
||||||
d down a console e change escape sequence
|
c toggle flow control d down a console
|
||||||
f force attach read/write g group info
|
e change escape sequence f force attach read/write
|
||||||
i information dump L toggle logging on/off
|
g group info i information dump
|
||||||
l? break sequence list l0 send break per config file
|
L toggle logging on/off l? break sequence list
|
||||||
l1-9 send specific break sequence m display the message of the day
|
l0 send break per config file l1-9 send specific break sequence
|
||||||
o (re)open the tty and log file p replay the last 60 lines
|
m display the message of the day o (re)open the tty and log file
|
||||||
r replay the last 20 lines s spy read only
|
p replay the last 60 lines r replay the last 20 lines
|
||||||
u show host status v show version info
|
s spy read only u show host status
|
||||||
w who is on this console x show console baud info
|
v show version info w who is on this console
|
||||||
z suspend the connection <cr> ignore/abort command
|
x show console baud info z suspend the connection
|
||||||
? print this message ^R replay the last line
|
| attach local command ? print this message
|
||||||
|
<cr> ignore/abort command ^R replay the last line
|
||||||
\ooo send character by octal code
|
\ooo send character by octal code
|
||||||
[disconnect]
|
[disconnect]
|
||||||
|
Reference in New Issue
Block a user