mirror of
https://github.com/bstansell/conserver.git
synced 2025-06-24 17:55:08 +00:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
8cd506c093 | |||
29b909ee59 | |||
aea0e2a547 | |||
9eed9f2d8f | |||
25a4dcb0fd | |||
75cfd02f7a | |||
ad7a90dd69 | |||
691c3102c9 | |||
eafae7c27d | |||
92cf41a9f2 | |||
1c188a41d6 | |||
aeb8ac0057 | |||
66e0902358 | |||
de2e2fd33c | |||
4f71385126 |
281
CHANGES
281
CHANGES
@ -1,6 +1,285 @@
|
||||
CHANGES
|
||||
=======
|
||||
|
||||
version 8.1.4 (Apr 13, 2004):
|
||||
- fixed macro use in manpages to hopefully be more compatible
|
||||
- removed extra newline of --MARK-- range output
|
||||
- fixed bug where server -b option wasn't working - reported by
|
||||
Nathan R. Hruby <nhruby@uga.edu>
|
||||
- fixed client segfault when using -R, -t, -d, and -b options
|
||||
- added a --with-uds configure option to have all client/server
|
||||
communication happen via unix domain sockets - suggested by
|
||||
William P LePera <lepera@us.ibm.com>
|
||||
|
||||
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
|
||||
client hostnames instead of ip addresses (like pre-8.0.0) -
|
||||
suggested by Han Pilmeyer <han@zk3.dec.com>
|
||||
- fixed bug where 'daemonmode' config file option wasn't being
|
||||
used
|
||||
- fixed potential logfile (-L) opening problem processing SIGHUP
|
||||
- fixed various potential conserver.cf issues with 'config'
|
||||
block values processing SIGHUP
|
||||
- added 'setproctitle' config option (default is off) to enable
|
||||
changing the process title to contain runtime information -
|
||||
patch by Dmitry Morozovsky <marck@rinet.ru>
|
||||
|
||||
version 8.0.4 (Oct 10, 2003):
|
||||
- fixed client rejection bug that can nearly never happen -
|
||||
reported by Han Pilmeyer <han@zk3.dec.com>
|
||||
- fixed bug where client is reconnected to the previous console
|
||||
when non-exact console names are used - reported by Rolf
|
||||
Petter Halle <rph@online.no>
|
||||
- fixed bug where exact matchs on a remote console name never
|
||||
happened - reported by Toby Gerhart <toby.gerhart@eds.com>
|
||||
- fixed bug where SIGHUP fails to update console aliases -
|
||||
reported by Han Pilmeyer <han@zk3.dec.com>
|
||||
|
||||
version 8.0.3 (Oct 6, 2003):
|
||||
- the SIGHUP process fails to pick up changes to certain fields
|
||||
because of a horribly broken SwapStr() function [broken in
|
||||
all previous 8.0.x versions] - reported by Toby Gerhart
|
||||
<toby.gerhart@eds.com>
|
||||
|
||||
version 8.0.2 (Oct 5, 2003):
|
||||
- reworked the i/o calls to better buffer data
|
||||
- added console 'motd' option for holding a "message of the
|
||||
day", displayed to the client on attachment to console -
|
||||
suggested by Toby Gerhart <toby.gerhart@eds.com>
|
||||
- added ^Ecm client command for displaying MOTD and integrated
|
||||
it into the client console attachment sequence
|
||||
- now unallocate client lists when forking new child conserver
|
||||
processes
|
||||
- changed strdup() to local StrDup() so dmalloc can gracefully
|
||||
track changes
|
||||
- added a ^Ec; sequence to let client signal server when it's
|
||||
ready to see console data, otherwise a chatty console can
|
||||
cause the login sequence to fail and you can never attach to
|
||||
the console
|
||||
|
||||
version 8.0.1 (Sep 29, 2003):
|
||||
- fixed bug in access list parsing where multiple addresses per
|
||||
line can cause errors - reported by Jay McCanta
|
||||
<mccantaj@amgen.com>
|
||||
- changed client password prompt to show hostname passed down by
|
||||
the server - suggested by Toby Gerhart <toby.gerhart@eds.com>
|
||||
- fixed bug where remote console names were only search for
|
||||
substring matches - reported by Toby Gerhart
|
||||
<toby.gerhart@eds.com>
|
||||
- the server -M option wasn't being used properly to limit the
|
||||
consoles managed by the host
|
||||
- added 'initcmd' console option which allows a command to
|
||||
interact with a console right after a console is opened -
|
||||
suggested by Greg Woods <woods@weird.com>
|
||||
- added the chat program contributed by Greg Woods
|
||||
<woods@weird.com> to the contrib/chat directory
|
||||
- added WUNTRACED to waitpid() for catching suspended processes
|
||||
- reworded some client/server messages to be clearer
|
||||
- embedded non-printable characters in break lists now display
|
||||
correctly when '^Ecl?' is used
|
||||
- in case client aborts unexpectedly, terminal state should
|
||||
now be restored to normal
|
||||
|
||||
version 8.0.0 (Sep 22, 2003):
|
||||
- better error messages and management of the user's password
|
||||
- 8.0.0-beta4 mistakenly lost conserver.passwd usage
|
||||
- empty passwords now don't trigger a passwd prompt (like 7.2.7)
|
||||
- upgraded to autoconf-2.57 and use recent config.guess/sub
|
||||
files - suggested by Jorgen Hagg <jorgen.hagg@axis.com>
|
||||
- we now install the conserver.rc file as well as sample
|
||||
conserver.cf and conserver.passwd files in
|
||||
$(prefix)/share/examples/conserver - suggested by
|
||||
Hubert Feyrer <hubertf@netbsd.org>
|
||||
|
||||
version 8.0.0-beta4 (Aug 24, 2003):
|
||||
- totally rewrote the client/server communication, allowing SSL
|
||||
connections to occur first, protecting *all* information
|
||||
- added 'admin' keyword to the 'access' portion of the config
|
||||
file for specifying users able to issue the 'quit' command
|
||||
- removed client -G option since it's not really useful any more
|
||||
- added client -t option for sending "text messages" to users,
|
||||
which is similar to broadcast messages, but you can specify
|
||||
the user and/or console - suggested by Trevor Fiatal
|
||||
<trevor@seven.com>
|
||||
- added client -d option for disconnecting users specified by
|
||||
username and/or console - suggested by Trevor Fiatal
|
||||
<trevor@seven.com>
|
||||
- removed --with-64bit configure option as 64bit operation is
|
||||
reported to work just fine
|
||||
- break strings with '\d' are interpreted as a delay, which can
|
||||
be specified in the config file (default 250ms)
|
||||
- removed 'reset -x' portion of default break sequence #3
|
||||
- remote conserver hostnames now properly match - had to be a
|
||||
character string match previously
|
||||
- hostname aliases now checked against access lists and the
|
||||
matched name is used for logging
|
||||
- added --with-trustrevdns to enable the use of reverse DNS
|
||||
information for access list checks [not recommended] - see the
|
||||
INSTALL file for full details on who should actually need this
|
||||
Many thanks to Chuck Rouzer <crouzer@yahoo.com> for all the
|
||||
help with FreeBSD support and the following issues...
|
||||
- fixed 'make test' problem on hosts where 'localhost' doesn't
|
||||
resolve to 127.0.0.1
|
||||
- fixed interface probe problem under *BSD
|
||||
- added openpty() interface for pty allocation
|
||||
|
||||
version 8.0.0-beta3 (Aug 8, 2003):
|
||||
- master process no longer forks on client requests - handles
|
||||
them with select() like child process
|
||||
- alarm()/SIGALRM usage removed and replaced with counters and
|
||||
timer on select() call
|
||||
- removed caching of timeouts to terminal servers - each
|
||||
socket connection now has a proper timeout (and can happen
|
||||
simultaniously)
|
||||
- partial write()s are properly buffered and retried
|
||||
- made all sockets (including SSL) non-buffered
|
||||
- client now supports piping data to it and properly printing
|
||||
all server data ("echo '^Ecr^Ec.' | console universe")
|
||||
|
||||
version 8.0.0-beta2 (Jul 17, 2003):
|
||||
- console aliases added with 'aliases' console keyword
|
||||
- two stop bit support for serial devices - requested by Kelly
|
||||
Setzer <setzer@placemark.com>
|
||||
- added support for inet_aton() over inet_addr()
|
||||
- all server interfaces now used to identify console management
|
||||
- server interfaces probed with SIOCGIFCONF ioctl, if available
|
||||
- added flow control options 'ixon', 'ixany', 'ixoff', and
|
||||
'crtscts'
|
||||
- added info to console client -i output
|
||||
- man pages updated, however the wording needs work
|
||||
|
||||
version 8.0.0-beta1 (Jul 4, 2003):
|
||||
- ***NOTICE*** the format of conserver.cf and conserver.passwd
|
||||
has completely changed. see the INSTALL file for
|
||||
upgrade instructions (it should be "fairly painless").
|
||||
some documentation has been updated to reflect the new world,
|
||||
some hasn't - my goal for beta2 is to have all the docs updated
|
||||
- many command-line options now also conserver.cf options options
|
||||
- POSIX termios interface now required for compilation - some
|
||||
POSIX requirements were already in the code and others will
|
||||
undoubtedly creep in as time goes by
|
||||
- configure --with-regex option removed because of conserver.cf
|
||||
and conserver.passwd changes
|
||||
- added -S option to server for syntax checking of the
|
||||
configuration file - suggested by Dave Stuit <djs@tellme.com>
|
||||
- authorized users now either have r/w or r/o access to consoles
|
||||
- getpassword.o replaces getpass() and getpassphrase() so we can
|
||||
get any string length
|
||||
- fixed rm commands in test script - patch by Petter Reinholdtsen
|
||||
<pere@hungry.com>
|
||||
|
||||
version 7.2.7 (Apr 9, 2003):
|
||||
- added test suite ('make test') for basic client/server
|
||||
communication tests
|
||||
@ -429,5 +708,5 @@ before version 6.05:
|
||||
and enhancements of various types were applied.
|
||||
|
||||
#
|
||||
# $Id: CHANGES,v 1.82 2003-04-09 07:20:21-07 bryan Exp $
|
||||
# $Id: CHANGES,v 1.167 2004/04/13 19:40:07 bryan Exp $
|
||||
#
|
||||
|
20
FAQ
20
FAQ
@ -65,23 +65,25 @@ directed to faq@conserver.com. The FAQ answers the following questions:
|
||||
When conserver was compiled, it was told to use the /etc/services
|
||||
entry of "conserver" (what came after getservbyname:). You'll need
|
||||
to either recompile conserver and hard-code a port number (using
|
||||
PORT instead of SERVICE in conserver/cons.h) or enter "conserver"
|
||||
in /etc/services.
|
||||
--with-port=<num>) or enter "conserver" in /etc/services.
|
||||
|
||||
6) What does "console: gethostbyname: console: host lookup error"
|
||||
mean (or something close to that)?
|
||||
|
||||
When the console command was compiled, it was told to use the
|
||||
hostname "console" (what came after gethostbyname:) as the master
|
||||
conserver host. You'll need to either recompile console with the
|
||||
appropriate name of your conserver host or add an alias of "console".
|
||||
In most cases, adding an alias is my suggestion.
|
||||
conserver host. You'll need to either reconfigure with the
|
||||
appropriate name of your conserver host (--with-master=<name>) or
|
||||
add an alias of "console". In most cases, adding an alias is my
|
||||
suggestion.
|
||||
|
||||
7) How do I set up a local serial port for no parity?
|
||||
|
||||
The conserver.cf man page will have this in the 6.17 release,
|
||||
but the answer is to use a 'p' after the baud rate. So, '9600p'
|
||||
is 9600 baud, no parity.
|
||||
The manpage has the answer to this question. For those that don't
|
||||
want to read it, here are some guidelines. For pre-7.2.2, you'd
|
||||
want to use a 'p' after the baud rate ("9600p", for example). For
|
||||
7.2.2 thru 7.2.7, you can use an 'n'. For 8.0.0 and beyond, you use
|
||||
'parity none;'.
|
||||
|
||||
8) Is "Conserver" a trademark or registered trademark?
|
||||
|
||||
@ -184,5 +186,5 @@ directed to faq@conserver.com. The FAQ answers the following questions:
|
||||
through the same problem?
|
||||
|
||||
#
|
||||
# $Id: FAQ,v 1.8 2003-04-08 14:05:16-07 bryan Exp $
|
||||
# $Id: FAQ,v 1.9 2003/08/23 19:27:10 bryan Exp $
|
||||
#
|
||||
|
100
INSTALL
100
INSTALL
@ -10,6 +10,89 @@ Upgrading?
|
||||
new features added to the client if you're considering *not*
|
||||
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
|
||||
|
||||
- I've added a '^Ec;' sequence to allow the client to signal the
|
||||
server as to when it's ready to see console data. Without
|
||||
this, verbose consoles will prevent clients from attaching
|
||||
(the client sees unexpected data). An 8.0.2 client should be
|
||||
compatible with an 8.0.1 server, but an 8.0.1 client is not
|
||||
compatible with an 8.0.2 server.
|
||||
|
||||
Version 8.0.1
|
||||
|
||||
- There's a slight client/server protocol change to implement
|
||||
the new 'initcmd' console option. If you use this
|
||||
functionality with an 8.0.0 client, you'll run into a
|
||||
compatibility problem while the 'initcmd' command is running.
|
||||
|
||||
Version 8.0.0
|
||||
|
||||
- The client/server protocol has been rearchitected. You *MUST*
|
||||
use an 8.0.0 client with an 8.0.0 server. No combination of
|
||||
client/server will work with pre-8.0.0 code.
|
||||
|
||||
- Upgrading from pre-8.0.0 code to 8.0.0 and beyond requires
|
||||
you to change your conserver.cf and conserver.passwd files
|
||||
because both of the file formats have changed.
|
||||
|
||||
The conserver.cf file changes are so major that there is a
|
||||
convert program available in the conserver subdirectory. Just
|
||||
run './conserver/convert <old-cf-file>' and it will attempt a
|
||||
conversion to the new format, sending it to stdout. Any errors
|
||||
will be printed to stderr. There are a couple of things
|
||||
you might need to adjust. First are the user access lists.
|
||||
If you are restricting users to certain consoles in your old
|
||||
conserver.passwd file, you'll need to move those restrictions
|
||||
into the new conserver.cf file. Restrictions are set with the
|
||||
'ro' and 'rw' tags in the configuration file. Second are the
|
||||
'access' blocks. What get produced by the convert program
|
||||
will be functionally equivalent to the old behavior, but you
|
||||
may be able to tune things to better suit your environment.
|
||||
|
||||
The conserver.passwd file's console restrictions have moved,
|
||||
as described above. So to convert the conserver.passwd file,
|
||||
all you really need to do is something like:
|
||||
|
||||
awk -F: '{print $1 ":" $2}' <old-passwd-file>
|
||||
|
||||
If you have comments or continuation lines in your file,
|
||||
you'll have to do a bit more cleanup to strip out the third
|
||||
field (which is what the awk command is intending to do).
|
||||
|
||||
- Conserver no longer trusts reverse DNS information by default.
|
||||
If you use the --with-trustrevdns configure flag, you can
|
||||
re-enable the use of gethostbyaddr() [I don't recommended it,
|
||||
however]. If you are using domain names in access lists,
|
||||
you'll either need to change those to use hostnames and/or ip
|
||||
addresses/ranges or use the --with-trustrevdns flag. For
|
||||
example, if you have (in the
|
||||
8.0.0 format):
|
||||
|
||||
allowed conserver.com; # allow *.conserver.com
|
||||
|
||||
then you'll need to worry about this change. If you only use
|
||||
full hostnames, you shouldn't have to do anything.
|
||||
|
||||
Version 7.2.4
|
||||
|
||||
- If SSL support is compiled into the code, older versions of
|
||||
@ -70,7 +153,6 @@ Detailed Instructions
|
||||
the defaults shown, you're set. If not, here are the conserver
|
||||
unique options:
|
||||
|
||||
--with-64bit Allow 64bit compilation
|
||||
--with-port=PORT Specify port number [conserver]
|
||||
--with-base=PORT Base port for secondary channel [0]
|
||||
--with-master=MASTER Specify master server hostname [console]
|
||||
@ -82,10 +164,13 @@ Detailed Instructions
|
||||
--with-pidfile=PIDFILE Specify PID filepath [/var/run/conserver.pid]
|
||||
--with-maxmemb=MAXMEMB Specify maximum consoles per process [16]
|
||||
--with-timeout=TIMEOUT Specify connect() timeout in seconds [10]
|
||||
--with-trustrevdns Trust reverse DNS information
|
||||
--with-extmsgs Produce extended messages
|
||||
--with-uds[=DIR] Use Unix domain sockets for client/server
|
||||
communication [/tmp/conserver]
|
||||
--with-libwrap[=PATH] Compile in libwrap (tcp_wrappers) support
|
||||
--with-openssl[=PATH] Compile in OpenSSL support
|
||||
--with-dmalloc[=PATH] Compile in dmalloc support
|
||||
--with-regex Use regular expressions in conserver.passwd
|
||||
--with-pam Enable PAM support
|
||||
|
||||
Not surprisingly, some match the old conserver/cons.h items...here
|
||||
@ -100,10 +185,11 @@ Detailed Instructions
|
||||
A couple of notes. First, --with-libwrap will add tcp_wrappers
|
||||
lookups to all socket connections in the server. --with-openssl
|
||||
will add encryption between the client and server when you connect
|
||||
to a console. things such as 'console -q', 'console -w', etc. are
|
||||
still unencrypted, as well as connections from conserver to any
|
||||
terminal servers. --with-dmalloc should only be used to do memory
|
||||
allocation debugging and not used in production.
|
||||
to a console. --with-uds will cause the client and server to use
|
||||
unix domain sockets for their communication, eliminating the
|
||||
tcp communication they normally do (which means --with-master and
|
||||
--with-port are not used). --with-dmalloc should only be used to
|
||||
do memory allocation debugging and not used in production.
|
||||
|
||||
- Run './configure'. This will detect system specific
|
||||
information. The --prefix option will redirect where things are
|
||||
@ -192,5 +278,5 @@ Other Information And Gotchas
|
||||
|
||||
|
||||
#
|
||||
# $Id: INSTALL,v 1.27 2003-04-09 07:15:27-07 bryan Exp $
|
||||
# $Id: INSTALL,v 1.38 2004/04/13 18:11:58 bryan Exp $
|
||||
#
|
||||
|
@ -25,6 +25,12 @@ autologin:
|
||||
autologin.install:
|
||||
( cd autologin && $(MAKE) install $(MAKE_FLAGS) ) || exit 1;
|
||||
|
||||
chat:
|
||||
( cd contrib/chat && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1;
|
||||
|
||||
chat.install:
|
||||
( cd contrib/chat && $(MAKE) install $(MAKE_FLAGS) ) || exit 1;
|
||||
|
||||
test:
|
||||
( cd test && ./dotest ) || exit 1
|
||||
|
||||
|
23
README
23
README
@ -24,17 +24,22 @@ Systems Tested
|
||||
compile conserver. If anyone has more to add to this list (or
|
||||
something on the list doesn't work any more), please let me know.
|
||||
|
||||
Solaris 2.5.1 thru 9 (sparc/x86), gcc
|
||||
AIX 4.3.3/5.1/5.2, native cc
|
||||
BSDI BSD/OS 3.X, gcc
|
||||
MacOS X
|
||||
Cygwin (w2k),gcc 2.95.3
|
||||
DEC Tru64 4.0, gcc
|
||||
DEC Tru64 4.0/5.1, native cc
|
||||
FreeBSD 4.2/4.8/5.1 (x86), gcc
|
||||
HP-UX 10.20, gcc
|
||||
HP-UX 11.10 parisc and ia64, native cc
|
||||
Irix 6.15, native cc
|
||||
Linux 2.2.18 (x86), gcc
|
||||
Linux 2.4.2 (x86), gcc
|
||||
FreeBSD 4.2 (x86), gcc
|
||||
cygwin (w2k),gcc 2.95.3
|
||||
DEC Tru64 4.0, gcc
|
||||
DEC Tru64 4.0/5.1, DEC cc
|
||||
HP-UX 10.20, gcc
|
||||
AIX 4.3.3, AIX cc
|
||||
Linux ia64, native gcc
|
||||
Linux RedHat 6.2 and 7.2 (x86), native gcc
|
||||
MacOS X, native gcc
|
||||
Solaris 2.5.1 thru 9 (sparc/x86), gcc
|
||||
Solaris 7/8, native cc
|
||||
|
||||
|
||||
Contributions
|
||||
@ -50,5 +55,5 @@ Contributions
|
||||
http://www.columbia.edu/acis/sy/unixdev/zinc
|
||||
|
||||
#
|
||||
# $Id: README,v 1.21 2002-09-23 10:10:11-07 bryan Exp $
|
||||
# $Id: README,v 1.22 2003/08/23 19:34:24 bryan Exp $
|
||||
#
|
||||
|
104
TODO
104
TODO
@ -10,67 +10,47 @@ Bryan Stansell
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
- usleep() statements, can they be removed and mimiced with some sort
|
||||
of console state thing and a timer? Aaron Burt <aaron@osdl.org>
|
||||
users email.
|
||||
|
||||
- OpenSSL sockets have been make blocking instead of keeping the
|
||||
underlying socket non-blocking. Why? It requires much more work to
|
||||
deal with non-blocking sockets and OpenSSL. Not impossible, just have
|
||||
to rewrite a lot of the code to handle the extra special cases. Perhaps
|
||||
by ignoring renegotiations this can be ignored, but I'm not sure.
|
||||
|
||||
- checks for EPIPE during write() should really be done, but, for the
|
||||
most part, consoles and clients will come around and we'll see
|
||||
problems on the read().
|
||||
|
||||
- Singular logging so that swatch/logsurfer can watch for errors across
|
||||
the board - unloved output comes close
|
||||
|
||||
- Telnet protocol should be improved
|
||||
- Not even RFC 854 compliant
|
||||
- Option negotiation ignored - should we negotiate anything?
|
||||
- Not even RFC 854 compliant...or maybe it is (as of 8.1.0)
|
||||
- Option negotiation semi-ignored - should we negotiate anything more?
|
||||
- Others?
|
||||
|
||||
- better shadow file support
|
||||
- what does this mean? i've forgotten.
|
||||
|
||||
- syslog?
|
||||
Daniel E. Singer <des@cs.duke.edu> would like to see it - especially
|
||||
in regards to --use-libwrap code
|
||||
|
||||
- alternate (md5) password encryption support in conserver.passwd
|
||||
- actually happens if the crypt() call supports it, like under linux
|
||||
- hpux has bigcrypt() also, which we support, so maybe we're covered
|
||||
|
||||
- config file examples for various configurations
|
||||
- sample conserver.cf has some...but it's not explained well
|
||||
|
||||
- per-line timestamps
|
||||
- only when not connected?
|
||||
|
||||
- flow control configuration (hardcoded on, i think)
|
||||
|
||||
- pipe input/output (console <-> program) via 'console'
|
||||
- some apps (net-ups thing, gdb) might need to talk to user
|
||||
|
||||
- group permissions (better user management in general)
|
||||
|
||||
- 64-bit compilation support (have a patch set contributed, somewhere, i think)
|
||||
- ^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.
|
||||
- this will never happen...i don't want to interpret data
|
||||
|
||||
- "listen" capability (watch all/multiple consoles)
|
||||
|
||||
- break sequences - need .5 second delays (or delays in general?)
|
||||
|
||||
- aliases for console entries
|
||||
- send data to multiple consoles (carbon copy) -
|
||||
Steve Lammert <slammert@panasas.com>
|
||||
|
||||
- authentication to terminal servers (ssh, passphrase, whatever)
|
||||
|
||||
- "not" or "except" in passwd file (!console).
|
||||
|
||||
- multi-homed/multi-ip hosts not supported well
|
||||
- other names/ip addrs not detected as local, necessarily
|
||||
- acls don't look at aliases properly
|
||||
- the whole thing needs some serious help
|
||||
- ssh should probably just be handled by invoking the ssh command.
|
||||
so, that's really already covered, no?
|
||||
- passphrase...hmmm..could really use some sort of send/expect
|
||||
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.
|
||||
- this does work, using the 'initcmd' option, so, all done?
|
||||
|
||||
- cyclades ts1000/2000 port : "Moses, Joel" <jmoses@deloitte.com>
|
||||
|
||||
@ -82,8 +62,7 @@ Bryan Stansell
|
||||
|
||||
- server -M flag should accept multiple addresses (comma separated)
|
||||
- should client as well?
|
||||
|
||||
- logfile rotation based on size
|
||||
- this may never happen...does anyone really need it?
|
||||
|
||||
- automatic log rotation in general : Egan Ford <egan@us.ibm.com>
|
||||
|
||||
@ -94,24 +73,7 @@ Bryan Stansell
|
||||
|
||||
- suggestions by Trevor Fiatal <trevor@seven.com>
|
||||
- include server hostname on 'console -x' output
|
||||
- non-interactively be able to
|
||||
- disconnect a single user-to-port session
|
||||
- disconnect all sessions to a given port
|
||||
- disconnect all sessions registered to a particular user
|
||||
- non-interactively be able to send messages to
|
||||
- all sessions open by a particular user
|
||||
console -t user "Time to go home."
|
||||
- a particular user-session
|
||||
console -t user@managed-host "Please disconnect from this host."
|
||||
- all users on a given host
|
||||
console -t @managed-host "I am taking over this host."
|
||||
|
||||
- support 2 stop bits (as well as other stty-type options in console
|
||||
definitions) : Kelly Setzer <setzer@placemark.com>
|
||||
|
||||
- ability to configure strings to be sent to a console whenever it is
|
||||
(re)opened (eg. a termserver login) : Greg A. Woods
|
||||
<woods@planix.com>
|
||||
- i think the -i output covers it, but maybe not
|
||||
|
||||
- ability to configure strings to be sent to a console periodically :
|
||||
Greg A. Woods <woods@planix.com>
|
||||
@ -119,7 +81,31 @@ Bryan Stansell
|
||||
- show attach/detach events to/of spy console clients : Greg A. Woods
|
||||
<woods@planix.com>
|
||||
|
||||
- redefine client escape sequence in conserver.cf : Toby Gerhart
|
||||
<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.27 2003-01-27 17:47:27-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
|
||||
console of the machine (either through the console server or via the physical
|
||||
|
@ -31,6 +31,8 @@ ALL = autologin
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
$(AUTOLOGIN_OBJS): $(AUTOLOGIN_HDRS)
|
||||
|
||||
autologin: $(AUTOLOGIN_OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o autologin $(AUTOLOGIN_OBJS) $(LIBS)
|
||||
|
||||
|
@ -17,5 +17,5 @@ Good luck.
|
||||
Bryan Stansell
|
||||
|
||||
#
|
||||
# $Id: README,v 1.2 2002-09-23 14:08:42-07 bryan Exp $
|
||||
# $Id: README,v 1.2 2002/09/23 21:08:42 bryan Exp $
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: README,v 1.3 93/04/21 16:13:37 ksb Exp $
|
||||
# $Id: README.old,v 1.1 2003/11/04 02:36:24 bryan Exp $
|
||||
|
||||
This program can be used to put a root shell on the console at boot time.
|
||||
See the manual page.
|
||||
|
@ -69,7 +69,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
char *rcsid = "$Id: autologin.c,v 1.23 2002-09-20 23:29:39-07 bryan Exp $";
|
||||
char *rcsid = "$Id: autologin.c,v 1.23 2002/09/21 06:29:39 bryan Exp $";
|
||||
#endif /* not lint */
|
||||
extern char *progname;
|
||||
gid_t awGrps[NGROUPS_MAX];
|
||||
|
@ -1,7 +1,7 @@
|
||||
# mkcmd parser for autologin program
|
||||
%%
|
||||
static char *rcsid =
|
||||
"$Id: autologin.m,v 1.2 92/07/28 13:18:34 ksb Exp $";
|
||||
"$Id: autologin.m,v 1.1 2003/11/04 02:36:24 bryan Exp $";
|
||||
%%
|
||||
|
||||
integer variable "iErrs" {
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $Id: autologin.man,v 1.3 93/03/16 16:41:45 ksb Exp $
|
||||
.\" $Id: autologin.man,v 1.2 2004/03/23 18:32:06 bryan Exp $
|
||||
.TH AUTOLOGIN 8L PUCC
|
||||
.SH NAME
|
||||
autologin \- create an automatic login session from /etc/inittab
|
||||
@ -112,12 +112,21 @@ environment variable set to
|
||||
ss10:2:respawn:/usr/local/etc/autologin \-e TERM=reg20 \-t/dev/tty10 \-lssinfo
|
||||
.ad
|
||||
.PP
|
||||
Adding the following line to \fI/etc/ttytab\fP on a Sun 4.1.\fIx\fP
|
||||
Adding the following line to
|
||||
.I /etc/ttytab
|
||||
on a Sun
|
||||
.RI 4.1. x
|
||||
machine establishes a root login on the console device:
|
||||
.br
|
||||
.na
|
||||
console "/usr/local/etc/autologin \-lroot \-t" xterm on local secure
|
||||
.ad
|
||||
Note that \fIinit\fP provides the \fItty\fP argument on the end of the command.
|
||||
.PP
|
||||
Note that
|
||||
.I init
|
||||
provides the
|
||||
.I tty
|
||||
argument on the end of the command.
|
||||
.SH FILES
|
||||
/bin/su
|
||||
.br
|
||||
|
@ -80,7 +80,7 @@ char **nargv, *ostr;
|
||||
#endif /* ! HAVE_GETOPT */
|
||||
|
||||
char
|
||||
*progname = "$Id$",
|
||||
*progname = "$Id: main.c,v 1.1 2003/11/04 02:36:24 bryan Exp $",
|
||||
*au_terse[] = {
|
||||
" [-u] [-c cmd] [-e env=value] [-g group] [-l login] [-t tty]",
|
||||
" -h",
|
||||
@ -111,7 +111,7 @@ int
|
||||
#endif
|
||||
|
||||
static char *rcsid =
|
||||
"$Id: autologin.m,v 1.2 92/07/28 13:18:34 ksb Exp $";
|
||||
"$Id: main.c,v 1.1 2003/11/04 02:36:24 bryan Exp $";
|
||||
|
||||
/*
|
||||
* parser
|
||||
|
51
compat.h
51
compat.h
@ -1,5 +1,21 @@
|
||||
#include <config.h>
|
||||
|
||||
/* things everything seems to need */
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#if USE_UNIX_DOMAIN_SOCKETS
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
|
||||
/* If, when processing a logfile for replaying the last N lines,
|
||||
* we end up seeing more than MAXREPLAYLINELEN characters in a line,
|
||||
* abort processing and display the data. Why? There could be some
|
||||
@ -76,17 +92,7 @@ typedef long fd_set;
|
||||
# include <sys/ioctl_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# include <termios.h> /* POSIX */
|
||||
#else
|
||||
# ifdef HAVE_TERMIO_H
|
||||
# include <termio.h> /* SysV */
|
||||
# else
|
||||
# ifdef HAVE_SGTTY_H
|
||||
# include <sgtty.h> /* BSD */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#include <termios.h>
|
||||
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
@ -211,6 +217,18 @@ extern char *h_errlist[];
|
||||
#include <usersec.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PTY_H
|
||||
#include <pty.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBUTIL_H
|
||||
#include <libutil.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UTIL_H
|
||||
#include <util.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NGROUPS_MAX
|
||||
# define NGROUPS_MAX 8
|
||||
@ -272,12 +290,21 @@ typedef int socklen_t;
|
||||
#define ONLRET 0
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET L_SET
|
||||
#endif
|
||||
|
||||
#ifndef PARAMS
|
||||
# if PROTOTYPES
|
||||
# define PARAMS(protos) protos
|
||||
# else /* no PROTOTYPES */
|
||||
# define PARAMS(protos) ()
|
||||
# endif /* no PROTOTYPES */
|
||||
# endif /* no PROTOTYPES */
|
||||
#endif
|
||||
|
||||
/* setup a conditional debugging line */
|
||||
#ifndef CONDDEBUG
|
||||
#define CONDDEBUG(line) if (fDebug) {debugFileName=__FILE__; debugLineNo=__LINE__; Debug line;}
|
||||
#endif
|
||||
|
||||
#if HAVE_DMALLOC
|
||||
|
326
config.guess
vendored
326
config.guess
vendored
@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2002-09-03'
|
||||
timestamp='2004-03-12'
|
||||
|
||||
# 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
|
||||
@ -98,30 +98,32 @@ trap 'exit 1' 1 2 15
|
||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||
# use `HOST_CC' if defined, but it is deprecated.
|
||||
|
||||
# This shell variable is my proudest work .. or something. --bje
|
||||
# Portable tmp directory creation inspired by the Autoconf team.
|
||||
|
||||
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
|
||||
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
|
||||
|| (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
|
||||
dummy=$tmpdir/dummy ;
|
||||
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
|
||||
set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
dummy=$tmp/dummy ;
|
||||
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||
case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int x;" > $dummy.c ;
|
||||
for c in cc gcc c89 c99 ; do
|
||||
if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then
|
||||
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD="$c"; break ;
|
||||
fi ;
|
||||
done ;
|
||||
rm -f $files ;
|
||||
if test x"$CC_FOR_BUILD" = x ; then
|
||||
CC_FOR_BUILD=no_compiler_found ;
|
||||
fi
|
||||
;;
|
||||
,,*) CC_FOR_BUILD=$CC ;;
|
||||
,*,*) CC_FOR_BUILD=$HOST_CC ;;
|
||||
esac ;
|
||||
unset files'
|
||||
esac ;'
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 1994-08-24)
|
||||
@ -178,18 +180,35 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
;;
|
||||
esac
|
||||
# The OS release
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
# Debian GNU/NetBSD machines have a different userland, and
|
||||
# thus, need a distinct triplet. However, they do not need
|
||||
# kernel version information, so it can be replaced with a
|
||||
# suitable tag, in the style of linux-gnu.
|
||||
case "${UNAME_VERSION}" in
|
||||
Debian*)
|
||||
release='-gnu'
|
||||
;;
|
||||
*)
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
;;
|
||||
esac
|
||||
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
|
||||
# contains redundant information, the shorter form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit 0 ;;
|
||||
amd64:OpenBSD:*:*)
|
||||
echo x86_64-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
cats:OpenBSD:*:*)
|
||||
echo arm-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -208,6 +227,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
mvmeppc:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pegasos:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -223,71 +245,70 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
||||
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:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
case $UNAME_RELEASE in
|
||||
*4.0)
|
||||
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
|
||||
# OSF/1 and Tru64 systems produced since 1995. I hope that
|
||||
# covers most systems running today. This code pipes the CPU
|
||||
# types through head -n 1, so we only detect the type of CPU 0.
|
||||
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
|
||||
case "$ALPHA_CPU_TYPE" in
|
||||
"EV4 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV4.5 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"LCA4 (21066/21068)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV5 (21164)")
|
||||
UNAME_MACHINE="alphaev5" ;;
|
||||
"EV5.6 (21164A)")
|
||||
UNAME_MACHINE="alphaev56" ;;
|
||||
"EV5.6 (21164PC)")
|
||||
UNAME_MACHINE="alphapca56" ;;
|
||||
"EV5.7 (21164PC)")
|
||||
UNAME_MACHINE="alphapca57" ;;
|
||||
"EV6 (21264)")
|
||||
UNAME_MACHINE="alphaev6" ;;
|
||||
"EV6.7 (21264A)")
|
||||
UNAME_MACHINE="alphaev67" ;;
|
||||
"EV6.8CB (21264C)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8AL (21264B)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8CX (21264D)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.9A (21264/EV69A)")
|
||||
UNAME_MACHINE="alphaev69" ;;
|
||||
"EV7 (21364)")
|
||||
UNAME_MACHINE="alphaev7" ;;
|
||||
"EV7.9 (21364A)")
|
||||
UNAME_MACHINE="alphaev79" ;;
|
||||
esac
|
||||
# A Pn.n version is a patched version.
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
eval $set_cc_for_build
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
|
||||
|
||||
.text
|
||||
.globl main
|
||||
.align 4
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,16,\$26,0
|
||||
ldgp \$29,0(\$27)
|
||||
.prologue 1
|
||||
.long 0x47e03d80 # implver \$0
|
||||
lda \$2,-1
|
||||
.long 0x47e20c21 # amask \$2,\$1
|
||||
lda \$16,\$Lformat
|
||||
mov \$0,\$17
|
||||
not \$1,\$18
|
||||
jsr \$26,printf
|
||||
ldgp \$29,0(\$26)
|
||||
mov 0,\$16
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
case `$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
1-0)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
1-1)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
1-101)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
2-303)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
2-1307)
|
||||
UNAME_MACHINE="alphaev68"
|
||||
;;
|
||||
3-1307)
|
||||
UNAME_MACHINE="alphaev7"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy && rmdir $tmpdir
|
||||
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 ;;
|
||||
Alpha*:OpenVMS:*:*)
|
||||
echo alpha-hp-vms
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
@ -310,6 +331,9 @@ EOF
|
||||
*:OS/390:*:*)
|
||||
echo i370-ibm-openedition
|
||||
exit 0 ;;
|
||||
*:OS400:*:*)
|
||||
echo powerpc-ibm-os400
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
@ -327,6 +351,9 @@ EOF
|
||||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
DRS?6000:unix:4.0:6*)
|
||||
echo sparc-icl-nx6
|
||||
exit 0 ;;
|
||||
DRS?6000:UNIX_SV:4.2*:7*)
|
||||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7 && exit 0 ;;
|
||||
@ -399,6 +426,9 @@ EOF
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
m68k:machten:*:*)
|
||||
echo m68k-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -437,10 +467,9 @@ EOF
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy \
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c \
|
||||
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
&& exit 0
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Motorola:PowerMAX_OS:*:*)
|
||||
@ -449,7 +478,7 @@ EOF
|
||||
Motorola:*:4.3:PL8-*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:*:*:PowerMAX_OS)
|
||||
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
@ -524,8 +553,7 @@ EOF
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
@ -623,11 +651,21 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||
fi ;;
|
||||
esac
|
||||
if [ ${HP_ARCH} = "hppa2.0w" ]
|
||||
then
|
||||
# avoid double evaluation of $set_cc_for_build
|
||||
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
HP_ARCH="hppa64"
|
||||
fi
|
||||
fi
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
ia64:HP-UX:*:*)
|
||||
@ -661,8 +699,7 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
@ -720,21 +757,26 @@ EOF
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3D:*:*:*)
|
||||
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*SV1:*:*:*)
|
||||
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
*:UNICOS/mp:*:*)
|
||||
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
5000:UNIX_System_V:4.*:*)
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -756,8 +798,10 @@ EOF
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
rm -f $dummy.c && rmdir $tmpdir
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
|
||||
# FreeBSD's kernel, but not the complete OS.
|
||||
case ${LIBC} in gnu) kernel_only='k' ;; esac
|
||||
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
@ -768,14 +812,17 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit 0 ;;
|
||||
x86:Interix*:3*)
|
||||
echo i386-pc-interix3
|
||||
x86:Interix*:[34]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
exit 0 ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit 0 ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
# UNAME_MACHINE based on the output of uname instead of i386?
|
||||
echo i386-pc-interix
|
||||
echo i586-pc-interix
|
||||
exit 0 ;;
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
@ -787,17 +834,28 @@ EOF
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
exit 0 ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit 0 ;;
|
||||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-gnu
|
||||
exit 0 ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
@ -818,8 +876,26 @@ EOF
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
rm -f $dummy.c && rmdir $tmpdir
|
||||
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
|
||||
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
||||
;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
@ -855,6 +931,9 @@ EOF
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit 0 ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
@ -912,9 +991,11 @@ EOF
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
rm -f $dummy.c && rmdir $tmpdir
|
||||
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
|
||||
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
|
||||
;;
|
||||
@ -932,6 +1013,26 @@ EOF
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
echo ${UNAME_MACHINE}-pc-os2-emx
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
exit 0 ;;
|
||||
i*86:atheos:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-atheos
|
||||
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*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i*86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
|
||||
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
@ -966,9 +1067,6 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i*86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
@ -995,9 +1093,12 @@ EOF
|
||||
mc68k:UNIX:SYSTEM5:3.51m)
|
||||
echo m68k-convergent-sysv
|
||||
exit 0 ;;
|
||||
M680?0:D-NIX:5.3:*)
|
||||
echo m68k-diab-dnix
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
|
||||
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
@ -1014,9 +1115,6 @@ EOF
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@ -1098,7 +1196,11 @@ EOF
|
||||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Darwin:*:*)
|
||||
echo `uname -p`-apple-darwin${UNAME_RELEASE}
|
||||
case `uname -p` in
|
||||
*86) UNAME_PROCESSOR=i686 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
UNAME_PROCESSOR=`uname -p`
|
||||
@ -1111,7 +1213,7 @@ EOF
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:NonStop-UX:*:*)
|
||||
@ -1134,11 +1236,6 @@ EOF
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-plan9
|
||||
exit 0 ;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
echo ${UNAME_MACHINE}-pc-os2-emx
|
||||
exit 0 ;;
|
||||
*:TOPS-10:*:*)
|
||||
echo pdp10-unknown-tops10
|
||||
exit 0 ;;
|
||||
@ -1157,11 +1254,11 @@ EOF
|
||||
*:ITS:*:*)
|
||||
echo pdp10-unknown-its
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i*86:atheos:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-atheos
|
||||
*:DragonFly:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
@ -1283,8 +1380,7 @@ main ()
|
||||
}
|
||||
EOF
|
||||
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
|
66
config.h.in
66
config.h.in
@ -45,9 +45,6 @@
|
||||
/* Define to 1 if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H
|
||||
|
||||
/* Define to 1 if you have the `getpassphrase' function. */
|
||||
#undef HAVE_GETPASSPHRASE
|
||||
|
||||
/* Define to 1 if you have the `getprpwnam' function. */
|
||||
#undef HAVE_GETPRPWNAM
|
||||
|
||||
@ -72,6 +69,9 @@
|
||||
/* Define to 1 if you have the <hpsecurity.h> header file. */
|
||||
#undef HAVE_HPSECURITY_H
|
||||
|
||||
/* Define to 1 if you have the `inet_aton' function. */
|
||||
#undef HAVE_INET_ATON
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
@ -87,6 +87,12 @@
|
||||
/* Define to 1 if you have the `sec' library (-lsec). */
|
||||
#undef HAVE_LIBSEC
|
||||
|
||||
/* Define to 1 if you have the `util' library (-lutil). */
|
||||
#undef HAVE_LIBUTIL
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
#undef HAVE_LIBUTIL_H
|
||||
|
||||
/* Define to 1 if you have the `xnet' library (-lxnet). */
|
||||
#undef HAVE_LIBXNET
|
||||
|
||||
@ -96,30 +102,39 @@
|
||||
/* Define to 1 if you have the `memcpy' function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define to 1 if you have the `openpty' function. */
|
||||
#undef HAVE_OPENPTY
|
||||
|
||||
/* have openssl support */
|
||||
#undef HAVE_OPENSSL
|
||||
|
||||
/* have PAM support */
|
||||
#undef HAVE_PAM
|
||||
|
||||
/* have POSIX regcomp */
|
||||
#undef HAVE_POSIX_REGCOMP
|
||||
|
||||
/* Define to 1 if you have the <prot.h> header file. */
|
||||
#undef HAVE_PROT_H
|
||||
|
||||
/* Define to 1 if you have the `ptsname' function. */
|
||||
#undef HAVE_PTSNAME
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
#undef HAVE_PTY_H
|
||||
|
||||
/* Define to 1 if you have the `putenv' function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Defined if sa_len member exists in struct sockaddr */
|
||||
#undef HAVE_SA_LEN
|
||||
|
||||
/* Define to 1 if you have the `setgroups' function. */
|
||||
#undef HAVE_SETGROUPS
|
||||
|
||||
@ -129,6 +144,9 @@
|
||||
/* Define to 1 if you have the `setpgrp' function. */
|
||||
#undef HAVE_SETPGRP
|
||||
|
||||
/* Define to 1 if you have the `setproctitle' function. */
|
||||
#undef HAVE_SETPROCTITLE
|
||||
|
||||
/* Define to 1 if you have the `setsid' function. */
|
||||
#undef HAVE_SETSID
|
||||
|
||||
@ -141,9 +159,6 @@
|
||||
/* Define to 1 if you have the `setvbuf' function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Define to 1 if you have the <shadow.h> header file. */
|
||||
#undef HAVE_SHADOW_H
|
||||
|
||||
@ -192,6 +207,9 @@
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#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. */
|
||||
#undef HAVE_SYS_PROC_H
|
||||
|
||||
@ -201,6 +219,9 @@
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
@ -237,12 +258,6 @@
|
||||
/* Define to 1 if you have the `tcsetpgrp' function. */
|
||||
#undef HAVE_TCSETPGRP
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define to 1 if you have the <ttyent.h> header file. */
|
||||
#undef HAVE_TTYENT_H
|
||||
|
||||
@ -258,6 +273,9 @@
|
||||
/* Define to 1 if you have the <usersec.h> header file. */
|
||||
#undef HAVE_USERSEC_H
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
#undef HAVE_UTIL_H
|
||||
|
||||
/* Logfile path */
|
||||
#undef LOGFILEPATH
|
||||
|
||||
@ -297,18 +315,27 @@
|
||||
/* Define to 1 if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
/* The size of a `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Defined if we trust reverse DNS */
|
||||
#undef TRUST_REVERSE_DNS
|
||||
|
||||
/* Directory for Unix domain sockets */
|
||||
#undef UDSDIR
|
||||
|
||||
/* Defined if we produce extended messages */
|
||||
#undef USE_EXTENDED_MESSAGES
|
||||
|
||||
/* use tcp_wrappers libwrap */
|
||||
#undef USE_LIBWRAP
|
||||
|
||||
/* Defined if we use Unix domain sockets */
|
||||
#undef USE_UNIX_DOMAIN_SOCKETS
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
@ -330,3 +357,6 @@
|
||||
|
||||
/* Define if <signal.h> does not define sig_atomic_t */
|
||||
#undef sig_atomic_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
157
config.sub
vendored
157
config.sub
vendored
@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2002-09-05'
|
||||
timestamp='2004-03-12'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@ -118,7 +118,8 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
|
||||
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@ -228,14 +229,15 @@ case $basic_machine in
|
||||
| a29k \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| clipper \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@ -245,21 +247,24 @@ case $basic_machine in
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| msp430 \
|
||||
| ns16k | ns32k \
|
||||
| openrisc | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh3e | 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 \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale | xstormy16 | xtensa \
|
||||
@ -294,7 +299,7 @@ case $basic_machine in
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
@ -302,8 +307,8 @@ case $basic_machine in
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* \
|
||||
| m32r-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
@ -315,21 +320,26 @@ case $basic_machine in
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39 | mipstx39el \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| msp430-* \
|
||||
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
|
||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
||||
@ -353,6 +363,9 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
@ -367,6 +380,12 @@ case $basic_machine in
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amd64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
amd64-*)
|
||||
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
@ -426,12 +445,20 @@ case $basic_machine in
|
||||
basic_machine=j90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
cris | cris-* | etrax*)
|
||||
basic_machine=cris-axis
|
||||
;;
|
||||
crx)
|
||||
basic_machine=crx-unknown
|
||||
os=-elf
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
@ -716,6 +743,10 @@ case $basic_machine in
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
nv1)
|
||||
basic_machine=nv1-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
@ -727,6 +758,10 @@ case $basic_machine in
|
||||
basic_machine=or32-unknown
|
||||
os=-coff
|
||||
;;
|
||||
os400)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-os400
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
@ -758,18 +793,24 @@ case $basic_machine in
|
||||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
pentiumii | pentium2 | pentiumiii | pentium3)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium4)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium4-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
@ -828,6 +869,10 @@ case $basic_machine in
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@ -835,6 +880,9 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparclite-wrs | simso-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
@ -901,10 +949,6 @@ case $basic_machine in
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
t3d)
|
||||
basic_machine=alpha-cray
|
||||
os=-unicos
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=alphaev5-cray
|
||||
os=-unicos
|
||||
@ -913,14 +957,18 @@ case $basic_machine in
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic4x | c4x*)
|
||||
basic_machine=tic4x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@ -934,6 +982,10 @@ case $basic_machine in
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
tpf)
|
||||
basic_machine=s390x-ibm
|
||||
os=-tpf
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
@ -977,10 +1029,6 @@ case $basic_machine in
|
||||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
windows32)
|
||||
basic_machine=i386-pc
|
||||
os=-windows32-msvcrt
|
||||
;;
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
@ -1027,13 +1075,13 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
|
||||
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@ -1106,18 +1154,20 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1129,8 +1179,10 @@ case $os in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-nto-qnx*)
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
@ -1139,6 +1191,9 @@ case $os in
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux-dietlibc)
|
||||
os=-linux-dietlibc
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
@ -1151,6 +1206,9 @@ case $os in
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince*)
|
||||
os=-wince
|
||||
;;
|
||||
@ -1172,6 +1230,9 @@ case $os in
|
||||
-atheos*)
|
||||
os=-atheos
|
||||
;;
|
||||
-syllable*)
|
||||
os=-syllable
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
@ -1194,6 +1255,9 @@ case $os in
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
@ -1224,6 +1288,12 @@ case $os in
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@ -1255,6 +1325,9 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
@ -1433,9 +1506,15 @@ case $basic_machine in
|
||||
-mvs* | -opened*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-os400*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-tpf*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-vxsim* | -vxworks* | -windiss*)
|
||||
vendor=wrs
|
||||
;;
|
||||
|
256
configure.in
256
configure.in
@ -10,13 +10,19 @@ AH_TEMPLATE([MAXMEMB], [Number of consoles per child process])
|
||||
AH_TEMPLATE([CONNECTTIMEOUT], [TCP connection timeout])
|
||||
AH_TEMPLATE([PIDFILE], [pidfile to write to])
|
||||
AH_TEMPLATE([USE_LIBWRAP], [use tcp_wrappers libwrap])
|
||||
AH_TEMPLATE([HAVE_POSIX_REGCOMP], [have POSIX regcomp])
|
||||
dnl AH_TEMPLATE([HAVE_POSIX_REGCOMP], [have POSIX regcomp])
|
||||
AH_TEMPLATE([HAVE_PAM], [have PAM support])
|
||||
AH_TEMPLATE([HAVE_OPENSSL], [have openssl support])
|
||||
AH_TEMPLATE([HAVE_DMALLOC], [have dmalloc support])
|
||||
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([USE_EXTENDED_MESSAGES],[Defined if we produce extended messages])
|
||||
AH_TEMPLATE([USE_UNIX_DOMAIN_SOCKETS],[Defined if we use Unix domain sockets])
|
||||
AH_TEMPLATE([UDSDIR], [Directory for Unix domain sockets])
|
||||
|
||||
dnl ### Normal initialization. ######################################
|
||||
AC_INIT
|
||||
AC_PREREQ(2.59)
|
||||
AC_CONFIG_SRCDIR([conserver/main.c])
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
@ -31,15 +37,22 @@ AC_SUBST(MKDIR)
|
||||
|
||||
|
||||
dnl ### Custom settings. ############################################
|
||||
AC_MSG_CHECKING(whether to allow 64bit compilation)
|
||||
AC_ARG_WITH(64bit,
|
||||
AC_HELP_STRING([--with-64bit],[Allow 64bit compilation]),
|
||||
[with_64bit=yes], [with_64bit=no])
|
||||
AC_MSG_RESULT($with_64bit)
|
||||
dnl AC_MSG_CHECKING(whether to allow 64bit compilation)
|
||||
dnl AC_ARG_WITH(64bit,
|
||||
dnl AC_HELP_STRING([--with-64bit],[Allow 64bit compilation]),
|
||||
dnl [case "$withval" in
|
||||
dnl yes)
|
||||
dnl with_64bit=yes
|
||||
dnl ;;
|
||||
dnl *)
|
||||
dnl with_64bit=no
|
||||
dnl ;;
|
||||
dnl esac], [with_64bit=no])
|
||||
dnl AC_MSG_RESULT($with_64bit)
|
||||
|
||||
AC_MSG_CHECKING(for port number specification)
|
||||
AC_ARG_WITH(port,
|
||||
AC_HELP_STRING([--with-port=PORT],[Specify port number @<:@conserver@:>@]),
|
||||
AS_HELP_STRING([--with-port=PORT],[Specify port number @<:@conserver@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(DEFPORT, "conserver")
|
||||
@ -55,7 +68,7 @@ AC_ARG_WITH(port,
|
||||
|
||||
AC_MSG_CHECKING(for secondary channel base port)
|
||||
AC_ARG_WITH(base,
|
||||
AC_HELP_STRING([--with-base=PORT], [Base port for secondary channel @<:@0@:>@]),
|
||||
AS_HELP_STRING([--with-base=PORT], [Base port for secondary channel @<:@0@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(DEFBASEPORT, "0")
|
||||
@ -71,7 +84,7 @@ AC_ARG_WITH(base,
|
||||
|
||||
AC_MSG_CHECKING(for master conserver hostname)
|
||||
AC_ARG_WITH(master,
|
||||
AC_HELP_STRING([--with-master=MASTER],[Specify master server hostname @<:@console@:>@]),
|
||||
AS_HELP_STRING([--with-master=MASTER],[Specify master server hostname @<:@console@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(MASTERHOST, "console")
|
||||
@ -87,7 +100,7 @@ AC_ARG_WITH(master,
|
||||
|
||||
AC_MSG_CHECKING(for configuration filename)
|
||||
AC_ARG_WITH(cffile,
|
||||
AC_HELP_STRING([--with-cffile=CFFILE],[Specify config filename @<:@SYSCONFDIR/conserver.cf@:>@]),
|
||||
AS_HELP_STRING([--with-cffile=CFFILE],[Specify config filename @<:@SYSCONFDIR/conserver.cf@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(CONFIGFILE, [SYSCONFDIR "/conserver.cf"])
|
||||
@ -107,7 +120,7 @@ AC_ARG_WITH(cffile,
|
||||
|
||||
AC_MSG_CHECKING(for password filename)
|
||||
AC_ARG_WITH(pwdfile,
|
||||
AC_HELP_STRING([--with-pwdfile=PWDFILE],[Specify password filename @<:@SYSCONFDIR/conserver.passwd@:>@]),
|
||||
AS_HELP_STRING([--with-pwdfile=PWDFILE],[Specify password filename @<:@SYSCONFDIR/conserver.passwd@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(PASSWDFILE, [SYSCONFDIR "/conserver.passwd"])
|
||||
@ -127,7 +140,7 @@ AC_ARG_WITH(pwdfile,
|
||||
|
||||
AC_MSG_CHECKING(for log filename)
|
||||
AC_ARG_WITH(logfile,
|
||||
AC_HELP_STRING([--with-logfile=LOGFILE],[Specify log filename @<:@/var/log/conserver@:>@]),
|
||||
AS_HELP_STRING([--with-logfile=LOGFILE],[Specify log filename @<:@/var/log/conserver@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/conserver")
|
||||
@ -144,7 +157,7 @@ AC_ARG_WITH(logfile,
|
||||
AC_SUBST(PIDFILE)
|
||||
AC_MSG_CHECKING(for PID filename)
|
||||
AC_ARG_WITH(pidfile,
|
||||
AC_HELP_STRING([--with-pidfile=PIDFILE],[Specify PID filepath @<:@/var/run/conserver.pid@:>@]),
|
||||
AS_HELP_STRING([--with-pidfile=PIDFILE],[Specify PID filepath @<:@/var/run/conserver.pid@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
PIDFILE="/var/run/conserver.pid"
|
||||
@ -159,7 +172,7 @@ AC_MSG_RESULT('$PIDFILE')
|
||||
|
||||
AC_MSG_CHECKING(for MAXMEMB setting)
|
||||
AC_ARG_WITH(maxmemb,
|
||||
AC_HELP_STRING([--with-maxmemb=MAXMEMB],[Specify maximum consoles per process @<:@16@:>@]),
|
||||
AS_HELP_STRING([--with-maxmemb=MAXMEMB],[Specify maximum consoles per process @<:@16@:>@]),
|
||||
[case "$withval" in
|
||||
yes|no)
|
||||
AC_DEFINE_UNQUOTED(MAXMEMB, 16)
|
||||
@ -181,7 +194,7 @@ AC_ARG_WITH(maxmemb,
|
||||
|
||||
AC_MSG_CHECKING(for connect() timeout)
|
||||
AC_ARG_WITH(timeout,
|
||||
AC_HELP_STRING([--with-timeout=TIMEOUT],[Specify connect() timeout in seconds @<:@10@:>@]),
|
||||
AS_HELP_STRING([--with-timeout=TIMEOUT],[Specify connect() timeout in seconds @<:@10@:>@]),
|
||||
[if expr "$withval" : '[[0-9]]*$' >/dev/null 2>&1 &&
|
||||
test "$withval" -gt 0 -a "$withval" -lt 300; then
|
||||
AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, $withval)
|
||||
@ -193,6 +206,58 @@ AC_ARG_WITH(timeout,
|
||||
[AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10)
|
||||
AC_MSG_RESULT(10)])
|
||||
|
||||
AC_MSG_CHECKING(whether to trust reverse DNS)
|
||||
AC_ARG_WITH(trustrevdns,
|
||||
AS_HELP_STRING([--with-trustrevdns],[Trust reverse DNS information]),
|
||||
[case "$withval" in
|
||||
yes)
|
||||
AC_DEFINE(TRUST_REVERSE_DNS)
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac],[AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(whether to display extended messages)
|
||||
AC_ARG_WITH(extmsgs,
|
||||
AS_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)])
|
||||
|
||||
AC_MSG_CHECKING(whether to use Unix domain sockets)
|
||||
AC_ARG_WITH(uds,
|
||||
AS_HELP_STRING([--with-uds@<:@=DIR@:>@ ],
|
||||
[Use Unix domain sockets for client/server communication @<:@/tmp/conserver@:>@]),
|
||||
[case "$withval" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(UDSDIR, "/tmp/conserver")
|
||||
AC_DEFINE(USE_UNIX_DOMAIN_SOCKETS)
|
||||
AC_MSG_RESULT([/tmp/conserver])
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE_UNQUOTED(UDSDIR, "$withval")
|
||||
AC_DEFINE(USE_UNIX_DOMAIN_SOCKETS)
|
||||
AC_MSG_RESULT('$withval')
|
||||
if expr "$withval" : '/' >/dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
echo "*** WARNING *** you may have better success using a fully-qualified path"
|
||||
echo "*** WARNING *** instead of '$withval'"
|
||||
fi
|
||||
;;
|
||||
esac],[AC_MSG_RESULT(no)])
|
||||
|
||||
dnl ### Check for compiler et al. ###################################
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
@ -204,39 +269,37 @@ AC_AIX
|
||||
AC_C_CONST
|
||||
AC_C_PROTOTYPES
|
||||
|
||||
AC_CHECK_SIZEOF(long)
|
||||
if test "$ac_cv_sizeof_long" -gt 4; then
|
||||
if test "$with_64bit" != "yes"; then
|
||||
AC_MSG_ERROR([cannot build on >32bit systems (to override use --with-64bit)])
|
||||
else
|
||||
AC_MSG_WARN([building a 64bit version of conserver - good luck!])
|
||||
fi
|
||||
fi
|
||||
dnl AC_CHECK_SIZEOF(long)
|
||||
dnl if test "$ac_cv_sizeof_long" -gt 4; then
|
||||
dnl if test "$with_64bit" != "yes"; then
|
||||
dnl AC_MSG_ERROR([cannot build on >32bit systems (to override use --with-64bit)])
|
||||
dnl else
|
||||
dnl AC_MSG_WARN([building a 64bit version of conserver - good luck!])
|
||||
dnl fi
|
||||
dnl fi
|
||||
|
||||
dnl ### Checks for header files. ###################################
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(sys/ioctl.h)
|
||||
|
||||
dnl ### POSIX terminal I/O
|
||||
AC_CHECK_HEADERS(termios.h)
|
||||
if test "$ac_cv_header_termios_h" != "yes"; then
|
||||
dnl ### SysV terminal I/O
|
||||
AC_CHECK_HEADERS(termio.h)
|
||||
if test "$ac_cv_header_termio_h" != "yes"; then
|
||||
dnl ### BSD terminal I/O
|
||||
AC_CHECK_HEADERS(sgtty.h)
|
||||
if test "$ac_cv_header_sgtty_h" != "yes"; then
|
||||
AC_MSG_ERROR([no usable terminal interface detected])
|
||||
fi
|
||||
fi
|
||||
AC_SYS_POSIX_TERMIOS
|
||||
if test "$ac_cv_sys_posix_termios" != "yes"; then
|
||||
AC_MSG_ERROR([POSIX termios interface required])
|
||||
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)
|
||||
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_SYS_WAIT
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
AC_CHECK_TYPE([sig_atomic_t],,
|
||||
AC_DEFINE(sig_atomic_t, volatile int,
|
||||
@ -250,6 +313,14 @@ AC_CHECK_TYPE([socklen_t],[AC_DEFINE(HAVE_SOCKLEN_T,1,
|
||||
[Defined if socklen_t exists])],,[$ac_includes_default
|
||||
#include <sys/socket.h>])
|
||||
|
||||
AC_MSG_CHECKING(for sa_len in struct sockaddr)
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/socket.h>],
|
||||
[struct sockaddr s; s.sa_len=0;],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SA_LEN)],
|
||||
[AC_MSG_RESULT(no)])
|
||||
|
||||
|
||||
dnl ### Host specific checks. ######################################
|
||||
AC_CANONICAL_HOST
|
||||
@ -273,7 +344,7 @@ AC_SUBST(CONSLIBS)
|
||||
AC_SUBST(CONSCPPFLAGS)
|
||||
AC_SUBST(CONSLDFLAGS)
|
||||
AC_ARG_WITH(libwrap,
|
||||
AC_HELP_STRING([--with-libwrap@<:@=PATH@:>@],
|
||||
AS_HELP_STRING([--with-libwrap@<:@=PATH@:>@],
|
||||
[Compile in libwrap (tcp_wrappers) support]),
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
@ -299,12 +370,23 @@ AC_ARG_WITH(libwrap,
|
||||
int deny_severity = 0;
|
||||
],[hosts_access((void *)0)],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_LIBWRAP)
|
||||
CONSLIBS="$CONSLIBS -lwrap"
|
||||
CONSLDFLAGS="$CONSLDFLAGS $WRAPLDFLAGS"
|
||||
CONSCPPFLAGS="$CONSCPPFLAGS $WRAPCPPFLAGS"],
|
||||
[AC_MSG_RESULT(no)])],)
|
||||
|
||||
AC_DEFINE(USE_LIBWRAP)
|
||||
CONSLIBS="$CONSLIBS -lwrap"
|
||||
CONSLDFLAGS="$CONSLDFLAGS $WRAPLDFLAGS"
|
||||
CONSCPPFLAGS="$CONSCPPFLAGS $WRAPCPPFLAGS"],
|
||||
[AC_MSG_RESULT(no)
|
||||
LIBS="$LIBS -lnsl"
|
||||
AC_MSG_CHECKING(for TCP wrappers library -lwrap with -lnsl)
|
||||
AC_TRY_LINK([#include <tcpd.h>
|
||||
int allow_severity = 0;
|
||||
int deny_severity = 0;
|
||||
],[hosts_access((void *)0)],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_LIBWRAP)
|
||||
CONSLIBS="$CONSLIBS -lwrap -lnsl"
|
||||
CONSLDFLAGS="$CONSLDFLAGS $WRAPLDFLAGS"
|
||||
CONSCPPFLAGS="$CONSCPPFLAGS $WRAPCPPFLAGS"],
|
||||
[AC_MSG_RESULT(no)])])],)
|
||||
LIBS="$oLIBS"
|
||||
CPPFLAGS="$oCPPFLAGS"
|
||||
LDFLAGS="$oLDFLAGS"
|
||||
@ -312,7 +394,7 @@ AC_ARG_WITH(libwrap,
|
||||
)
|
||||
|
||||
AC_ARG_WITH(openssl,
|
||||
AC_HELP_STRING([--with-openssl@<:@=PATH@:>@],
|
||||
AS_HELP_STRING([--with-openssl@<:@=PATH@:>@],
|
||||
[Compile in OpenSSL support]),
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
@ -350,7 +432,7 @@ AC_ARG_WITH(openssl,
|
||||
)
|
||||
|
||||
AC_ARG_WITH(dmalloc,
|
||||
AC_HELP_STRING([--with-dmalloc@<:@=PATH@:>@],
|
||||
AS_HELP_STRING([--with-dmalloc@<:@=PATH@:>@],
|
||||
[Compile in dmalloc support]),
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
@ -390,42 +472,42 @@ AC_ARG_WITH(dmalloc,
|
||||
|
||||
dnl ### Check for needed functions. ################################
|
||||
|
||||
dnl The following basically stollen from the less-358 distribution, but
|
||||
dnl modified for my own purposes
|
||||
AC_MSG_CHECKING(for POSIX regex)
|
||||
AC_ARG_WITH(regex,
|
||||
AC_HELP_STRING([--with-regex],
|
||||
[Use regular expressions in conserver.passwd]),
|
||||
[if test "$withval" = yes; then
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
main() { regex_t r; regmatch_t rm; char *text = "xabcy";
|
||||
if (regcomp(&r, "abc", 0)) exit(1);
|
||||
if (regexec(&r, text, 1, &rm, 0)) exit(1);
|
||||
if (rm.rm_so != 1) exit(1); /* check for correct offset */
|
||||
exit(0); }
|
||||
],have_posix_regex=yes,have_posix_regex=no,have_posix_regex=unknown)
|
||||
if test $have_posix_regex = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_REGCOMP)
|
||||
elif test $have_posix_regex = unknown; then
|
||||
AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>],
|
||||
[regex_t *r; regfree(r);],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_REGCOMP))
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi],[AC_MSG_RESULT(no)])
|
||||
dnl dnl The following basically stollen from the less-358 distribution, but
|
||||
dnl dnl modified for my own purposes
|
||||
dnl AC_MSG_CHECKING(for POSIX regex)
|
||||
dnl AC_ARG_WITH(regex,
|
||||
dnl AC_HELP_STRING([--with-regex],
|
||||
dnl [Use regular expressions in conserver.passwd]),
|
||||
dnl [if test "$withval" = yes; then
|
||||
dnl AC_TRY_RUN([
|
||||
dnl #include <sys/types.h>
|
||||
dnl #include <regex.h>
|
||||
dnl main() { regex_t r; regmatch_t rm; char *text = "xabcy";
|
||||
dnl if (regcomp(&r, "abc", 0)) exit(1);
|
||||
dnl if (regexec(&r, text, 1, &rm, 0)) exit(1);
|
||||
dnl if (rm.rm_so != 1) exit(1); /* check for correct offset */
|
||||
dnl exit(0); }
|
||||
dnl ],have_posix_regex=yes,have_posix_regex=no,have_posix_regex=unknown)
|
||||
dnl if test $have_posix_regex = yes; then
|
||||
dnl AC_MSG_RESULT(yes)
|
||||
dnl AC_DEFINE(HAVE_POSIX_REGCOMP)
|
||||
dnl elif test $have_posix_regex = unknown; then
|
||||
dnl AC_TRY_LINK([
|
||||
dnl #include <sys/types.h>
|
||||
dnl #include <regex.h>],
|
||||
dnl [regex_t *r; regfree(r);],
|
||||
dnl AC_MSG_RESULT(yes)
|
||||
dnl AC_DEFINE(HAVE_POSIX_REGCOMP))
|
||||
dnl else
|
||||
dnl AC_MSG_RESULT(no)
|
||||
dnl fi
|
||||
dnl else
|
||||
dnl AC_MSG_RESULT(no)
|
||||
dnl fi],[AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(for PAM support)
|
||||
AC_ARG_WITH(pam,
|
||||
AC_HELP_STRING([--with-pam],
|
||||
AS_HELP_STRING([--with-pam],
|
||||
[Enable PAM support]),
|
||||
[if test "$withval" = yes; then
|
||||
oLIBS="$LIBS"
|
||||
@ -451,8 +533,22 @@ AC_ARG_WITH(pam,
|
||||
AC_MSG_RESULT(no)
|
||||
fi],[AC_MSG_RESULT(no)])
|
||||
|
||||
dnl Checks for pty allocation...
|
||||
dnl According to the xemacs distribution:
|
||||
dnl getpt() is the preferred pty allocation method on glibc systems.
|
||||
dnl _getpty() is the preferred pty allocation method on SGI systems.
|
||||
dnl grantpt(), unlockpt(), ptsname() are defined by Unix98.
|
||||
dnl openpty() is the preferred pty allocation method on BSD and Tru64 systems.
|
||||
dnl openpty() might be declared in:
|
||||
dnl - pty.h (Tru64 or Linux)
|
||||
dnl - libutil.h (FreeBSD)
|
||||
dnl - util.h (NetBSD)
|
||||
dnl Conserver doesn't support getpt() or _getpt() yet.
|
||||
AC_CHECK_HEADERS(pty.h libutil.h util.h)
|
||||
AC_CHECK_LIB(util, openpty)
|
||||
AC_CHECK_FUNCS(openpty)
|
||||
|
||||
AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt sigaction setsockopt getdtablesize putenv memset memcpy memcmp sysconf getpassphrase getlogin)
|
||||
AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt sigaction setsockopt getdtablesize putenv memset memcpy memcmp memmove sysconf getlogin inet_aton setproctitle)
|
||||
AC_FUNC_SETPGRP
|
||||
AC_CHECK_FUNC(strcasecmp,
|
||||
[AC_DEFINE(HAVE_STRCASECMP, 1, [Define if strcasecmp is available])],
|
||||
@ -467,6 +563,6 @@ AC_CHECK_FUNCS(getaudit getaudit_addr)
|
||||
|
||||
|
||||
dnl ### Create output files. #######################################
|
||||
AC_CONFIG_FILES([Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile])
|
||||
AC_CONFIG_FILES([Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile contrib/chat/Makefile])
|
||||
AC_CONFIG_FILES([conserver/conserver.rc], [chmod +x conserver/conserver.rc])
|
||||
AC_OUTPUT
|
||||
|
@ -1,19 +1,11 @@
|
||||
The two files you need to set up are the conserver.cf and conserver.passwd
|
||||
files. See the sample conserver.cf and conserver.passwd files
|
||||
for examples. You can start with those and then modify extensively.
|
||||
The man page for conserver.cf should explain that file with enough detail
|
||||
to get you going.
|
||||
|
||||
As for the conserver.passwd file, here are some instructions. The file
|
||||
contains three fields seperated by colons: <username>:<passwd>:<hosts>.
|
||||
The <passwd> field should either be an encrypted password or the special
|
||||
string '*passwd*', which will cause the console server to do a getpwnam()
|
||||
call. The <hosts> field can be a comma seperated list of console names
|
||||
(from conserver.cf) or the special string 'any'. Access for the user
|
||||
is only granted to the hosts listed here (or all if 'any' is used).
|
||||
The man page for conserver.cf and conserver.passwd should explain the
|
||||
files with enough detail to get you going.
|
||||
|
||||
That's about it. Good luck.
|
||||
|
||||
#
|
||||
# $Id: INSTALL,v 1.2 1999-08-24 13:45:00-07 bryan Exp $
|
||||
# $Id: INSTALL,v 1.3 2003/07/04 18:21:21 bryan Exp $
|
||||
#
|
||||
|
@ -3,6 +3,8 @@ srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
mandir = @mandir@
|
||||
sysconfdir = @sysconfdir@
|
||||
datadir = @datadir@
|
||||
exampledir = $(datadir)/examples/conserver
|
||||
|
||||
### Installation programs and flags
|
||||
INSTALL = @INSTALL@
|
||||
@ -24,5 +26,8 @@ install:
|
||||
$(MKDIR) $(DESTDIR)$(mandir)/man5
|
||||
$(INSTALL) conserver.cf.man $(DESTDIR)$(mandir)/man5/conserver.cf.5
|
||||
$(INSTALL) conserver.passwd.man $(DESTDIR)$(mandir)/man5/conserver.passwd.5
|
||||
$(MKDIR) $(DESTDIR)$(exampledir)
|
||||
$(INSTALL) -m 0644 conserver.cf $(DESTDIR)$(exampledir)
|
||||
$(INSTALL) -m 0644 conserver.passwd $(DESTDIR)$(exampledir)
|
||||
|
||||
.PHONY: clean distclean install
|
||||
|
@ -1,26 +1,114 @@
|
||||
#
|
||||
# $Id: conserver.cf,v 1.4 2001-06-28 10:24:01-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. Any logfile name that doesn't begin with a '/' has LOGDIR
|
||||
# prepended to it. So, most consoles will just have a '&' as the logfile
|
||||
# name which causes /var/consoles/<consolename> to be used.
|
||||
#
|
||||
LOGDIR=/var/consoles
|
||||
#
|
||||
# list of consoles we serve
|
||||
# name : tty[@host] : baud[parity] : logfile : [mark-interval(m|h|d|l)][+]
|
||||
# name : !host : port : logfile : [mark-interval(m|h|d|l)][+]
|
||||
# name : |command : : logfile : [mark-interval(m|h|d|l)][+]
|
||||
#
|
||||
tweety:!ts1:2002:&:
|
||||
bambam:!ts1:2003:&:
|
||||
shell:|::/dev/null:
|
||||
telnet:|telnet host::/dev/null:
|
||||
ttya:/dev/ttya:9600p:&:
|
||||
%%
|
||||
#
|
||||
# list of clients we allow
|
||||
# {trusted|allowed|rejected} : machines
|
||||
#
|
||||
allowed: 127.0.0.1 gnac.com
|
||||
|
||||
### set up global access
|
||||
default full { rw *; }
|
||||
|
||||
### define some terminal server specifics
|
||||
# we set portbase and portinc so we can reference the ports in a
|
||||
# physical representation and let conserver do the math to figure
|
||||
# out the actual socket address
|
||||
default cisco { type host; portbase 2000; portinc 1; }
|
||||
default xyplex { type host; portbase 2000; portinc 100; }
|
||||
default iolan { type host; portbase 10000; portinc 1; }
|
||||
|
||||
### set 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 * {
|
||||
# The '&' character is substituted with the console name
|
||||
logfile /var/consoles/&;
|
||||
# timestamps every hour with activity and break logging
|
||||
timestamp 1hab;
|
||||
# include the 'full' default
|
||||
include full;
|
||||
# master server is localhost
|
||||
master localhost;
|
||||
}
|
||||
|
||||
### define the first terminal server
|
||||
default ts1.conserver.com {
|
||||
# use the xyplex defaults
|
||||
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;
|
||||
}
|
||||
|
||||
# now define the consoles on ts1.conserver.com
|
||||
# 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;
|
||||
exec ssh localhost;
|
||||
# provide a 'message-of-the-day'
|
||||
motd "just a simple ssh to localhost";
|
||||
}
|
||||
|
||||
# connect to /dev/ttya
|
||||
console ttya {
|
||||
type device;
|
||||
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;
|
||||
parity none;
|
||||
}
|
||||
|
||||
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 * {
|
||||
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;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
||||
bryan:td1AgneGE3RsU:any
|
||||
djs:*passwd*:any
|
||||
todd:*passwd*:server1
|
||||
bryan:td1AgneGE3RsU
|
||||
djs:*passwd*
|
||||
todd:*passwd*
|
||||
|
@ -1,70 +1,84 @@
|
||||
.\" $Id: conserver.passwd.man,v 1.6 2002-09-23 14:15:53-07 bryan Exp $
|
||||
.TH CONSERVER.PASSWD 5 "Local"
|
||||
.\" $Id: conserver.passwd.man,v 1.10 2004/01/08 16:12:33 bryan Exp $
|
||||
.TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.4" "conserver"
|
||||
.SH NAME
|
||||
conserver.passwd \- user access information for conserver(8)
|
||||
conserver.passwd \- user access information for
|
||||
.BR conserver (8)
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
\fIusername\fB:\fIpassword\fB:\fIconsoles\fR
|
||||
.IB username : password
|
||||
.SH DESCRIPTION
|
||||
The \fBconserver.passwd\fP file
|
||||
is the user authentication and authorization file for
|
||||
The
|
||||
.B conserver.passwd
|
||||
file is the user authentication and authorization file for
|
||||
.BR conserver (8).
|
||||
Upon each incoming client connection,
|
||||
\fBconserver\fP opens and reads the \fBconserver.passwd\fP file,
|
||||
so edits to the file take effect immediately.
|
||||
It reads only until the first \fIusername\fP match.
|
||||
.B conserver
|
||||
opens and reads the
|
||||
.B conserver.passwd
|
||||
file, so edits to the file take effect immediately.
|
||||
It reads only until the first
|
||||
.I username
|
||||
match.
|
||||
.PP
|
||||
Blank lines and comment lines (those beginning with a ``#'' and
|
||||
optional leading whitespace) are ignored. Non-ignored lines
|
||||
beginning with whitespace are considered continuations of the
|
||||
previous line. This allows you to span one logical line over
|
||||
optional leading whitespace) are ignored.
|
||||
Non-ignored lines beginning with whitespace are considered
|
||||
continuations of the previous line.
|
||||
This allows you to span one logical line over
|
||||
many physical lines and insert comments wherever appropriate.
|
||||
.PP
|
||||
Each logical line consists of three colon-separated fields.
|
||||
Leading and trailing white space in each
|
||||
field is ignored.
|
||||
Each logical line consists of two colon-separated fields.
|
||||
Leading and trailing white space in each field is ignored.
|
||||
.TP
|
||||
.I username
|
||||
the login name of the authorized user,
|
||||
or the string ``\fB*any*\fP'' to match any user.
|
||||
This is compared against the name sent by the \fBconsole\fP client,
|
||||
based either on the user's identity or on the \fB\-l\fP option.
|
||||
Since \fBconserver\fP only uses the first \fIusername\fP match,
|
||||
an ``\fB*any*\fP'' entry will apply to any user
|
||||
or the string
|
||||
.RB `` *any* ''
|
||||
to match any user.
|
||||
This is compared against the name sent by the
|
||||
.B console
|
||||
client, based either on the user's identity or on the
|
||||
.B \-l option.
|
||||
Since
|
||||
.B conserver
|
||||
only uses the first
|
||||
.I username
|
||||
match, a
|
||||
.RB `` *any* ''
|
||||
entry will apply to any user
|
||||
without an entry earlier in the file.
|
||||
.TP
|
||||
.I password
|
||||
the encrypted password,
|
||||
or the string ``\fB*passwd*\fP''
|
||||
to indicate that \fBconserver\fP should look up the user's password
|
||||
in the system \fBpasswd\fP (or \fBshadow\fP) database. If PAM
|
||||
support has been enabled (\fB--with-pam\fP), PAM lookups will be done instead
|
||||
of \fBpasswd\fP (or \fBshadow\fP) lookups.
|
||||
or the string
|
||||
.RB `` *passwd* ''
|
||||
to indicate that
|
||||
.B conserver
|
||||
should look up the user's password
|
||||
in the system
|
||||
.BR passwd " (or " shadow ") database."
|
||||
If PAM support has been enabled
|
||||
.RB ( --with-pam ),
|
||||
PAM lookups will be done instead of
|
||||
.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.
|
||||
.TP
|
||||
.I consoles
|
||||
a comma- and/or space-separated list of consoles
|
||||
to which the user is permitted to connect,
|
||||
or the string ``\fBany\fP'' to allow access to any console.
|
||||
These names must match the console names in the \fBconserver.cf\fP file.
|
||||
If regular expression support was compiled in using --with-regex, the
|
||||
names here are treated as regular expressions.
|
||||
.SH EXAMPLE
|
||||
.TP 30
|
||||
\fBmary:r71mXjfALB5Ak:any\fP
|
||||
Mary may connect to any console if her password matches;
|
||||
.TP 24
|
||||
.B mary:r71mXjfALB5Ak
|
||||
Mary uses the password specified above;
|
||||
it does not matter whether she has a login on the conserver host.
|
||||
.TP
|
||||
\fBfred:*passwd*:foo.example.com,bar.example.com\fP
|
||||
Fred may connect only to the listed consoles,
|
||||
and only with his regular login password on the conserver host.
|
||||
.B fred:*passwd*
|
||||
Fred may connect only with his regular login password on the conserver host.
|
||||
.TP
|
||||
\fBbozo:*:\fP
|
||||
Bozo is not allowed access to any consoles.
|
||||
.B bozo:*
|
||||
Bozo is only allowed to access a console if his password isn't used (since
|
||||
it's invalid) which means he needs to come from a
|
||||
.B trusted
|
||||
host.
|
||||
.TP
|
||||
\fB*any*:*passwd*:any\fP
|
||||
Anyone not listed above may access any console
|
||||
if they have a regular login and know the password.
|
||||
.B *any*:*passwd*
|
||||
Anyone not listed above uses their regular login and password.
|
||||
.SH "SEE ALSO"
|
||||
.BR console (1),
|
||||
.BR conserver.cf (5),
|
||||
@ -73,4 +87,8 @@ if they have a regular login and know the password.
|
||||
.PP
|
||||
There is currently no way provided by the conserver package
|
||||
to generate the encrypted password strings
|
||||
besides copying them from the system \fBpasswd\fP database.
|
||||
besides copying them from the system
|
||||
.B passwd
|
||||
database or running
|
||||
.BR crypt (3)
|
||||
via C or perl or some other language that supports it.
|
||||
|
@ -1,5 +1,5 @@
|
||||
%!PS-Adobe-2.0 EPSF-1.2
|
||||
%%$Id: label.ps,v 1.8 94/01/21 09:37:42 ksb Exp $
|
||||
%%$Id: label.ps,v 1.1 2003/11/04 02:36:26 bryan Exp $
|
||||
%%Title: RJ-11
|
||||
%%Creator: A Braunsdorf
|
||||
%%CreationDate:
|
||||
|
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,30 +1,45 @@
|
||||
# dummy conserver config file
|
||||
#
|
||||
# $Id: dummy.cf,v 4.3 92/07/27 12:23:59 ksb Exp $
|
||||
#
|
||||
# 1. change the `/dev/ttya' to any tty device you can put a serial device on
|
||||
# that you could talk to with kermit/cu. Put in the baud rate and parity.
|
||||
#
|
||||
# 2. change the `cc.purdue.edu' to your local domain.
|
||||
#
|
||||
# 3. !! do not leave this up, as it can give local users a root shell (login)
|
||||
# !! for extended testing change the `|' to `|su - tst' where tst is a
|
||||
# !! vanilla test acount, or comment out the `login' console.
|
||||
# $Id: test.cf,v 1.2 2003/07/04 18:04:05 bryan Exp $
|
||||
#
|
||||
default full {
|
||||
rw *;
|
||||
}
|
||||
default * {
|
||||
logfile /tmp/&;
|
||||
timestamp "";
|
||||
include full;
|
||||
}
|
||||
break 5 {
|
||||
string "\rtest\r";
|
||||
}
|
||||
# list of consoles we serve
|
||||
# name : tty[@host] : baud[parity] : device : group
|
||||
DOMAINHACK=
|
||||
LOGDIR=/tmp
|
||||
BREAK5=\rtest\r
|
||||
shell:|:9600p:&:5
|
||||
bash:|/usr/local/bin/bash::&:2
|
||||
web:!www.conserver.com:80:&:
|
||||
b:/dev/ttyb:9600p:&:
|
||||
#ts6-10:!ts6:10010:&:
|
||||
#ts6-11:!ts6:10011:&:
|
||||
#ts6-12:!ts6:10012:&:
|
||||
#ts6-13:!ts6:10013:&:
|
||||
%%
|
||||
console shell {
|
||||
master localhost;
|
||||
timestamp 5;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
console bash {
|
||||
master localhost;
|
||||
timestamp 2;
|
||||
type exec;
|
||||
exec /usr/local/bin/bash;
|
||||
}
|
||||
console web {
|
||||
master localhost;
|
||||
type host;
|
||||
host www.conserver.com;
|
||||
port 80;
|
||||
}
|
||||
console b {
|
||||
master localhost;
|
||||
type device;
|
||||
device /dev/ttyb;
|
||||
baud 9600;
|
||||
parity none;
|
||||
}
|
||||
# list of clients we allow
|
||||
# type machines
|
||||
trusted: 127.0.0.1
|
||||
access * {
|
||||
trusted 127.0.0.1;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
<META name="author" content=
|
||||
"Bryan Stansell <bryan@conserver.com>">
|
||||
<LINK rel="SHORTCUT ICON" href="conserver.ico">
|
||||
<LINK rel="icon" href="conserver.ico">
|
||||
|
||||
<TITLE>Conserver</TITLE>
|
||||
|
||||
@ -55,11 +56,11 @@
|
||||
<INPUT type="HIDDEN" name="method" value="and"> <INPUT
|
||||
type="HIDDEN" name="format" value="builtin-long">
|
||||
<INPUT type="HIDDEN" name="sort" value="score"> <INPUT
|
||||
type="HIDDEN" name="config" value="htdig"> <INPUT type=
|
||||
"HIDDEN" name="restrict" value=""> <INPUT type="HIDDEN"
|
||||
name="exclude" value=""> <INPUT type="TEXT" size="20"
|
||||
name="words" value=""> <INPUT type="SUBMIT" value=
|
||||
"Search">
|
||||
type="HIDDEN" name="config" value="conserver.com">
|
||||
<INPUT type="HIDDEN" name="restrict" value=""> <INPUT
|
||||
type="HIDDEN" name="exclude" value=""> <INPUT type=
|
||||
"TEXT" size="20" name="words" value=""> <INPUT type=
|
||||
"SUBMIT" value="Search">
|
||||
</FORM>
|
||||
</TD>
|
||||
</TR>
|
||||
@ -159,35 +160,32 @@
|
||||
the website. Next, there's Kevin Braunsdorf's version at
|
||||
<A href=
|
||||
"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
|
||||
look like any new versions have been out since August
|
||||
It doesn't look like Kevin is working on his thread ony
|
||||
more either. No new versions have been out since August
|
||||
2000 (version 8.5), but maybe this info will be out of
|
||||
date by the time you read this. Lastly, the conserver.com
|
||||
version is based on Kevin's "5.21-Beta" distribution, but
|
||||
since <B>HEAVILY</B> modified and enhanced (more details
|
||||
in the "Origin" section above).</P>
|
||||
date by the time you read this (I last checked Feb 10,
|
||||
2004). Lastly, the conserver.com version is based on
|
||||
Kevin's "5.21-Beta" distribution, but since
|
||||
<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
|
||||
either use Kevin's latest distribution or the
|
||||
conserver.com distribution. Which one? Well, obviously
|
||||
I'm biased and believe the conserver.com distribution
|
||||
should be your choice, but Kevin's does have UPS (serial
|
||||
port line toggling bits) that the conserver.com version
|
||||
doesn't have. What does the conserver.com distribution
|
||||
have? Well, in reality, too many things to list. You'll
|
||||
have to look at the <A href="CHANGES">CHANGES</A> file
|
||||
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>
|
||||
definitely use the conserver.com distribution. Why? It's
|
||||
actively maintained, has many more features than the
|
||||
other versions (see <A href="CHANGES">CHANGES</A> for a
|
||||
semi-scary history), and has an active user community.
|
||||
Kevin's version does have UPS support (basic serial port
|
||||
line toggling bits) which is missing in the conserver.com
|
||||
version, but no one has asked me for it, so does anyone
|
||||
actually need it?</P>
|
||||
|
||||
<H3>Downloading</H3>
|
||||
|
||||
<P>The current version, released on Apr 9, 2003, is <A
|
||||
href="7.2.7.tar.gz">7.2.7.tar.gz</A>. You can get it via
|
||||
<P>The current version, released on Apr 13, 2004, is <A
|
||||
href="8.1.4.tar.gz">8.1.4.tar.gz</A>. You can get it via
|
||||
<A href=
|
||||
"ftp://ftp.conserver.com/conserver/7.2.7.tar.gz">FTP</A>
|
||||
or <A href="7.2.7.tar.gz">HTTP</A>. See the <A href=
|
||||
"ftp://ftp.conserver.com/conserver/8.1.4.tar.gz">FTP</A>
|
||||
or <A href="8.1.4.tar.gz">HTTP</A>. See the <A href=
|
||||
"CHANGES">CHANGES</A> file for information on the latest
|
||||
updates.</P>
|
||||
|
||||
@ -208,6 +206,11 @@
|
||||
<P>Check the <A href="INSTALL">INSTALL</A> file for
|
||||
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>
|
||||
|
||||
<P>Here's a list of systems that I've been told can
|
||||
@ -216,7 +219,7 @@
|
||||
more), please let me know.</P>
|
||||
|
||||
<UL>
|
||||
<LI>AIX 4.3.3/5.1, native cc</LI>
|
||||
<LI>AIX 4.3.3/5.1/5.2, native cc</LI>
|
||||
|
||||
<LI>BSDI BSD/OS 3.X, gcc</LI>
|
||||
|
||||
@ -226,7 +229,7 @@
|
||||
|
||||
<LI>DEC Tru64 4.0/5.1, native cc</LI>
|
||||
|
||||
<LI>FreeBSD 4.2 (x86), gcc</LI>
|
||||
<LI>FreeBSD 4.2/4.8/5.1 (x86), gcc</LI>
|
||||
|
||||
<LI>HP-UX 10.20, gcc</LI>
|
||||
|
||||
|
@ -6,6 +6,8 @@ exec_prefix = @exec_prefix@
|
||||
sbindir = @sbindir@
|
||||
sysconfdir = @sysconfdir@
|
||||
mandir = @mandir@
|
||||
datadir = @datadir@
|
||||
exampledir = $(datadir)/examples/conserver
|
||||
|
||||
### Installation programs and flags
|
||||
INSTALL = @INSTALL@
|
||||
@ -26,19 +28,25 @@ LIBS = @LIBS@ @CONSLIBS@
|
||||
### Makefile rules - no user-servicable parts below
|
||||
|
||||
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 \
|
||||
$(srcdir)/client.h $(srcdir)/consent.h $(srcdir)/group.h \
|
||||
$(srcdir)/main.h $(srcdir)/master.h $(srcdir)/readcfg.h \
|
||||
$(srcdir)/util.h
|
||||
ALL = conserver
|
||||
$(srcdir)/client.h $(srcdir)/consent.h $(srcdir)/cutil.h \
|
||||
$(srcdir)/group.h $(srcdir)/main.h $(srcdir)/master.h \
|
||||
$(srcdir)/readcfg.h $(srcdir)/version.h
|
||||
|
||||
ALL = conserver convert
|
||||
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
$(CONSERVER_OBJS): $(CONSERVER_HDRS)
|
||||
|
||||
conserver: $(CONSERVER_OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o conserver $(CONSERVER_OBJS) $(LIBS)
|
||||
|
||||
convert: convert.o cutil.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o convert convert.o cutil.o $(LIBS)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
||||
@ -53,7 +61,7 @@ install: conserver
|
||||
$(INSTALL_PROGRAM) conserver $(DESTDIR)$(sbindir)
|
||||
$(MKDIR) $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) conserver.man $(DESTDIR)$(mandir)/man8/conserver.8
|
||||
$(MKDIR) $(DESTDIR)$(sysconfdir)
|
||||
[ -f $(DESTDIR)$(sysconfdir)/conserver.rc ] || $(INSTALL) conserver.rc $(DESTDIR)$(sysconfdir)
|
||||
$(MKDIR) $(DESTDIR)$(exampledir)
|
||||
$(INSTALL) conserver.rc $(DESTDIR)$(exampledir)
|
||||
|
||||
.PHONY: clean distclean install
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Sun-serial,v 2.1 93/02/09 11:45:12 ldv Exp $
|
||||
# $Id: Sun-serial,v 1.1 2003/11/04 02:36:25 bryan Exp $
|
||||
|
||||
If you are going to be hooking Sun consoles to your console server, you
|
||||
will run into a problem: The sun will halt whenever the cable is unplugged.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: access.c,v 5.53 2003-04-06 05:31:54-07 bryan Exp $
|
||||
* $Id: access.c,v 5.71 2003/11/20 13:56:38 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -34,24 +34,9 @@
|
||||
* 4. This notice may not be removed or altered.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include <compat.h>
|
||||
#include <util.h>
|
||||
|
||||
#include <cutil.h>
|
||||
#include <access.h>
|
||||
#include <consent.h>
|
||||
#include <client.h>
|
||||
@ -60,7 +45,6 @@
|
||||
#include <main.h>
|
||||
|
||||
|
||||
|
||||
/* Compare an Internet address (IPv4 expected), with an address pattern
|
||||
* passed as a character string representing an address in the Internet
|
||||
* standard `.' notation, optionally followed by a slash and an integer
|
||||
@ -84,9 +68,12 @@ AddrCmp(addr, pattern)
|
||||
{
|
||||
in_addr_t hostaddr, pattern_addr, netmask;
|
||||
char *p, *slash_posn;
|
||||
static STRING *buf = (STRING *) 0;
|
||||
static STRING *buf = (STRING *)0;
|
||||
#if HAVE_INET_ATON
|
||||
struct in_addr inetaddr;
|
||||
#endif
|
||||
|
||||
if (buf == (STRING *) 0)
|
||||
if (buf == (STRING *)0)
|
||||
buf = AllocString();
|
||||
slash_posn = strchr(pattern, '/');
|
||||
if (slash_posn != NULL) {
|
||||
@ -97,9 +84,15 @@ AddrCmp(addr, pattern)
|
||||
} else
|
||||
p = pattern;
|
||||
|
||||
#if HAVE_INET_ATON
|
||||
if (inet_aton(p, &inetaddr) == 0)
|
||||
return 1;
|
||||
pattern_addr = inetaddr.s_addr;
|
||||
#else
|
||||
pattern_addr = inet_addr(p);
|
||||
if (pattern_addr == (in_addr_t) (-1))
|
||||
return 1; /* malformed address */
|
||||
#endif
|
||||
|
||||
if (slash_posn) {
|
||||
/* convert explicit netmask */
|
||||
@ -123,9 +116,9 @@ AddrCmp(addr, pattern)
|
||||
netmask = 0xffffffff; /* compare entire addresses */
|
||||
hostaddr = addr->s_addr;
|
||||
|
||||
Debug(1, "AddrCmp(): host=%lx(%lx/%lx) acl=%lx(%lx/%lx)",
|
||||
hostaddr & netmask, hostaddr, netmask, pattern_addr & netmask,
|
||||
pattern_addr, netmask);
|
||||
CONDDEBUG((1, "AddrCmp(): host=%lx(%lx/%lx) acl=%lx(%lx/%lx)",
|
||||
hostaddr & netmask, hostaddr, netmask,
|
||||
pattern_addr & netmask, pattern_addr, netmask));
|
||||
return (hostaddr & netmask) != (pattern_addr & netmask);
|
||||
}
|
||||
|
||||
@ -133,53 +126,149 @@ AddrCmp(addr, pattern)
|
||||
*/
|
||||
char
|
||||
#if PROTOTYPES
|
||||
AccType(struct in_addr *addr, char *hname)
|
||||
AccType(struct in_addr *addr, char **peername)
|
||||
#else
|
||||
AccType(addr, hname)
|
||||
AccType(addr, peername)
|
||||
struct in_addr *addr;
|
||||
char *hname;
|
||||
char **peername;
|
||||
#endif
|
||||
{
|
||||
char *pcName;
|
||||
int len;
|
||||
ACCESS *pACtmp;
|
||||
socklen_t so;
|
||||
struct hostent *he = (struct hostent *)0;
|
||||
int a;
|
||||
char ret;
|
||||
#if TRUST_REVERSE_DNS
|
||||
char **revNames = (char **)0;
|
||||
#endif
|
||||
|
||||
if (fDebug) {
|
||||
if (hname)
|
||||
Debug(1, "AccType(): hostname=%s, ip=%s", hname,
|
||||
inet_ntoa(*addr));
|
||||
else
|
||||
Debug(1, "AccType(): hostname=<unresolvable>, ip=%s",
|
||||
inet_ntoa(*addr));
|
||||
CONDDEBUG((1, "AccType(): ip=%s", inet_ntoa(*addr)));
|
||||
|
||||
ret = config->defaultaccess;
|
||||
so = sizeof(*addr);
|
||||
|
||||
#if TRUST_REVERSE_DNS
|
||||
/* if we trust reverse dns, we get the names associated with
|
||||
* the address we're checking and then check each of those
|
||||
* against the access list entries (below).
|
||||
*/
|
||||
if ((he =
|
||||
gethostbyaddr((char *)addr, so,
|
||||
AF_INET)) == (struct hostent *)0) {
|
||||
Error("AccType(): gethostbyaddr(%s): %s", inet_ntoa(*addr),
|
||||
hstrerror(h_errno));
|
||||
} else {
|
||||
char *hname;
|
||||
if (he->h_name != (char *)0) {
|
||||
/* count up the number of names */
|
||||
for (a = 0, hname = he->h_aliases[a]; hname != (char *)0;
|
||||
hname = he->h_aliases[++a]);
|
||||
a += 2; /* h_name + (char *)0 */
|
||||
/* now duplicate them */
|
||||
if ((revNames =
|
||||
(char **)calloc(a, sizeof(char *))) != (char **)0) {
|
||||
for (hname = he->h_name, a = 0; hname != (char *)0;
|
||||
hname = he->h_aliases[a++]) {
|
||||
if ((revNames[a] = StrDup(hname)) == (char *)0)
|
||||
break;
|
||||
CONDDEBUG((1,"AccType(): revNames[%d]='%s'", a, hname));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (pACtmp = pACList; pACtmp != (ACCESS *) 0;
|
||||
pACtmp = pACtmp->pACnext) {
|
||||
Debug(1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||
pACtmp->ctrust);
|
||||
#endif
|
||||
|
||||
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
||||
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||
pACtmp->ctrust));
|
||||
if (pACtmp->isCIDR != 0) {
|
||||
if (0 == AddrCmp(addr, pACtmp->pcwho)) {
|
||||
return pACtmp->ctrust;
|
||||
if (AddrCmp(addr, pACtmp->pcwho) == 0) {
|
||||
ret = pACtmp->ctrust;
|
||||
goto common_ret;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (hname && hname[0] != '\000') {
|
||||
pcName = hname;
|
||||
len = strlen(pcName);
|
||||
while (len >= pACtmp->ilen) {
|
||||
Debug(1, "AccType(): name=%s", pcName);
|
||||
if (0 == strcasecmp(pcName, pACtmp->pcwho)) {
|
||||
return pACtmp->ctrust;
|
||||
|
||||
if ((he = gethostbyname(pACtmp->pcwho)) == (struct hostent *)0) {
|
||||
Error("AccType(): gethostbyname(%s): %s", pACtmp->pcwho,
|
||||
hstrerror(h_errno));
|
||||
} else if (4 != he->h_length || AF_INET != he->h_addrtype) {
|
||||
Error
|
||||
("AccType(): gethostbyname(%s): wrong address size (4 != %d) or address family (%d != %d)",
|
||||
pACtmp->pcwho, he->h_length, AF_INET, he->h_addrtype);
|
||||
} else {
|
||||
for (a = 0; he->h_addr_list[a] != (char *)0; a++) {
|
||||
CONDDEBUG((1, "AccType(): addr=%s",
|
||||
inet_ntoa(*(struct in_addr *)
|
||||
(he->h_addr_list[a]))));
|
||||
if (
|
||||
#if HAVE_MEMCMP
|
||||
memcmp(&(addr->s_addr), he->h_addr_list[a],
|
||||
he->h_length)
|
||||
#else
|
||||
bcmp(&(addr->s_addr), he->h_addr_list[a],
|
||||
he->h_length)
|
||||
#endif
|
||||
== 0) {
|
||||
ret = pACtmp->ctrust;
|
||||
goto common_ret;
|
||||
}
|
||||
pcName = strchr(pcName, '.');
|
||||
if ((char *)0 == pcName) {
|
||||
break;
|
||||
}
|
||||
++pcName;
|
||||
len = strlen(pcName);
|
||||
}
|
||||
}
|
||||
#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
|
||||
}
|
||||
return chDefAcc;
|
||||
|
||||
common_ret:
|
||||
if (config->loghostnames == FLAGTRUE && peername != (char **)0) {
|
||||
#if TRUST_REVERSE_DNS
|
||||
if (revNames != (char **)0 && revNames[0] != (char *)0)
|
||||
*peername = StrDup(revNames[0]);
|
||||
#else
|
||||
if ((he =
|
||||
gethostbyaddr((char *)addr, so,
|
||||
AF_INET)) != (struct hostent *)0) {
|
||||
*peername = StrDup(he->h_name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if TRUST_REVERSE_DNS
|
||||
common_ret2:
|
||||
if (revNames != (char **)0) {
|
||||
for (a = 0; revNames[a] != (char *)0; a++)
|
||||
free(revNames[a]);
|
||||
free(revNames);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
@ -191,100 +280,51 @@ SetDefAccess(pAddr, pHost)
|
||||
char *pHost;
|
||||
#endif
|
||||
{
|
||||
char *pcWho, *pcDomain;
|
||||
int iLen;
|
||||
char *pcDomain;
|
||||
char *addr;
|
||||
ACCESS *a;
|
||||
|
||||
addr = inet_ntoa(*pAddr);
|
||||
iLen = strlen(addr);
|
||||
if ((ACCESS *) 0 == (pACList = (ACCESS *) calloc(1, sizeof(ACCESS)))) {
|
||||
OutOfMem();
|
||||
while (pAddr->s_addr != (in_addr_t) 0) {
|
||||
addr = inet_ntoa(*pAddr);
|
||||
if ((a = (ACCESS *)calloc(1, sizeof(ACCESS))) == (ACCESS *)0)
|
||||
OutOfMem();
|
||||
if ((a->pcwho = StrDup(addr)) == (char *)0)
|
||||
OutOfMem();
|
||||
a->ctrust = 'a';
|
||||
a->pACnext = pACList;
|
||||
pACList = a;
|
||||
|
||||
CONDDEBUG((1, "SetDefAccess(): trust=%c, who=%s", pACList->ctrust,
|
||||
pACList->pcwho));
|
||||
pAddr++;
|
||||
}
|
||||
if ((char *)0 == (pcWho = malloc(iLen + 1))) {
|
||||
OutOfMem();
|
||||
}
|
||||
pACList->ctrust = 'a';
|
||||
pACList->ilen = iLen;
|
||||
pACList->pcwho = strcpy(pcWho, addr);
|
||||
|
||||
Debug(1, "SetDefAccess(): trust=%c, who=%s", pACList->ctrust,
|
||||
pACList->pcwho);
|
||||
|
||||
if ((char *)0 == (pcDomain = strchr(pHost, '.'))) {
|
||||
if ((char *)0 == (pcDomain = strchr(pHost, '.')))
|
||||
return;
|
||||
}
|
||||
++pcDomain;
|
||||
iLen = strlen(pcDomain);
|
||||
|
||||
if ((ACCESS *) 0 ==
|
||||
(pACList->pACnext = (ACCESS *) calloc(1, sizeof(ACCESS)))) {
|
||||
if ((a = (ACCESS *)calloc(1, sizeof(ACCESS))) == (ACCESS *)0)
|
||||
OutOfMem();
|
||||
}
|
||||
if ((char *)0 == (pcWho = malloc(iLen + 1))) {
|
||||
if ((a->pcwho = StrDup(pcDomain)) == (char *)0)
|
||||
OutOfMem();
|
||||
}
|
||||
pACList->pACnext->ctrust = 'a';
|
||||
pACList->pACnext->ilen = iLen;
|
||||
pACList->pACnext->pcwho = strcpy(pcWho, pcDomain);
|
||||
a->ctrust = 'a';
|
||||
a->pACnext = pACList;
|
||||
pACList = a;
|
||||
|
||||
Debug(1, "SetDefAccess(): trust=%c, who=%s", pACList->pACnext->ctrust,
|
||||
pACList->pACnext->pcwho);
|
||||
}
|
||||
|
||||
/* thread ther list of uniq console server machines, aliases for (ksb)
|
||||
* machines will screw us up
|
||||
*/
|
||||
REMOTE *
|
||||
#if PROTOTYPES
|
||||
FindUniq(REMOTE * pRCAll)
|
||||
#else
|
||||
FindUniq(pRCAll)
|
||||
REMOTE *pRCAll;
|
||||
#endif
|
||||
{
|
||||
REMOTE *pRC;
|
||||
|
||||
/* INV: tail of the list we are building always contains only
|
||||
* uniq hosts, or the empty list.
|
||||
*/
|
||||
if ((REMOTE *) 0 == pRCAll) {
|
||||
return (REMOTE *) 0;
|
||||
}
|
||||
|
||||
pRCAll->pRCuniq = FindUniq(pRCAll->pRCnext);
|
||||
|
||||
/* if it is in the returned list of uniq hosts, return that list
|
||||
* else add us by returning our node
|
||||
*/
|
||||
for (pRC = pRCAll->pRCuniq; (REMOTE *) 0 != pRC; pRC = pRC->pRCuniq) {
|
||||
if (0 == strcasecmp(pRC->rhost.string, pRCAll->rhost.string)) {
|
||||
return pRCAll->pRCuniq;
|
||||
}
|
||||
}
|
||||
return pRCAll;
|
||||
CONDDEBUG((1, "SetDefAccess(): trust=%c, who=%s", pACList->ctrust,
|
||||
pACList->pcwho));
|
||||
}
|
||||
|
||||
void
|
||||
#if PROTOTYPES
|
||||
DestroyRemoteConsole(REMOTE * pRCList)
|
||||
#else
|
||||
DestroyRemoteConsole(pRCList)
|
||||
REMOTE *pRCList;
|
||||
#endif
|
||||
{
|
||||
DestroyString(&pRCList->rserver);
|
||||
DestroyString(&pRCList->rhost);
|
||||
free(pRCList);
|
||||
}
|
||||
|
||||
void
|
||||
#if PROTOTYPES
|
||||
DestroyAccessList(ACCESS * pACList)
|
||||
DestroyAccessList(ACCESS *pACList)
|
||||
#else
|
||||
DestroyAccessList(pACList)
|
||||
ACCESS *pACList;
|
||||
#endif
|
||||
{
|
||||
if (pACList == (ACCESS *)0)
|
||||
return;
|
||||
if (pACList->pcwho != (char *)0)
|
||||
free(pACList->pcwho);
|
||||
free(pACList);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: access.h,v 5.22 2003-03-06 10:13:41-08 bryan Exp $
|
||||
* $Id: access.h,v 5.26 2003/08/10 18:11:20 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -39,21 +39,11 @@
|
||||
|
||||
typedef struct access {
|
||||
char ctrust; /* how much do we trust the host */
|
||||
int ilen; /* length (strlen) of pcwho */
|
||||
char *pcwho; /* what is the hosts name/ip number */
|
||||
int isCIDR; /* is this a CIDR addr (or hostname?) */
|
||||
struct access *pACnext; /* next access list */
|
||||
} ACCESS;
|
||||
|
||||
typedef struct remote { /* console at another host */
|
||||
struct remote *pRCnext; /* next remote console we know about */
|
||||
struct remote *pRCuniq; /* list of uniq remote servers */
|
||||
STRING rserver; /* remote server name */
|
||||
STRING rhost; /* remote host to call to get it */
|
||||
} REMOTE;
|
||||
|
||||
extern REMOTE *FindUniq PARAMS((REMOTE *));
|
||||
extern char AccType PARAMS((struct in_addr *, char *));
|
||||
extern char AccType PARAMS((struct in_addr *, char **));
|
||||
extern void SetDefAccess PARAMS((struct in_addr *, char *));
|
||||
extern void DestroyRemoteConsole PARAMS((REMOTE *));
|
||||
extern void DestroyAccessList PARAMS((ACCESS *));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: client.c,v 5.60 2003-03-17 08:38:40-08 bryan Exp $
|
||||
* $Id: client.c,v 5.83 2004/04/13 18:12:00 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -34,59 +34,59 @@
|
||||
* 4. This notice may not be removed or altered.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include <compat.h>
|
||||
#include <util.h>
|
||||
|
||||
#include <cutil.h>
|
||||
#include <consent.h>
|
||||
#include <access.h>
|
||||
#include <client.h>
|
||||
#include <group.h>
|
||||
|
||||
#if defined(USE_LIBWRAP)
|
||||
#include <syslog.h>
|
||||
#include <tcpd.h>
|
||||
int allow_severity = LOG_INFO;
|
||||
int deny_severity = LOG_WARNING;
|
||||
#endif
|
||||
|
||||
|
||||
/* find the next guy who wants to write on the console (ksb)
|
||||
*/
|
||||
CONSCLIENT *
|
||||
void
|
||||
#if PROTOTYPES
|
||||
FindWrite(CONSCLIENT * pCL)
|
||||
FindWrite(CONSENT *pCE)
|
||||
#else
|
||||
FindWrite(pCL)
|
||||
CONSCLIENT *pCL;
|
||||
FindWrite(pCE)
|
||||
CONSENT *pCE;
|
||||
#endif
|
||||
{
|
||||
/* return the first guy to have the `want write' bit set
|
||||
CONSCLIENT *pCL;
|
||||
|
||||
/* make the first guy to have the `want write' bit set the writer
|
||||
* (tell him of the promotion, too) we could look for the
|
||||
* most recent or some such... I guess it doesn't matter that
|
||||
* much.
|
||||
*/
|
||||
for ( /*passed in */ ; (CONSCLIENT *) 0 != pCL; pCL = pCL->pCLnext) {
|
||||
if (!pCL->fwantwr)
|
||||
if (pCE->pCLwr != (CONSCLIENT *)0 || pCE->fronly ||
|
||||
!(pCE->fup && pCE->ioState == ISNORMAL &&
|
||||
pCE->initfile == (CONSFILE *)0))
|
||||
return;
|
||||
|
||||
for (pCL = pCE->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) {
|
||||
if (!pCL->fwantwr || pCL->fro)
|
||||
continue;
|
||||
if (!pCL->pCEto->fup || pCL->pCEto->fronly)
|
||||
break;
|
||||
pCL->fwantwr = 0;
|
||||
pCL->fwr = 1;
|
||||
if (pCL->pCEto->nolog) {
|
||||
FileWrite(pCL->fd, "\r\n[attached (nologging)]\r\n", -1);
|
||||
if (pCE->nolog) {
|
||||
FileWrite(pCL->fd, FLAGFALSE, "\r\n[attached (nologging)]\r\n",
|
||||
-1);
|
||||
} else {
|
||||
FileWrite(pCL->fd, "\r\n[attached]\r\n", -1);
|
||||
FileWrite(pCL->fd, FLAGFALSE, "\r\n[attached]\r\n", -1);
|
||||
}
|
||||
TagLogfileAct(pCL->pCEto, "%s attached", pCL->acid.string);
|
||||
return pCL;
|
||||
TagLogfileAct(pCE, "%s attached", pCL->acid->string);
|
||||
pCE->pCLwr = pCL;
|
||||
return;
|
||||
}
|
||||
return (CONSCLIENT *) 0;
|
||||
}
|
||||
|
||||
/* replay last iBack lines of the log file upon connect to console (ksb)
|
||||
@ -97,15 +97,15 @@ FindWrite(pCL)
|
||||
*/
|
||||
void
|
||||
#if PROTOTYPES
|
||||
Replay(CONSFILE * fdLog, CONSFILE * fdOut, int iBack)
|
||||
Replay(CONSENT *pCE, CONSFILE *fdOut, int iBack)
|
||||
#else
|
||||
Replay(fdLog, fdOut, iBack)
|
||||
CONSFILE *fdLog;
|
||||
Replay(pCE, fdOut, iBack)
|
||||
CONSENT *pCE;
|
||||
CONSFILE *fdOut;
|
||||
int iBack;
|
||||
#endif
|
||||
{
|
||||
|
||||
CONSFILE *fdLog = (CONSFILE *)0;
|
||||
off_t file_pos;
|
||||
off_t buf_pos;
|
||||
char *buf;
|
||||
@ -116,8 +116,8 @@ Replay(fdLog, fdOut, iBack)
|
||||
struct stat stLog;
|
||||
struct lines {
|
||||
int is_mark;
|
||||
STRING line;
|
||||
STRING mark_end;
|
||||
STRING *line;
|
||||
STRING *mark_end;
|
||||
} *lines;
|
||||
int n_lines;
|
||||
int ln;
|
||||
@ -130,8 +130,18 @@ Replay(fdLog, fdOut, iBack)
|
||||
unsigned long dmallocMarkReplay = 0;
|
||||
#endif
|
||||
|
||||
if ((CONSFILE *) 0 == fdLog) {
|
||||
FileWrite(fdOut, "[no log file on this console]\r\n", -1);
|
||||
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",
|
||||
-1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -160,6 +170,10 @@ Replay(fdLog, fdOut, iBack)
|
||||
if ((struct lines *)0 == lines) {
|
||||
OutOfMem();
|
||||
}
|
||||
for (i = 0; i < n_lines; i++) {
|
||||
lines[i].mark_end = AllocString();
|
||||
lines[i].line = AllocString();
|
||||
}
|
||||
ln = -1;
|
||||
|
||||
/* loop as long as there is data in the file or we have not found
|
||||
@ -174,18 +188,10 @@ Replay(fdLog, fdOut, iBack)
|
||||
* the rest (as we work our way back in the file) should be
|
||||
*/
|
||||
buf_pos = (file_pos / BUFSIZ) * BUFSIZ;
|
||||
#if defined(SEEK_SET)
|
||||
/* PTX and maybe other Posix systems
|
||||
*/
|
||||
if (FileSeek(fdLog, buf_pos, SEEK_SET) < 0) {
|
||||
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;
|
||||
}
|
||||
bp = buf + r;
|
||||
@ -199,21 +205,21 @@ Replay(fdLog, fdOut, iBack)
|
||||
|
||||
/* reverse the text to put it in forward order
|
||||
*/
|
||||
u = lines[ln].line.used - 1;
|
||||
u = lines[ln].line->used - 1;
|
||||
for (i = 0; i < u / 2; i++) {
|
||||
int temp;
|
||||
|
||||
temp = lines[ln].line.string[i];
|
||||
lines[ln].line.string[i]
|
||||
= lines[ln].line.string[u - i - 1];
|
||||
lines[ln].line.string[u - i - 1] = temp;
|
||||
temp = lines[ln].line->string[i];
|
||||
lines[ln].line->string[i]
|
||||
= lines[ln].line->string[u - i - 1];
|
||||
lines[ln].line->string[u - i - 1] = temp;
|
||||
}
|
||||
|
||||
/* see if this line is a MARK
|
||||
*/
|
||||
if (lines[ln].line.used > 0 &&
|
||||
lines[ln].line.string[0] == '[') {
|
||||
i = sscanf(lines[ln].line.string + 1,
|
||||
if (lines[ln].line->used > 0 &&
|
||||
lines[ln].line->string[0] == '[') {
|
||||
i = sscanf(lines[ln].line->string + 1,
|
||||
"-- MARK -- %3c %3c %d %d:%d:%d %d]\r\n",
|
||||
dummy, dummy, &j, &j, &j, &j, &j);
|
||||
is_mark = (i == 7);
|
||||
@ -227,27 +233,24 @@ Replay(fdLog, fdOut, iBack)
|
||||
/* this is a mark and the previous line is also
|
||||
* a mark, so make (or continue) that range
|
||||
*/
|
||||
if (0 == lines[ln - 1].mark_end.allocated) {
|
||||
if (0 == lines[ln - 1].mark_end->allocated) {
|
||||
/* this is a new range - shuffle pointers
|
||||
*
|
||||
* remember that we are moving backward
|
||||
*/
|
||||
lines[ln - 1].mark_end = lines[ln - 1].line;
|
||||
lines[ln - 1].line.string = (char *)0;
|
||||
lines[ln - 1].line.used = 0;
|
||||
lines[ln - 1].line.allocated = 0;
|
||||
*(lines[ln - 1].mark_end) = *(lines[ln - 1].line);
|
||||
InitString(lines[ln - 1].line);
|
||||
}
|
||||
/* if unallocated, cheat and shuffle pointers */
|
||||
if (0 == lines[ln - 1].line.allocated) {
|
||||
lines[ln - 1].line = lines[ln].line;
|
||||
lines[ln].line.string = (char *)0;
|
||||
lines[ln].line.used = 0;
|
||||
lines[ln].line.allocated = 0;
|
||||
if (0 == lines[ln - 1].line->allocated) {
|
||||
*(lines[ln - 1].line) = *(lines[ln].line);
|
||||
InitString(lines[ln].line);
|
||||
} else {
|
||||
BuildString((char *)0, &lines[ln - 1].line);
|
||||
BuildString(lines[ln].line.string,
|
||||
&lines[ln - 1].line);
|
||||
BuildString((char *)0, &lines[ln].line);
|
||||
BuildString((char *)0, lines[ln - 1].line);
|
||||
BuildStringN(lines[ln].line->string,
|
||||
lines[ln].line->used - 1,
|
||||
lines[ln - 1].line);
|
||||
BuildString((char *)0, lines[ln].line);
|
||||
}
|
||||
ln--;
|
||||
}
|
||||
@ -268,14 +271,14 @@ Replay(fdLog, fdOut, iBack)
|
||||
if (ln < 0) {
|
||||
ln = 0;
|
||||
}
|
||||
BuildStringChar(ch, &lines[ln].line);
|
||||
BuildStringChar(ch, lines[ln].line);
|
||||
|
||||
/* if we've processed "a lot" of data for a line, then bail
|
||||
* why? there must be some very long non-newline terminated
|
||||
* strings and if we just keep going back, we could spew lots
|
||||
* of data and chew up lots of memory
|
||||
*/
|
||||
if (lines[ln].line.used > MAXREPLAYLINELEN) {
|
||||
if (lines[ln].line->used > MAXREPLAYLINELEN) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -284,18 +287,18 @@ Replay(fdLog, fdOut, iBack)
|
||||
|
||||
/* if we got back to beginning of file but saw some data, include it
|
||||
*/
|
||||
if (ln >= 0 && lines[ln].line.used > 0) {
|
||||
if (ln >= 0 && lines[ln].line->used > 0) {
|
||||
|
||||
/* reverse the text to put it in forward order
|
||||
*/
|
||||
u = lines[ln].line.used - 1;
|
||||
u = lines[ln].line->used - 1;
|
||||
for (i = 0; i < u / 2; i++) {
|
||||
int temp;
|
||||
|
||||
temp = lines[ln].line.string[i];
|
||||
lines[ln].line.string[i]
|
||||
= lines[ln].line.string[u - i - 1];
|
||||
lines[ln].line.string[u - i - 1] = temp;
|
||||
temp = lines[ln].line->string[i];
|
||||
lines[ln].line->string[i]
|
||||
= lines[ln].line->string[u - i - 1];
|
||||
lines[ln].line->string[u - i - 1] = temp;
|
||||
}
|
||||
ln++;
|
||||
}
|
||||
@ -303,41 +306,47 @@ Replay(fdLog, fdOut, iBack)
|
||||
/* copy the lines into the buffer and put them in order
|
||||
*/
|
||||
for (i = ln - 1; i >= 0; i--) {
|
||||
if (lines[i].is_mark && 0 != lines[i].mark_end.used) {
|
||||
if (lines[i].is_mark && 0 != lines[i].mark_end->used) {
|
||||
int mark_len;
|
||||
|
||||
/* output the start of the range, stopping at the ']'
|
||||
*/
|
||||
s = strrchr(lines[i].line.string, ']');
|
||||
s = strrchr(lines[i].line->string, ']');
|
||||
if ((char *)0 != s) {
|
||||
*s = '\000';
|
||||
}
|
||||
FileWrite(fdOut, lines[i].line.string, -1);
|
||||
FileWrite(fdOut, " .. ", -1);
|
||||
FileWrite(fdOut, FLAGTRUE, lines[i].line->string, -1);
|
||||
FileWrite(fdOut, FLAGTRUE, " .. ", 4);
|
||||
|
||||
/* build the end string by removing the leading "[-- MARK -- "
|
||||
* and replacing "]\r\n" on the end with " -- MARK --]\r\n"
|
||||
*/
|
||||
mark_len = sizeof("[-- MARK -- ") - 1;
|
||||
|
||||
s = strrchr(lines[i].mark_end.string + mark_len, ']');
|
||||
s = strrchr(lines[i].mark_end->string + mark_len, ']');
|
||||
if ((char *)0 != s) {
|
||||
*s = '\000';
|
||||
}
|
||||
FileWrite(fdOut, lines[i].mark_end.string + mark_len, -1);
|
||||
FileWrite(fdOut, " -- MARK --]\r\n", -1);
|
||||
u = lines[i].mark_end.used;
|
||||
s = lines[i].mark_end.string;
|
||||
FileWrite(fdOut, FLAGTRUE,
|
||||
lines[i].mark_end->string + mark_len, -1);
|
||||
FileWrite(fdOut, FLAGFALSE, " -- MARK --]\r\n", -1);
|
||||
u = lines[i].mark_end->used;
|
||||
s = lines[i].mark_end->string;
|
||||
} else
|
||||
FileWrite(fdOut, lines[i].line.string, -1);
|
||||
FileWrite(fdOut, FLAGFALSE, lines[i].line->string,
|
||||
lines[i].line->used - 1);
|
||||
}
|
||||
|
||||
common_exit:
|
||||
|
||||
/* if we opened the logfile, close it */
|
||||
if (fdLog != pCE->fdlog)
|
||||
FileClose(&fdLog);
|
||||
|
||||
if ((struct lines *)0 != lines) {
|
||||
for (i = 0; i < n_lines; i++) {
|
||||
DestroyString(&lines[i].mark_end);
|
||||
DestroyString(&lines[i].line);
|
||||
DestroyString(lines[i].mark_end);
|
||||
DestroyString(lines[i].line);
|
||||
}
|
||||
free(lines);
|
||||
lines = (struct lines *)0;
|
||||
@ -347,7 +356,7 @@ Replay(fdLog, fdOut, iBack)
|
||||
buf = (char *)0;
|
||||
}
|
||||
#if HAVE_DMALLOC && DMALLOC_MARK_REPLAY
|
||||
Debug(1, "Replay(): dmalloc / MarkReplay");
|
||||
CONDDEBUG((1, "Replay(): dmalloc / MarkReplay"));
|
||||
dmalloc_log_changed(dmallocMarkReplay, 1, 0, 1);
|
||||
#endif
|
||||
}
|
||||
@ -357,8 +366,7 @@ Replay(fdLog, fdOut, iBack)
|
||||
*/
|
||||
#define WHEN_SPY 0x01
|
||||
#define WHEN_ATTACH 0x02
|
||||
#define WHEN_VT100 0x04
|
||||
#define WHEN_EXPERT 0x08 /* ZZZ no way to set his yet */
|
||||
#define WHEN_EXPERT 0x04 /* ZZZ no way to set his yet */
|
||||
#define WHEN_ALWAYS 0x40
|
||||
|
||||
#define HALFLINE 40
|
||||
@ -370,6 +378,7 @@ typedef struct HLnode {
|
||||
|
||||
static HELP aHLTable[] = {
|
||||
{WHEN_ALWAYS, ". disconnect"},
|
||||
{WHEN_ALWAYS, "; move to another console"},
|
||||
{WHEN_ALWAYS, "a attach read/write"},
|
||||
{WHEN_ALWAYS, "b send broadcast message"},
|
||||
{WHEN_ATTACH, "c toggle flow control"},
|
||||
@ -382,6 +391,7 @@ static HELP aHLTable[] = {
|
||||
{WHEN_ATTACH, "l? break sequence list"},
|
||||
{WHEN_ATTACH, "l0 send break per config file"},
|
||||
{WHEN_ATTACH, "l1-9 send specific break sequence"},
|
||||
{WHEN_ALWAYS, "m display the message of the day"},
|
||||
{WHEN_ALWAYS, "o (re)open the tty and log file"},
|
||||
{WHEN_ALWAYS, "p replay the last 60 lines"},
|
||||
{WHEN_ALWAYS, "r replay the last 20 lines"},
|
||||
@ -391,24 +401,20 @@ static HELP aHLTable[] = {
|
||||
{WHEN_ALWAYS, "w who is on this console"},
|
||||
{WHEN_ALWAYS, "x show console baud info"},
|
||||
{WHEN_ALWAYS, "z suspend the connection"},
|
||||
{WHEN_ALWAYS, "<cr> ignore/abort command"},
|
||||
{WHEN_ATTACH, "| attach local command"},
|
||||
{WHEN_ALWAYS, "? print this message"},
|
||||
{WHEN_ALWAYS, "<cr> ignore/abort command"},
|
||||
{WHEN_ALWAYS, "^R replay the last line"},
|
||||
{WHEN_ATTACH, "\\ooo send character by octal code"},
|
||||
{WHEN_EXPERT, "^I toggle tab expansion"},
|
||||
{WHEN_EXPERT, "; change to another console"},
|
||||
{WHEN_EXPERT, "+(-) do (not) drop line"},
|
||||
{WHEN_VT100, "PF1 print this message"},
|
||||
{WHEN_VT100, "PF2 disconnect"},
|
||||
{WHEN_VT100, "PF3 replay the last 20 lines"},
|
||||
{WHEN_VT100, "PF4 spy read only"}
|
||||
};
|
||||
|
||||
/* list the commands we know for the user (ksb)
|
||||
*/
|
||||
void
|
||||
#if PROTOTYPES
|
||||
HelpUser(CONSCLIENT * pCL)
|
||||
HelpUser(CONSCLIENT *pCL)
|
||||
#else
|
||||
HelpUser(pCL)
|
||||
CONSCLIENT *pCL;
|
||||
@ -418,20 +424,17 @@ HelpUser(pCL)
|
||||
static char
|
||||
acH1[] = "help]\r\n", acH2[] = "help spy mode]\r\n", acEoln[] =
|
||||
"\r\n";
|
||||
static STRING *acLine = (STRING *) 0;
|
||||
static STRING *acLine = (STRING *)0;
|
||||
|
||||
if (acLine == (STRING *) 0)
|
||||
if (acLine == (STRING *)0)
|
||||
acLine = AllocString();
|
||||
|
||||
iCmp = WHEN_ALWAYS | WHEN_SPY;
|
||||
if (pCL->fwr) {
|
||||
FileWrite(pCL->fd, acH1, sizeof(acH1) - 1);
|
||||
FileWrite(pCL->fd, FLAGTRUE, acH1, sizeof(acH1) - 1);
|
||||
iCmp |= WHEN_ATTACH;
|
||||
} else {
|
||||
FileWrite(pCL->fd, acH2, sizeof(acH2) - 1);
|
||||
}
|
||||
if ('\033' == pCL->ic[0] && 'O' == pCL->ic[1]) {
|
||||
iCmp |= WHEN_VT100;
|
||||
FileWrite(pCL->fd, FLAGTRUE, acH2, sizeof(acH2) - 1);
|
||||
}
|
||||
|
||||
BuildString((char *)0, acLine);
|
||||
@ -446,12 +449,14 @@ HelpUser(pCL)
|
||||
}
|
||||
BuildString(aHLTable[i].actext, acLine);
|
||||
BuildString(acEoln, acLine);
|
||||
FileWrite(pCL->fd, acLine->string, -1);
|
||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
|
||||
acLine->used - 1);
|
||||
BuildString((char *)0, acLine);
|
||||
continue;
|
||||
} else {
|
||||
BuildString(acEoln, acLine);
|
||||
FileWrite(pCL->fd, acLine->string, -1);
|
||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
|
||||
acLine->used - 1);
|
||||
BuildString((char *)0, acLine);
|
||||
}
|
||||
}
|
||||
@ -460,13 +465,97 @@ HelpUser(pCL)
|
||||
BuildString(aHLTable[i].actext, acLine);
|
||||
if (acLine->used > HALFLINE) {
|
||||
BuildString(acEoln, acLine);
|
||||
FileWrite(pCL->fd, acLine->string, -1);
|
||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string,
|
||||
acLine->used - 1);
|
||||
BuildString((char *)0, acLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (acLine->used != 0) {
|
||||
BuildString(acEoln, acLine);
|
||||
FileWrite(pCL->fd, acLine->string, -1);
|
||||
FileWrite(pCL->fd, FLAGTRUE, acLine->string, acLine->used - 1);
|
||||
}
|
||||
FileWrite(pCL->fd, FLAGFALSE, (char *)0, 0);
|
||||
}
|
||||
|
||||
int
|
||||
#if PROTOTYPES
|
||||
ClientAccessOk(CONSCLIENT *pCL)
|
||||
#else
|
||||
ClientAccessOk(pCL)
|
||||
CONSCLIENT *pCL;
|
||||
#endif
|
||||
{
|
||||
char *peername = (char *)0;
|
||||
int retval = 1;
|
||||
|
||||
#if USE_UNIX_DOMAIN_SOCKETS
|
||||
struct in_addr addr;
|
||||
|
||||
# if HAVE_INET_ATON
|
||||
inet_aton("127.0.0.1", &addr);
|
||||
# else
|
||||
addr.s_addr = inet_addr("127.0.0.1");
|
||||
# endif
|
||||
pCL->caccess = AccType(&addr, &peername);
|
||||
if (pCL->caccess == 'r') {
|
||||
FileWrite(pCL->fd, FLAGFALSE, "access from your host refused\r\n",
|
||||
-1);
|
||||
retval = 0;
|
||||
}
|
||||
#else
|
||||
socklen_t so;
|
||||
int cfd;
|
||||
struct sockaddr_in in_port;
|
||||
int getpeer = -1;
|
||||
|
||||
cfd = FileFDNum(pCL->fd);
|
||||
pCL->caccess = 'r';
|
||||
# if defined(USE_LIBWRAP)
|
||||
{
|
||||
struct request_info request;
|
||||
request_init(&request, RQ_DAEMON, progname, RQ_FILE, cfd, 0);
|
||||
fromhost(&request);
|
||||
if (!hosts_access(&request)) {
|
||||
FileWrite(pCL->fd, FLAGFALSE,
|
||||
"access from your host refused\r\n", -1);
|
||||
retval = 0;
|
||||
goto setpeer;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
so = sizeof(in_port);
|
||||
if (-1 ==
|
||||
(getpeer = getpeername(cfd, (struct sockaddr *)&in_port, &so))) {
|
||||
FileWrite(pCL->fd, FLAGFALSE, "getpeername failed\r\n", -1);
|
||||
retval = 0;
|
||||
goto setpeer;
|
||||
}
|
||||
pCL->caccess = AccType(&in_port.sin_addr, &peername);
|
||||
if (pCL->caccess == 'r') {
|
||||
FileWrite(pCL->fd, FLAGFALSE, "access from your host refused\r\n",
|
||||
-1);
|
||||
retval = 0;
|
||||
}
|
||||
setpeer:
|
||||
#endif
|
||||
|
||||
if (pCL->peername != (STRING *)0) {
|
||||
BuildString((char *)0, pCL->peername);
|
||||
if (peername != (char *)0)
|
||||
BuildString(peername, pCL->peername);
|
||||
#if USE_UNIX_DOMAIN_SOCKETS
|
||||
else
|
||||
BuildString("127.0.0.1", pCL->peername);
|
||||
#else
|
||||
else if (getpeer != -1)
|
||||
BuildString(inet_ntoa(in_port.sin_addr), pCL->peername);
|
||||
else
|
||||
BuildString("<unknown>", pCL->peername);
|
||||
#endif
|
||||
}
|
||||
if (peername != (char *)0)
|
||||
free(peername);
|
||||
return retval;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: client.h,v 5.27 2003-03-06 10:13:41-08 bryan Exp $
|
||||
* $Id: client.h,v 5.36 2003/12/25 19:22:00 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -35,32 +35,36 @@
|
||||
*/
|
||||
/* states for a server fsm
|
||||
*/
|
||||
#define S_NORMAL 0 /* just pass character */
|
||||
#define S_ESC1 1 /* first escape character received */
|
||||
#define S_CMD 2 /* second interrupt character received */
|
||||
#define S_CATTN 3 /* change 1 escape character to next input char */
|
||||
#define S_CESC 4 /* change 2 escape character to next input char */
|
||||
#define S_HALT1 5 /* we have a halt sequence in progress */
|
||||
#define S_SUSP 6 /* we are suspened, first char wakes us up */
|
||||
#define S_IDENT 7 /* probational connection (who is this) */
|
||||
#define S_HOST 8 /* still needs a host name to connect */
|
||||
#define S_PASSWD 9 /* still needs a passwd to connect */
|
||||
#define S_QUOTE 10 /* send any character we can spell */
|
||||
#define S_BCAST 11 /* send a broadcast message to all connections */
|
||||
typedef enum clientState {
|
||||
S_NORMAL, /* just pass character */
|
||||
S_ESC1, /* first escape character received */
|
||||
S_CMD, /* second interrupt character received */
|
||||
S_CATTN, /* change 1 escape char to next input char */
|
||||
S_CESC, /* change 2 escape char to next input char */
|
||||
S_HALT1, /* we have a halt sequence in progress */
|
||||
S_SUSP, /* we are suspened, first char wakes us up */
|
||||
S_IDENT, /* probational connection (who is this) */
|
||||
S_PASSWD, /* still needs a passwd to connect */
|
||||
S_QUOTE, /* send any character we can spell */
|
||||
S_BCAST, /* send a broadcast message to all clients */
|
||||
S_CWAIT, /* wait for client */
|
||||
S_CEXEC /* client execing a program */
|
||||
} CLIENTSTATE;
|
||||
|
||||
typedef struct client { /* Connection Information: */
|
||||
CONSFILE *fd; /* file descriptor */
|
||||
short fcon; /* currently connect or not */
|
||||
short fwr; /* (client) write enable flag */
|
||||
short fwantwr; /* (client) wants to write */
|
||||
short fro; /* read-only permission */
|
||||
short fecho; /* echo commands (not set by machines) */
|
||||
STRING acid; /* login and location of client */
|
||||
STRING peername; /* location of client */
|
||||
STRING *acid; /* login and location of client */
|
||||
STRING *peername; /* location of client */
|
||||
STRING *username; /* login of client */
|
||||
time_t tym; /* time of connect */
|
||||
time_t typetym; /* time of last keystroke */
|
||||
char actym[32]; /* pre-formatted time */
|
||||
struct consent
|
||||
*pCEwant, /* what machine we would like to be on */
|
||||
*pCEto; /* host a client gets output from */
|
||||
struct client
|
||||
**ppCLbscan, /* back link for scan ptr */
|
||||
@ -70,14 +74,17 @@ typedef struct client { /* Connection Information: */
|
||||
*pCLnext; /* next person on this list */
|
||||
/* next lists link clients on a console */
|
||||
char ic[2]; /* two character escape sequence */
|
||||
char iState; /* state for fsm in server */
|
||||
CLIENTSTATE iState; /* state for fsm in server */
|
||||
char caccess; /* did we trust the remote machine */
|
||||
STRING accmd; /* the command the user issued */
|
||||
STRING msg; /* the broadcast message */
|
||||
IOSTATE ioState; /* state of the socket */
|
||||
time_t stateTimer; /* timer for various ioState states */
|
||||
STRING *accmd; /* the command the user issued */
|
||||
STRING *msg; /* the broadcast message */
|
||||
struct sockaddr_in
|
||||
cnct_port; /* where from */
|
||||
} CONSCLIENT;
|
||||
|
||||
extern void Replay PARAMS((CONSFILE *, CONSFILE *, int));
|
||||
extern void Replay PARAMS((CONSENT *, CONSFILE *, int));
|
||||
extern void HelpUser PARAMS((CONSCLIENT *));
|
||||
extern CONSCLIENT *FindWrite PARAMS((CONSCLIENT *));
|
||||
extern void FindWrite PARAMS((CONSENT *));
|
||||
extern int ClientAccessOk PARAMS((CONSCLIENT *));
|
||||
|
1231
conserver/consent.c
1231
conserver/consent.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: consent.h,v 5.36 2003-03-17 08:54:53-08 bryan Exp $
|
||||
* $Id: consent.h,v 5.56 2004/02/20 14:58:14 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -46,60 +46,127 @@ typedef struct baud { /* a baud rate table */
|
||||
} BAUD;
|
||||
|
||||
typedef struct parity { /* a parity bits table */
|
||||
char ckey;
|
||||
char *key;
|
||||
int iset;
|
||||
int iclr;
|
||||
} PARITY;
|
||||
|
||||
typedef enum consType {
|
||||
UNKNOWNTYPE = 0,
|
||||
DEVICE,
|
||||
EXEC,
|
||||
HOST
|
||||
} CONSTYPE;
|
||||
|
||||
typedef struct names {
|
||||
char *name;
|
||||
struct names *next;
|
||||
} NAMES;
|
||||
|
||||
typedef struct consentUsers {
|
||||
NAMES *user;
|
||||
short not;
|
||||
struct consentUsers *next;
|
||||
} CONSENTUSERS;
|
||||
|
||||
/* we calloc() these things, so we're trying to make everything be
|
||||
* "empty" when it's got a zero value
|
||||
*/
|
||||
typedef struct consent { /* console information */
|
||||
STRING server; /* server name */
|
||||
STRING dfile; /* device file */
|
||||
STRING lfile; /* log file */
|
||||
BAUD *pbaud; /* the baud on this console port */
|
||||
PARITY *pparity; /* the parity on this line */
|
||||
/*** config file settings ***/
|
||||
char *server; /* server name */
|
||||
CONSTYPE type; /* console type */
|
||||
NAMES *aliases; /* aliases for server name */
|
||||
/* type == DEVICE */
|
||||
char *device; /* device file */
|
||||
char *devicesubst; /* device substitution pattern */
|
||||
BAUD *baud; /* the baud on this console port */
|
||||
PARITY *parity; /* the parity on this line */
|
||||
FLAG hupcl; /* use HUPCL */
|
||||
FLAG cstopb; /* use two stop bits */
|
||||
FLAG ixon; /* XON/XOFF flow control on output */
|
||||
FLAG ixany; /* any character to restart output */
|
||||
FLAG ixoff; /* XON/XOFF flow control on input */
|
||||
#if defined(CRTSCTS)
|
||||
FLAG crtscts; /* use hardware flow control */
|
||||
#endif
|
||||
/* type == HOST */
|
||||
char *host; /* hostname */
|
||||
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 */
|
||||
char *exec; /* exec command */
|
||||
char *execsubst; /* exec substitution pattern */
|
||||
/* global stuff */
|
||||
char *master; /* master hostname */
|
||||
unsigned short breakNum; /* break type [1-9] */
|
||||
char *logfile; /* logfile */
|
||||
off_t logfilemax; /* size limit for rolling logfile */
|
||||
char *initcmd; /* initcmd command */
|
||||
char *initsubst; /* initcmd substitution pattern */
|
||||
char *motd; /* motd */
|
||||
time_t idletimeout; /* idle timeout */
|
||||
char *idlestring; /* string to print when idle */
|
||||
/* timestamp stuff */
|
||||
int mark; /* Mark (chime) interval */
|
||||
long nextMark; /* Next mark (chime) time */
|
||||
unsigned short breakType; /* break type [1-9] */
|
||||
unsigned short autoReUp; /* is it coming back up automatically? */
|
||||
unsigned short downHard; /* did it go down unexpectedly? */
|
||||
FLAG activitylog; /* log attach/detach/bump */
|
||||
FLAG breaklog; /* log breaks sent */
|
||||
/* options */
|
||||
FLAG ondemand; /* bring up on-demand */
|
||||
FLAG reinitoncc; /* open if down on client connect */
|
||||
FLAG striphigh; /* strip high-bit of console data */
|
||||
FLAG autoreinit; /* auto-reinitialize if failed */
|
||||
FLAG unloved; /* copy "unloved" data to stdout */
|
||||
|
||||
/* Used if network console */
|
||||
int isNetworkConsole;
|
||||
STRING networkConsoleHost;
|
||||
unsigned short networkConsolePort;
|
||||
int telnetState;
|
||||
|
||||
/* used if virtual console */
|
||||
STRING acslave; /* pseudo-device slave side */
|
||||
int fvirtual; /* is a pty device we use as a console */
|
||||
STRING pccmd; /* virtual console command */
|
||||
pid_t ipid; /* pid of virtual command */
|
||||
|
||||
/* only used in child */
|
||||
int nolog; /* don't log output */
|
||||
/*** runtime settings ***/
|
||||
CONSFILE *fdlog; /* the local log file */
|
||||
int fdtty; /* the port to talk to machine on */
|
||||
int activitylog; /* log attach/detach/bump */
|
||||
int breaklog; /* log breaks sent */
|
||||
unsigned short fup; /* we setup this line? */
|
||||
unsigned short fronly; /* we can only read this console */
|
||||
struct client *pCLon; /* clients on this console */
|
||||
struct client *pCLwr; /* client that is writting on console */
|
||||
CONSFILE *cofile; /* the port to talk to machine on */
|
||||
char *execSlave; /* pseudo-device slave side */
|
||||
int execSlaveFD; /* fd of slave side */
|
||||
pid_t ipid; /* pid of virtual command */
|
||||
pid_t initpid; /* pid of initcmd command */
|
||||
CONSFILE *initfile; /* the command run on init */
|
||||
STRING *wbuf; /* write() buffer */
|
||||
int wbufIAC; /* next IAC location in wbuf */
|
||||
IOSTATE ioState; /* state of the socket */
|
||||
time_t stateTimer; /* timer for ioState states */
|
||||
time_t lastWrite; /* time of last data sent to console */
|
||||
|
||||
/*** state information ***/
|
||||
char acline[132 * 2 + 2]; /* max chars we will call a line */
|
||||
int iend; /* length of data stored in acline */
|
||||
int telnetState; /* state for telnet negotiations */
|
||||
unsigned short autoReUp; /* is it coming back up automatically? */
|
||||
FLAG downHard; /* did it go down unexpectedly? */
|
||||
unsigned short nolog; /* don't log output */
|
||||
unsigned short fup; /* we setup this line? */
|
||||
unsigned short fronly; /* we can only read this console */
|
||||
|
||||
/*** list management ***/
|
||||
struct client *pCLon; /* clients on this console */
|
||||
struct client *pCLwr; /* client that is writting on console */
|
||||
CONSENTUSERS *rw; /* rw users */
|
||||
CONSENTUSERS *ro; /* ro users */
|
||||
struct consent *pCEnext; /* next console entry */
|
||||
} CONSENT;
|
||||
|
||||
struct hostcache {
|
||||
STRING hostname;
|
||||
struct hostcache *next;
|
||||
};
|
||||
typedef struct remote { /* console at another host */
|
||||
struct remote *pRCnext; /* next remote console we know about */
|
||||
struct remote *pRCuniq; /* list of uniq remote servers */
|
||||
char *rserver; /* remote server name */
|
||||
char *rhost; /* remote host to call to get it */
|
||||
NAMES *aliases; /* aliases for remote server name */
|
||||
} REMOTE;
|
||||
|
||||
extern PARITY *FindParity PARAMS((char *));
|
||||
extern BAUD *FindBaud PARAMS((char *));
|
||||
extern void ConsInit PARAMS((CONSENT *, fd_set *, short));
|
||||
extern void ConsDown PARAMS((CONSENT *, fd_set *, short));
|
||||
extern int CheckHostCache PARAMS((const char *));
|
||||
extern void AddHostCache PARAMS((const char *));
|
||||
extern void ClearHostCache PARAMS((void));
|
||||
extern void ClearHostCache PARAMS((void));
|
||||
extern void ConsInit PARAMS((CONSENT *));
|
||||
extern void ConsDown PARAMS((CONSENT *, FLAG, FLAG));
|
||||
extern REMOTE *FindUniq PARAMS((REMOTE *));
|
||||
extern void DestroyRemoteConsole PARAMS((REMOTE *));
|
||||
extern void StartInit PARAMS((CONSENT *));
|
||||
extern void StopInit PARAMS((CONSENT *));
|
||||
|
@ -1,24 +1,41 @@
|
||||
.\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine
|
||||
.\" $Id: conserver.man,v 1.32 2003-04-08 14:05:59-07 bryan Exp $
|
||||
.TH CONSERVER 8 "Local"
|
||||
.\" $Id: conserver.man,v 1.46 2004/04/13 18:19:26 bryan Exp $
|
||||
.TH CONSERVER 8 "2004/04/13" "conserver-8.1.4" "conserver"
|
||||
.SH NAME
|
||||
conserver \- console server daemon
|
||||
.SH SYNOPSIS
|
||||
\fBconserver\fP [\fB\-7dDEFhinoRuvV\fP] [\fB\-a\fP \fItype\fP]
|
||||
[\fB\-m\fP \fImax\fP]
|
||||
[\fB\-M\fP \fIaddr\fP] [\fB\-p\fP \fIport\fP] [\fB\-b\fP \fIport\fP]
|
||||
[\fB\-c\fP \fIcred\fP] [\fB\-C\fP \fIconfig\fP] [\fB\-P\fP \fIpasswd\fP]
|
||||
[\fB\-L\fP \fIlogfile\fP] [\fB\-O\fP \fImin\fP]
|
||||
.B conserver
|
||||
.RB [ \-7dDEFhinoRSuvV ]
|
||||
.RB [ \-a
|
||||
.IR type ]
|
||||
.RB [ \-m
|
||||
.IR max ]
|
||||
.RB [ \-M
|
||||
.IR master ]
|
||||
.RB [ \-p
|
||||
.IR port ]
|
||||
.RB [ \-b
|
||||
.IR port ]
|
||||
.RB [ \-c
|
||||
.IR cred ]
|
||||
.RB [ \-C
|
||||
.IR config ]
|
||||
.RB [ \-P
|
||||
.IR passwd ]
|
||||
.RB [ \-L
|
||||
.IR logfile ]
|
||||
.RB [ \-O
|
||||
.IR min ]
|
||||
.RB [ \-U
|
||||
.IR logfile ]
|
||||
.SH DESCRIPTION
|
||||
.B Conserver
|
||||
is the daemon that manages
|
||||
remote access to system consoles by multiple users via the
|
||||
.BR console (1)
|
||||
client program
|
||||
and logs all console output.
|
||||
It can connect to consoles via local serial ports
|
||||
or terminal servers that allow network access,
|
||||
or to any external program.
|
||||
client program and logs all console output.
|
||||
It can connect to consoles via local serial ports, terminal
|
||||
servers that allow network access, or to any external program.
|
||||
.PP
|
||||
When started,
|
||||
.B conserver
|
||||
@ -28,112 +45,156 @@ file for details of each console it should manage,
|
||||
including serial port or network parameters and logging options.
|
||||
(Also, in environments where multiple servers share a cf file,
|
||||
any server is able to refer clients to the particular server
|
||||
managing a requested console,
|
||||
so that the client need not have knowledge of the
|
||||
distribution of consoles among servers.)
|
||||
managing a requested console, so that the client need not have
|
||||
knowledge of the distribution of consoles among servers.)
|
||||
.B Conserver
|
||||
forks a child for each group of consoles it must manage
|
||||
and assigns each process a port number to listen on.
|
||||
The maximum number of consoles managed by each child process is set using
|
||||
\fB-m\fP option.
|
||||
The maximum number of consoles managed by each child process is set using the
|
||||
.B \-m
|
||||
option.
|
||||
The
|
||||
.BR console (1)
|
||||
client program communicates with the master console server process to find
|
||||
the port (and host, in a multi-server configuration)
|
||||
on which the appropriate child is listening.
|
||||
The master conserver process forks a new process to handle each
|
||||
incoming client connection (which should be very short-lived, since it's
|
||||
duty is to redirect the client to a child).
|
||||
.B Conserver
|
||||
restricts connections from clients based on the host access section of its
|
||||
.BR conserver.cf (5)
|
||||
and authenticates users against its
|
||||
file, restricts users based on the console access lists of the
|
||||
.BR conserver.cf (5)
|
||||
file, and authenticates
|
||||
users against its
|
||||
.BR conserver.passwd (5)
|
||||
file.
|
||||
.B Conserver
|
||||
can also restrict clients using the tcp-wrappers package (enabled
|
||||
using \fB--with-libwrap\fP). This authentication is done before consulting
|
||||
using
|
||||
.BR --with-libwrap ).
|
||||
This authentication is done before consulting
|
||||
the
|
||||
.BR conserver.cf (5)
|
||||
access list.
|
||||
.PP
|
||||
.B Conserver
|
||||
completely controls any connection to a controlled host.
|
||||
All escape sequences given by the user to \fBconsole\fP
|
||||
are passed to the server without interpretation.
|
||||
The server recognizes and processes all escape sequences,
|
||||
except the suspend sequence, which is
|
||||
recognized by the server and
|
||||
sent as a TCP out-of-band command from the server to the client.
|
||||
When Unix domain sockets are used between the client and
|
||||
server (enabled using
|
||||
.BR --with-uds ),
|
||||
authentication checks are done on the hardcoded address ``127.0.0.1''.
|
||||
Automatic client redirection is also disabled (as if the
|
||||
.B \-R
|
||||
option was used) since the client cannot communicate with remote servers.
|
||||
The directory used to hold the sockets is checked to make sure it's empty
|
||||
when the server starts.
|
||||
The server will
|
||||
.B not
|
||||
remove any files in the directory itself, just in case the directory is
|
||||
accidentally specified as ``/etc'' or some other critical location.
|
||||
The server will do it's best to remove all the sockets when it shuts down,
|
||||
but it could stop ungracefully (crash, ``kill -9'', etc)
|
||||
and leave files behind.
|
||||
It's would then be up to the admin (or a creative startup script) to clean
|
||||
up the directory before the server will start again.
|
||||
.PP
|
||||
The \fBconserver\fP parent process will automatically respawn any child
|
||||
process that dies. The following signals are propagated by the parent
|
||||
process to its children.
|
||||
.TP
|
||||
.B Conserver
|
||||
completely controls any connection to a console.
|
||||
All escape sequences given by the user to
|
||||
.B console
|
||||
are passed to the server without interpretation.
|
||||
The server recognizes and processes all escape sequences.
|
||||
.PP
|
||||
The
|
||||
.B conserver
|
||||
parent process will automatically respawn any child process that dies.
|
||||
The following signals are propagated by the parent process to its children.
|
||||
.TP 10
|
||||
SIGTERM
|
||||
Close all connections and exit.
|
||||
.TP
|
||||
SIGHUP
|
||||
Reread the configuration file. New consoles are managed by
|
||||
forking off new childen, deleted consoles (and their clients) are dropped,
|
||||
Reread the configuration file.
|
||||
New consoles are managed by forking off new children, deleted
|
||||
consoles (and their clients) are dropped,
|
||||
and changes to consoles are done "in place", resetting the console
|
||||
port (bringing it down and up) only when necessary. The console name is
|
||||
used to determine when consoles have been added/removed/changed. All
|
||||
actions performed by SIGUSR2 are also performed.
|
||||
port (bringing it down and up) only when necessary.
|
||||
The console name is used to determine when consoles
|
||||
have been added/removed/changed.
|
||||
All actions performed by SIGUSR2 are also performed.
|
||||
.TP
|
||||
SIGUSR1
|
||||
Try to connect to any consoles marked as
|
||||
down. This can come in handy if you had a terminal server (or more)
|
||||
Try to connect to any consoles marked as down.
|
||||
This can come in handy if you had a terminal server (or more)
|
||||
that wasn't accepting connections at startup and you want
|
||||
\fBconserver\fP to try to reconnect to all those downed ports.
|
||||
.B conserver
|
||||
to try to reconnect to all those downed ports.
|
||||
.TP
|
||||
SIGUSR2
|
||||
Close and reopen all console logfiles
|
||||
and, if in daemon mode (\fB\-d\fP option),
|
||||
the error logfile (see the \fB\-L\fP option). All actions performed by
|
||||
SIGUSR1 are also performed.
|
||||
and, if in daemon mode
|
||||
.RB ( \-d
|
||||
option), the error logfile (see the
|
||||
.BR \-L
|
||||
option).
|
||||
All actions performed by SIGUSR1 are also performed.
|
||||
.PP
|
||||
Slave hosts which have no current
|
||||
.BR console (1)
|
||||
Consoles which have no current client
|
||||
connection might produce important error messages.
|
||||
With the \fB\-u\fP option, these unloved errors are labeled with a machine name
|
||||
With the
|
||||
.B \-u
|
||||
option, these ``unloved'' errors are labeled with a machine name
|
||||
and output on stdout (or, in daemon mode, to the logfile).
|
||||
This allows a live operator or an automated log scanner
|
||||
to find otherwise unseen errors by watching in a single location.
|
||||
.PP
|
||||
\fBConserver\fP must be run as root if it is to bind to a port under
|
||||
1024 or if it must read protected password files (like shadow passwords)
|
||||
.B Conserver
|
||||
must be run as root if it is to bind to a port under 1024 or if it
|
||||
must read protected password files (like shadow passwords)
|
||||
for authentication (see
|
||||
.BR conserver.passwd (5)).
|
||||
Otherwise, it may be run by any user, with \fB\-p\fP used to specify
|
||||
a port above 1024.
|
||||
Otherwise, it may be run by any user, with
|
||||
.B \-p
|
||||
used to specify a port above 1024.
|
||||
.PP
|
||||
If encryption has been built into the code (\fB--with-openssl\fP),
|
||||
If encryption has been built into the code
|
||||
.RB ( --with-openssl ),
|
||||
encrypted client connections (without certificate exchanges) happen
|
||||
by default. To add certificate exchanges, use the \fB-c\fP option with
|
||||
the client and server. For authentication of the certificates to work,
|
||||
by default.
|
||||
To add certificate exchanges, use the
|
||||
.B \-c
|
||||
option with the client and server.
|
||||
For authentication of the certificates to work,
|
||||
the signing certificate must be properly trusted, which usually means
|
||||
the public portion is in \fIOPENSSL_ROOT\fP\fB/ssl/certs\fP (on both
|
||||
the client and server sides). See the sample self-signing certficate
|
||||
making script \fBcontrib/maketestcerts\fP for further clues. To allow
|
||||
the public portion is in
|
||||
.IB OPENSSL_ROOT /ssl/certs
|
||||
(on both the client and server sides).
|
||||
See the sample self-signing certificate making script
|
||||
.B contrib/maketestcerts
|
||||
for further clues.
|
||||
To allow
|
||||
non-encrypted client connections (in addition to encrypted client
|
||||
connections), use the \fB-E\fP option.
|
||||
connections), use the
|
||||
.B \-E
|
||||
option.
|
||||
.SH OPTIONS
|
||||
.PP
|
||||
Options may be given as separate arguments (e.g., \fB\-n -d\fP)
|
||||
or clustered (e.g., \fB\-nd\fP).
|
||||
Options may be given as separate arguments (e.g.,
|
||||
.B \-n
|
||||
.BR \-d )
|
||||
or clustered (e.g.,
|
||||
.BR \-nd ).
|
||||
Options and their arguments may be separated by optional white space.
|
||||
Option arguments containing spaces or other characters special to the shell
|
||||
must be quoted.
|
||||
.TP
|
||||
.TP 12
|
||||
.B \-7
|
||||
Strip the high bit off of all data received,
|
||||
whether from the \fBconsole\fP client or from the console device,
|
||||
before any processing occurs.
|
||||
whether from the
|
||||
.B console
|
||||
client or from the console device, before any processing occurs.
|
||||
.TP
|
||||
.BI \-a type
|
||||
Set the default access type for incoming connections from
|
||||
\fBconsole\fP clients:
|
||||
.B console
|
||||
clients:
|
||||
.RB ` r '
|
||||
for refused (the default),
|
||||
.RB ` a '
|
||||
@ -146,43 +207,60 @@ the access section of
|
||||
.TP
|
||||
.BI \-b port
|
||||
Set the base port for children to listen on.
|
||||
Each child starts looking for free ports at \fIport\fP
|
||||
Each child starts looking for free ports at
|
||||
.I port
|
||||
and working upward, trying a maximum number of ports
|
||||
equal to twice the maximum number of groups.
|
||||
If no free ports are available in that range,
|
||||
\fBconserver\fP exits.
|
||||
By default, \fBconserver\fP lets the operating system choose
|
||||
a free port.
|
||||
.B conserver
|
||||
exits.
|
||||
By default,
|
||||
.B conserver
|
||||
lets the operating system choose a free port.
|
||||
.TP
|
||||
.BI \-c cred
|
||||
Load an SSL certificate and key from the PEM encoded file \fIcred\fP.
|
||||
Load an SSL certificate and key from the PEM encoded file
|
||||
.IR cred .
|
||||
.TP
|
||||
.BI \-C config
|
||||
Read configuration information from the file \fIconfig\fP.
|
||||
The default \fIconfig\fP may be changed at compile time using the
|
||||
\fB--with-cffile\fP option.
|
||||
Read configuration information from the file
|
||||
.IR config .
|
||||
The default
|
||||
.I config
|
||||
may be changed at compile time using the
|
||||
.B --with-cffile
|
||||
option.
|
||||
.TP
|
||||
.B \-d
|
||||
Become a daemon. Disconnects from the controlling terminal and sends
|
||||
all output to the logfile (see \fB\-L\fP).
|
||||
Become a daemon.
|
||||
Disconnects from the controlling terminal and sends
|
||||
all output (including any debug output) to the logfile (see
|
||||
.BR \-L ).
|
||||
.TP
|
||||
.B \-D
|
||||
Enable debugging output, sent to stderr. Multiple \fB-D\fP options
|
||||
increases debug output.
|
||||
Enable debugging output, sent to stderr.
|
||||
Multiple
|
||||
.B \-D
|
||||
options increases debug output.
|
||||
.TP
|
||||
.B \-E
|
||||
If encryption has been built into the code (\fB--with-openssl\fP),
|
||||
encrypted client connections are a requirement. This option allows
|
||||
non-encrypted clients (as well as encrypted clients) to connect to
|
||||
consoles.
|
||||
If encryption has been built into the code
|
||||
.RB ( --with-openssl ),
|
||||
encrypted client connections are a requirement.
|
||||
This option allows non-encrypted clients (as well as encrypted clients) to
|
||||
connect to consoles.
|
||||
.TP
|
||||
.B \-F
|
||||
Do not automatically reinitialize failed (unexpectedly closed)
|
||||
consoles. If the console is a program (`|' syntax) and it closes
|
||||
with a zero exit status, the console is reinitialized regardless
|
||||
of this option. Without this option, a console is immediately reopened,
|
||||
Do not automatically reinitialize failed (unexpectedly closed) consoles.
|
||||
If the console is a program (`|' syntax) and it closes with a zero
|
||||
exit status, the console is reinitialized regardless of this option.
|
||||
Without this option, a console is immediately reopened,
|
||||
and if that fails, retried every minute until successful.
|
||||
This option has no effect on the \fB-o\fP and \fB-O\fP options.
|
||||
This option has no effect on the
|
||||
.B \-o
|
||||
and
|
||||
.B \-O
|
||||
options.
|
||||
.TP
|
||||
.B \-h
|
||||
Output a brief help message.
|
||||
@ -191,24 +269,43 @@ Output a brief help message.
|
||||
Initiate console connections on demand (and close them when not used).
|
||||
.TP
|
||||
.BI \-L logfile
|
||||
Log errors and informational messages to \fIlogfile\fP
|
||||
after startup in daemon mode (\fB\-d\fP).
|
||||
Log errors and informational messages to
|
||||
.I logfile
|
||||
after startup in daemon mode
|
||||
.RB ( \-d ).
|
||||
This option does not apply when not running in daemon mode.
|
||||
The default \fIlogfile\fP may be changed at compile time using the
|
||||
\fB--with-logfile\fP option.
|
||||
The default
|
||||
.I logfile
|
||||
may be changed at compile time using the
|
||||
.B --with-logfile
|
||||
option.
|
||||
.TP
|
||||
.BI \-m max
|
||||
Set the maximum consoles managed per process.
|
||||
The default \fImax\fP may be changed at compile time using the
|
||||
\fB--with-maxmemb\fP option.
|
||||
The default
|
||||
.I max
|
||||
may be changed at compile time using the
|
||||
.B --with-maxmemb
|
||||
option.
|
||||
.TP
|
||||
.BI \-M addr
|
||||
Set the address to listen on. This allows conserver to bind to a
|
||||
.BI \-M master
|
||||
Normally, this allows conserver to bind to a
|
||||
particular IP address (like `127.0.0.1') instead of all interfaces.
|
||||
The default is to bind to all addresses.
|
||||
However, if
|
||||
.B --with-uds
|
||||
was used to enable Unix domain sockets for client/server communication,
|
||||
this points conserver to the directory where it should store the sockets.
|
||||
The default
|
||||
.IR master
|
||||
directory, ``/tmp/conserver'',
|
||||
may be changed at compile time using the
|
||||
.B --with-uds
|
||||
option.
|
||||
.TP
|
||||
.B \-n
|
||||
Obsolete (now a no-op); see \fB\-u\fP.
|
||||
Obsolete (now a no-op); see
|
||||
.BR \-u .
|
||||
.TP
|
||||
.B \-o
|
||||
Normally, a client connecting to a ``downed'' console does just that.
|
||||
@ -216,45 +313,148 @@ Using this option, the server will automatically attempt to open
|
||||
(``bring up'') the console when the client connects.
|
||||
.TP
|
||||
.BI \-O min
|
||||
Enable periodic attempts (every \fImin\fP minutes) to open (``bring up'')
|
||||
all downed consoles (similar to sending a SIGUSR1).
|
||||
Enable periodic attempts (every
|
||||
.I min
|
||||
minutes) to open (``bring up'') all downed
|
||||
consoles (similar to sending a SIGUSR1).
|
||||
.TP
|
||||
.BI \-p port
|
||||
Set the TCP port for the master process to listen on.
|
||||
This may be either a port number or a service name.
|
||||
The default \fIport\fP, ``conserver'' (typically 782),
|
||||
may be changed at compile time using the \fB--with-port\fP option.
|
||||
The default
|
||||
.IR port ,
|
||||
``conserver'' (typically 782),
|
||||
may be changed at compile time using the
|
||||
.B --with-port
|
||||
option.
|
||||
If the
|
||||
.B --with-uds
|
||||
option was used, this option is ignored.
|
||||
.TP
|
||||
.BI \-P passwd
|
||||
Read the table of authorized user data from the file \fIpasswd\fP.
|
||||
The default \fIpasswd\fP may be changed at compile time using the
|
||||
\fB--with-pwdfile\fP option.
|
||||
Read the table of authorized user data from the file
|
||||
.IR passwd .
|
||||
The default
|
||||
.I passwd
|
||||
may be changed at compile time using the
|
||||
.B --with-pwdfile
|
||||
option.
|
||||
.TP
|
||||
.B \-R
|
||||
Disable automatic client redirection to other conserver hosts. This
|
||||
means informational commands like \fB-w\fP and \fB-i\fP will only show
|
||||
the status of the local conserver host and attempts to connect to
|
||||
remote consoles will result in an informative message to the user.
|
||||
Disable automatic client redirection to other conserver hosts.
|
||||
This
|
||||
means informational commands like
|
||||
.B \-w
|
||||
and
|
||||
.B \-i
|
||||
will only show the status of the local conserver host and attempts to
|
||||
connect to remote consoles will result in an informative message to the user.
|
||||
.TP
|
||||
.B \-S
|
||||
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.
|
||||
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
|
||||
.B \-u
|
||||
Send unloved console output to \fBconserver\fP's stdout
|
||||
(which, in daemon mode, is redirected to the logfile).
|
||||
Send unloved console output to
|
||||
.BR conserver 's
|
||||
stdout (which, in daemon mode, is redirected to the logfile).
|
||||
This applies to all consoles to which no user is attached,
|
||||
independent of whether logging of individual consoles is enabled
|
||||
via \fBconserver.cf\fP entries.
|
||||
independent of whether logging of individual consoles is enabled via
|
||||
.B conserver.cf
|
||||
entries.
|
||||
.TP
|
||||
.BI \-U logfile
|
||||
Copy all console data to the ``unified''
|
||||
.IR logfile .
|
||||
The output is the same as the
|
||||
.B \-u
|
||||
output, but all consoles, not
|
||||
just those without a user, are logged.
|
||||
Each line of output is prefixed with the console name.
|
||||
If a user is attached read/write, a `*' is appended to the console name,
|
||||
to allow log watching utilites to ignore potential user-introduced alarms.
|
||||
.TP
|
||||
.B \-v
|
||||
Echo the configuration as it is being read (be verbose).
|
||||
.TP
|
||||
.B \-V
|
||||
Output the version number and settings of the \fBconserver\fP
|
||||
Output the version number and settings of the
|
||||
.B conserver
|
||||
program and then exit.
|
||||
.SH PROTOCOL
|
||||
.PP
|
||||
The protocol used to interact with the
|
||||
.B conserver
|
||||
daemon has two basic styles.
|
||||
The first style is the initial line-based mode, which occurs before
|
||||
connecting to a console.
|
||||
The second style is the character-based, escape-sequence mode, while
|
||||
connected to a console.
|
||||
.PP
|
||||
The initial line-based mode begins the same for both the master process
|
||||
and it's children.
|
||||
Upon a successful (non-rejected) client connection, an ``ok'' is sent.
|
||||
The client then issues a command and the server responds to it with a
|
||||
result string (``ok'' being the sign of success for most commands).
|
||||
The commands available are ``help'', ``ssl'' (if
|
||||
SSL was built into the code), ``login'', and ``exit''.
|
||||
Using the ``login'' command, the client authenticates and gains access to
|
||||
the extended command set.
|
||||
This is where the master process and it's children differ.
|
||||
The master process gives the client access to global commands, and the
|
||||
child provides commands for interacting with the consoles it manages.
|
||||
The ``help'' command, in both cases, will provide a complete
|
||||
list of commands and a short description of what they do.
|
||||
.PP
|
||||
The second, character-based, style of interaction occurs when the client
|
||||
issues the ``call'' command with a child process.
|
||||
This command connects the client to a console and, at that point, relays
|
||||
all traffic between the client and the console.
|
||||
There is no more command-based interaction between the client and the server,
|
||||
any interaction with the server is done with the default escape sequence.
|
||||
.PP
|
||||
This is, by no means, a complete description of the entire client/server
|
||||
interaction.
|
||||
It is, however, a brief explanation in order to give a idea of
|
||||
what the program does.
|
||||
.SH FILES
|
||||
.PP
|
||||
The following default file locations may be overridden
|
||||
at compile time or by the command-line options described above.
|
||||
Run \fBconserver \-V\fP (with no other options) to see
|
||||
the defaults set at compile time.
|
||||
Run
|
||||
.B conserver \-V
|
||||
(with no other options) to see the defaults set at compile time.
|
||||
.PP
|
||||
.PD 0
|
||||
.TP 25
|
||||
@ -272,20 +472,17 @@ the master conserver process ID
|
||||
.TP
|
||||
.B /var/log/conserver
|
||||
log of errors and informational messages
|
||||
.TP
|
||||
.B /tmp/conserver
|
||||
directory to hold Unix domain sockets (if enabled)
|
||||
.PD
|
||||
.PP
|
||||
Additionally, output from individual consoles may be logged
|
||||
to separate files specified in
|
||||
.BR conserver.cf (5).
|
||||
.SH BUGS
|
||||
SSL encryption only occurs when connecting to a single console, not
|
||||
on all client/server activity. The \fB-q\fP/\fB-Q\fP quit command will
|
||||
pass the root password in the clear. Other info-type
|
||||
options (like \fB-i\fP, \fB-w\fP, etc)
|
||||
are all sent unencrypted as well. This should be fixed soon.
|
||||
.PP
|
||||
I'm sure there are more, I just don't know where they are. Please
|
||||
let me know if you find any.
|
||||
I'm sure there are bugs, I just don't know where they are.
|
||||
Please let me know if you find any.
|
||||
.SH AUTHORS
|
||||
Thomas A. Fine, Ohio State Computer Science
|
||||
.br
|
||||
|
@ -1,4 +0,0 @@
|
||||
bryan:r71mXjfALB5Ak:any
|
||||
djs:r71mXjfALB5Ak:login
|
||||
chogan:*passwd*:foobar,login,shell
|
||||
hogan:*passwd*:any
|
511
conserver/convert.c
Normal file
511
conserver/convert.c
Normal file
@ -0,0 +1,511 @@
|
||||
/*
|
||||
* $Id: convert.c,v 1.8 2003/11/20 13:56:38 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||
*
|
||||
* Copyright GNAC, Inc., 1998
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990 The Ohio State University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that: (1) source distributions retain this entire copyright
|
||||
* notice and comment, and (2) distributions including binaries display
|
||||
* the following acknowledgement: ``This product includes software
|
||||
* developed by The Ohio State University and its contributors''
|
||||
* in the documentation or other materials provided with the distribution
|
||||
* and in all advertising materials mentioning features or use of this
|
||||
* software. Neither the name of the University nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
/*
|
||||
* Network console modifications by Robert Olson, olson@mcs.anl.gov.
|
||||
*/
|
||||
|
||||
#include <compat.h>
|
||||
|
||||
#include <cutil.h>
|
||||
#include <consent.h>
|
||||
#include <client.h>
|
||||
#include <group.h>
|
||||
#include <access.h>
|
||||
#include <readcfg.h>
|
||||
#include <master.h>
|
||||
#include <main.h>
|
||||
|
||||
|
||||
void
|
||||
DestroyDataStructures()
|
||||
{
|
||||
}
|
||||
|
||||
char *
|
||||
#if PROTOTYPES
|
||||
ReadLine2(FILE *fp, STRING *save, int *iLine)
|
||||
#else
|
||||
ReadLine2(fp, save, iLine)
|
||||
FILE *fp;
|
||||
STRING *save;
|
||||
int *iLine;
|
||||
#endif
|
||||
{
|
||||
static char buf[1024];
|
||||
char *wholeline = (char *)0;
|
||||
char *ret = (char *)0;
|
||||
int i, buflen, peek, commentCheck = 1, comment = 0;
|
||||
static STRING *bufstr = (STRING *)0;
|
||||
static STRING *wholestr = (STRING *)0;
|
||||
|
||||
if (bufstr == (STRING *)0)
|
||||
bufstr = AllocString();
|
||||
if (wholestr == (STRING *)0)
|
||||
wholestr = AllocString();
|
||||
peek = 0;
|
||||
wholeline = (char *)0;
|
||||
BuildString((char *)0, bufstr);
|
||||
BuildString((char *)0, wholestr);
|
||||
while (save->used || ((ret = fgets(buf, sizeof(buf), fp)) != (char *)0)
|
||||
|| peek) {
|
||||
/* If we have a previously saved line, use it instead */
|
||||
if (save->used) {
|
||||
strcpy(buf, save->string);
|
||||
BuildString((char *)0, save);
|
||||
}
|
||||
|
||||
if (peek) {
|
||||
/* End of file? Never mind. */
|
||||
if (ret == (char *)0)
|
||||
break;
|
||||
|
||||
/* If we don't have a line continuation and we've seen
|
||||
* some worthy data
|
||||
*/
|
||||
if (!isspace((int)buf[0]) && (wholeline != (char *)0)) {
|
||||
BuildString((char *)0, save);
|
||||
BuildString(buf, save);
|
||||
break;
|
||||
}
|
||||
|
||||
peek = 0;
|
||||
}
|
||||
|
||||
if (commentCheck) {
|
||||
for (i = 0; buf[i] != '\000'; i++)
|
||||
if (!isspace((int)buf[i]))
|
||||
break;
|
||||
if (buf[i] == '#') {
|
||||
comment = 1;
|
||||
commentCheck = 0;
|
||||
} else if (buf[i] != '\000') {
|
||||
commentCheck = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for EOL */
|
||||
buflen = strlen(buf);
|
||||
if ((buflen >= 1) && (buf[buflen - 1] == '\n')) {
|
||||
(*iLine)++; /* Finally have a whole line */
|
||||
/* if (comment == 0 && commentCheck == 0) { */
|
||||
/* Finish off the chunk without the \n */
|
||||
buf[buflen - 1] = '\000';
|
||||
BuildString(buf, bufstr);
|
||||
wholeline = BuildString(bufstr->string, wholestr);
|
||||
/* }*/
|
||||
peek = 1;
|
||||
comment = 0;
|
||||
commentCheck = 1;
|
||||
BuildString((char *)0, bufstr);
|
||||
} else {
|
||||
/* Save off the partial chunk */
|
||||
BuildString(buf, bufstr);
|
||||
}
|
||||
}
|
||||
|
||||
/* If we hit the EOF and weren't peeking ahead
|
||||
* and it's not a comment
|
||||
*/
|
||||
/*
|
||||
if (!peek && (ret == (char *)0) && (comment == 0) &&
|
||||
(commentCheck == 0)) {
|
||||
*/
|
||||
if (!peek && (ret == (char *)0)) {
|
||||
(*iLine)++;
|
||||
wholeline = BuildString(bufstr->string, wholestr);
|
||||
if (wholeline[0] == '\000')
|
||||
wholeline = (char *)0;
|
||||
}
|
||||
|
||||
CONDDEBUG((1, "ReadLine2(): returning <%s>",
|
||||
(wholeline != (char *)0) ? wholeline : "<NULL>"));
|
||||
return wholeline;
|
||||
}
|
||||
|
||||
/* read in the configuration file, fill in all the structs we use (ksb)
|
||||
* to manage the consoles
|
||||
*/
|
||||
void
|
||||
#if PROTOTYPES
|
||||
ReadCfg(char *pcFile, FILE *fp)
|
||||
#else
|
||||
ReadCfg(pcFile, fp)
|
||||
char *pcFile;
|
||||
FILE *fp;
|
||||
#endif
|
||||
{
|
||||
int iLine;
|
||||
unsigned char *acIn;
|
||||
static STRING *acInSave = (STRING *)0;
|
||||
char *acStart;
|
||||
static STRING *logDirectory = (STRING *)0;
|
||||
static STRING *defMark = (STRING *)0;
|
||||
int sawACL = 0;
|
||||
int printedFull = 0;
|
||||
|
||||
if (defMark == (STRING *)0)
|
||||
defMark = AllocString();
|
||||
if (logDirectory == (STRING *)0)
|
||||
logDirectory = AllocString();
|
||||
if (acInSave == (STRING *)0)
|
||||
acInSave = AllocString();
|
||||
BuildString((char *)0, defMark);
|
||||
BuildString((char *)0, acInSave);
|
||||
BuildString((char *)0, logDirectory);
|
||||
|
||||
iLine = 0;
|
||||
while ((acIn =
|
||||
(unsigned char *)ReadLine2(fp, acInSave,
|
||||
&iLine)) != (unsigned char *)0) {
|
||||
char *pcLine, *pcMode, *pcLog, *pcRem, *pcStart, *pcMark, *pcBreak;
|
||||
char *pcColon;
|
||||
|
||||
acStart = PruneSpace((char *)acIn);
|
||||
if (acStart[0] == '#') {
|
||||
printf("%s\n", acStart);
|
||||
continue;
|
||||
}
|
||||
if (printedFull == 0) {
|
||||
printf("default full {\n\trw *;\n}\n");
|
||||
printedFull = 1;
|
||||
}
|
||||
|
||||
if ('%' == acStart[0] && '%' == acStart[1] && '\000' == acStart[2]) {
|
||||
break;
|
||||
}
|
||||
if ((char *)0 != (pcLine = strchr(acStart, '=')) &&
|
||||
((char *)0 == (pcColon = strchr(acStart, ':')) ||
|
||||
pcColon > pcLine)) {
|
||||
*pcLine++ = '\000';
|
||||
acStart = PruneSpace(acStart);
|
||||
pcLine = PruneSpace(pcLine);
|
||||
if (0 == strcmp(acStart, "LOGDIR")) {
|
||||
BuildString((char *)0, logDirectory);
|
||||
BuildString(pcLine, logDirectory);
|
||||
printf("default * {\n");
|
||||
if (logDirectory->used > 1)
|
||||
printf("\tlogfile %s/&;\n", logDirectory->string);
|
||||
else
|
||||
printf("\tlogfile \"\";\n");
|
||||
if (defMark->used > 1)
|
||||
printf("\ttimestamp %s;\n", defMark->string);
|
||||
else
|
||||
printf("\ttimestamp \"\";\n");
|
||||
printf("\tinclude full;\n}\n");
|
||||
} else if (0 == strcmp(acStart, "TIMESTAMP")) {
|
||||
BuildString((char *)0, defMark);
|
||||
BuildString(pcLine, defMark);
|
||||
printf("default * {\n");
|
||||
if (logDirectory->used > 1)
|
||||
printf("\tlogfile %s/&;\n", logDirectory->string);
|
||||
else
|
||||
printf("\tlogfile \"\";\n");
|
||||
if (defMark->used > 1)
|
||||
printf("\ttimestamp %s;\n", defMark->string);
|
||||
else
|
||||
printf("\ttimestamp \"\";\n");
|
||||
printf("\tinclude full;\n}\n");
|
||||
} else if (0 == strcmp(acStart, "DOMAINHACK")) {
|
||||
} else if (0 == strncmp(acStart, "BREAK", 5) &&
|
||||
acStart[5] >= '1' && acStart[5] <= '9' &&
|
||||
acStart[6] == '\000') {
|
||||
CONDDEBUG((1, "ReadCfg(): BREAK%c found with `%s'",
|
||||
acStart[5], pcLine));
|
||||
if (pcLine[0] == '\000') {
|
||||
printf("break %c {\n\tstring \"\";\n}\n", acStart[5]);
|
||||
} else {
|
||||
char *q, *p;
|
||||
p = pcLine;
|
||||
BuildTmpString((char *)0);
|
||||
while ((q = strchr(p, '"')) != (char *)0) {
|
||||
*q = '\000';
|
||||
BuildTmpString(p);
|
||||
BuildTmpString("\\\"");
|
||||
p = q + 1;
|
||||
*q = '"';
|
||||
}
|
||||
q = BuildTmpString(p);
|
||||
printf("break %c {\n\tstring \"%s\";\n}\n", acStart[5],
|
||||
q);
|
||||
}
|
||||
} else {
|
||||
Error("%s(%d) unknown variable `%s'", pcFile, iLine,
|
||||
acStart);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ((char *)0 == (pcLine = strchr(acStart, ':')) ||
|
||||
(char *)0 == (pcMode = strchr(pcLine + 1, ':')) ||
|
||||
(char *)0 == (pcLog = strchr(pcMode + 1, ':'))) {
|
||||
Error("%s(%d) bad config line `%s'", pcFile, iLine, acIn);
|
||||
continue;
|
||||
}
|
||||
*pcLine++ = '\000';
|
||||
*pcMode++ = '\000';
|
||||
*pcLog++ = '\000';
|
||||
|
||||
acStart = PruneSpace(acStart);
|
||||
pcLine = PruneSpace(pcLine);
|
||||
pcMode = PruneSpace(pcMode);
|
||||
pcLog = PruneSpace(pcLog);
|
||||
|
||||
if ((char *)0 != (pcMark = strchr(pcLog, ':'))) {
|
||||
*pcMark++ = '\000';
|
||||
pcLog = PruneSpace(pcLog);
|
||||
pcMark = PruneSpace(pcMark);
|
||||
/* Skip null intervals */
|
||||
if (pcMark[0] == '\000')
|
||||
pcMark = (char *)0;
|
||||
}
|
||||
|
||||
if ((char *)0 == pcMark) {
|
||||
pcBreak = (char *)0;
|
||||
} else {
|
||||
if ((char *)0 != (pcBreak = strchr(pcMark, ':'))) {
|
||||
*pcBreak++ = '\000';
|
||||
pcMark = PruneSpace(pcMark);
|
||||
pcBreak = PruneSpace(pcBreak);
|
||||
/* Ignore null specs */
|
||||
if (pcMark[0] == '\000')
|
||||
pcMark = (char *)0;
|
||||
if (pcBreak[0] == '\000')
|
||||
pcBreak = (char *)0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((char *)0 != (pcRem = strchr(pcLine, '@'))) {
|
||||
*pcRem++ = '\000';
|
||||
pcLine = PruneSpace(pcLine);
|
||||
pcRem = PruneSpace(pcRem);
|
||||
}
|
||||
|
||||
printf("console %s {\n", acStart);
|
||||
if (pcRem == (char *)0) {
|
||||
printf("\tmaster localhost;\n");
|
||||
} else {
|
||||
printf("\tmaster %s;\n", pcRem);
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we substitute the console name for any '&' character in the
|
||||
* logfile name. That way you can just have something like
|
||||
* "/var/console/&" for each of the conserver.cf entries.
|
||||
*/
|
||||
if (pcLog[0] == '&' && pcLog[1] == '\000' &&
|
||||
logDirectory->used > 1) {
|
||||
/* special case where logfile name is '&' and the LOGDIR was
|
||||
* seen above. in this case we just allow inheritance to
|
||||
* work it's magic.
|
||||
*/
|
||||
} else if (pcLog[0] == '\000') {
|
||||
printf("\tlogfile \"\";\n");
|
||||
} else {
|
||||
STRING *lfile;
|
||||
lfile = AllocString();
|
||||
BuildString((char *)0, lfile);
|
||||
pcStart = pcLog;
|
||||
BuildString(pcStart, lfile);
|
||||
if (logDirectory->used > 1 && lfile->used > 1 &&
|
||||
lfile->string[0] != '/') {
|
||||
char *p;
|
||||
BuildTmpString((char *)0);
|
||||
p = BuildTmpString(lfile->string);
|
||||
BuildString((char *)0, lfile);
|
||||
BuildString(logDirectory->string, lfile);
|
||||
BuildStringChar('/', lfile);
|
||||
BuildString(p, lfile);
|
||||
BuildTmpString((char *)0);
|
||||
}
|
||||
printf("\tlogfile %s;\n", lfile->string);
|
||||
DestroyString(lfile);
|
||||
}
|
||||
|
||||
if (pcMark) {
|
||||
printf("\ttimestamp %s;\n", pcMark);
|
||||
}
|
||||
|
||||
if (pcBreak) {
|
||||
int bt;
|
||||
bt = atoi(pcBreak);
|
||||
if (bt > 9 || bt < 0) {
|
||||
Error("%s(%d) bad break spec `%d'", pcFile, iLine, bt);
|
||||
} else {
|
||||
printf("\tbreak %d;\n", bt);
|
||||
}
|
||||
}
|
||||
|
||||
if (pcLine[0] == '!') {
|
||||
pcLine = PruneSpace(pcLine + 1);
|
||||
printf("\ttype host;\n");
|
||||
printf("\thost %s;\n", pcLine);
|
||||
printf("\tport %s;\n", pcMode);
|
||||
} else if ('|' == pcLine[0]) {
|
||||
pcLine = PruneSpace(pcLine + 1);
|
||||
printf("\ttype exec;\n");
|
||||
if (pcLine == (char *)0 || pcLine[0] == '\000')
|
||||
printf("\texec \"\";\n");
|
||||
else
|
||||
printf("\texec %s;\n", pcLine);
|
||||
} else {
|
||||
char p, *t;
|
||||
printf("\ttype device;\n");
|
||||
printf("\tdevice %s;\n", pcLine);
|
||||
t = pcMode;
|
||||
while (isdigit((int)(*t))) {
|
||||
++t;
|
||||
}
|
||||
p = *t;
|
||||
*t = '\000';
|
||||
printf("\tbaud %s;\n", pcMode);
|
||||
switch (p) {
|
||||
case 'E':
|
||||
case 'e':
|
||||
t = "even";
|
||||
break;
|
||||
case 'M':
|
||||
case 'm':
|
||||
t = "mark";
|
||||
break;
|
||||
case 'N':
|
||||
case 'n':
|
||||
case 'P':
|
||||
case 'p':
|
||||
t = "none";
|
||||
break;
|
||||
case 'O':
|
||||
case 'o':
|
||||
t = "odd";
|
||||
break;
|
||||
case 'S':
|
||||
case 's':
|
||||
t = "space";
|
||||
break;
|
||||
default:
|
||||
Error
|
||||
("%s(%d) unknown parity type `%c' - assuming `none'",
|
||||
pcFile, iLine, p);
|
||||
t = "none";
|
||||
break;
|
||||
}
|
||||
printf("\tparity %s;\n", t);
|
||||
}
|
||||
printf("}\n");
|
||||
}
|
||||
|
||||
while ((acIn =
|
||||
(unsigned char *)ReadLine2(fp, acInSave,
|
||||
&iLine)) != (unsigned char *)0) {
|
||||
char *pcNext;
|
||||
char cType;
|
||||
|
||||
acStart = PruneSpace((char *)acIn);
|
||||
if (acStart[0] == '#') {
|
||||
printf("%s\n", acStart);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('%' == acStart[0] && '%' == acStart[1] && '\000' == acStart[2]) {
|
||||
break;
|
||||
}
|
||||
if ((char *)0 == (pcNext = strchr(acStart, ':'))) {
|
||||
Error("%s(%d) missing colon?", pcFile, iLine);
|
||||
continue;
|
||||
}
|
||||
|
||||
do {
|
||||
*pcNext++ = '\000';
|
||||
} while (isspace((int)(*pcNext)));
|
||||
|
||||
switch (acStart[0]) {
|
||||
case 'a': /* allowed, allow, allows */
|
||||
case 'A':
|
||||
if (!sawACL) {
|
||||
sawACL = 1;
|
||||
printf("access * {\n");
|
||||
}
|
||||
printf("\tallowed %s;\n", pcNext);
|
||||
break;
|
||||
case 'r': /* rejected, refused, refuse */
|
||||
case 'R':
|
||||
if (!sawACL) {
|
||||
sawACL = 1;
|
||||
printf("access * {\n");
|
||||
}
|
||||
printf("\trejected %s;\n", pcNext);
|
||||
break;
|
||||
case 't': /* trust, trusted, trusts */
|
||||
case 'T':
|
||||
if (!sawACL) {
|
||||
sawACL = 1;
|
||||
printf("access * {\n");
|
||||
}
|
||||
printf("\ttrusted %s;\n", pcNext);
|
||||
break;
|
||||
default:
|
||||
cType = ' ';
|
||||
Error("%s(%d) unknown access key `%s'", pcFile, iLine,
|
||||
acStart);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sawACL) {
|
||||
printf("}\n");
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
#if PROTOTYPES
|
||||
main(int argc, char **argv)
|
||||
#else
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
#endif
|
||||
{
|
||||
char *pcFile;
|
||||
FILE *fp;
|
||||
|
||||
progname = "convert";
|
||||
fDebug = 0;
|
||||
|
||||
|
||||
if (argc != 2) {
|
||||
Error("Usage: convert old-conserver.cf");
|
||||
return 1;
|
||||
}
|
||||
|
||||
pcFile = argv[1];
|
||||
if ((fp = fopen(pcFile, "r")) == (FILE *)0) {
|
||||
Error("fopen(%s): %s", pcFile, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
ReadCfg(pcFile, fp);
|
||||
return 0;
|
||||
}
|
2390
conserver/cutil.c
Normal file
2390
conserver/cutil.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: util.h,v 1.41 2003-03-08 08:39:57-08 bryan Exp $
|
||||
* $Id: cutil.h,v 1.61 2004/03/10 02:55:45 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -18,8 +18,11 @@
|
||||
|
||||
/* 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_DROP '.' /* dropped by server */
|
||||
#define OB_ABRT '.' /* abort */
|
||||
|
||||
/* Struct to wrap information about a "file"...
|
||||
* This can be a socket, local file, whatever. We do this so
|
||||
@ -28,12 +31,31 @@
|
||||
enum consFileType {
|
||||
simpleFile,
|
||||
simpleSocket,
|
||||
simplePipe,
|
||||
#if HAVE_OPENSSL
|
||||
SSLSocket,
|
||||
#endif
|
||||
nothing
|
||||
};
|
||||
|
||||
typedef enum IOState {
|
||||
ISDISCONNECTED = 0,
|
||||
INCONNECT,
|
||||
ISNORMAL,
|
||||
#if HAVE_OPENSSL
|
||||
INSSLACCEPT,
|
||||
INSSLSHUTDOWN,
|
||||
#endif
|
||||
ISFLUSHING
|
||||
} IOSTATE;
|
||||
|
||||
typedef enum flag {
|
||||
FLAGUNKNOWN = 0,
|
||||
FLAGTRUE,
|
||||
FLAGFALSE
|
||||
} FLAG;
|
||||
|
||||
|
||||
typedef struct dynamicString {
|
||||
char *string;
|
||||
int used;
|
||||
@ -46,18 +68,38 @@ typedef struct consFile {
|
||||
/* Standard socket type stuff */
|
||||
enum consFileType ftype;
|
||||
int fd;
|
||||
int fdout; /* only used when a simplePipe */
|
||||
STRING *wbuf;
|
||||
FLAG quoteiac;
|
||||
FLAG sawiac;
|
||||
FLAG sawiacsusp;
|
||||
FLAG sawiacexec;
|
||||
FLAG sawiacabrt;
|
||||
FLAG sawiacgoto;
|
||||
#if HAVE_OPENSSL
|
||||
/* SSL stuff */
|
||||
SSL *ssl;
|
||||
int waitonWrite;
|
||||
int waitonRead;
|
||||
FLAG waitForWrite;
|
||||
FLAG waitForRead;
|
||||
#endif
|
||||
/* Add crypto stuff to suit */
|
||||
#if DEBUG_CONSFILE_IO
|
||||
int debugrfd;
|
||||
int debugwfd;
|
||||
#endif
|
||||
} CONSFILE;
|
||||
|
||||
extern int isMultiProc, fDebug, fVerbose;
|
||||
extern int isMultiProc, fDebug, fVerbose, fErrorPrinted;
|
||||
extern char *progname;
|
||||
extern pid_t thepid;
|
||||
#define MAXHOSTNAME 1024
|
||||
extern char myHostname[];
|
||||
extern struct in_addr *myAddrs;
|
||||
extern fd_set rinit;
|
||||
extern fd_set winit;
|
||||
extern int maxfd;
|
||||
extern int debugLineNo;
|
||||
extern char *debugFileName;
|
||||
|
||||
extern const char *StrTime PARAMS((time_t *));
|
||||
extern void Debug PARAMS((int, char *, ...));
|
||||
@ -69,22 +111,28 @@ extern int GetMaxFiles PARAMS(());
|
||||
extern char *FmtCtl PARAMS((int, STRING *));
|
||||
extern void FmtCtlStr PARAMS((char *, int, STRING *));
|
||||
extern CONSFILE *FileOpenFD PARAMS((int, enum consFileType));
|
||||
extern CONSFILE *FileOpenPipe PARAMS((int, int));
|
||||
extern CONSFILE *FileOpen PARAMS((const char *, int, int));
|
||||
extern int FileClose PARAMS((CONSFILE **));
|
||||
extern int FileRead PARAMS((CONSFILE *, void *, int));
|
||||
extern int FileWrite PARAMS((CONSFILE *, const char *, int));
|
||||
extern void FileVWrite PARAMS((CONSFILE *, const char *, va_list));
|
||||
extern void FilePrint PARAMS((CONSFILE *, const char *, ...));
|
||||
extern int FileWrite PARAMS((CONSFILE *, FLAG, char *, int));
|
||||
extern void FileVWrite PARAMS((CONSFILE *, FLAG, char *, va_list));
|
||||
extern void FilePrint PARAMS((CONSFILE *, FLAG, char *, ...));
|
||||
extern int FileStat PARAMS((CONSFILE *, struct stat *));
|
||||
extern int FileSeek PARAMS((CONSFILE *, off_t, int));
|
||||
extern int FileSend PARAMS((CONSFILE *, const void *, size_t, int));
|
||||
extern int FileFDNum PARAMS((CONSFILE *));
|
||||
extern int FileFDOutNum PARAMS((CONSFILE *));
|
||||
extern int FileUnopen PARAMS((CONSFILE *));
|
||||
extern void OutOfMem PARAMS(());
|
||||
extern char *BuildTmpString PARAMS((const char *));
|
||||
extern char *BuildTmpStringChar PARAMS((const char));
|
||||
extern char *BuildTmpStringPrint PARAMS((char *, ...));
|
||||
extern char *BuildString PARAMS((const char *, STRING *));
|
||||
extern char *BuildStringChar PARAMS((const char, STRING *));
|
||||
extern char *BuildStringPrint PARAMS((STRING *, char *, ...));
|
||||
extern char *BuildStringN PARAMS((const char *, int, STRING *));
|
||||
extern char *ShiftString PARAMS((STRING *, int));
|
||||
extern void InitString PARAMS((STRING *));
|
||||
extern void DestroyString PARAMS((STRING *));
|
||||
extern void DestroyStrings PARAMS((void));
|
||||
@ -92,10 +140,27 @@ extern STRING *AllocString PARAMS((void));
|
||||
extern char *ReadLine PARAMS((FILE *, STRING *, int *));
|
||||
extern enum consFileType FileGetType PARAMS((CONSFILE *));
|
||||
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 DestroyDataStructures PARAMS((void));
|
||||
extern int IsMe PARAMS((char *));
|
||||
extern char *PruneSpace PARAMS((char *));
|
||||
extern int FileCanRead PARAMS((CONSFILE *, fd_set *, fd_set *));
|
||||
extern int FileCanWrite PARAMS((CONSFILE *, fd_set *, fd_set *));
|
||||
extern int FileBufEmpty PARAMS((CONSFILE *));
|
||||
extern int SetFlags PARAMS((int, int, int));
|
||||
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
|
||||
extern SSL *FileGetSSL PARAMS((CONSFILE *));
|
||||
extern void FileSetSSL PARAMS((CONSFILE *, SSL *));
|
||||
extern int SSLVerifyCallback PARAMS((int, X509_STORE_CTX *));
|
||||
extern int FileSSLAccept PARAMS((CONSFILE *));
|
||||
extern int FileCanSSLAccept PARAMS((CONSFILE *, fd_set *, fd_set *));
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fallback.c,v 5.53 2003-03-17 08:27:34-08 bryan Exp $
|
||||
* $Id: fallback.c,v 5.60 2003/11/20 13:56:38 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -14,78 +14,31 @@
|
||||
* Mike Rowan (mtr@mace.cc.purdue.edu)
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/file.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/errno.h>
|
||||
#include <netinet/in.h>
|
||||
#include <syslog.h>
|
||||
#include <signal.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <compat.h>
|
||||
#include <util.h>
|
||||
|
||||
#if defined(_AIX)
|
||||
#include <cutil.h>
|
||||
|
||||
/*
|
||||
* get a pty for the user (emulate the neato sequent call) (mm)
|
||||
* get a pty for the user
|
||||
*
|
||||
* this has been revamped rather heavily for 8.0.0. i've taken ideas
|
||||
* from the xemacs and openssh distributions to get code that *should*
|
||||
* work on systems i have no access to. thanks to those reference
|
||||
* packages, i think things are ok...hopefully it's true!
|
||||
*/
|
||||
static int
|
||||
#if PROTOTYPES
|
||||
GetPseudoTTY(STRING * slave, STRING * master)
|
||||
GetPseudoTTY(STRING *slave, int *slaveFD)
|
||||
#else
|
||||
GetPseudoTTY(slave, master)
|
||||
GetPseudoTTY(slave, slaveFD)
|
||||
STRING *slave;
|
||||
STRING *master;
|
||||
int *slaveFD;
|
||||
#endif
|
||||
{
|
||||
int fd;
|
||||
char *pcName;
|
||||
|
||||
if (0 > (fd = open("/dev/ptc", O_RDWR | O_NDELAY, 0))) {
|
||||
return -1;
|
||||
}
|
||||
if ((char *)0 == (pcName = ttyname(fd))) {
|
||||
return -1;
|
||||
}
|
||||
BuildString((char *)0, slave);
|
||||
BuildString(pcName, slave);
|
||||
|
||||
BuildString((char *)0, master);
|
||||
BuildString(pcName, master);
|
||||
master->string[7] = 'c';
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(HAVE_PTSNAME) && defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT)
|
||||
#if defined(linux)
|
||||
extern char *ptsname();
|
||||
extern int grantpt();
|
||||
extern int unlockpt();
|
||||
#endif
|
||||
|
||||
/* get a pty for the user -- emulate the neato sequent call under (gregf)
|
||||
* DYNIX/ptx v4.0
|
||||
*/
|
||||
static int
|
||||
#if PROTOTYPES
|
||||
GetPseudoTTY(STRING * slave, STRING * master)
|
||||
#else
|
||||
GetPseudoTTY(slave, master)
|
||||
STRING *slave;
|
||||
STRING *master;
|
||||
#endif
|
||||
{
|
||||
int fd;
|
||||
#if HAVE_OPENPTY
|
||||
int fd = -1;
|
||||
int sfd = -1;
|
||||
int opty = 0;
|
||||
char *pcName;
|
||||
#if HAVE_SIGACTION
|
||||
sigset_t oldmask, newmask;
|
||||
@ -93,9 +46,6 @@ GetPseudoTTY(slave, master)
|
||||
extern RETSIGTYPE FlagReapVirt PARAMS((int));
|
||||
#endif
|
||||
|
||||
if (0 > (fd = open("/dev/ptmx", O_RDWR, 0))) {
|
||||
return -1;
|
||||
}
|
||||
#if HAVE_SIGACTION
|
||||
sigemptyset(&newmask);
|
||||
sigaddset(&newmask, SIGCHLD);
|
||||
@ -106,7 +56,7 @@ GetPseudoTTY(slave, master)
|
||||
SimpleSignal(SIGCHLD, SIG_DFL);
|
||||
#endif
|
||||
|
||||
grantpt(fd); /* change permission of slave */
|
||||
opty = openpty(&fd, &sfd, NULL, NULL, NULL);
|
||||
|
||||
#if HAVE_SIGACTION
|
||||
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
|
||||
@ -116,52 +66,121 @@ GetPseudoTTY(slave, master)
|
||||
SimpleSignal(SIGCHLD, FlagReapVirt);
|
||||
#endif
|
||||
|
||||
unlockpt(fd); /* unlock slave */
|
||||
BuildString((char *)0, master);
|
||||
if ((char *)0 == (pcName = ttyname(fd))) {
|
||||
BuildString("/dev/ptmx", master);
|
||||
} else {
|
||||
BuildString(pcName, master);
|
||||
if (opty != 0) {
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
if (sfd >= 0)
|
||||
close(sfd);
|
||||
return -1;
|
||||
}
|
||||
if ((char *)0 == (pcName = ttyname(sfd))) {
|
||||
close(fd);
|
||||
close(sfd);
|
||||
return -1;
|
||||
}
|
||||
BuildString((char *)0, slave);
|
||||
BuildString(pcName, slave);
|
||||
|
||||
if ((char *)0 == (pcName = ptsname(fd))) {
|
||||
*slaveFD = sfd;
|
||||
return fd;
|
||||
#else
|
||||
#if (HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT) || defined(_AIX)
|
||||
int fd = -1;
|
||||
int sfd = -1;
|
||||
char *pcName;
|
||||
#if HAVE_SIGACTION
|
||||
sigset_t oldmask, newmask;
|
||||
#else
|
||||
extern RETSIGTYPE FlagReapVirt PARAMS((int));
|
||||
#endif
|
||||
int c;
|
||||
/* clone list and idea stolen from xemacs distribution */
|
||||
static char *clones[] = {
|
||||
"/dev/ptmx", /* Various systems */
|
||||
"/dev/ptm/clone", /* HPUX */
|
||||
"/dev/ptc", /* AIX */
|
||||
"/dev/ptmx_bsd", /* Tru64 */
|
||||
(char *)0
|
||||
};
|
||||
|
||||
/* try to find the pty allocator */
|
||||
for (c = 0; clones[c] != (char *)0; c++) {
|
||||
if ((fd = open(clones[c], O_RDWR, 0)) >= 0)
|
||||
break;
|
||||
}
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
|
||||
#if HAVE_SIGACTION
|
||||
sigemptyset(&newmask);
|
||||
sigaddset(&newmask, SIGCHLD);
|
||||
if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
|
||||
Error("GetPseudoTTY(): sigprocmask(SIG_BLOCK): %s",
|
||||
strerror(errno));
|
||||
#else
|
||||
SimpleSignal(SIGCHLD, SIG_DFL);
|
||||
#endif
|
||||
|
||||
#if HAVE_GRANTPT
|
||||
grantpt(fd); /* change permission of slave */
|
||||
#endif
|
||||
|
||||
#if HAVE_SIGACTION
|
||||
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
|
||||
Error("GetPseudoTTY(): sigprocmask(SIG_SETMASK): %s",
|
||||
strerror(errno));
|
||||
#else
|
||||
SimpleSignal(SIGCHLD, FlagReapVirt);
|
||||
#endif
|
||||
|
||||
#if HAVE_UNLOCKPT
|
||||
unlockpt(fd); /* unlock slave */
|
||||
#endif
|
||||
|
||||
#if defined(_AIX)
|
||||
if ((pcName = ttyname(fd)) == (char *)0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
# if HAVE_PTSNAME
|
||||
if ((pcName = ptsname(fd)) == (char *)0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
# else
|
||||
close(fd);
|
||||
return -1;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* go ahead and open the slave */
|
||||
if ((sfd = open(pcName, O_RDWR, 0)) < 0) {
|
||||
Error("GetPseudoTTY(): open(%s): %s", pcName, strerror(errno));
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
BuildString((char *)0, slave);
|
||||
BuildString(pcName, slave);
|
||||
|
||||
*slaveFD = sfd;
|
||||
return fd;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* Below is the string for finding /dev/ptyXX. For each architecture we
|
||||
* leave some pty's world writable because we don't have source for
|
||||
* everything that uses pty's. For the most part, we'll be trying to
|
||||
* make /dev/ptyq* the "free" pty's.
|
||||
*/
|
||||
|
||||
/* all the world's a vax ;-) */
|
||||
static char charone[] = "prstuvwxyzPQRSTUVWq";
|
||||
static char chartwo[] =
|
||||
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
/*
|
||||
* get a pty for the user (emulate the neato sequent call) (ksb)
|
||||
*/
|
||||
static int
|
||||
#if PROTOTYPES
|
||||
GetPseudoTTY(STRING * slave, STRING * master)
|
||||
#else
|
||||
GetPseudoTTY(slave, master)
|
||||
STRING *slave;
|
||||
STRING *master;
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* Below is the string for finding /dev/ptyXX. For each architecture we
|
||||
* leave some pty's world writable because we don't have source for
|
||||
* everything that uses pty's. For the most part, we'll be trying to
|
||||
* make /dev/ptyq* the "free" pty's.
|
||||
*/
|
||||
/* all the world's a vax ;-) */
|
||||
static char charone[] = "prstuvwxyzPQRSTUVWq";
|
||||
static char chartwo[] =
|
||||
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
static char acMaster[] = "/dev/ptyXX";
|
||||
static char acSlave[] = "/dev/ttyXX";
|
||||
static char *pcOne = charone, *pcTwo = chartwo;
|
||||
int fd, iLoop, iIndex = sizeof("/dev/pty") - 1;
|
||||
int fd, sfd, iLoop, iIndex = sizeof("/dev/pty") - 1;
|
||||
char *pcOld1;
|
||||
struct stat statBuf;
|
||||
|
||||
@ -203,41 +222,47 @@ GetPseudoTTY(slave, master)
|
||||
break;
|
||||
}
|
||||
|
||||
BuildString((char *)0, master);
|
||||
BuildString(acMaster, master);
|
||||
/* go ahead and open the slave */
|
||||
if ((sfd = open(acSlave, O_RDWR, 0)) < 0) {
|
||||
Error("GetPseudoTTY(): open(%s): %s", acSlave, strerror(errno));
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
BuildString((char *)0, slave);
|
||||
BuildString(acSlave, slave);
|
||||
|
||||
*slaveFD = sfd;
|
||||
return fd;
|
||||
#endif /* (HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT) || defined(_AIX) */
|
||||
#endif /* HAVE_OPENPTY */
|
||||
}
|
||||
#endif
|
||||
#endif /* _AIX */
|
||||
|
||||
/*
|
||||
* get a Joe pty bacause the daemon is not with us, sadly. (ksb)
|
||||
* get a pty using the GetPseudoTTY code above
|
||||
*/
|
||||
int
|
||||
#if PROTOTYPES
|
||||
FallBack(STRING * pcSlave, STRING * pcMaster)
|
||||
FallBack(char **slave, int *sfd)
|
||||
#else
|
||||
FallBack(pcSlave, pcMaster)
|
||||
STRING *pcSlave, *pcMaster;
|
||||
FallBack(slave, sfd)
|
||||
char **slave;
|
||||
int *sfd;
|
||||
#endif
|
||||
{
|
||||
int fd;
|
||||
static STRING *pcTSlave = (STRING *) 0;
|
||||
static STRING *pcTMaster = (STRING *) 0;
|
||||
static STRING *pcTSlave = (STRING *)0;
|
||||
|
||||
if (pcTSlave == (STRING *) 0)
|
||||
if (pcTSlave == (STRING *)0)
|
||||
pcTSlave = AllocString();
|
||||
if (pcTMaster == (STRING *) 0)
|
||||
pcTMaster = AllocString();
|
||||
|
||||
if (-1 == (fd = GetPseudoTTY(pcTSlave, pcTMaster))) {
|
||||
if ((fd = GetPseudoTTY(pcTSlave, sfd)) == -1) {
|
||||
return -1;
|
||||
}
|
||||
BuildString((char *)0, pcSlave);
|
||||
BuildString(pcTSlave->string, pcSlave);
|
||||
BuildString((char *)0, pcMaster);
|
||||
BuildString(pcTMaster->string, pcMaster);
|
||||
if ((*slave) != (char *)0)
|
||||
free(*slave);
|
||||
if (((*slave) = StrDup(pcTSlave->string))
|
||||
== (char *)0)
|
||||
OutOfMem();
|
||||
return fd;
|
||||
}
|
||||
|
5487
conserver/group.c
5487
conserver/group.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: group.h,v 5.31 2003-03-17 08:43:20-08 bryan Exp $
|
||||
* $Id: group.h,v 5.43 2003/12/20 06:11:53 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -34,6 +34,15 @@
|
||||
* 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()
|
||||
*/
|
||||
#define AUTH_SUCCESS 0 /* ok */
|
||||
@ -45,7 +54,6 @@ typedef struct grpent { /* group info */
|
||||
unsigned short port; /* port group listens on */
|
||||
pid_t pid; /* pid of server for group */
|
||||
int imembers; /* number of consoles in this group */
|
||||
fd_set rinit; /* descriptor list */
|
||||
CONSENT *pCElist; /* list of consoles in this group */
|
||||
CONSENT *pCEctl; /* our control `console' */
|
||||
CONSCLIENT *pCLall; /* all clients to scan after select */
|
||||
@ -53,12 +61,25 @@ typedef struct grpent { /* group info */
|
||||
struct grpent *pGEnext; /* next group entry */
|
||||
} GRPENT;
|
||||
|
||||
extern time_t timers[];
|
||||
|
||||
extern void Spawn PARAMS((GRPENT *));
|
||||
extern int CheckPass PARAMS((char *, char *));
|
||||
extern void TagLogfile PARAMS((const CONSENT *, const char *, ...));
|
||||
extern void TagLogfileAct PARAMS((const CONSENT *, const char *, ...));
|
||||
extern void CleanupBreak PARAMS((short));
|
||||
extern void TagLogfile PARAMS((const CONSENT *, char *, ...));
|
||||
extern void TagLogfileAct PARAMS((const CONSENT *, char *, ...));
|
||||
extern void DestroyGroup PARAMS((GRPENT *));
|
||||
extern void DestroyConsent PARAMS((GRPENT *, CONSENT *));
|
||||
extern void SendClientsMsg PARAMS((CONSENT *, char *));
|
||||
extern void ResetMark PARAMS((void));
|
||||
extern void DestroyConsentUsers PARAMS((CONSENTUSERS **));
|
||||
extern CONSENTUSERS *ConsentFindUser PARAMS((CONSENTUSERS *, char *));
|
||||
extern int ConsentUserOk PARAMS((CONSENTUSERS *, char *));
|
||||
extern void DisconnectClient
|
||||
PARAMS((GRPENT *, CONSCLIENT *, char *, FLAG));
|
||||
extern int ClientAccess PARAMS((CONSENT *, char *));
|
||||
extern void DestroyClient PARAMS((CONSCLIENT *));
|
||||
extern int CheckPasswd PARAMS((CONSCLIENT *, char *));
|
||||
extern void ExpandString PARAMS((char *, CONSENT *, short));
|
||||
#if HAVE_OPENSSL
|
||||
extern int AttemptSSL PARAMS((CONSCLIENT *));
|
||||
#endif
|
||||
|
1252
conserver/main.c
1252
conserver/main.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: main.h,v 5.45 2003-03-09 15:20:43-08 bryan Exp $
|
||||
* $Id: main.h,v 5.52 2004/04/13 18:12:00 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -37,24 +37,24 @@
|
||||
/* program options and stuff
|
||||
*/
|
||||
extern char rcsid[];
|
||||
extern int fAll, fSoftcar, fNoinit, fInteractive, fStrip, fDaemon, fReopen,
|
||||
fReopenall, fNoautoreup, fNoredir;
|
||||
extern char chDefAcc;
|
||||
extern int fAll, fNoinit, fInteractive, fStrip, fDaemon, fReopen,
|
||||
fNoautoreup, fSyntaxOnly;
|
||||
extern in_addr_t bindAddr;
|
||||
extern unsigned short bindPort, bindBasePort;
|
||||
extern char *pcLogfile;
|
||||
extern char *pcConfig;
|
||||
extern char *pcPasswd;
|
||||
extern STRING *defaultShell;
|
||||
extern int cMaxMemb;
|
||||
extern struct sockaddr_in in_port;
|
||||
extern char acMyHost[];
|
||||
extern struct in_addr acMyAddr;
|
||||
extern int domainHack;
|
||||
extern int isMaster;
|
||||
extern CONFIG *optConf;
|
||||
extern CONFIG *config;
|
||||
extern CONFIG defConfig;
|
||||
extern CONSFILE *unifiedlog;
|
||||
#if USE_UNIX_DOMAIN_SOCKETS
|
||||
extern char *interface;
|
||||
#endif
|
||||
#if HAVE_OPENSSL
|
||||
extern SSL_CTX *ctx;
|
||||
extern int fReqEncryption;
|
||||
#endif
|
||||
extern void ReopenLogfile PARAMS((void));
|
||||
extern void ReopenUnifiedlog PARAMS((void));
|
||||
extern void DumpDataStructures PARAMS((void));
|
||||
|
1010
conserver/master.c
1010
conserver/master.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: master.h,v 5.16 2003-03-06 10:13:41-08 bryan Exp $
|
||||
* $Id: master.h,v 5.17 2003/10/03 14:23:37 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -37,5 +37,7 @@
|
||||
/*
|
||||
* stuff the master process needs
|
||||
*/
|
||||
extern CONSCLIENT *pCLmall;
|
||||
extern CONSCLIENT *pCLmfree;
|
||||
extern void Master PARAMS((void));
|
||||
extern void SignalKids PARAMS((int));
|
||||
|
6068
conserver/readcfg.c
6068
conserver/readcfg.c
File diff suppressed because it is too large
Load Diff
@ -1,50 +1,53 @@
|
||||
/*
|
||||
* $Id: readcfg.h,v 5.23 2003-03-06 10:13:41-08 bryan Exp $
|
||||
* $Id: readcfg.h,v 5.38 2003/11/10 15:37:24 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||
*
|
||||
* Copyright GNAC, Inc., 1998
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 1992 Purdue Research Foundation, West Lafayette, Indiana
|
||||
* 47907. All rights reserved.
|
||||
*
|
||||
* Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
|
||||
*
|
||||
* This software is not subject to any license of the American Telephone
|
||||
* and Telegraph Company or the Regents of the University of California.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose on
|
||||
* any computer system, and to alter it and redistribute it freely, subject
|
||||
* to the following restrictions:
|
||||
*
|
||||
* 1. Neither the authors nor Purdue University are responsible for any
|
||||
* consequences of the use of this software.
|
||||
*
|
||||
* 2. The origin of this software must not be misrepresented, either by
|
||||
* explicit claim or by omission. Credit to the authors and Purdue
|
||||
* University must appear in documentation and sources.
|
||||
*
|
||||
* 3. Altered versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
*
|
||||
* 4. This notice may not be removed or altered.
|
||||
*/
|
||||
#define BREAKDELAYDEFAULT 250
|
||||
|
||||
/* we read in which hosts to trust and which ones we proxy for
|
||||
* from a file, into these structures
|
||||
*/
|
||||
typedef struct config {
|
||||
STRING *name;
|
||||
char defaultaccess;
|
||||
FLAG daemonmode;
|
||||
char *logfile;
|
||||
char *passwdfile;
|
||||
char *primaryport;
|
||||
FLAG redirect;
|
||||
FLAG loghostnames;
|
||||
int reinitcheck;
|
||||
char *secondaryport;
|
||||
char *unifiedlog;
|
||||
#if HAVE_SETPROCTITLE
|
||||
FLAG setproctitle;
|
||||
#endif
|
||||
#if HAVE_OPENSSL
|
||||
char *sslcredentials;
|
||||
FLAG sslrequired;
|
||||
#endif
|
||||
} CONFIG;
|
||||
|
||||
extern GRPENT *pGroups; /* group info */
|
||||
typedef struct breaks {
|
||||
STRING *seq;
|
||||
int delay;
|
||||
} BREAKS;
|
||||
|
||||
extern NAMES *userList; /* user list */
|
||||
extern GRPENT *pGroups; /* group info */
|
||||
extern REMOTE *pRCList; /* list of remote consoles we know about */
|
||||
extern REMOTE *pRCUniq; /* list of uniq console servers */
|
||||
extern ACCESS *pACList; /* `who do you love' (or trust) */
|
||||
extern STRING *breakList; /* list of break sequences */
|
||||
extern ACCESS *pACList; /* `who do you love' (or trust) */
|
||||
extern CONSENTUSERS *pADList; /* list of admin users */
|
||||
extern BREAKS breakList[9]; /* list of break sequences */
|
||||
extern CONFIG *pConfig; /* settings seen by config parser */
|
||||
|
||||
extern void ReadCfg PARAMS((char *, FILE *));
|
||||
extern char *PruneSpace PARAMS((char *));
|
||||
extern void ReReadCfg PARAMS((void));
|
||||
extern void ReReadCfg PARAMS((int));
|
||||
extern void DestroyBreakList PARAMS((void));
|
||||
extern void DestroyUserList PARAMS((void));
|
||||
extern void DestroyConfig PARAMS((CONFIG *));
|
||||
extern NAMES *FindUserList PARAMS((char *));
|
||||
extern NAMES *AddUserList PARAMS((char *));
|
||||
extern CONSENT *FindConsoleName PARAMS((CONSENT *, char *));
|
||||
|
1370
conserver/util.c
1370
conserver/util.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: version.h,v 1.42 2003-04-08 16:19:19-07 bryan Exp $
|
||||
* $Id: version.h,v 1.60 2004/04/03 15:44:49 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
@ -14,4 +14,4 @@
|
||||
@(#) Copyright 2000 conserver.com.\n\
|
||||
All rights reserved.\n"
|
||||
|
||||
#define THIS_VERSION "conserver.com version 7.2.7"
|
||||
#define THIS_VERSION "conserver.com version 8.1.4"
|
||||
|
@ -15,7 +15,7 @@ MKDIR = @MKDIR@
|
||||
|
||||
### Compiler and link options
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@ # -DPUCC -DSUN5
|
||||
CFLAGS = @CFLAGS@
|
||||
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
CPPFLAGS = -I.. -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/conserver $(DEFS) @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
@ -25,18 +25,23 @@ LIBS = @LIBS@
|
||||
|
||||
### Makefile rules - no user-servicable parts below
|
||||
|
||||
CONSOLE_OBJS = console.o ../conserver/util.o
|
||||
CONSOLE_HDRS = ../config.h $(top_srcdir)/compat.h $(top_srcdir)/conserver/port.h
|
||||
CONSOLE_OBJS = console.o getpassword.o ../conserver/cutil.o
|
||||
CONSOLE_HDRS = ../config.h $(top_srcdir)/compat.h \
|
||||
$(top_srcdir)/conserver/cutil.h \
|
||||
$(top_srcdir)/conserver/version.h \
|
||||
$(srcdir)/getpassword.h
|
||||
ALL = console
|
||||
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
$(CONSOLE_OBJS): $(CONSOLE_HDRS)
|
||||
|
||||
console: $(CONSOLE_OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o console $(CONSOLE_OBJS) $(LIBS)
|
||||
|
||||
../conserver/util.o:
|
||||
( cd ../conserver && $(MAKE) $(MAKE_FLAGS) util.o ) || exit 1;
|
||||
../conserver/cutil.o:
|
||||
( cd ../conserver && $(MAKE) $(MAKE_FLAGS) cutil.o ) || exit 1;
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
2145
console/console.c
2145
console/console.c
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,50 @@
|
||||
.\" $Id: console.man,v 1.25 2003-03-04 07:53:03-08 bryan Exp $
|
||||
.TH CONSOLE 1 "Local"
|
||||
.\" $Id: console.man,v 1.46 2004/03/23 18:32:09 bryan Exp $
|
||||
.TH CONSOLE 1 "2004/03/23" "conserver-8.1.4" "conserver"
|
||||
.SH NAME
|
||||
console \- console server client program
|
||||
.SH SYNOPSIS
|
||||
\fBconsole\fP [\fB\-aAEfFGsS\fP] [\fB\-7Dv\fP]
|
||||
[\fB\-c\fP \fIcred\fP] [\fB\-M\fP \fImach\fP]
|
||||
[\fB\-p\fP \fIport\fP] [\fB\-e\fP \fIesc\fP] [\fB\-l\fP \fIuser\fP]
|
||||
\fIconsole\fP
|
||||
.B console
|
||||
.RB [ \-aAEfFsS ]
|
||||
.RB [ \-7Dv ]
|
||||
.RB [ \-c
|
||||
.IR cred ]
|
||||
.BR [ \-M
|
||||
.IR mach ]
|
||||
.BR [ \-p
|
||||
.IR port ]
|
||||
.BR [ \-e
|
||||
.IR esc ]
|
||||
.BR [ \-l
|
||||
.IR user ]
|
||||
.I console
|
||||
.br
|
||||
\fBconsole\fP [\fB\-hiIPrRuVwWx\fP] [\fB\-7Dv\fP] [\fB\-M\fP \fImach\fP]
|
||||
[\fB\-p\fP \fIport\fP] [\fB\-\fP[\fBbB\fP] \fImessage\fP]
|
||||
.B console
|
||||
.RB [ \-hiIPrRuVwWx ]
|
||||
.RB [ \-7Dv ]
|
||||
.RB [ \-M
|
||||
.IR mach ]
|
||||
.RB [ \-p
|
||||
.IR port ]
|
||||
.RB [ \-d
|
||||
.RI [ user ][\f3@\fP console ]]
|
||||
.RB [ \- [ bB ]
|
||||
.IR message ]
|
||||
.RB [ \-t
|
||||
.RI [ user ][\f3@\fP console ]
|
||||
.IR message ]
|
||||
.br
|
||||
\fBconsole\fP [\fB\-qQ\fP] [\fB\-7Dv\fP] [\fB\-M\fP \fImach\fP]
|
||||
[\fB\-p\fP \fIport\fP]
|
||||
.B console
|
||||
.RB [ \-qQ ]
|
||||
.RB [ \-7Dv ]
|
||||
.RB [ \-M
|
||||
.IR mach ]
|
||||
.RB [ \-p
|
||||
.IR port ]
|
||||
.SH DESCRIPTION
|
||||
.B Console
|
||||
is used to manipulate console terminals remotely or to poll running
|
||||
\fBconserver\fP(8) daemons for status information.
|
||||
.BR conserver (8)
|
||||
daemons for status information.
|
||||
.PP
|
||||
In the first form above,
|
||||
.B console
|
||||
@ -33,39 +61,39 @@ outputs only the requested information and exits.
|
||||
.B Console
|
||||
knows only of a primary
|
||||
.B conserver
|
||||
host
|
||||
(see the \fB\-M\fP option below),
|
||||
to which it initially connects.
|
||||
host (see the
|
||||
.B \-M
|
||||
option below), to which it initially connects.
|
||||
In a multi-server environment, the primary server may refer
|
||||
the client to a different server handling the requested console,
|
||||
or it will provide a list of all servers if required
|
||||
(as when
|
||||
or it will provide a list of all servers if required (as when
|
||||
.B console
|
||||
is invoked with the
|
||||
.RB ` \-r '
|
||||
.B \-r
|
||||
option).
|
||||
.B Console
|
||||
then opens connections to the appropriate server(s).
|
||||
It is not necessary for the user of
|
||||
.B console
|
||||
to know which server manages which consoles,
|
||||
as long as
|
||||
to know which server manages which consoles, as long as
|
||||
.B console
|
||||
knows a valid primary server
|
||||
and all available consoles are listed in the primary server's
|
||||
configuration file.
|
||||
.SH OPTIONS
|
||||
.PP
|
||||
Options may be given as separate arguments (e.g., \fB\-v -w\fP)
|
||||
or clustered (e.g., \fB\-vw\fP).
|
||||
Options may be given as separate arguments (e.g.,
|
||||
.B \-v
|
||||
.BR \-w )
|
||||
or clustered (e.g.,
|
||||
.BR \-vw ).
|
||||
Options and their arguments may be separated by optional white space.
|
||||
Option arguments containing spaces or other characters special to the shell
|
||||
must be quoted.
|
||||
.TP
|
||||
.TP 11
|
||||
.B \-7
|
||||
Strip the high bit off of all data received,
|
||||
whether from user input or from the server,
|
||||
before any processing occurs.
|
||||
Strip the high bit off of all data received, whether from user
|
||||
input or from the server, before any processing occurs.
|
||||
Disallows escape sequence characters with the high bit set.
|
||||
.TP
|
||||
.B \-a
|
||||
@ -73,35 +101,63 @@ Access a console with a two-way (read-write) connection (this is the default).
|
||||
The connection is dropped to spy mode if someone else is attached read-write.
|
||||
.TP
|
||||
.BI \-b message
|
||||
Broadcast a \fImessage\fP to all users connected to each server.
|
||||
Broadcast a
|
||||
.I message
|
||||
to all users connected to each server.
|
||||
.TP
|
||||
.BI \-B message
|
||||
Same as \fB\-b\fP but just send a \fImessage\fP to users on the primary server.
|
||||
Same as
|
||||
.B \-b
|
||||
but just send a
|
||||
.I message
|
||||
to users on the primary server.
|
||||
.TP
|
||||
.BI \-c cred
|
||||
Load an SSL certificate and key from the PEM encoded file \fIcred\fP.
|
||||
Load an SSL certificate and key from the PEM encoded file
|
||||
.IR cred .
|
||||
.TP
|
||||
.B \-d
|
||||
Disconnect the users specified by
|
||||
.IR user @ console .
|
||||
You may specify the target as
|
||||
.I user
|
||||
(disconnect the
|
||||
.IR user,
|
||||
regardless of what console they are attached to),
|
||||
.RI @ console
|
||||
(disconnect all users attached to
|
||||
.IR console ),
|
||||
or
|
||||
.IR user @ console
|
||||
(disconnect the
|
||||
.I user
|
||||
attached to
|
||||
.IR console ).
|
||||
.TP
|
||||
.B \-D
|
||||
Enable debugging output.
|
||||
.TP
|
||||
.BI \-e esc
|
||||
Set the initial two-character escape sequence to
|
||||
those represented by \fIesc\fP.
|
||||
Any of the forms output by \fBcat\fP(1)'s \-\fBv\fP option
|
||||
are accepted. The default value is ``\fB^Ec\fP''.
|
||||
Set the initial two-character escape sequence to those represented by
|
||||
.IR esc .
|
||||
Any of the forms output by
|
||||
.BR cat (1)'s
|
||||
.B \-v
|
||||
option are accepted.
|
||||
The default value is
|
||||
.RB `` ^Ec ''.
|
||||
.TP
|
||||
.B \-E
|
||||
If encryption has been built into the code (\fB--with-openssl\fP), encrypted
|
||||
client connections are a requirement. This option allows the client to
|
||||
connect to a console over a non-encrypted connection.
|
||||
If encryption has been built into the code
|
||||
.RB ( --with-openssl ),
|
||||
encrypted client connections are a requirement.
|
||||
This option allows the client to connect to a console
|
||||
over a non-encrypted connection.
|
||||
.TP
|
||||
.B \-f
|
||||
Same as \fB\-a\fP except it will force any existing connection into spy mode.
|
||||
.TP
|
||||
.B \-G
|
||||
Request a raw connection to the group control virtual console;
|
||||
this is only useful for learning the protocol used by the
|
||||
interactive sequence.
|
||||
Same as
|
||||
.B \-a
|
||||
except it will force any existing connection into spy mode.
|
||||
.TP
|
||||
.B \-h
|
||||
Display a brief help message.
|
||||
@ -110,54 +166,103 @@ Display a brief help message.
|
||||
Display information in a machine-parseable format (see below for the details).
|
||||
.TP
|
||||
.B \-I
|
||||
Same as \fB\-i\fP but just acts on the primary server.
|
||||
Same as
|
||||
.B \-i
|
||||
but just acts on the primary server.
|
||||
.TP
|
||||
.BI \-l user
|
||||
Set the login name used for authentication to \fIuser\fP.
|
||||
By default, \fBconsole\fP uses $USER if its uid matches the user's real uid,
|
||||
Set the login name used for authentication to
|
||||
.IR user .
|
||||
By default,
|
||||
.B console
|
||||
uses $USER if its uid matches the user's real uid,
|
||||
or $LOGNAME if its uid matches the user's real uid,
|
||||
or else the name associated with the user's real uid.
|
||||
.TP
|
||||
.BI \-M mach
|
||||
The \fBconsole\fP client program polls \fImach\fP as the primary server,
|
||||
rather than the default set at compile time (typically ``\fBconsole\fP'').
|
||||
The default \fImach\fP may be changed at compile time using the
|
||||
\fB--with-master\fP option.
|
||||
The
|
||||
.B console
|
||||
client program polls
|
||||
.I mach
|
||||
as the primary server,
|
||||
rather than the default set at compile time (typically
|
||||
.RB `` console '').
|
||||
The default
|
||||
.I mach
|
||||
may be changed at compile time using the
|
||||
.B --with-master
|
||||
option.
|
||||
.TP
|
||||
.BI \-p port
|
||||
Set the port to connect to. This may be either a port number
|
||||
or a service name. The default \fIport\fP may be changed at compile time
|
||||
using the \fB--with-port\fP option.
|
||||
Set the port to connect to.
|
||||
This may be either a port number
|
||||
or a service name.
|
||||
The default
|
||||
.I port
|
||||
may be changed at compile time
|
||||
using the
|
||||
.B --with-port
|
||||
option.
|
||||
.TP
|
||||
.B \-P
|
||||
Display the pid of the master daemon process on each server.
|
||||
.TP
|
||||
.B \-q
|
||||
The \fBconsole\fP client connects to each server to request that the
|
||||
server daemon quit (shut down). The root password of the host(s)
|
||||
running conserver is required unless the local host is listed as
|
||||
``trusted'' in the conserver.cf file; in that case, just
|
||||
press <return>.
|
||||
The
|
||||
.B console
|
||||
client connects to each server to request that the
|
||||
server daemon quit (shut down).
|
||||
The root password of the host(s) running conserver is required
|
||||
unless the local host is listed as ``trusted'' in the
|
||||
conserver.cf file; in that case, just press <return>.
|
||||
.TP
|
||||
.B \-Q
|
||||
Same as \fB\-q\fP but just acts on the primary server.
|
||||
Same as
|
||||
.B \-q
|
||||
but just acts on the primary server.
|
||||
.TP
|
||||
.B \-r
|
||||
Display daemon versions. The \fBconsole\fP client connects to each
|
||||
Display daemon versions.
|
||||
The
|
||||
.B console
|
||||
client connects to each
|
||||
server to request its version information.
|
||||
.TP
|
||||
.B \-R
|
||||
Same as \fB\-r\fP but just acts on the primary server.
|
||||
Same as
|
||||
.B \-r
|
||||
but just acts on the primary server.
|
||||
.TP
|
||||
.B \-s
|
||||
Request a read-only (spy mode) connection.
|
||||
In this mode all the escape sequences (below) work, or report errors,
|
||||
but all other keyboard input is discarded.
|
||||
.TP
|
||||
.B \-t
|
||||
Send a text
|
||||
.I message
|
||||
to
|
||||
.IR user @ console .
|
||||
You may specify the target as
|
||||
.I user
|
||||
(send to
|
||||
.IR user,
|
||||
regardless of what console they are attached to),
|
||||
.RI @ console
|
||||
(send to all users attached to
|
||||
.IR console ),
|
||||
or
|
||||
.IR user @ console
|
||||
(send to
|
||||
.I user
|
||||
attached to
|
||||
.IR console ).
|
||||
.TP
|
||||
.B \-u
|
||||
Show a list of all consoles with status (`up' or `down')
|
||||
and attached users (\fIuser\fP@\fIhost\fP if attached read-write,
|
||||
`<spies>' if only users in spy mode, or `<none>').
|
||||
Show a list of all consoles with status (`up', `down', or `init')
|
||||
and attached users
|
||||
.RI ( user @ host
|
||||
if attached read-write, `<spies>' if only users in spy mode, or `<none>').
|
||||
.TP
|
||||
.B \-v
|
||||
Be more verbose when building the connection(s).
|
||||
@ -170,77 +275,110 @@ and then exit.
|
||||
.TP
|
||||
.B \-w
|
||||
Show a list of all who are currently connected to consoles,
|
||||
including the hostnames where the \fBconsole\fP connections originate
|
||||
and the idle times. This is useful to see if anybody is actively
|
||||
including the hostnames where the
|
||||
.B console
|
||||
connections originate and the idle times.
|
||||
This is useful to see if anybody is actively
|
||||
using the console system if it becomes necessary to shut down
|
||||
\fBconserver\fP.
|
||||
.BR conserver .
|
||||
.TP
|
||||
.B \-W
|
||||
Same as \fB\-w\fP but just acts on the primary server.
|
||||
Same as
|
||||
.B \-w
|
||||
but just acts on the primary server.
|
||||
.TP
|
||||
.B \-x
|
||||
Show a list of consoles and devices.
|
||||
.PP
|
||||
The \fB\-A\fP, \fB\-F\fP, or \fB\-S\fP options have the same effect as
|
||||
their lower-case variants.
|
||||
The
|
||||
.BR \-A ,
|
||||
.BR \-F ", or"
|
||||
.B \-S
|
||||
options have the same effect as their lower-case variants.
|
||||
In addition, they each request the last 20 lines of the console output after
|
||||
making the connection (as if `\fB^Ecr\fP' were typed).
|
||||
making the connection (as if
|
||||
.RB ` ^Ecr '
|
||||
were typed).
|
||||
.PP
|
||||
The \fB-i\fP option outputs information regarding each console in
|
||||
ten colon-separated fields.
|
||||
The
|
||||
.B \-i
|
||||
option outputs information regarding each console in 15 colon-separated fields.
|
||||
.TP
|
||||
.B name
|
||||
.I name
|
||||
The name of the console.
|
||||
.TP
|
||||
.B hostname,pid,socket
|
||||
.I hostname,pid,socket
|
||||
The hostname, pid, and socket number of the child process managing
|
||||
the console.
|
||||
.TP
|
||||
.B type
|
||||
The type of console. Values will be a `/' for a local device, `|' for
|
||||
.I type
|
||||
The type of console.
|
||||
Values will be a `/' for a local device, `|' for
|
||||
a command, or `!' for a remote port.
|
||||
.TP
|
||||
.B console-details
|
||||
The details regarding the console. The values here (all comma seperated)
|
||||
depend on the type of the console. Local devices will have values of
|
||||
the device file, baud rate, and file descriptor for the device.
|
||||
.I console-details
|
||||
The details regarding 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/parity, and
|
||||
file descriptor for the device.
|
||||
Commands will have values of the command, the command's pid, the
|
||||
pseudo-tty, and file descriptor for the pseudo-tty.
|
||||
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
|
||||
.B users-list
|
||||
The details of each user connected to the console. The details for each
|
||||
user are an `@' seperated list of `w', `r', or `s' (for read-write, read-only,
|
||||
.I users-list
|
||||
The details of each user connected to the console.
|
||||
The details for each
|
||||
user are an `@' separated list of `w', `r', or `s' (for read-write, read-only,
|
||||
or suspended), username, hostname the user is on, the user's idle time,
|
||||
and (for `r' and `s' users only) ``rw'' or ``ro'' (if the user wants
|
||||
read-write mode or not). Each user bundle is seperated by commas.
|
||||
read-write mode or not).
|
||||
Each user bundle is separated by commas.
|
||||
.TP
|
||||
.B state
|
||||
The state of the console. Values with either be ``up'' or ``down''.
|
||||
.I state
|
||||
The state of the console.
|
||||
Values with either be ``up'', ``down'', or ``init''.
|
||||
.TP
|
||||
.B perm
|
||||
This value will either be ``rw'' or ``ro''. It will only be ``ro'' if
|
||||
.I perm
|
||||
This value will either be ``rw'' or ``ro''.
|
||||
It will only be ``ro'' if
|
||||
the console is a local device (`/' type) and the permissions are such
|
||||
that the server can open the file for read, but not write.
|
||||
.TP
|
||||
.B logfile-details
|
||||
The details regarding the logging for the console. The comma seperated
|
||||
.I logfile-details
|
||||
The details regarding the logging for the console.
|
||||
The comma-separated
|
||||
values will be the logfile, ``log'' or ``nolog'' (if logging is on
|
||||
or not - toggled via ^EcL), ``act'' or ``noact'' (if activity logging is
|
||||
enabled or not - the `a' timestamp option), the timestamp interval, and
|
||||
the file descriptor of the logfile.
|
||||
.TP
|
||||
.B break
|
||||
.I break
|
||||
The default break sequence used for the console.
|
||||
.TP
|
||||
.B reup
|
||||
.I reup
|
||||
If the console is currently down and the automatic reconnection code
|
||||
is at work, it will have the value of ``autoup'', otherwise it
|
||||
will be ``noautoup''.
|
||||
.TP
|
||||
.I aliases
|
||||
The console aliases are presented in a comma-separated list.
|
||||
.TP
|
||||
.I options
|
||||
The active options for the console are presented in a comma-separated list.
|
||||
.TP
|
||||
.I initcmd
|
||||
The initcmd configuration option for the console.
|
||||
.TP
|
||||
.I idletimeout
|
||||
The idletimeout configuration option for the console.
|
||||
.TP
|
||||
.I idlestring
|
||||
The idlestring configuration option for the console.
|
||||
.SH "ESCAPE SEQUENCES"
|
||||
The connection can be controlled by a two-character escape sequence, followed
|
||||
by a command. The default escape sequence is ``control-E c''
|
||||
by a command.
|
||||
The default escape sequence is ``control-E c''
|
||||
(octal 005 143).
|
||||
(The escape sequences are actually processed by the server; see the
|
||||
.BR conserver (8)
|
||||
@ -248,58 +386,96 @@ man page for more information.)
|
||||
Commands are:
|
||||
.sp
|
||||
.PD 0
|
||||
.IP a
|
||||
.TP 13
|
||||
.B \.
|
||||
disconnect
|
||||
.TP
|
||||
.B ;
|
||||
move to another console
|
||||
.TP
|
||||
.B a
|
||||
attach read-write if nobody already is
|
||||
.IP b
|
||||
.TP
|
||||
.B b
|
||||
send broadcast message to all users on this console
|
||||
.IP c
|
||||
.TP
|
||||
.B c
|
||||
toggle flow control (don't do this)
|
||||
.IP d
|
||||
.TP
|
||||
.B d
|
||||
down the current console
|
||||
.IP e\fIcc\fP
|
||||
.TP
|
||||
.BI e cc
|
||||
change the escape sequence to the next two characters
|
||||
.IP f
|
||||
.TP
|
||||
.B f
|
||||
forcibly attach read-write
|
||||
.IP g
|
||||
.TP
|
||||
.B g
|
||||
group info
|
||||
.IP L
|
||||
.TP
|
||||
.B i
|
||||
information dump
|
||||
.TP
|
||||
.B L
|
||||
toggle logging on/off
|
||||
.IP l?
|
||||
.TP
|
||||
.B l?
|
||||
list the break sequences available
|
||||
.IP l0
|
||||
.TP
|
||||
.B l0
|
||||
send the break sequence associated with this console
|
||||
.IP l1-9
|
||||
.TP
|
||||
.B l1-9
|
||||
send the specific break sequence
|
||||
.IP o
|
||||
.TP
|
||||
.B m
|
||||
display the "message of the day"
|
||||
.TP
|
||||
.B o
|
||||
close (if open) and reopen the line (to clear errors (silo overflows))
|
||||
and the log file
|
||||
.IP p
|
||||
.TP
|
||||
.B p
|
||||
replay the last 60 lines of output
|
||||
.IP r
|
||||
.TP
|
||||
.B r
|
||||
replay the last 20 lines of output
|
||||
.IP s
|
||||
.TP
|
||||
.B s
|
||||
switch to spy mode (read-only)
|
||||
.IP u
|
||||
.TP
|
||||
.B u
|
||||
show status of hosts/users in this group
|
||||
.IP v
|
||||
.TP
|
||||
.B v
|
||||
show the version of the group server
|
||||
.IP w
|
||||
.TP
|
||||
.B w
|
||||
who is using this console
|
||||
.IP x
|
||||
.TP
|
||||
.B x
|
||||
examine this group's devices and modes
|
||||
.IP z
|
||||
.TP
|
||||
.B z
|
||||
suspend this connection
|
||||
.IP ?
|
||||
.TP
|
||||
.B |
|
||||
attach a local command to the console
|
||||
.TP
|
||||
.B ?
|
||||
display list of commands
|
||||
.IP "^M (return)"
|
||||
.TP
|
||||
.BR ^M " (return)"
|
||||
continue, ignore the escape sequence
|
||||
.IP "^R (ctrl-R)"
|
||||
.TP
|
||||
.BR ^R " (ctrl-R)"
|
||||
replay the last line only
|
||||
.IP \e\\fIooo\fP
|
||||
send character having octal code \fIooo\fP
|
||||
(must specify three octal digits)
|
||||
.IP \.
|
||||
disconnect
|
||||
.TP
|
||||
.BI \e ooo
|
||||
send character having octal code
|
||||
.IR ooo " (must"
|
||||
specify three octal digits)
|
||||
.PD
|
||||
.PP
|
||||
If any other character is hit after the escape sequence, all three characters
|
||||
@ -307,73 +483,85 @@ will be discarded.
|
||||
Note that a line break or a down command
|
||||
can only be sent from a full two-way attachment.
|
||||
To send the escape sequence through the connection one must redefine
|
||||
the outer escape sequence, or use \fB^Ec\\\fP\fIooo\fP to send the
|
||||
the outer escape sequence, or use
|
||||
.BI ^Ec\e ooo
|
||||
to send the
|
||||
first escape character before typing the second character directly.
|
||||
.PP
|
||||
In the \fB\-u\fP output, the login ``<none>'' indicates no one is
|
||||
In the
|
||||
.B \-u
|
||||
output, the login ``<none>'' indicates no one is
|
||||
viewing that console, and the login ``<spies>'' indicates that
|
||||
no one has a full two-way attachment. When no one is attached to
|
||||
a console its output is cloned to the stdout of the server process
|
||||
if \fBconserver\fP was started with the \fB\-u\fP option.
|
||||
no one has a full two-way attachment.
|
||||
When no one is attached to
|
||||
a console its output is cloned to the stdout of the server process if
|
||||
.B conserver
|
||||
was started with the
|
||||
.B \-u
|
||||
option.
|
||||
.SH EXAMPLES
|
||||
.TP
|
||||
.TP 15
|
||||
console \-u
|
||||
Outputs something like:
|
||||
.sp
|
||||
.RS
|
||||
.ta 18n 24n
|
||||
dumb up <none>
|
||||
.br
|
||||
expert up ksb@mentor
|
||||
.br
|
||||
tyro up <spies>
|
||||
.br
|
||||
mentor up <none>
|
||||
.br
|
||||
sage up fine@cis
|
||||
.DT
|
||||
.RE
|
||||
.IP
|
||||
The \fB<none>\fP indicates no one is viewing \fIdumb\fP or \fImentor\fP,
|
||||
the \fB<spies>\fP indicates only read-only connections exist for \fItyro\fP,
|
||||
.ft CR
|
||||
.nf
|
||||
dumb up <none>
|
||||
expert up ksb@mentor
|
||||
tyro up <spies>
|
||||
mentor up <none>
|
||||
sage up fine@cis
|
||||
.fi
|
||||
.ft
|
||||
.IP
|
||||
The
|
||||
.B <none>
|
||||
indicates no one is viewing
|
||||
.IR dumb
|
||||
or
|
||||
.IR mentor ,
|
||||
the
|
||||
.B <spies>
|
||||
indicates only read-only connections exist for
|
||||
.IR tyro ,
|
||||
and other
|
||||
.IR login @ host
|
||||
entries indicate users attached read-write to
|
||||
.I sage
|
||||
and
|
||||
other \fIlogin\fP@\fIhost\fP entries indicate users attached read-write to
|
||||
\fIsage\fP and \fIexpert\fP.
|
||||
.IR expert .
|
||||
.TP
|
||||
console \-w
|
||||
Outputs something like:
|
||||
.sp
|
||||
.RS
|
||||
.ta 18n 26n 32n
|
||||
ksb@extra attach 2days expert
|
||||
.br
|
||||
file@cis attach 21:46 sage
|
||||
.br
|
||||
dmr@alice spy \00:04 tyro
|
||||
.DT
|
||||
.RE
|
||||
.IP
|
||||
.ft CR
|
||||
.nf
|
||||
ksb@extra attach 2days expert
|
||||
file@cis attach 21:46 sage
|
||||
dmr@alice spy \00:04 tyro
|
||||
.fi
|
||||
.ft
|
||||
.IP
|
||||
The third column is the idle time of the user.
|
||||
Either \fIhours\fP:\fIminutes\fP or number of days is displayed.
|
||||
Either
|
||||
.IR hours : minutes
|
||||
or number of days is displayed.
|
||||
.TP
|
||||
console \-e \*(lq^[1\*(rq lv426
|
||||
console \-e "^[1" lv426
|
||||
Requests a connection to the host ``lv426'' with the escape characters
|
||||
set to ``escape one''.
|
||||
.SH BUGS
|
||||
SSL encryption only occurs when connecting to a single console, not
|
||||
on all client/server activity. The \fB-q\fP/\fB-Q\fP quit command will
|
||||
pass the root password in the clear. Other info-type
|
||||
options (like \fB-i\fP, \fB-w\fP, etc)
|
||||
are all sent unencrypted as well. This should be fixed soon.
|
||||
.PP
|
||||
It is possible to create a loop of console connections, with ugly results.
|
||||
Never run \fBconsole\fP from within a console connection (unless you set each
|
||||
Never run
|
||||
.B console
|
||||
from within a console connection (unless you set each
|
||||
escape sequence differently).
|
||||
.PP
|
||||
The \fB\-G\fP option doesn't help to explain how connections get built.
|
||||
The \-i output can produce more than the stated number of fields of
|
||||
information if the user-provided information has embedded colons.
|
||||
.PP
|
||||
I'm sure there are more, I just don't know where they are. Please
|
||||
let me know if you find any.
|
||||
I'm sure there are more, I just don't know where they are.
|
||||
Please let me know if you find any.
|
||||
.SH AUTHORS
|
||||
Thomas A. Fine, Ohio State Computer Science
|
||||
.br
|
||||
|
159
console/getpassword.c
Normal file
159
console/getpassword.c
Normal file
@ -0,0 +1,159 @@
|
||||
/*
|
||||
* $Id: getpassword.c,v 1.8 2003/11/20 13:56:41 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||
*
|
||||
* Copyright GNAC, Inc., 1998
|
||||
*/
|
||||
|
||||
#include <compat.h>
|
||||
|
||||
#include <pwd.h>
|
||||
|
||||
#include <cutil.h>
|
||||
#include <version.h>
|
||||
|
||||
|
||||
/* the next two routines assure that the users tty is in the
|
||||
* correct mode for us to do our thing
|
||||
*/
|
||||
static int screwy = 0;
|
||||
static struct termios o_tios;
|
||||
/* this holds the password given to us by the user */
|
||||
static STRING *pass = (STRING *)0;
|
||||
|
||||
|
||||
/*
|
||||
* show characters that are already tty processed,
|
||||
* and read characters before cononical processing
|
||||
* we really use cbreak at PUCC because we need even parity...
|
||||
*/
|
||||
static void
|
||||
#if PROTOTYPES
|
||||
C2Raw(int fd)
|
||||
#else
|
||||
C2Raw(fd)
|
||||
int fd;
|
||||
#endif
|
||||
{
|
||||
struct termios n_tios;
|
||||
|
||||
if (!isatty(fd) || 0 != screwy)
|
||||
return;
|
||||
|
||||
if (0 != tcgetattr(fd, &o_tios)) {
|
||||
Error("tcgetattr(%d): %s", fd, strerror(errno));
|
||||
Bye(EX_UNAVAILABLE);
|
||||
}
|
||||
n_tios = o_tios;
|
||||
n_tios.c_iflag &= ~(IUCLC | IXON);
|
||||
n_tios.c_oflag &= ~OPOST;
|
||||
n_tios.c_lflag &= ~(ISIG | ECHO | IEXTEN);
|
||||
n_tios.c_cc[VMIN] = 1;
|
||||
n_tios.c_cc[VTIME] = 0;
|
||||
if (0 != tcsetattr(fd, TCSANOW, &n_tios)) {
|
||||
Error("tcsetattr(%d, TCSANOW): %s", fd, strerror(errno));
|
||||
Bye(EX_UNAVAILABLE);
|
||||
}
|
||||
screwy = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* put the tty back as it was, however that was
|
||||
*/
|
||||
static void
|
||||
#if PROTOTYPES
|
||||
C2Normal(int fd)
|
||||
#else
|
||||
C2Normal(fd)
|
||||
int fd;
|
||||
#endif
|
||||
{
|
||||
if (!screwy)
|
||||
return;
|
||||
tcsetattr(fd, TCSANOW, &o_tios);
|
||||
screwy = 0;
|
||||
}
|
||||
|
||||
char *
|
||||
#if PROTOTYPES
|
||||
GetPassword(char *prompt)
|
||||
#else
|
||||
GetPassword(prompt)
|
||||
char *prompt;
|
||||
#endif
|
||||
{
|
||||
int fd;
|
||||
int nc;
|
||||
char buf[BUFSIZ];
|
||||
int done = 0;
|
||||
|
||||
if (prompt == (char *)0)
|
||||
prompt = "";
|
||||
if ((pass = AllocString()) == (STRING *)0)
|
||||
OutOfMem();
|
||||
BuildString((char *)0, pass);
|
||||
|
||||
if ((fd = open("/dev/tty", O_RDWR)) == -1) {
|
||||
Error("could not open `/dev/tty': %s", strerror(errno));
|
||||
return (char *)0;
|
||||
}
|
||||
|
||||
C2Raw(fd);
|
||||
write(fd, prompt, strlen(prompt));
|
||||
while (!done) {
|
||||
int i;
|
||||
if ((nc = read(0, buf, sizeof(buf))) == 0)
|
||||
break;
|
||||
for (i = 0; i < nc; ++i) {
|
||||
if (buf[i] == 0x0d || buf[i] == 0x0a) {
|
||||
/* CR, NL */
|
||||
done = 1;
|
||||
break;
|
||||
} else
|
||||
BuildStringChar(buf[i], pass);
|
||||
}
|
||||
}
|
||||
C2Normal(fd);
|
||||
/*
|
||||
{
|
||||
static STRING *c = (STRING *) 0;
|
||||
if ((c = AllocString()) == (STRING *) 0)
|
||||
OutOfMem();
|
||||
write(fd, "\n'", 2);
|
||||
if (pass->used) {
|
||||
FmtCtlStr(pass->string, pass->used - 1, c);
|
||||
write(fd, c->string, c->used - 1);
|
||||
}
|
||||
write(fd, "'\n", 2);
|
||||
}
|
||||
*/
|
||||
write(fd, "\n", 1);
|
||||
close(fd);
|
||||
/* this way a (char*)0 is only returned on error */
|
||||
if (pass->string == (char *)0)
|
||||
return "";
|
||||
else
|
||||
return pass->string;
|
||||
}
|
||||
|
||||
void
|
||||
#if PROTOTYPES
|
||||
ClearPassword(void)
|
||||
#else
|
||||
ClearPassword()
|
||||
#endif
|
||||
{
|
||||
if (pass == (STRING *)0 || pass->allocated == 0)
|
||||
return;
|
||||
|
||||
#if HAVE_MEMSET
|
||||
memset((void *)(pass->string), '\000', pass->allocated);
|
||||
#else
|
||||
bzero((char *)(pass->string), pass->allocated);
|
||||
#endif
|
||||
|
||||
BuildString((char *)0, pass);
|
||||
}
|
10
console/getpassword.h
Normal file
10
console/getpassword.h
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id: getpassword.h,v 1.3 2003/09/11 09:10:58 bryan Exp $
|
||||
*
|
||||
* Copyright conserver.com, 2000
|
||||
*
|
||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||
*/
|
||||
|
||||
extern char *GetPassword PARAMS((char *));
|
||||
extern void *ClearPassword PARAMS((void));
|
@ -1,5 +1,11 @@
|
||||
Various contributions by folks....
|
||||
|
||||
chat
|
||||
Author: Greg Woods <woods@weird.com>
|
||||
Synopsis: A send/expect program...source code from the NetBSD
|
||||
distribution and modified by Greg Woods to work
|
||||
a bit better with conserver
|
||||
|
||||
solaris-package
|
||||
Author: Michael Sullivan <mike@trdlnk.com>
|
||||
Synopsis: Creates a solaris package
|
||||
@ -18,5 +24,5 @@ will be helpful.
|
||||
Bryan Stansell
|
||||
|
||||
#
|
||||
# $Id: README,v 1.3 2002-10-13 19:57:44-07 bryan Exp $
|
||||
# $Id: README,v 1.4 2003/09/29 14:29:37 bryan Exp $
|
||||
#
|
||||
|
52
contrib/chat/Makefile.in
Normal file
52
contrib/chat/Makefile.in
Normal file
@ -0,0 +1,52 @@
|
||||
### Path settings
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
sysconfdir = @sysconfdir@
|
||||
mandir = @mandir@
|
||||
|
||||
### Installation programs and flags
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
|
||||
LN_S = @LN_S@
|
||||
MKDIR = @MKDIR@
|
||||
|
||||
### Compiler and link options
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
DEFS = @DEFS@
|
||||
CPPFLAGS = -I$(top_srcdir) -I$(srcdir) $(DEFS) @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
### Makefile rules - no user-servicable parts below
|
||||
|
||||
CHAT_OBJS = chat.o
|
||||
CHAT_HDRS = ../../config.h
|
||||
ALL = chat
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
chat: $(CHAT_OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o chat $(CHAT_OBJS) $(LIBS)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o $(ALL) core
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
|
||||
install: chat
|
||||
$(MKDIR) $(DESTDIR)$(bindir)
|
||||
$(INSTALL_PROGRAM) chat $(DESTDIR)$(bindir)
|
||||
$(MKDIR) $(DESTDIR)$(mandir)/man1
|
||||
$(INSTALL) chat.man $(DESTDIR)$(mandir)/man1/chat.1
|
||||
|
||||
.PHONY: clean distclean install
|
8
contrib/chat/README
Normal file
8
contrib/chat/README
Normal file
@ -0,0 +1,8 @@
|
||||
Information from Greg Woods <woods@weird.com>:
|
||||
|
||||
This version of "chat" is derived from the NetBSD variant found in
|
||||
/usr/src/usr.sbin/pppd/chat.
|
||||
|
||||
It has had a new '-I' command-line flag added so that it can ignore
|
||||
the fact it's not running on a TTY device (i.e. to allow it to work
|
||||
over a socket).
|
1753
contrib/chat/chat.c
Normal file
1753
contrib/chat/chat.c
Normal file
File diff suppressed because it is too large
Load Diff
511
contrib/chat/chat.man
Normal file
511
contrib/chat/chat.man
Normal file
@ -0,0 +1,511 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" manual page [] for chat 1.8
|
||||
.\" Id: chat.8,v 1.9 1999/09/06 05:10:23 paulus Exp
|
||||
.\" SH section heading
|
||||
.\" SS subsection heading
|
||||
.\" LP paragraph
|
||||
.\" IP indented paragraph
|
||||
.\" TP hanging label
|
||||
.TH CHAT 8 "22 May 1999" "Chat Version 1.22"
|
||||
.SH "NAME"
|
||||
chat \- Automated conversational script with a modem
|
||||
.SH "SYNOPSIS"
|
||||
.B chat
|
||||
[
|
||||
.I options
|
||||
]
|
||||
.I script
|
||||
.SH "DESCRIPTION"
|
||||
.LP
|
||||
The \fIchat\fR program defines a conversational exchange between the
|
||||
computer and the modem. Its primary purpose is to establish the
|
||||
connection between the Point-to-Point Protocol Daemon (\fIpppd\fR) and
|
||||
the remote's \fIpppd\fR process.
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
.B -f \fI<chat file>
|
||||
Read the chat script from the chat \fIfile\fR. The use of this option
|
||||
is mutually exclusive with the chat script parameters. The user must
|
||||
have read access to the file. Multiple lines are permitted in the
|
||||
file. Space or horizontal tab characters should be used to separate
|
||||
the strings.
|
||||
.TP
|
||||
.B -t \fI<timeout>
|
||||
Set the timeout for the expected string to be received. If the string
|
||||
is not received within the time limit then the reply string is not
|
||||
sent. An alternate reply may be sent or the script will fail if there
|
||||
is no alternate reply string. A failed script will cause the
|
||||
\fIchat\fR program to terminate with a non-zero error code.
|
||||
.TP
|
||||
.B -r \fI<report file>
|
||||
Set the file for output of the report strings. If you use the keyword
|
||||
\fIREPORT\fR, the resulting strings are written to this file. If this
|
||||
option is not used and you still use \fIREPORT\fR keywords, the
|
||||
\fIstderr\fR file is used for the report strings.
|
||||
.TP
|
||||
.B -e
|
||||
Start with the echo option turned on. Echoing may also be turned on
|
||||
or off at specific points in the chat script by using the \fIECHO\fR
|
||||
keyword. When echoing is enabled, all output from the modem is echoed
|
||||
to \fIstderr\fR.
|
||||
.TP
|
||||
.B -E
|
||||
Enables environment variable substituion within chat scripts using the
|
||||
standard \fI$xxx\fR syntax.
|
||||
.TP
|
||||
.B -v
|
||||
Request that the \fIchat\fR script be executed in a verbose mode. The
|
||||
\fIchat\fR program will then log the execution state of the chat
|
||||
script as well as all text received from the modem and the output
|
||||
strings sent to the modem. The default is to log through the SYSLOG;
|
||||
the logging method may be altered with the -S and -s flags. SYSLOGs
|
||||
are logged to facility LOG_LOCAL2.
|
||||
.TP
|
||||
.B -V
|
||||
Request that the \fIchat\fR script be executed in a stderr verbose
|
||||
mode. The \fIchat\fR program will then log all text received from the
|
||||
modem and the output strings sent to the modem to the stderr device. This
|
||||
device is usually the local console at the station running the chat or
|
||||
pppd program.
|
||||
.TP
|
||||
.B -s
|
||||
Use stderr. All log messages from '-v' and all error messages will be
|
||||
sent to stderr.
|
||||
.TP
|
||||
.B -S
|
||||
Do not use the SYSLOG. By default, error messages are sent to the
|
||||
SYSLOG. The use of -S will prevent both log messages from '-v' and
|
||||
error messages from being sent to the SYSLOG (to facility LOG_LOCAL2).
|
||||
.TP
|
||||
.B -T \fI<phone number>
|
||||
Pass in an arbitary string, usually a phone number, that will be
|
||||
substituted for the \eT substitution metacharacter in a send string.
|
||||
.TP
|
||||
.B -U \fI<phone number 2>
|
||||
Pass in a second string, usually a phone number, that will be
|
||||
substituted for the \eU substitution metacharacter in a send string.
|
||||
This is useful when dialing an ISDN terminal adapter that requires two
|
||||
numbers.
|
||||
.TP
|
||||
.B script
|
||||
If the script is not specified in a file with the \fI-f\fR option then
|
||||
the script is included as parameters to the \fIchat\fR program.
|
||||
.SH "CHAT SCRIPT"
|
||||
.LP
|
||||
The \fIchat\fR script defines the communications.
|
||||
.LP
|
||||
A script consists of one or more "expect-send" pairs of strings,
|
||||
separated by spaces, with an optional "subexpect-subsend" string pair,
|
||||
separated by a dash as in the following example:
|
||||
.IP
|
||||
ogin:-BREAK-ogin: ppp ssword: hello2u2
|
||||
.LP
|
||||
This line indicates that the \fIchat\fR program should expect the string
|
||||
"ogin:". If it fails to receive a login prompt within the time interval
|
||||
allotted, it is to send a break sequence to the remote and then expect the
|
||||
string "ogin:". If the first "ogin:" is received then the break sequence is
|
||||
not generated.
|
||||
.LP
|
||||
Once it received the login prompt the \fIchat\fR program will send the
|
||||
string ppp and then expect the prompt "ssword:". When it receives the
|
||||
prompt for the password, it will send the password hello2u2.
|
||||
.LP
|
||||
A carriage return is normally sent following the reply string. It is not
|
||||
expected in the "expect" string unless it is specifically requested by using
|
||||
the \er character sequence.
|
||||
.LP
|
||||
The expect sequence should contain only what is needed to identify the
|
||||
string. Since it is normally stored on a disk file, it should not contain
|
||||
variable information. It is generally not acceptable to look for time
|
||||
strings, network identification strings, or other variable pieces of data as
|
||||
an expect string.
|
||||
.LP
|
||||
To help correct for characters which may be corrupted during the initial
|
||||
sequence, look for the string "ogin:" rather than "login:". It is possible
|
||||
that the leading "l" character may be received in error and you may never
|
||||
find the string even though it was sent by the system. For this reason,
|
||||
scripts look for "ogin:" rather than "login:" and "ssword:" rather than
|
||||
"password:".
|
||||
.LP
|
||||
A very simple script might look like this:
|
||||
.IP
|
||||
ogin: ppp ssword: hello2u2
|
||||
.LP
|
||||
In other words, expect ....ogin:, send ppp, expect ...ssword:, send hello2u2.
|
||||
.LP
|
||||
In actual practice, simple scripts are rare. At the vary least, you
|
||||
should include sub-expect sequences should the original string not be
|
||||
received. For example, consider the following script:
|
||||
.IP
|
||||
ogin:--ogin: ppp ssword: hello2u2
|
||||
.LP
|
||||
This would be a better script than the simple one used earlier. This would look
|
||||
for the same login: prompt, however, if one was not received, a single
|
||||
return sequence is sent and then it will look for login: again. Should line
|
||||
noise obscure the first login prompt then sending the empty line will
|
||||
usually generate a login prompt again.
|
||||
.SH "COMMENTS"
|
||||
Comments can be embedded in the chat script. A comment is a line which
|
||||
starts with the \fB#\fR (hash) character in column 1. Such comment
|
||||
lines are just ignored by the chat program. If a '#' character is to
|
||||
be expected as the first character of the expect sequence, you should
|
||||
quote the expect string, or give its octal value, `\e043'.
|
||||
In a script file if you want to wait for a prompt that starts with a '#'
|
||||
character, you would have to write something like this:
|
||||
.IP
|
||||
# Now wait for the prompt and send logout string
|
||||
.br
|
||||
\'# ' logout
|
||||
.SH "SENDING DATA FROM A FILE"
|
||||
If the string to send starts with an at sign (@), the rest of the
|
||||
string is taken to be the name of a file to read to get the string to
|
||||
send. If the last character of the data read is a newline, it is
|
||||
removed. The file can be a named pipe (or fifo) instead of a regular
|
||||
file. This provides a way for \fBchat\fR to communicate with another
|
||||
program, for example, a program to prompt the user and receive a
|
||||
password typed in.
|
||||
.SH "ABORT STRINGS"
|
||||
Many modems will report the status of the call as a string. These
|
||||
strings may be \fBCONNECTED\fR or \fBNO CARRIER\fR or \fBBUSY\fR. It
|
||||
is often desirable to terminate the script should the modem fail to
|
||||
connect to the remote. The difficulty is that a script would not know
|
||||
exactly which modem string it may receive. On one attempt, it may
|
||||
receive \fBBUSY\fR while the next time it may receive \fBNO CARRIER\fR.
|
||||
.LP
|
||||
These "abort" strings may be specified in the script using the \fIABORT\fR
|
||||
sequence. It is written in the script as in the following example:
|
||||
.IP
|
||||
ABORT BUSY ABORT 'NO CARRIER' '' ATZ OK ATDT5551212 CONNECT
|
||||
.LP
|
||||
This sequence will expect nothing; and then send the string ATZ. The
|
||||
expected response to this is the string \fIOK\fR. When it receives \fIOK\fR,
|
||||
the string ATDT5551212 to dial the telephone. The expected string is
|
||||
\fICONNECT\fR. If the string \fICONNECT\fR is received the remainder of the
|
||||
script is executed. However, should the modem find a busy telephone, it will
|
||||
send the string \fIBUSY\fR. This will cause the string to match the abort
|
||||
character sequence. The script will then fail because it found a match to
|
||||
the abort string. If it received the string \fINO CARRIER\fR, it will abort
|
||||
for the same reason. Either string may be received. Either string will
|
||||
terminate the \fIchat\fR script.
|
||||
.SH "CLR_ABORT STRINGS"
|
||||
This sequence allows for clearing previously set \fBABORT\fR strings.
|
||||
\fBABORT\fR strings are kept in an array of a pre-determined size (at
|
||||
compilation time); \fBCLR_ABORT\fR will reclaim the space for cleared
|
||||
entries so that new strings can use that space.
|
||||
.SH "SAY STRINGS"
|
||||
The \fBSAY\fR directive allows the script to send strings to the user
|
||||
at the terminal via standard error. If \fBchat\fR is being run by
|
||||
pppd, and pppd is running as a daemon (detached from its controlling
|
||||
terminal), standard error will normally be redirected to the file
|
||||
/etc/ppp/connect-errors.
|
||||
.LP
|
||||
\fBSAY\fR strings must be enclosed in single or double quotes. If
|
||||
carriage return and line feed are needed in the string to be output,
|
||||
you must explicitly add them to your string.
|
||||
.LP
|
||||
The SAY strings could be used to give progress messages in sections of
|
||||
the script where you want to have 'ECHO OFF' but still let the user
|
||||
know what is happening. An example is:
|
||||
.IP
|
||||
ABORT BUSY
|
||||
.br
|
||||
ECHO OFF
|
||||
.br
|
||||
SAY "Dialling your ISP...\en"
|
||||
.br
|
||||
\'' ATDT5551212
|
||||
.br
|
||||
TIMEOUT 120
|
||||
.br
|
||||
SAY "Waiting up to 2 minutes for connection ... "
|
||||
.br
|
||||
CONNECT ''
|
||||
.br
|
||||
SAY "Connected, now logging in ...\n"
|
||||
.br
|
||||
ogin: account
|
||||
.br
|
||||
ssword: pass
|
||||
.br
|
||||
$ \c
|
||||
SAY "Logged in OK ...\n"
|
||||
\fIetc ...\fR
|
||||
.LP
|
||||
This sequence will only present the SAY strings to the user and all
|
||||
the details of the script will remain hidden. For example, if the
|
||||
above script works, the user will see:
|
||||
.IP
|
||||
Dialling your ISP...
|
||||
.br
|
||||
Waiting up to 2 minutes for connection ... Connected, now logging in ...
|
||||
.br
|
||||
Logged in OK ...
|
||||
.LP
|
||||
.SH "REPORT STRINGS"
|
||||
A \fBreport\fR string is similar to the ABORT string. The difference
|
||||
is that the strings, and all characters to the next control character
|
||||
such as a carriage return, are written to the report file.
|
||||
.LP
|
||||
The report strings may be used to isolate the transmission rate of the
|
||||
modem's connect string and return the value to the chat user. The
|
||||
analysis of the report string logic occurs in conjunction with the
|
||||
other string processing such as looking for the expect string. The use
|
||||
of the same string for a report and abort sequence is probably not
|
||||
very useful, however, it is possible.
|
||||
.LP
|
||||
The report strings to no change the completion code of the program.
|
||||
.LP
|
||||
These "report" strings may be specified in the script using the \fIREPORT\fR
|
||||
sequence. It is written in the script as in the following example:
|
||||
.IP
|
||||
REPORT CONNECT ABORT BUSY '' ATDT5551212 CONNECT '' ogin: account
|
||||
.LP
|
||||
This sequence will expect nothing; and then send the string
|
||||
ATDT5551212 to dial the telephone. The expected string is
|
||||
\fICONNECT\fR. If the string \fICONNECT\fR is received the remainder
|
||||
of the script is executed. In addition the program will write to the
|
||||
expect-file the string "CONNECT" plus any characters which follow it
|
||||
such as the connection rate.
|
||||
.SH "CLR_REPORT STRINGS"
|
||||
This sequence allows for clearing previously set \fBREPORT\fR strings.
|
||||
\fBREPORT\fR strings are kept in an array of a pre-determined size (at
|
||||
compilation time); \fBCLR_REPORT\fR will reclaim the space for cleared
|
||||
entries so that new strings can use that space.
|
||||
.SH "ECHO"
|
||||
The echo options controls whether the output from the modem is echoed
|
||||
to \fIstderr\fR. This option may be set with the \fI-e\fR option, but
|
||||
it can also be controlled by the \fIECHO\fR keyword. The "expect-send"
|
||||
pair \fIECHO\fR \fION\fR enables echoing, and \fIECHO\fR \fIOFF\fR
|
||||
disables it. With this keyword you can select which parts of the
|
||||
conversation should be visible. For instance, with the following
|
||||
script:
|
||||
.IP
|
||||
ABORT 'BUSY'
|
||||
.br
|
||||
ABORT 'NO CARRIER'
|
||||
.br
|
||||
'' ATZ
|
||||
.br
|
||||
OK\er\en ATD1234567
|
||||
.br
|
||||
\er\en \ec
|
||||
.br
|
||||
ECHO ON
|
||||
.br
|
||||
CONNECT \ec
|
||||
.br
|
||||
ogin: account
|
||||
.LP
|
||||
all output resulting from modem configuration and dialing is not visible,
|
||||
but starting with the \fICONNECT\fR (or \fIBUSY\fR) message, everything
|
||||
will be echoed.
|
||||
.SH "HANGUP"
|
||||
The HANGUP options control whether a modem hangup should be considered
|
||||
as an error or not. This option is useful in scripts for dialling
|
||||
systems which will hang up and call your system back. The HANGUP
|
||||
options can be \fBON\fR or \fBOFF\fR.
|
||||
.br
|
||||
When HANGUP is set OFF and the modem hangs up (e.g., after the first
|
||||
stage of logging in to a callback system), \fBchat\fR will continue
|
||||
running the script (e.g., waiting for the incoming call and second
|
||||
stage login prompt). As soon as the incoming call is connected, you
|
||||
should use the \fBHANGUP ON\fR directive to reinstall normal hang up
|
||||
signal behavior. Here is an (simple) example script:
|
||||
.IP
|
||||
ABORT 'BUSY'
|
||||
.br
|
||||
'' ATZ
|
||||
.br
|
||||
OK\er\en ATD1234567
|
||||
.br
|
||||
\er\en \ec
|
||||
.br
|
||||
CONNECT \ec
|
||||
.br
|
||||
\'Callback login:' call_back_ID
|
||||
.br
|
||||
HANGUP OFF
|
||||
.br
|
||||
ABORT "Bad Login"
|
||||
.br
|
||||
\'Callback Password:' Call_back_password
|
||||
.br
|
||||
TIMEOUT 120
|
||||
.br
|
||||
CONNECT \ec
|
||||
.br
|
||||
HANGUP ON
|
||||
.br
|
||||
ABORT "NO CARRIER"
|
||||
.br
|
||||
ogin:--BREAK--ogin: real_account
|
||||
.br
|
||||
\fIetc ...\fR
|
||||
.LP
|
||||
.SH "TIMEOUT"
|
||||
The initial timeout value is 45 seconds. This may be changed using the \fB-t\fR
|
||||
parameter.
|
||||
.LP
|
||||
To change the timeout value for the next expect string, the following
|
||||
example may be used:
|
||||
.IP
|
||||
ATZ OK ATDT5551212 CONNECT TIMEOUT 10 ogin:--ogin: TIMEOUT 5 assword: hello2u2
|
||||
.LP
|
||||
This will change the timeout to 10 seconds when it expects the login:
|
||||
prompt. The timeout is then changed to 5 seconds when it looks for the
|
||||
password prompt.
|
||||
.LP
|
||||
The timeout, once changed, remains in effect until it is changed again.
|
||||
.SH "SENDING EOT"
|
||||
The special reply string of \fIEOT\fR indicates that the chat program
|
||||
should send an EOT character to the remote. This is normally the
|
||||
End-of-file character sequence. A return character is not sent
|
||||
following the EOT.
|
||||
.PR
|
||||
The EOT sequence may be embedded into the send string using the
|
||||
sequence \fI^D\fR.
|
||||
.SH "GENERATING BREAK"
|
||||
The special reply string of \fIBREAK\fR will cause a break condition
|
||||
to be sent. The break is a special signal on the transmitter. The
|
||||
normal processing on the receiver is to change the transmission rate.
|
||||
It may be used to cycle through the available transmission rates on
|
||||
the remote until you are able to receive a valid login prompt.
|
||||
.PR
|
||||
The break sequence may be embedded into the send string using the
|
||||
\fI\eK\fR sequence.
|
||||
.SH "ESCAPE SEQUENCES"
|
||||
The expect and reply strings may contain escape sequences. All of the
|
||||
sequences are legal in the reply string. Many are legal in the expect.
|
||||
Those which are not valid in the expect sequence are so indicated.
|
||||
.TP
|
||||
.B ''
|
||||
Expects or sends a null string. If you send a null string then it will still
|
||||
send the return character. This sequence may either be a pair of apostrophe
|
||||
or quote characters.
|
||||
.TP
|
||||
.B \eb
|
||||
represents a backspace character.
|
||||
.TP
|
||||
.B \ec
|
||||
Suppresses the newline at the end of the reply string. This is the only
|
||||
method to send a string without a trailing return character. It must
|
||||
be at the end of the send string. For example,
|
||||
the sequence hello\ec will simply send the characters h, e, l, l, o.
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \ed
|
||||
Delay for one second. The program uses sleep(1) which will delay to a
|
||||
maximum of one second.
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \eK
|
||||
Insert a BREAK
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \en
|
||||
Send a newline or linefeed character.
|
||||
.TP
|
||||
.B \eN
|
||||
Send a null character. The same sequence may be represented by \e0.
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \ep
|
||||
Pause for a fraction of a second. The delay is 1/10th of a second.
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \eq
|
||||
Suppress writing the string to the SYSLOG. The string ?????? is
|
||||
written to the log in its place.
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \er
|
||||
Send or expect a carriage return.
|
||||
.TP
|
||||
.B \es
|
||||
Represents a space character in the string. This may be used when it
|
||||
is not desirable to quote the strings which contains spaces. The
|
||||
sequence 'HI\ TIM' and HI\esTIM are the same.
|
||||
.TP
|
||||
.B \et
|
||||
Send or expect a tab character.
|
||||
.TP
|
||||
.B \eT
|
||||
Send the phone number string as specified with the \fI-T\fR option
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \eU
|
||||
Send the phone number 2 string as specified with the \fI-U\fR option
|
||||
.I (not valid in expect.)
|
||||
.TP
|
||||
.B \e\e
|
||||
Send or expect a backslash character.
|
||||
.TP
|
||||
.B \eddd
|
||||
Collapse the octal digits (ddd) into a single ASCII character and send that
|
||||
character.
|
||||
.I (some characters are not valid in expect.)
|
||||
.TP
|
||||
.B \^^C
|
||||
Substitute the sequence with the control character represented by C.
|
||||
For example, the character DC1 (17) is shown as \^^Q.
|
||||
.I (some characters are not valid in expect.)
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
Environment variables are available within chat scripts, if the \fI-E\fR
|
||||
option was specified in the command line. The metacharacter \fI$\fR is used
|
||||
to introduce the name of the environment variable to substitute. If the
|
||||
substition fails, because the requested environment variable is not set,
|
||||
\fInothing\fR is replaced for the variable.
|
||||
.SH "TERMINATION CODES"
|
||||
The \fIchat\fR program will terminate with the following completion
|
||||
codes.
|
||||
.TP
|
||||
.B 0
|
||||
The normal termination of the program. This indicates that the script
|
||||
was executed without error to the normal conclusion.
|
||||
.TP
|
||||
.B 1
|
||||
One or more of the parameters are invalid or an expect string was too
|
||||
large for the internal buffers. This indicates that the program as not
|
||||
properly executed.
|
||||
.TP
|
||||
.B 2
|
||||
An error occurred during the execution of the program. This may be due
|
||||
to a read or write operation failing for some reason or chat receiving
|
||||
a signal such as SIGINT.
|
||||
.TP
|
||||
.B 3
|
||||
A timeout event occurred when there was an \fIexpect\fR string without
|
||||
having a "-subsend" string. This may mean that you did not program the
|
||||
script correctly for the condition or that some unexpected event has
|
||||
occurred and the expected string could not be found.
|
||||
.TP
|
||||
.B 4
|
||||
The first string marked as an \fIABORT\fR condition occurred.
|
||||
.TP
|
||||
.B 5
|
||||
The second string marked as an \fIABORT\fR condition occurred.
|
||||
.TP
|
||||
.B 6
|
||||
The third string marked as an \fIABORT\fR condition occurred.
|
||||
.TP
|
||||
.B 7
|
||||
The fourth string marked as an \fIABORT\fR condition occurred.
|
||||
.TP
|
||||
.B ...
|
||||
The other termination codes are also strings marked as an \fIABORT\fR
|
||||
condition.
|
||||
.LP
|
||||
Using the termination code, it is possible to determine which event
|
||||
terminated the script. It is possible to decide if the string "BUSY"
|
||||
was received from the modem as opposed to "NO DIAL TONE". While the
|
||||
first event may be retried, the second will probably have little
|
||||
chance of succeeding during a retry.
|
||||
.SH "SEE ALSO"
|
||||
Additional information about \fIchat\fR scripts may be found with UUCP
|
||||
documentation. The \fIchat\fR script was taken from the ideas proposed
|
||||
by the scripts used by the \fIuucico\fR program.
|
||||
.LP
|
||||
uucp(1), uucico(8)
|
||||
.SH "COPYRIGHT"
|
||||
The \fIchat\fR program is in public domain. This is not the GNU public
|
||||
license. If it breaks then you get to keep both pieces.
|
@ -5,8 +5,10 @@
|
||||
# for conserver and it's OpenSSL bits. It's far from perfect...or useful
|
||||
# outside of my own purposes. If this helps, cool. In the end I put the
|
||||
# rootcert.pem file in my global certs directory (OPENSSL_ROOT/ssl/certs),
|
||||
# point the server to server.pem and point the client at client.pem.
|
||||
# Ugly, yeah, but it's an ok test.
|
||||
# point the server to server.pem and point the client at client.pem. I
|
||||
# then run the c_rehash command (I supposed it helps or is important).
|
||||
# When it asks for a passphrase, use 'pass', otherwise this script won't
|
||||
# work. Ugly, yeah, but it's an ok test.
|
||||
#
|
||||
|
||||
[ -f rootreq.pem -a -f rootkey.pem ] || cat <<EOD | openssl req -newkey rsa:1024 -sha1 -keyout rootkey.pem -out rootreq.pem -passin pass:pass -passout pass:pass
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
|
||||
%define pkg conserver
|
||||
%define ver 7.2.7
|
||||
%define ver 8.1.4
|
||||
|
||||
# define the name of the machine on which the main conserver
|
||||
# daemon will be running if you don't want to use the default
|
||||
@ -17,7 +17,7 @@
|
||||
Summary: Serial console server daemon/client
|
||||
Name: %{pkg}
|
||||
Version: %{ver}
|
||||
Release: 1.%{distver}x
|
||||
Release: 1.%{distver}
|
||||
Copyright: distributable
|
||||
Group: System Environment/Daemons
|
||||
URL: http://www.conserver.com/
|
||||
@ -100,4 +100,6 @@ fi
|
||||
%{prefix}/share/man/man8/conserver.8.gz
|
||||
%{prefix}/share/man/man5/conserver.cf.5.gz
|
||||
%{prefix}/share/man/man5/conserver.passwd.5.gz
|
||||
%{prefix}/share/examples/conserver/conserver.cf
|
||||
%{prefix}/share/examples/conserver/conserver.passwd
|
||||
%{prefix}/sbin/conserver
|
||||
|
@ -1,7 +1,7 @@
|
||||
PKG="conserver"
|
||||
NAME="Console server and client"
|
||||
CATEGORY="system"
|
||||
VERSION="7.2.7"
|
||||
VERSION="8.1.4"
|
||||
DESC="Console server and client"
|
||||
CLASSES=none
|
||||
ARCH=sparc
|
||||
|
23
test/dotest
23
test/dotest
@ -6,11 +6,14 @@ exitval=0
|
||||
|
||||
cleanup()
|
||||
{
|
||||
[ -f test.out ] && rm test.out
|
||||
[ -f c.cf ] && rm c.cf
|
||||
[ -f test.out ] && rm -f test.out
|
||||
[ -f c.cf ] && rm -f c.cf
|
||||
[ $pid -eq 0 ] && return 0
|
||||
kill $pid
|
||||
for i in *.log; do rm $i; done
|
||||
for i in *.log; do
|
||||
[ "$i" != "conserver.log" ] && [ -f "$i" ] && rm -f "$i";
|
||||
done
|
||||
[ "$exitval" = 0 ] && rm -f conserver.log
|
||||
exit $exitval
|
||||
}
|
||||
|
||||
@ -21,7 +24,7 @@ dotest()
|
||||
if [ "$2" ]; then
|
||||
eval "$2" > test.out 2>&1
|
||||
else
|
||||
(echo "$1" && sleep 2) | \
|
||||
echo "$1" | \
|
||||
../console/console -M 127.0.0.1 -p 7777 shell > test.out 2>&1
|
||||
fi
|
||||
if [ "$record" ]; then
|
||||
@ -30,8 +33,8 @@ dotest()
|
||||
else
|
||||
if [ -f results/test$testnum ]; then
|
||||
if diff -i test.out results/test$testnum >test$testnum.diff 2>&1; then
|
||||
echo "succeded"
|
||||
rm test$testnum.diff
|
||||
echo "succeeded"
|
||||
rm -f test$testnum.diff
|
||||
else
|
||||
echo "failed (diffs in test$testnum.diff)"
|
||||
exitval=1
|
||||
@ -39,7 +42,7 @@ dotest()
|
||||
else
|
||||
echo "unknown (not recorded)"
|
||||
fi
|
||||
rm test.out
|
||||
rm -f test.out
|
||||
fi
|
||||
}
|
||||
|
||||
@ -57,6 +60,7 @@ else
|
||||
fi
|
||||
|
||||
$ECHO "starting conserver...$EE"
|
||||
rm -f c.cf
|
||||
cp test1.cf c.cf
|
||||
../conserver/conserver -M 127.0.0.1 -p 7777 -v -C c.cf \
|
||||
-P test.passwd -m 32 > conserver.log 2>&1 &
|
||||
@ -75,6 +79,7 @@ dotest 'cdc.'
|
||||
dotest 'coc.'
|
||||
|
||||
echo "moving in second config file"
|
||||
rm -f c.cf
|
||||
cp test2.cf c.cf
|
||||
kill -1 $pid
|
||||
sleep 3
|
||||
@ -85,4 +90,8 @@ dotest 'cl?c.'
|
||||
dotest 'cdc.'
|
||||
dotest 'coc.'
|
||||
|
||||
dotest EVAL "echo 'tu.' | ../console/console -M 127.0.0.1 -p 7777 -e 'tu' shell"
|
||||
dotest EVAL "../console/console -M 127.0.0.1 -p 7777 -R | sed -e 's/ [^ ]*$//'"
|
||||
dotest EVAL "../console/console -M 127.0.0.1 -p 7777 -x | sed -e 's/ on [^ ]* */ on /'"
|
||||
|
||||
cleanup
|
||||
|
@ -1,16 +1,2 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[help]
|
||||
. disconnect a attach read/write
|
||||
b send broadcast message c toggle flow control
|
||||
d down a console e change escape sequence
|
||||
f force attach read/write g group info
|
||||
i information dump L toggle logging on/off
|
||||
l? break sequence list 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 r replay the last 20 lines
|
||||
s spy read only u show host status
|
||||
v show version info w who is on this console
|
||||
x show console baud info z suspend the connection
|
||||
<cr> ignore/abort command ? print this message
|
||||
^R replay the last line \ooo send character by octal code
|
||||
[Enter `tu?' for help]
|
||||
[disconnect]
|
||||
|
@ -1,8 +1 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[halt list]
|
||||
0 `\z'
|
||||
1 `\z'
|
||||
2 `\r~^b'
|
||||
3 `#.reset -x\r'
|
||||
4 `hiya there\r'
|
||||
[disconnect]
|
||||
version `conserver.com version
|
||||
|
@ -1,3 +1,3 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[line down]
|
||||
[disconnect]
|
||||
shellb on at Local
|
||||
shella on at Local
|
||||
shell on at Local
|
||||
|
@ -1,4 +0,0 @@
|
||||
console: shell is down
|
||||
[Enter `^Ec?' for help]
|
||||
[up -- attached]
|
||||
[disconnect]
|
@ -1,16 +1,18 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[help]
|
||||
. disconnect a attach read/write
|
||||
b send broadcast message c toggle flow control
|
||||
d down a console e change escape sequence
|
||||
f force attach read/write g group info
|
||||
i information dump L toggle logging on/off
|
||||
l? break sequence list l0 send break per config file
|
||||
l1-9 send specific break sequence o (re)open the tty and log file
|
||||
. disconnect ; move to another console
|
||||
a attach read/write b send broadcast message
|
||||
c toggle flow control d down a console
|
||||
e change escape sequence f force attach read/write
|
||||
g group info i information dump
|
||||
L toggle logging on/off l? break sequence list
|
||||
l0 send break per config file l1-9 send specific break sequence
|
||||
m display the message of the day o (re)open the tty and log file
|
||||
p replay the last 60 lines r replay the last 20 lines
|
||||
s spy read only u show host status
|
||||
v show version info w who is on this console
|
||||
x show console baud info z suspend the connection
|
||||
<cr> ignore/abort command ? print this message
|
||||
^R replay the last line \ooo send character by octal code
|
||||
| attach local command ? print this message
|
||||
<cr> ignore/abort command ^R replay the last line
|
||||
\ooo send character by octal code
|
||||
[disconnect]
|
||||
|
@ -1,8 +1,9 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[halt list]
|
||||
0 `\z'
|
||||
1 `\z'
|
||||
2 `\r~^b'
|
||||
3 `#.reset -x\r'
|
||||
5 `\rtest\r'
|
||||
0 - 250ms, `\z'
|
||||
1 - 250ms, `\z'
|
||||
2 - 250ms, `\r~^b'
|
||||
3 - 250ms, `#.'
|
||||
4 - 600ms, `\r\d~\d^b'
|
||||
5 - 250ms, `\rtest\r'
|
||||
[disconnect]
|
||||
|
@ -1,16 +1,18 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[help]
|
||||
. disconnect a attach read/write
|
||||
b send broadcast message c toggle flow control
|
||||
d down a console e change escape sequence
|
||||
f force attach read/write g group info
|
||||
i information dump L toggle logging on/off
|
||||
l? break sequence list l0 send break per config file
|
||||
l1-9 send specific break sequence o (re)open the tty and log file
|
||||
. disconnect ; move to another console
|
||||
a attach read/write b send broadcast message
|
||||
c toggle flow control d down a console
|
||||
e change escape sequence f force attach read/write
|
||||
g group info i information dump
|
||||
L toggle logging on/off l? break sequence list
|
||||
l0 send break per config file l1-9 send specific break sequence
|
||||
m display the message of the day o (re)open the tty and log file
|
||||
p replay the last 60 lines r replay the last 20 lines
|
||||
s spy read only u show host status
|
||||
v show version info w who is on this console
|
||||
x show console baud info z suspend the connection
|
||||
<cr> ignore/abort command ? print this message
|
||||
^R replay the last line \ooo send character by octal code
|
||||
| attach local command ? print this message
|
||||
<cr> ignore/abort command ^R replay the last line
|
||||
\ooo send character by octal code
|
||||
[disconnect]
|
||||
|
@ -1,8 +1,8 @@
|
||||
[Enter `^Ec?' for help]
|
||||
[halt list]
|
||||
0 `\z'
|
||||
1 `\z'
|
||||
2 `\r~^b'
|
||||
3 `#.reset -x\r'
|
||||
4 `hiya there\r'
|
||||
0 - 250ms, `\z'
|
||||
1 - 250ms, `\z'
|
||||
2 - 250ms, `\r~^b'
|
||||
3 - 250ms, `#.'
|
||||
4 - 250ms, `hiya there\r'
|
||||
[disconnect]
|
||||
|
34
test/test.cf
34
test/test.cf
@ -1,7 +1,29 @@
|
||||
# test conserver config file
|
||||
LOGDIR=.
|
||||
BREAK5=\rtest\r
|
||||
shell:|:9600p:&.log:5
|
||||
shell2:|::shell2.log:2
|
||||
%%
|
||||
trusted: 127.0.0.1
|
||||
default full {
|
||||
rw *;
|
||||
}
|
||||
default * {
|
||||
logfile ./&;
|
||||
timestamp "";
|
||||
include full;
|
||||
}
|
||||
break 5 {
|
||||
string "\rtest\r";
|
||||
}
|
||||
console shell {
|
||||
master localhost;
|
||||
logfile ./&.log;
|
||||
timestamp 5;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
console shell2 {
|
||||
master localhost;
|
||||
logfile ./shell2.log;
|
||||
timestamp 2;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
access * {
|
||||
trusted 127.0.0.1;
|
||||
}
|
||||
|
@ -1,7 +1,29 @@
|
||||
# test conserver config file
|
||||
LOGDIR=.
|
||||
BREAK5=\rtest\r
|
||||
shell:|:9600p:&.log:5
|
||||
shell2:|::shell2.log:2
|
||||
%%
|
||||
trusted: 127.0.0.1
|
||||
default full {
|
||||
rw *;
|
||||
}
|
||||
default * {
|
||||
logfile ./&;
|
||||
timestamp "";
|
||||
include full;
|
||||
}
|
||||
break 5 {
|
||||
string "\rtest\r";
|
||||
}
|
||||
console shell {
|
||||
master 127.0.0.1;
|
||||
logfile ./&.log;
|
||||
timestamp 5;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
console shell2 {
|
||||
master 127.0.0.1;
|
||||
logfile ./shell2.log;
|
||||
timestamp 2;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
access * {
|
||||
trusted 127.0.0.1;
|
||||
}
|
||||
|
@ -1,8 +1,35 @@
|
||||
# test conserver config file
|
||||
LOGDIR=.
|
||||
BREAK4=hiya there\r
|
||||
shell:|:9600p:&.log:5
|
||||
shella:|::&.log:5
|
||||
shellb:|::&.log:
|
||||
%%
|
||||
trusted: 127.0.0.1
|
||||
default full {
|
||||
rw *;
|
||||
}
|
||||
default * {
|
||||
logfile ./&;
|
||||
timestamp "";
|
||||
include full;
|
||||
}
|
||||
break 4 {
|
||||
string "hiya there\r";
|
||||
}
|
||||
console shell {
|
||||
master 127.0.0.1;
|
||||
logfile ./&.log;
|
||||
timestamp 5;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
console shella {
|
||||
master 127.0.0.1;
|
||||
logfile ./&.log;
|
||||
timestamp 5;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
console shellb {
|
||||
master 127.0.0.1;
|
||||
logfile ./&.log;
|
||||
type exec;
|
||||
exec "";
|
||||
}
|
||||
access * {
|
||||
trusted 127.0.0.1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user