mirror of
https://github.com/bstansell/conserver.git
synced 2025-04-24 04:55:48 +00:00
Compare commits
213 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
290933b4a7 | ||
|
ccf3a7a21f | ||
|
36a0f4cb31 | ||
|
1542e903af | ||
|
247f4775c1 | ||
|
ba8c638db1 | ||
|
9cbb5cd602 | ||
|
ebec2150ec | ||
|
440e593268 | ||
|
42e0224903 | ||
|
525f3a6fb4 | ||
|
4a2f357f0b | ||
|
0631fe04e6 | ||
|
5cd5df957c | ||
|
b4fce1abda | ||
|
a3ff2f39ea | ||
|
6d6e7e8e67 | ||
|
806701ab42 | ||
|
6746187d86 | ||
|
7db62ca35e | ||
|
c3a4e61906 | ||
|
f6f3999437 | ||
|
13c1365e46 | ||
|
8e3b84789d | ||
|
47c232b881 | ||
|
c2cc96b67f | ||
|
ee0fa16229 | ||
|
93671649a6 | ||
|
337647ed35 | ||
|
342fe1a4da | ||
|
affb22138d | ||
|
28837087b4 | ||
|
f93b20a3bc | ||
|
ec846dfedd | ||
|
e4162a8a6d | ||
|
8d83acb273 | ||
|
037ed61e1a | ||
|
b7aa0508f0 | ||
|
84fc79a459 | ||
|
31bdc9b4dd | ||
|
123eb1144f | ||
|
7b028b54b5 | ||
|
bc481964b5 | ||
|
1b2bf598b0 | ||
|
8ac5440d2e | ||
|
d3e5f34fa7 | ||
|
902344ce8d | ||
|
52a65dd864 | ||
|
32a918162f | ||
|
1a961cdf18 | ||
|
0ed802ea6f | ||
|
ebf3da2169 | ||
|
cf24bb9404 | ||
|
959a3bc8de | ||
|
e801b9cc75 | ||
|
8b3dfdb14f | ||
|
ae26f9fc02 | ||
|
361d55f656 | ||
|
e7ca230c22 | ||
|
60bdfc3a12 | ||
|
ce3b4f1d00 | ||
|
c8355ae8b9 | ||
|
d8bf1d96a8 | ||
|
780daa7d37 | ||
|
3091aa88c7 | ||
|
974451e7cf | ||
|
f1f3e2a1dc | ||
|
5be57261e8 | ||
|
0d64aad812 | ||
|
15359cd1f3 | ||
|
3bf686ed39 | ||
|
4396ff9456 | ||
|
e42a2c9c85 | ||
|
5935a7984e | ||
|
62dba066e1 | ||
|
3d3b5b7c44 | ||
|
8ac7f57db8 | ||
|
4caac4ddd7 | ||
|
0967c4b179 | ||
|
453bb82a75 | ||
|
2cbcb24728 | ||
|
3c96ccb0da | ||
|
a1368a2e94 | ||
|
8e37bc88d3 | ||
|
0d24934aaf | ||
|
5b7b61b33b | ||
|
7d1af7dd2b | ||
|
785f2dae9a | ||
|
11963af83e | ||
|
2a089dff46 | ||
|
2d8a816b62 | ||
|
55738e4e97 | ||
|
02d0c15a77 | ||
|
51ac2ace52 | ||
|
e862920a82 | ||
|
933f3271ad | ||
|
af79b97fdf | ||
|
3da2e0db15 | ||
|
958da9f13c | ||
|
31a4e9493d | ||
|
ca0bde5039 | ||
|
e77500eb11 | ||
|
b626f3fea9 | ||
|
dbe104674d | ||
|
54f35f135e | ||
|
17a2e50d5f | ||
|
3b1dbb3474 | ||
|
975304f033 | ||
|
d565e30d36 | ||
|
0aa733db99 | ||
|
abd8edec1d | ||
|
68422e949d | ||
|
2a9f3d981f | ||
|
08e8f7667d | ||
|
209b3a889a | ||
|
8455d4a8ce | ||
|
61473af523 | ||
|
a33f8cf63a | ||
|
89e400246b | ||
|
686f718e0d | ||
|
d3ffe500c9 | ||
|
b24257e79a | ||
|
f84e82a8d7 | ||
|
009bd45dad | ||
|
2561311abb | ||
|
956a618114 | ||
|
d679fa21b4 | ||
|
636dc4946b | ||
|
cdf979c5ad | ||
|
e289ba408f | ||
|
6c543f8137 | ||
|
1687e20148 | ||
|
62f5083f23 | ||
|
a8cff43007 | ||
|
b8e0d85185 | ||
|
3b12232c1c | ||
|
126e7cf04f | ||
|
4f29d9aa75 | ||
|
feb72a9a8f | ||
|
b0c99fe46d | ||
|
a18c8bc6c4 | ||
|
a75e3fc17c | ||
|
969731ea4f | ||
|
bd837bf4ce | ||
|
da781c9187 | ||
|
e6193995fe | ||
|
c3db82a572 | ||
|
8060b14efe | ||
|
649f5099d5 | ||
|
ddc8eec8c6 | ||
|
95c958d6b3 | ||
|
742da69935 | ||
|
8cfbe1aeb1 | ||
|
6c5814c9c8 | ||
|
5decb6e739 | ||
|
b68bc50e61 | ||
|
7e1d967251 | ||
|
ba1adaa351 | ||
|
b1cbf1580a | ||
|
16f1639262 | ||
|
efb908117f | ||
|
043a43225b | ||
|
fc94056635 | ||
|
f43f978691 | ||
|
5c9ffec7cd | ||
|
51cfe7eb30 | ||
|
6cee71850e | ||
|
922be28008 | ||
|
d330a25f97 | ||
|
1f8e299fe4 | ||
|
5ab4cad967 | ||
|
6526fcd002 | ||
|
9228512c67 | ||
|
2297db8291 | ||
|
8c44a3dec9 | ||
|
b352435f5c | ||
|
16bbf649dd | ||
|
225cddc056 | ||
|
b5a569345d | ||
|
de081974fc | ||
|
4c35d42135 | ||
|
3946ca2958 | ||
|
d4fe34041f | ||
|
d529026f11 | ||
|
09178676ce | ||
|
0032b330ec | ||
|
0a4d65a504 | ||
|
d97fd1a57f | ||
|
b285f0a948 | ||
|
12671246ae | ||
|
123cecc122 | ||
|
b1a0fa3c50 | ||
|
7315957bba | ||
|
06f5c67298 | ||
|
4330a8b5c0 | ||
|
139e08e73b | ||
|
4a32f41eca | ||
|
46a63441bb | ||
|
9b2d757e5f | ||
|
ff83413d6a | ||
|
864f9e7b9a | ||
|
26b165d251 | ||
|
d6af8728d7 | ||
|
16598183c6 | ||
|
4e3c2e134e | ||
|
166633395d | ||
|
05d8632431 | ||
|
28079e19a8 | ||
|
eb2ad65fba | ||
|
b2ea81a201 | ||
|
4039e65b31 | ||
|
8534a21cef | ||
|
484806e667 |
48
.cirrus.yml
Normal file
48
.cirrus.yml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
env:
|
||||||
|
CIRRUS_CLONE_DEPTH: 1
|
||||||
|
|
||||||
|
freebsd_13_task:
|
||||||
|
freebsd_instance:
|
||||||
|
image_family: freebsd-13-3
|
||||||
|
install_script:
|
||||||
|
- pkg install -y autoconf automake
|
||||||
|
- ./package/setup-configure
|
||||||
|
basic_script: &basic
|
||||||
|
- "[ -f Makefile ] && make distclean"
|
||||||
|
- ./configure || { cat config.log; exit 1; }
|
||||||
|
- make
|
||||||
|
- make test
|
||||||
|
uds_script: &uds
|
||||||
|
- "[ -f Makefile ] && make distclean"
|
||||||
|
- ./configure --with-trust-uds-cred --with-uds || { cat config.log; exit 1; }
|
||||||
|
- make
|
||||||
|
- make test
|
||||||
|
pam_ssl_script: &pamssl
|
||||||
|
- "[ -f Makefile ] && make distclean"
|
||||||
|
- ./configure --with-pam --with-openssl || { cat config.log; exit 1; }
|
||||||
|
- make
|
||||||
|
- make test
|
||||||
|
gssapi_script: &gssapi
|
||||||
|
- "[ -f Makefile ] && make distclean"
|
||||||
|
- ./configure --with-gssapi || { cat config.log; exit 1; }
|
||||||
|
- make
|
||||||
|
- make test
|
||||||
|
|
||||||
|
linux_gcc_task:
|
||||||
|
container:
|
||||||
|
image: gcc:latest
|
||||||
|
install_script:
|
||||||
|
- ./package/setup-configure
|
||||||
|
basic_script: *basic
|
||||||
|
uds_script: *uds
|
||||||
|
pam_ssl_script: *pamssl
|
||||||
|
|
||||||
|
#macos_task:
|
||||||
|
# osx_instance:
|
||||||
|
# image: mojave-xcode-10.1
|
||||||
|
# install_script:
|
||||||
|
# - brew install autoconf automake
|
||||||
|
# - ./package/setup-configure
|
||||||
|
# basic_script: *basic
|
||||||
|
# uds_script: *uds
|
||||||
|
# pam_ssl_script: *pamssl
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.[ch]~
|
4
FAQ
4
FAQ
@ -184,7 +184,3 @@ directed to faq@conserver.com. The FAQ answers the following questions:
|
|||||||
- Have you tried a search on the conserver site (it searches
|
- Have you tried a search on the conserver site (it searches
|
||||||
mailing list traffic as well) to see if someone else has gone
|
mailing list traffic as well) to see if someone else has gone
|
||||||
through the same problem?
|
through the same problem?
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: FAQ,v 1.9 2003/08/23 19:27:10 bryan Exp $
|
|
||||||
#
|
|
||||||
|
31
INSTALL
31
INSTALL
@ -156,8 +156,9 @@ Detailed Instructions
|
|||||||
--with-port=PORT Specify port number [conserver]
|
--with-port=PORT Specify port number [conserver]
|
||||||
--with-base=PORT Base port for secondary channel [0]
|
--with-base=PORT Base port for secondary channel [0]
|
||||||
--with-master=MASTER Specify master server hostname [console]
|
--with-master=MASTER Specify master server hostname [console]
|
||||||
--with-cffile=CFFILE Specify config filename
|
--with-ccffile=CFFILE Specify client config filename
|
||||||
[SYSCONFDIR/conserver.cf]
|
[SYSCONFDIR/console.cf]
|
||||||
|
--with-cffile=CFFILE Specify config filename [SYSCONFDIR/conserver.cf]
|
||||||
--with-pwdfile=PWDFILE Specify password filename
|
--with-pwdfile=PWDFILE Specify password filename
|
||||||
[SYSCONFDIR/conserver.passwd]
|
[SYSCONFDIR/conserver.passwd]
|
||||||
--with-logfile=LOGFILE Specify log filename [/var/log/conserver]
|
--with-logfile=LOGFILE Specify log filename [/var/log/conserver]
|
||||||
@ -166,12 +167,22 @@ Detailed Instructions
|
|||||||
--with-timeout=TIMEOUT Specify connect() timeout in seconds [10]
|
--with-timeout=TIMEOUT Specify connect() timeout in seconds [10]
|
||||||
--with-trustrevdns Trust reverse DNS information
|
--with-trustrevdns Trust reverse DNS information
|
||||||
--with-extmsgs Produce extended messages
|
--with-extmsgs Produce extended messages
|
||||||
|
--with-rpath Use -R as well as -L for libraries
|
||||||
|
--with-cycladests (deprecated - noop) Build for a Cyclades TS
|
||||||
--with-uds[=DIR] Use Unix domain sockets for client/server
|
--with-uds[=DIR] Use Unix domain sockets for client/server
|
||||||
communication [/tmp/conserver]
|
communication [/tmp/conserver]
|
||||||
|
--with-trust-uds-cred Trust UDS credentials obtained via socket
|
||||||
--with-libwrap[=PATH] Compile in libwrap (tcp_wrappers) support
|
--with-libwrap[=PATH] Compile in libwrap (tcp_wrappers) support
|
||||||
--with-openssl[=PATH] Compile in OpenSSL support
|
--with-openssl[=PATH] Compile in OpenSSL support
|
||||||
|
--with-req-server-cert Require server SSL certificate by client
|
||||||
|
--with-gssapi[=PATH] Compile in GSS-API support
|
||||||
|
--with-striprealm retry username without @REALM with gss-api
|
||||||
|
authentication
|
||||||
|
--with-freeipmi[=PATH] Compile in FreeIPMI support
|
||||||
--with-dmalloc[=PATH] Compile in dmalloc support
|
--with-dmalloc[=PATH] Compile in dmalloc support
|
||||||
--with-pam Enable PAM support
|
--with-pam Enable PAM support
|
||||||
|
--with-ipv6 (experimental) Use IPv6 for client/server
|
||||||
|
communication
|
||||||
|
|
||||||
Not surprisingly, some match the old conserver/cons.h items...here
|
Not surprisingly, some match the old conserver/cons.h items...here
|
||||||
they are for reference:
|
they are for reference:
|
||||||
@ -245,17 +256,6 @@ Detailed Instructions
|
|||||||
|
|
||||||
Other Information And Gotchas
|
Other Information And Gotchas
|
||||||
|
|
||||||
- Debian Linux Distribution
|
|
||||||
|
|
||||||
The Debian folks have conserver distributed with the package
|
|
||||||
names of conserver-client and conserver-server. They are in
|
|
||||||
the distribution "sid" and the "non-free" part (because the
|
|
||||||
Ohio State license doesn't explicitly allow for modification to
|
|
||||||
the code, even though it's totally implied and the intention of
|
|
||||||
the author - I've even got proof in email! Oh well, can't
|
|
||||||
blame the Debian folks for being cautious - they've been burned
|
|
||||||
before, apparently).
|
|
||||||
|
|
||||||
- Potential GCC bug
|
- Potential GCC bug
|
||||||
|
|
||||||
Adam Morris <AMorris@providence.org> reported a problem with
|
Adam Morris <AMorris@providence.org> reported a problem with
|
||||||
@ -275,8 +275,3 @@ Other Information And Gotchas
|
|||||||
connecting to servers, you might be tickling this bug and you
|
connecting to servers, you might be tickling this bug and you
|
||||||
can upgrade the compiler, turn off the optimization, or apply
|
can upgrade the compiler, turn off the optimization, or apply
|
||||||
this code change.
|
this code change.
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: INSTALL,v 1.39 2005/05/21 13:47:16 bryan Exp $
|
|
||||||
#
|
|
||||||
|
126
LICENSE
126
LICENSE
@ -1,115 +1,29 @@
|
|||||||
Since this piece of software has had many contiributors, there is a
|
BSD 3-Clause License
|
||||||
"chain" of licensing information embedded in the files. I've copied
|
|
||||||
what I could find here so that it's easy to reference. The entire
|
|
||||||
bundle of software is guided by these licensing statements.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2000, conserver.com
|
Copyright (c) 2000, conserver.com
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are
|
modification, are permitted provided that the following conditions are met:
|
||||||
met:
|
|
||||||
|
|
||||||
- Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
this list of conditions and the following disclaimer.
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
- Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
notice, this list of conditions and the following disclaimer in the
|
this list of conditions and the following disclaimer in the documentation
|
||||||
documentation and/or other materials provided with the
|
and/or other materials provided with the distribution.
|
||||||
distribution.
|
|
||||||
|
|
||||||
- Neither the name of conserver.com nor the names of its contributors
|
* Neither the name of the copyright holder nor the names of its
|
||||||
may be used to endorse or promote products derived from this
|
contributors may be used to endorse or promote products derived from
|
||||||
software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 1998, GNAC, Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
- Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
- Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
|
|
||||||
- Neither the name of GNAC, Inc. 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
||||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
|
||||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright 1992 Purdue Research Foundation, West Lafayette, Indiana
|
|
||||||
47907. All rights reserved.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
|
||||||
|
115
LICENSES
Normal file
115
LICENSES
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
Since this piece of software has had many contiributors, there is a
|
||||||
|
"chain" of licensing information embedded in the files. I've copied
|
||||||
|
what I could find here so that it's easy to reference. The entire
|
||||||
|
bundle of software is guided by these licensing statements.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2000, conserver.com
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
- Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
- Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
- Neither the name of conserver.com 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 1998, GNAC, Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
- Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
- Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
- Neither the name of GNAC, Inc. 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright 1992 Purdue Research Foundation, West Lafayette, Indiana
|
||||||
|
47907. All rights reserved.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------
|
104
LICENSES.md
Normal file
104
LICENSES.md
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
License Clarification
|
||||||
|
=====================
|
||||||
|
|
||||||
|
The licenses attached to this software ([LICENSES](LICENSES)) are supposed
|
||||||
|
to paint a simple concept: that this software was built for the open source
|
||||||
|
community and they result in a license compatible with [LICENSE](LICENSE).
|
||||||
|
|
||||||
|
Unfortunately, the real world steps in and troubles can arise. This note
|
||||||
|
has been moved over from the [INSTALL](INSTALL) file:
|
||||||
|
|
||||||
|
The Debian folks have conserver distributed with the package
|
||||||
|
names of conserver-client and conserver-server. They are in
|
||||||
|
the distribution "sid" and the "non-free" part (because the
|
||||||
|
Ohio State license doesn't explicitly allow for modification to
|
||||||
|
the code, even though it's totally implied and the intention of
|
||||||
|
the author - I've even got proof in email! Oh well, can't
|
||||||
|
blame the Debian folks for being cautious - they've been burned
|
||||||
|
before, apparently).
|
||||||
|
|
||||||
|
Here's a copy of the message I exchanged with Thomas A. Fine (original
|
||||||
|
author at OSU) in 2001 that is referenced above:
|
||||||
|
|
||||||
|
Date: Wed, 27 Jun 2001 19:47:18 -0400 (EDT)
|
||||||
|
To: bryan@conserver.com
|
||||||
|
From: "Thomas A. Fine" <fine@head-cfa.harvard.edu>
|
||||||
|
Subject: Re: A conserver license question...
|
||||||
|
|
||||||
|
> Hi Tom,
|
||||||
|
>
|
||||||
|
> I had a little "problem" crop up that I was hoping you could help me
|
||||||
|
> with. A guy out in net-land is trying to put a debian package together
|
||||||
|
> of the code I've been releasing (based on your original work) and they
|
||||||
|
> don't like part of the Ohio State license. I've attached the message
|
||||||
|
> below.
|
||||||
|
>
|
||||||
|
> I'm not sure what can be done. One thought was a message from you that
|
||||||
|
> I could put with the code stating that modifications are ok would
|
||||||
|
> work. Or maybe just modifying the original license statement. Heck, I
|
||||||
|
> don't even know if either are 100% legal. Maybe I need to talk to
|
||||||
|
> someone at Ohio State.
|
||||||
|
>
|
||||||
|
> Well, if you have any ideas or suggestions, please let me know. Don't
|
||||||
|
> know if I ever got a chance to thank you for the great stuff you
|
||||||
|
> started! Thank you! ;-)
|
||||||
|
|
||||||
|
Well, if I knew then what I know now, I would have copyrighted it
|
||||||
|
under my own name, and not under OSU, and then I could change it.
|
||||||
|
Since I don't work there anymore, strictly speaking, I can't change
|
||||||
|
it.
|
||||||
|
|
||||||
|
However, IMHO, this license allows modifications, without explicitly
|
||||||
|
stating it. I can state without a doubt that this was my intention
|
||||||
|
at the time (and hence, OSU's intention, since I put in the copyright
|
||||||
|
while working for OSU).
|
||||||
|
|
||||||
|
But also, since it allows use of the source, and since the statement
|
||||||
|
required for inclusion says "includes software ..." it seems pretty
|
||||||
|
clear that modification was both allowed and expected. You can't
|
||||||
|
really use sources if you aren't changing them, and you certainly
|
||||||
|
can't include this software in some other product without making
|
||||||
|
modifications.
|
||||||
|
|
||||||
|
As I recall, I more or less used the copyright that Berkeley was using
|
||||||
|
back then for there BSD-related software, so I'm surprised there's a
|
||||||
|
problem with it.
|
||||||
|
|
||||||
|
I have to point out that version 1.2, available at
|
||||||
|
http://hea-www.harvard.edu/~fine/Tech/cs1.2/
|
||||||
|
is distributed entirely without copyright notices. Interesting, no?
|
||||||
|
So I guess I could add a copyright notice to that. But would I then
|
||||||
|
be violating the OSU copyright that I wrote for 1.1? Since it is
|
||||||
|
a different version, I could probably write a new copyright notice
|
||||||
|
and license and be free and clear.
|
||||||
|
|
||||||
|
There's also Purdue's versions of the software. It's mentioned on my
|
||||||
|
console server web page at
|
||||||
|
http://hea-www.harvard.edu/~fine/Tech/console-server.html
|
||||||
|
|
||||||
|
So, pass this on to the people you're working with and let me know how
|
||||||
|
you want to proceed.
|
||||||
|
|
||||||
|
tom
|
||||||
|
|
||||||
|
In addition, a post to the Conserver Users mailing list in May 2020 contained:
|
||||||
|
|
||||||
|
From: Paul Wise via users <users@conserver.com>
|
||||||
|
To: users@conserver.com
|
||||||
|
Subject: Re: license change?
|
||||||
|
Date: Mon, 25 May 2020 12:42:28 +0800
|
||||||
|
|
||||||
|
On Thu, 2019-07-04 at 10:20 +0200, Bryan Stansell via users wrote:
|
||||||
|
> So, it's more the lack of explicitly stating the code can be
|
||||||
|
> modified.
|
||||||
|
|
||||||
|
Since then I talked to one of RedHat's lawyers and they mentioned that
|
||||||
|
they have dealt with this problem too and also concluded that these
|
||||||
|
licenses were intended to cover modification. The current wording of
|
||||||
|
the initial part of the BSD license reflects an attempt to correct an
|
||||||
|
earlier mistake (i.e. someone pointed out the error and Berkeley added
|
||||||
|
"with or without modification"). Also the anti-endorsement clause
|
||||||
|
implies a right to modify.
|
||||||
|
|
||||||
|
Hopefully corporations (or, I suppose, their lawyers) will be happy with the
|
||||||
|
explanation above and become comfortable with the stated license.
|
6
PROTOCOL
6
PROTOCOL
@ -7,7 +7,7 @@ What Is This?
|
|||||||
|
|
||||||
The following is an attempt to describe the client/server protocol used
|
The following is an attempt to describe the client/server protocol used
|
||||||
between the server (conserver) and the client (console). This document
|
between the server (conserver) and the client (console). This document
|
||||||
bases it's information on conserver version 8.1.4, as it's the release
|
bases its information on conserver version 8.1.4, as it's the release
|
||||||
currently available. If there are changes to the client/server
|
currently available. If there are changes to the client/server
|
||||||
protocol, the INSTALL file should reference them and, ideally, this
|
protocol, the INSTALL file should reference them and, ideally, this
|
||||||
document will be updated.
|
document will be updated.
|
||||||
@ -300,7 +300,3 @@ The more "interesting" escape sequences are the following.
|
|||||||
" -- attached (nologging)]"
|
" -- attached (nologging)]"
|
||||||
" -- attached]"
|
" -- attached]"
|
||||||
" -- spy mode]"
|
" -- spy mode]"
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: PROTOCOL,v 1.2 2005/09/05 21:54:03 bryan Exp $
|
|
||||||
#
|
|
||||||
|
70
README
70
README
@ -1,70 +0,0 @@
|
|||||||
README
|
|
||||||
======
|
|
||||||
|
|
||||||
|
|
||||||
Maintainer/Enhancer
|
|
||||||
|
|
||||||
Bryan Stansell (bryan@conserver.com)
|
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
|
||||||
|
|
||||||
See the INSTALL file for installation, the conserver.html file for
|
|
||||||
an overview, and the man pages for specifics.
|
|
||||||
|
|
||||||
|
|
||||||
Downloading
|
|
||||||
|
|
||||||
The latest version can be found at http://www.conserver.com/
|
|
||||||
(US-West).
|
|
||||||
|
|
||||||
Mirrors of the site are at:
|
|
||||||
|
|
||||||
Australia http://planetmirror.com/pub/conserver/
|
|
||||||
Ireland http://conserver.oss-mirror.org/
|
|
||||||
Germany http://conserver.linux-mirror.org/
|
|
||||||
Russia http://conserver.rinet.ru/
|
|
||||||
|
|
||||||
|
|
||||||
Systems Tested
|
|
||||||
|
|
||||||
Here's a list of systems that I've been told can successfully
|
|
||||||
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.
|
|
||||||
|
|
||||||
AIX 4.3.3/5.1/5.2, native cc
|
|
||||||
BSDI BSD/OS 3.X, gcc
|
|
||||||
Cygwin (w2k),gcc 2.95.3
|
|
||||||
DEC Tru64 4.0, gcc
|
|
||||||
DEC Tru64 4.0/5.1, native cc
|
|
||||||
FreeBSD 4.x (i386) gcc
|
|
||||||
FreeBSD 5.x (i386/amd64/sparc64) gcc
|
|
||||||
FreeBSD 6.x/7.x (i386/amd64/sparc64/ia64) 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
|
|
||||||
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
|
|
||||||
Solaris 10 and Solaris Express (build 33) (x86), gcc and native cc
|
|
||||||
|
|
||||||
|
|
||||||
Contributions
|
|
||||||
|
|
||||||
Contributions distributed with the code can be found in the contrib
|
|
||||||
subdirectory. Other tools that complement conserver are listed
|
|
||||||
below.
|
|
||||||
|
|
||||||
Zinc
|
|
||||||
----
|
|
||||||
According to the website, Zinc is a console log output management
|
|
||||||
program. For more information, visit the website at:
|
|
||||||
http://www.columbia.edu/acis/sy/unixdev/zinc
|
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: README,v 1.26 2006/04/16 17:45:08 bryan Exp $
|
|
||||||
#
|
|
35
README.md
Normal file
35
README.md
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
Conserver
|
||||||
|
=========
|
||||||
|
|
||||||
|
[](https://cirrus-ci.com/github/bstansell/conserver)
|
||||||
|
|
||||||
|
Conserver is an application that allows multiple users to watch a
|
||||||
|
serial console at the same time. It can log the data, allows users to
|
||||||
|
take write-access of a console (one at a time), and has a variety of
|
||||||
|
bells and whistles to accentuate that basic functionality. The idea is
|
||||||
|
that conserver will log all your serial traffic so you can go back and
|
||||||
|
review why something crashed, look at changes (if done on the console),
|
||||||
|
or tie the console logs into a monitoring system (just watch the
|
||||||
|
logfiles it creates). With multi-user capabilities you can work on
|
||||||
|
equipment with others, mentor, train, etc. It also does all that
|
||||||
|
client-server stuff so that, assuming you have a network connection,
|
||||||
|
you can interact with any of the equipment from home or wherever.
|
||||||
|
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
-------------
|
||||||
|
|
||||||
|
See the `INSTALL` file for installation and the man pages for specifics.
|
||||||
|
|
||||||
|
|
||||||
|
Downloading
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The latest version can be found on [GitHub](https://github.com/bstansell/conserver/releases).
|
||||||
|
|
||||||
|
|
||||||
|
Contributions
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Contributions distributed with the code can be found in the `contrib`
|
||||||
|
subdirectory.
|
4
TODO
4
TODO
@ -106,7 +106,3 @@ Bryan Stansell
|
|||||||
|
|
||||||
- quick-recheck of down consoles (for uds) and possibly only log state
|
- quick-recheck of down consoles (for uds) and possibly only log state
|
||||||
changes (instead of each try) : DJ Gregor <dj@gregor.com>
|
changes (instead of each try) : DJ Gregor <dj@gregor.com>
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: TODO,v 1.56 2006/04/03 22:20:34 bryan Exp $
|
|
||||||
#
|
|
||||||
|
1
_config.yml
Normal file
1
_config.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
theme: jekyll-theme-cayman
|
@ -1,5 +1,3 @@
|
|||||||
# $Id: INSTALL.old,v 1.1 2003/11/04 02:36:24 bryan Exp $
|
|
||||||
|
|
||||||
To install this program you need root access and access to the physical
|
To install this program you need root access and access to the physical
|
||||||
console of the machine (either through the console server or via the physical
|
console of the machine (either through the console server or via the physical
|
||||||
world).
|
world).
|
||||||
|
@ -15,7 +15,3 @@ No one I've ever talked to found a need for something like autologin.
|
|||||||
Good luck.
|
Good luck.
|
||||||
|
|
||||||
Bryan Stansell
|
Bryan Stansell
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: README,v 1.2 2002/09/23 21:08:42 bryan Exp $
|
|
||||||
#
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# $Id: README.old,v 1.1 2003/11/04 02:36:24 bryan Exp $
|
|
||||||
|
|
||||||
This program can be used to put a root shell on the console at boot time.
|
This program can be used to put a root shell on the console at boot time.
|
||||||
See the manual page.
|
See the manual page.
|
||||||
|
|
||||||
|
@ -34,13 +34,13 @@
|
|||||||
* to change the /etc/security/audit_event line.
|
* to change the /etc/security/audit_event line.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define AUE_autologin 32900
|
# define AUE_autologin 32900
|
||||||
|
|
||||||
#include <sys/unistd.h>
|
# include <sys/unistd.h>
|
||||||
#include <netdb.h>
|
# include <netdb.h>
|
||||||
#include <bsm/audit.h>
|
# include <bsm/audit.h>
|
||||||
#include <bsm/libbsm.h>
|
# include <bsm/libbsm.h>
|
||||||
#include <libintl.h>
|
# include <libintl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
@ -68,9 +68,6 @@
|
|||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
|
||||||
char *rcsid = "$Id: autologin.c,v 1.27 2013/09/20 21:15:13 bryan Exp $";
|
|
||||||
#endif /* not lint */
|
|
||||||
extern char *progname;
|
extern char *progname;
|
||||||
gid_t awGrps[NGROUPS_MAX];
|
gid_t awGrps[NGROUPS_MAX];
|
||||||
int iGrps = 0;
|
int iGrps = 0;
|
||||||
@ -86,7 +83,7 @@ void make_utmp();
|
|||||||
void usage();
|
void usage();
|
||||||
|
|
||||||
int
|
int
|
||||||
Process()
|
Process(void)
|
||||||
{
|
{
|
||||||
int iErrs = 0;
|
int iErrs = 0;
|
||||||
int i, iNewGrp;
|
int i, iNewGrp;
|
||||||
@ -209,9 +206,13 @@ Process()
|
|||||||
|
|
||||||
/* Close open files
|
/* Close open files
|
||||||
*/
|
*/
|
||||||
|
#if HAVE_CLOSEFROM
|
||||||
|
closefrom((char *)0 == pcTty ? 3 : 0);
|
||||||
|
#else
|
||||||
for (i = (char *)0 == pcTty ? 3 : 0; i < getdtablesize(); ++i) {
|
for (i = (char *)0 == pcTty ? 3 : 0; i < getdtablesize(); ++i) {
|
||||||
(void)close(i);
|
(void)close(i);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make us a session leader so that when we open /dev/tty
|
/* Make us a session leader so that when we open /dev/tty
|
||||||
* it will become our controlling terminal.
|
* it will become our controlling terminal.
|
||||||
@ -411,8 +412,7 @@ Process()
|
|||||||
|
|
||||||
#ifndef HAVE_PUTENV
|
#ifndef HAVE_PUTENV
|
||||||
int
|
int
|
||||||
putenv(pcAssign)
|
putenv(char *pcAssign)
|
||||||
char *pcAssign;
|
|
||||||
{
|
{
|
||||||
register char *pcEq;
|
register char *pcEq;
|
||||||
|
|
||||||
@ -427,8 +427,7 @@ putenv(pcAssign)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
addgroup(pcGrp)
|
addgroup(char *pcGrp)
|
||||||
char *pcGrp;
|
|
||||||
{
|
{
|
||||||
struct group *grp;
|
struct group *grp;
|
||||||
|
|
||||||
@ -451,9 +450,7 @@ addgroup(pcGrp)
|
|||||||
/* install a utmp entry to show the use we know is here is here (ksb)
|
/* install a utmp entry to show the use we know is here is here (ksb)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
make_utmp(pclogin, pctty)
|
make_utmp(char *pclogin, char *pctty)
|
||||||
char *pclogin;
|
|
||||||
char *pctty;
|
|
||||||
{
|
{
|
||||||
register int iFound, iPos;
|
register int iFound, iPos;
|
||||||
register int fdUtmp;
|
register int fdUtmp;
|
||||||
@ -513,7 +510,7 @@ make_utmp(pclogin, pctty)
|
|||||||
(void)strncpy(utmp.ut_line, pcDev, sizeof(utmp.ut_line));
|
(void)strncpy(utmp.ut_line, pcDev, sizeof(utmp.ut_line));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SETTTYENT
|
# ifdef HAVE_SETTTYENT
|
||||||
{
|
{
|
||||||
register struct ttyent *ty;
|
register struct ttyent *ty;
|
||||||
|
|
||||||
@ -534,7 +531,7 @@ make_utmp(pclogin, pctty)
|
|||||||
(void)strncpy(utmp.ut_line, pcDev, sizeof(utmp.ut_line));
|
(void)strncpy(utmp.ut_line, pcDev, sizeof(utmp.ut_line));
|
||||||
(void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name));
|
(void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name));
|
||||||
(void)strncpy(utmp.ut_host, "(autologin)", sizeof(utmp.ut_host));
|
(void)strncpy(utmp.ut_host, "(autologin)", sizeof(utmp.ut_host));
|
||||||
#else
|
# else
|
||||||
/* look through /etc/utmp by hand (sigh)
|
/* look through /etc/utmp by hand (sigh)
|
||||||
*/
|
*/
|
||||||
iFound = iPos = 0;
|
iFound = iPos = 0;
|
||||||
@ -546,7 +543,7 @@ make_utmp(pclogin, pctty)
|
|||||||
iPos++;
|
iPos++;
|
||||||
}
|
}
|
||||||
(void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name));
|
(void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name));
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
utmp.ut_time = time((time_t *)0);
|
utmp.ut_time = time((time_t *)0);
|
||||||
|
|
||||||
@ -562,7 +559,7 @@ make_utmp(pclogin, pctty)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
char *u_pch;
|
char *u_pch;
|
||||||
int u_loop;
|
int u_loop;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# mkcmd parser for autologin program
|
# mkcmd parser for autologin program
|
||||||
%%
|
%%
|
||||||
static char *rcsid =
|
|
||||||
"$Id: autologin.m,v 1.1 2003/11/04 02:36:24 bryan Exp $";
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
integer variable "iErrs" {
|
integer variable "iErrs" {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
.\" $Id: autologin.man,v 1.2 2004/03/23 18:32:06 bryan Exp $
|
|
||||||
.TH AUTOLOGIN 8L PUCC
|
.TH AUTOLOGIN 8L PUCC
|
||||||
.SH NAME
|
.SH NAME
|
||||||
autologin \- create an automatic login session from /etc/inittab
|
autologin \- create an automatic login session from /etc/inittab
|
||||||
|
@ -20,9 +20,7 @@ static int
|
|||||||
* does +arg if you give a last argument of "+", else give (char *)0
|
* does +arg if you give a last argument of "+", else give (char *)0
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
getopt(nargc, nargv, ostr)
|
getopt(int nargc, char **nargv, char *ostr)
|
||||||
int nargc;
|
|
||||||
char **nargv, *ostr;
|
|
||||||
{
|
{
|
||||||
register char *oli; /* option letter list index */
|
register char *oli; /* option letter list index */
|
||||||
static char EMSG[] = ""; /* just a null place */
|
static char EMSG[] = ""; /* just a null place */
|
||||||
@ -83,39 +81,35 @@ getopt(nargc, nargv, ostr)
|
|||||||
#endif /* ! HAVE_GETOPT */
|
#endif /* ! HAVE_GETOPT */
|
||||||
|
|
||||||
char
|
char
|
||||||
*progname =
|
*progname = "", *au_terse[] = {
|
||||||
"$Id: main.c,v 1.2 2013/09/20 21:15:13 bryan Exp $", *au_terse[] = {
|
|
||||||
" [-u] [-c cmd] [-e env=value] [-g group] [-l login] [-t tty]",
|
" [-u] [-c cmd] [-e env=value] [-g group] [-l login] [-t tty]",
|
||||||
" -h",
|
" -h",
|
||||||
" -V",
|
" -V",
|
||||||
(char *)0
|
(char *)0
|
||||||
}, *u_help[] = {
|
}, *u_help[] = {
|
||||||
"c cmd command to run",
|
|
||||||
"e env=value environment variable to set",
|
"c cmd command to run",
|
||||||
"g group initial group",
|
"e env=value environment variable to set",
|
||||||
"h print this help message",
|
"g group initial group",
|
||||||
"l login login name",
|
"h print this help message",
|
||||||
"t tty attach to this terminal",
|
"l login login name",
|
||||||
"u do no make utmp entry",
|
"t tty attach to this terminal",
|
||||||
"V show version information", (char *)0}, *pcCommand =
|
"u do no make utmp entry",
|
||||||
(char *)0, *pcGroup = (char *)0, *pcLogin = (char *)0, *pcTty =
|
"V show version information", (char *)0
|
||||||
(char *)0;
|
}, *pcCommand = (char *)0, *pcGroup = (char *)0, *pcLogin =
|
||||||
|
(char *)0, *pcTty = (char *)0;
|
||||||
int
|
int
|
||||||
fMakeUtmp = 1, iErrs = 0;
|
fMakeUtmp = 1, iErrs = 0;
|
||||||
|
|
||||||
#ifndef u_terse
|
#ifndef u_terse
|
||||||
#define u_terse (au_terse[0])
|
# define u_terse (au_terse[0])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *rcsid = "$Id: main.c,v 1.2 2013/09/20 21:15:13 bryan Exp $";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* parser
|
* parser
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char **argv)
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
{
|
||||||
static char
|
static char
|
||||||
sbOpt[] = "c:e:g:hl:t:uV", *u_pch = (char *)0;
|
sbOpt[] = "c:e:g:hl:t:uV", *u_pch = (char *)0;
|
||||||
@ -178,7 +172,7 @@ main(argc, argv)
|
|||||||
fMakeUtmp = 0;
|
fMakeUtmp = 0;
|
||||||
continue;
|
continue;
|
||||||
case 'V':
|
case 'V':
|
||||||
printf("%s: %s\n", progname, rcsid);
|
printf("%s\n", progname);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
extern char *progname, *au_terse[4], *u_help[9];
|
extern char *progname, *au_terse[4], *u_help[9];
|
||||||
#ifndef u_terse
|
#ifndef u_terse
|
||||||
#define u_terse (au_terse[0])
|
# define u_terse (au_terse[0])
|
||||||
#endif
|
#endif
|
||||||
extern int main();
|
extern int main();
|
||||||
extern int fMakeUtmp, iErrs;
|
extern int fMakeUtmp, iErrs;
|
||||||
|
98
compat.h
98
compat.h
@ -49,15 +49,15 @@
|
|||||||
/* For legacy compile-time setting of the port...
|
/* For legacy compile-time setting of the port...
|
||||||
*/
|
*/
|
||||||
#if ! defined(DEFPORT)
|
#if ! defined(DEFPORT)
|
||||||
# if defined(SERVICENAME)
|
# if defined(SERVICENAME)
|
||||||
# define DEFPORT SERVICENAME
|
# define DEFPORT SERVICENAME
|
||||||
|
# else
|
||||||
|
# if defined(PORTNUMBER)
|
||||||
|
# define DEFPORT PORTNUMBER
|
||||||
# else
|
# else
|
||||||
# if defined(PORTNUMBER)
|
# define DEFPORT "conserver"
|
||||||
# define DEFPORT PORTNUMBER
|
|
||||||
# else
|
|
||||||
# define DEFPORT "conserver"
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if STDC_HEADERS
|
#if STDC_HEADERS
|
||||||
@ -129,7 +129,7 @@ typedef long fd_set;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_TYPES_H
|
#if HAVE_TYPES_H
|
||||||
#include <sys/types.h>
|
# include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYS_WAIT_H
|
#if HAVE_SYS_WAIT_H
|
||||||
@ -138,30 +138,30 @@ typedef long fd_set;
|
|||||||
#define LO(s) ((unsigned)((s) & 0377))
|
#define LO(s) ((unsigned)((s) & 0377))
|
||||||
#define HI(s) ((unsigned)(((s) >> 8) & 0377))
|
#define HI(s) ((unsigned)(((s) >> 8) & 0377))
|
||||||
#if !defined(WIFEXITED)
|
#if !defined(WIFEXITED)
|
||||||
#define WIFEXITED(s) (LO(s)==0)
|
# define WIFEXITED(s) (LO(s)==0)
|
||||||
#endif
|
#endif
|
||||||
#if !defined(WEXITSTATUS)
|
#if !defined(WEXITSTATUS)
|
||||||
#define WEXITSTATUS(s) HI(s)
|
# define WEXITSTATUS(s) HI(s)
|
||||||
#endif
|
#endif
|
||||||
#if !defined(WIFSIGNALED)
|
#if !defined(WIFSIGNALED)
|
||||||
#define WIFSIGNALED(s) ((LO(s)>0)&&(HI(s)==0))
|
# define WIFSIGNALED(s) ((LO(s)>0)&&(HI(s)==0))
|
||||||
#endif
|
#endif
|
||||||
#if !defined(WTERMSIG)
|
#if !defined(WTERMSIG)
|
||||||
#define WTERMSIG(s) (LO(s)&0177)
|
# define WTERMSIG(s) (LO(s)&0177)
|
||||||
#endif
|
#endif
|
||||||
#if !defined(WIFSTOPPED)
|
#if !defined(WIFSTOPPED)
|
||||||
#define WIFSTOPPED(s) ((LO(s)==0177)&&(HI(s)!=0))
|
# define WIFSTOPPED(s) ((LO(s)==0177)&&(HI(s)!=0))
|
||||||
#endif
|
#endif
|
||||||
#if !defined(WSTOPSIG)
|
#if !defined(WSTOPSIG)
|
||||||
#define WSTOPSIG(s) HI(s)
|
# define WSTOPSIG(s) HI(s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYSEXITS_H
|
#if HAVE_SYSEXITS_H
|
||||||
#include <sysexits.h>
|
# include <sysexits.h>
|
||||||
#else
|
#else
|
||||||
#define EX_OK 0
|
# define EX_OK 0
|
||||||
#define EX_UNAVAILABLE 69
|
# define EX_UNAVAILABLE 69
|
||||||
#define EX_TEMPFAIL 75
|
# define EX_TEMPFAIL 75
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -235,19 +235,19 @@ extern char *h_errlist[];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_USERSEC_H
|
#ifdef HAVE_USERSEC_H
|
||||||
#include <usersec.h>
|
# include <usersec.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PTY_H
|
#ifdef HAVE_PTY_H
|
||||||
#include <pty.h>
|
# include <pty.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBUTIL_H
|
#ifdef HAVE_LIBUTIL_H
|
||||||
#include <libutil.h>
|
# include <libutil.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UTIL_H
|
#ifdef HAVE_UTIL_H
|
||||||
#include <util.h>
|
# include <util.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -280,54 +280,66 @@ typedef int socklen_t;
|
|||||||
* as legacy definitions.
|
* as legacy definitions.
|
||||||
*/
|
*/
|
||||||
#ifndef IUCLC
|
#ifndef IUCLC
|
||||||
#define IUCLC 0
|
# define IUCLC 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef OLCUC
|
#ifndef OLCUC
|
||||||
#define OLCUC 0
|
# define OLCUC 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef XCASE
|
#ifndef XCASE
|
||||||
#define XCASE 0
|
# define XCASE 0
|
||||||
#endif
|
#endif
|
||||||
/* Some systems don't have OFILL or *DLY. */
|
/* Some systems don't have OFILL or *DLY. */
|
||||||
#ifndef OFILL
|
#ifndef OFILL
|
||||||
#define OFILL 0
|
# define OFILL 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef NLDLY
|
#ifndef NLDLY
|
||||||
#define NLDLY 0
|
# define NLDLY 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef CRDLY
|
#ifndef CRDLY
|
||||||
#define CRDLY 0
|
# define CRDLY 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef TABDLY
|
#ifndef TABDLY
|
||||||
#define TABDLY 0
|
# define TABDLY 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef BSDLY
|
#ifndef BSDLY
|
||||||
#define BSDLY 0
|
# define BSDLY 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef ONOCR
|
#ifndef ONOCR
|
||||||
#define ONOCR 0
|
# define ONOCR 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef ONLRET
|
#ifndef ONLRET
|
||||||
#define ONLRET 0
|
# define ONLRET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SEEK_SET
|
#ifndef SEEK_SET
|
||||||
#define SEEK_SET L_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
|
#endif
|
||||||
|
|
||||||
/* setup a conditional debugging line */
|
/* setup a conditional debugging line */
|
||||||
#ifndef CONDDEBUG
|
#ifndef CONDDEBUG
|
||||||
#define CONDDEBUG(line) if (fDebug) {debugFileName=__FILE__; debugLineNo=__LINE__; Debug line;}
|
# define CONDDEBUG(line) if (fDebug) {debugFileName=__FILE__; debugLineNo=__LINE__; Debug line;}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_DMALLOC
|
#if HAVE_DMALLOC
|
||||||
#include <dmalloc.h>
|
# include <dmalloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
# include <ipmiconsole.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef INADDR_STYPE
|
||||||
|
# if USE_IPV6
|
||||||
|
# define INADDR_STYPE struct sockaddr_storage
|
||||||
|
# else
|
||||||
|
# define INADDR_STYPE struct in_addr
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SOCKADDR_STYPE
|
||||||
|
# if USE_IPV6
|
||||||
|
# define SOCKADDR_STYPE struct sockaddr_storage
|
||||||
|
# else
|
||||||
|
# define SOCKADDR_STYPE struct sockaddr_in
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
417
config.h.in
417
config.h.in
@ -1,417 +0,0 @@
|
|||||||
/* config.h.in. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Client config file path */
|
|
||||||
#undef CLIENTCONFIGFILE
|
|
||||||
|
|
||||||
/* Config file path */
|
|
||||||
#undef CONFIGFILE
|
|
||||||
|
|
||||||
/* ./configure invocation */
|
|
||||||
#undef CONFIGINVOCATION
|
|
||||||
|
|
||||||
/* TCP connection timeout */
|
|
||||||
#undef CONNECTTIMEOUT
|
|
||||||
|
|
||||||
/* Base socket used for secondary channel */
|
|
||||||
#undef DEFBASEPORT
|
|
||||||
|
|
||||||
/* Socket used to communicate */
|
|
||||||
#undef DEFPORT
|
|
||||||
|
|
||||||
/* Defined if building for a Cyclades TS */
|
|
||||||
#undef FOR_CYCLADES_TS
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `bigcrypt' function. */
|
|
||||||
#undef HAVE_BIGCRYPT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <bsm/audit.h> header file. */
|
|
||||||
#undef HAVE_BSM_AUDIT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <crypt.h> header file. */
|
|
||||||
#undef HAVE_CRYPT_H
|
|
||||||
|
|
||||||
/* have dmalloc support */
|
|
||||||
#undef HAVE_DMALLOC
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getaudit' function. */
|
|
||||||
#undef HAVE_GETAUDIT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getaudit_addr' function. */
|
|
||||||
#undef HAVE_GETAUDIT_ADDR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getdtablesize' function. */
|
|
||||||
#undef HAVE_GETDTABLESIZE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getlogin' function. */
|
|
||||||
#undef HAVE_GETLOGIN
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getopt' function. */
|
|
||||||
#undef HAVE_GETOPT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <getopt.h> header file. */
|
|
||||||
#undef HAVE_GETOPT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getprpwnam' function. */
|
|
||||||
#undef HAVE_GETPRPWNAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getrlimit' function. */
|
|
||||||
#undef HAVE_GETRLIMIT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getsid' function. */
|
|
||||||
#undef HAVE_GETSID
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getspnam' function. */
|
|
||||||
#undef HAVE_GETSPNAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gettimeofday' function. */
|
|
||||||
#undef HAVE_GETTIMEOFDAY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getuserattr' function. */
|
|
||||||
#undef HAVE_GETUSERATTR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getutent' function. */
|
|
||||||
#undef HAVE_GETUTENT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `grantpt' function. */
|
|
||||||
#undef HAVE_GRANTPT
|
|
||||||
|
|
||||||
/* have gss-api support */
|
|
||||||
#undef HAVE_GSSAPI
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Defined if in_addr_t exists */
|
|
||||||
#undef HAVE_IN_ADDR_T
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `iscomsec' function. */
|
|
||||||
#undef HAVE_ISCOMSEC
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `bsm' library (-lbsm). */
|
|
||||||
#undef HAVE_LIBBSM
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `memcmp' function. */
|
|
||||||
#undef HAVE_MEMCMP
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setlinebuf' function. */
|
|
||||||
#undef HAVE_SETLINEBUF
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setsockopt' function. */
|
|
||||||
#undef HAVE_SETSOCKOPT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setttyent' function. */
|
|
||||||
#undef HAVE_SETTTYENT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setvbuf' function. */
|
|
||||||
#undef HAVE_SETVBUF
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <shadow.h> header file. */
|
|
||||||
#undef HAVE_SHADOW_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `sigaction' function. */
|
|
||||||
#undef HAVE_SIGACTION
|
|
||||||
|
|
||||||
/* Defined if socklen_t exists */
|
|
||||||
#undef HAVE_SOCKLEN_T
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define if strcasecmp is available */
|
|
||||||
#undef HAVE_STRCASECMP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strerror' function. */
|
|
||||||
#undef HAVE_STRERROR
|
|
||||||
|
|
||||||
/* Define if stricmp is available */
|
|
||||||
#undef HAVE_STRICMP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strlcpy' function. */
|
|
||||||
#undef HAVE_STRLCPY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stropts.h> header file. */
|
|
||||||
#undef HAVE_STROPTS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `sysconf' function. */
|
|
||||||
#undef HAVE_SYSCONF
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sysexits.h> header file. */
|
|
||||||
#undef HAVE_SYSEXITS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/audit.h> header file. */
|
|
||||||
#undef HAVE_SYS_AUDIT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/ioctl_compat.h> header file. */
|
|
||||||
#undef HAVE_SYS_IOCTL_COMPAT_H
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
|
||||||
#undef HAVE_SYS_RESOURCE_H
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
||||||
#undef HAVE_SYS_TIME_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/ttold.h> header file. */
|
|
||||||
#undef HAVE_SYS_TTOLD_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/uio.h> header file. */
|
|
||||||
#undef HAVE_SYS_UIO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/un.h> header file. */
|
|
||||||
#undef HAVE_SYS_UN_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/vlimit.h> header file. */
|
|
||||||
#undef HAVE_SYS_VLIMIT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
|
||||||
#undef HAVE_SYS_WAIT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `tcgetattr' function. */
|
|
||||||
#undef HAVE_TCGETATTR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `tcgetpgrp' function. */
|
|
||||||
#undef HAVE_TCGETPGRP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `tcsendbreak' function. */
|
|
||||||
#undef HAVE_TCSENDBREAK
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `tcsetattr' function. */
|
|
||||||
#undef HAVE_TCSETATTR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `tcsetpgrp' function. */
|
|
||||||
#undef HAVE_TCSETPGRP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <ttyent.h> header file. */
|
|
||||||
#undef HAVE_TTYENT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <types.h> header file. */
|
|
||||||
#undef HAVE_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `unlockpt' function. */
|
|
||||||
#undef HAVE_UNLOCKPT
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Hostname of console server */
|
|
||||||
#undef MASTERHOST
|
|
||||||
|
|
||||||
/* Number of consoles per child process */
|
|
||||||
#undef MAXMEMB
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Password file path */
|
|
||||||
#undef PASSWDFILE
|
|
||||||
|
|
||||||
/* pidfile to write to */
|
|
||||||
#undef PIDFILE
|
|
||||||
|
|
||||||
/* Define to 1 if the C compiler supports function prototypes. */
|
|
||||||
#undef PROTOTYPES
|
|
||||||
|
|
||||||
/* Defined if client requires server SSL certificate */
|
|
||||||
#undef REQ_SERVER_CERT
|
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
|
||||||
#undef RETSIGTYPE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* retry username without @REALM with gss-api authentication */
|
|
||||||
#undef STRIP_REALM
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* Enable extensions on AIX 3, Interix. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
# undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable GNU extensions on systems that have them. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# undef _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable threading extensions on Solaris. */
|
|
||||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
# undef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
#endif
|
|
||||||
/* Enable extensions on HP NonStop. */
|
|
||||||
#ifndef _TANDEM_SOURCE
|
|
||||||
# undef _TANDEM_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable general extensions on Solaris. */
|
|
||||||
#ifndef __EXTENSIONS__
|
|
||||||
# undef __EXTENSIONS__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Defined if we use Unix domain sockets */
|
|
||||||
#undef USE_UNIX_DOMAIN_SOCKETS
|
|
||||||
|
|
||||||
/* Define to 1 if on MINIX. */
|
|
||||||
#undef _MINIX
|
|
||||||
|
|
||||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
|
||||||
this defined. */
|
|
||||||
#undef _POSIX_1_SOURCE
|
|
||||||
|
|
||||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define like PROTOTYPES; this can be used by system headers. */
|
|
||||||
#undef __PROTOTYPES
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
#undef const
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef gid_t
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
|
||||||
#undef mode_t
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
|
||||||
#undef pid_t
|
|
||||||
|
|
||||||
/* Define if <signal.h> does not define sig_atomic_t */
|
|
||||||
#undef sig_atomic_t
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
#undef size_t
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef uid_t
|
|
1658
config.sub
vendored
1658
config.sub
vendored
File diff suppressed because it is too large
Load Diff
@ -15,23 +15,26 @@ dnl AH_TEMPLATE([HAVE_POSIX_REGCOMP], [have POSIX regcomp])
|
|||||||
AH_TEMPLATE([HAVE_PAM], [have PAM support])
|
AH_TEMPLATE([HAVE_PAM], [have PAM support])
|
||||||
AH_TEMPLATE([HAVE_OPENSSL], [have openssl support])
|
AH_TEMPLATE([HAVE_OPENSSL], [have openssl support])
|
||||||
AH_TEMPLATE([HAVE_GSSAPI], [have gss-api support])
|
AH_TEMPLATE([HAVE_GSSAPI], [have gss-api support])
|
||||||
|
AH_TEMPLATE([HAVE_FREEIPMI], [have freeipmi support])
|
||||||
AH_TEMPLATE([STRIP_REALM], [retry username without @REALM with gss-api authentication])
|
AH_TEMPLATE([STRIP_REALM], [retry username without @REALM with gss-api authentication])
|
||||||
AH_TEMPLATE([HAVE_DMALLOC], [have dmalloc support])
|
AH_TEMPLATE([HAVE_DMALLOC], [have dmalloc support])
|
||||||
AH_TEMPLATE([HAVE_SA_LEN],[Defined if sa_len member exists in struct sockaddr])
|
AH_TEMPLATE([HAVE_SA_LEN],[Defined if sa_len member exists in struct sockaddr])
|
||||||
AH_TEMPLATE([TRUST_REVERSE_DNS],[Defined if we trust reverse DNS])
|
AH_TEMPLATE([TRUST_REVERSE_DNS],[Defined if we trust reverse DNS])
|
||||||
AH_TEMPLATE([USE_EXTENDED_MESSAGES],[Defined if we produce extended messages])
|
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([USE_UNIX_DOMAIN_SOCKETS],[Defined if we use Unix domain sockets])
|
||||||
|
AH_TEMPLATE([USE_IPV6], [Defined if building with IPv6 support])
|
||||||
AH_TEMPLATE([UDSDIR], [Directory for Unix domain sockets])
|
AH_TEMPLATE([UDSDIR], [Directory for Unix domain sockets])
|
||||||
AH_TEMPLATE([FOR_CYCLADES_TS], [Defined if building for a Cyclades TS])
|
AH_TEMPLATE([FOR_CYCLADES_TS], [Defined if building for a Cyclades TS])
|
||||||
AH_TEMPLATE([REQ_SERVER_CERT], [Defined if client requires server SSL certificate])
|
AH_TEMPLATE([REQ_SERVER_CERT], [Defined if client requires server SSL certificate])
|
||||||
|
AH_TEMPLATE([TRUST_UDS_CRED], [Defined if we trust credentials from UDS client])
|
||||||
|
|
||||||
dnl ### Normal initialization. ######################################
|
dnl ### Normal initialization. ######################################
|
||||||
AC_INIT
|
AC_INIT([conserver],m4_esyscmd_s([./gen-version number]))
|
||||||
AC_PREREQ(2.59)
|
AC_PREREQ(2.69)
|
||||||
AC_CONFIG_SRCDIR([conserver/main.c])
|
AC_CONFIG_SRCDIR([conserver/main.c])
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED(CONFIGINVOCATION, "$0 $@")
|
AC_DEFINE_UNQUOTED(CONFIGINVOCATION, "$0 $*")
|
||||||
|
|
||||||
dnl ### Set some option defaults. ###################################
|
dnl ### Set some option defaults. ###################################
|
||||||
if test -z "$CFLAGS"; then
|
if test -z "$CFLAGS"; then
|
||||||
@ -40,6 +43,9 @@ fi
|
|||||||
MKDIR="mkdir -p -m 755"
|
MKDIR="mkdir -p -m 755"
|
||||||
AC_SUBST(MKDIR)
|
AC_SUBST(MKDIR)
|
||||||
|
|
||||||
|
AC_SUBST(CONSERVER_VERSION, m4_esyscmd_s([./gen-version number]))
|
||||||
|
AC_SUBST(CONSERVER_DATE, m4_esyscmd_s([./gen-version date]))
|
||||||
|
|
||||||
|
|
||||||
dnl ### Custom settings. ############################################
|
dnl ### Custom settings. ############################################
|
||||||
dnl AC_MSG_CHECKING(whether to allow 64bit compilation)
|
dnl AC_MSG_CHECKING(whether to allow 64bit compilation)
|
||||||
@ -257,35 +263,6 @@ AC_ARG_WITH(extmsgs,
|
|||||||
;;
|
;;
|
||||||
esac],[AC_MSG_RESULT(no)])
|
esac],[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
AC_MSG_CHECKING(whether to use Unix domain sockets)
|
|
||||||
cons_with_uds="NO"
|
|
||||||
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])
|
|
||||||
cons_with_uds="YES"
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_DEFINE_UNQUOTED(UDSDIR, "$withval")
|
|
||||||
AC_DEFINE(USE_UNIX_DOMAIN_SOCKETS)
|
|
||||||
AC_MSG_RESULT('$withval')
|
|
||||||
cons_with_uds="YES"
|
|
||||||
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)])
|
|
||||||
|
|
||||||
use_dash_r=no
|
use_dash_r=no
|
||||||
AC_MSG_CHECKING(whether to use -R paths as well as -L)
|
AC_MSG_CHECKING(whether to use -R paths as well as -L)
|
||||||
AC_ARG_WITH(rpath,
|
AC_ARG_WITH(rpath,
|
||||||
@ -303,7 +280,7 @@ AC_ARG_WITH(rpath,
|
|||||||
|
|
||||||
AC_MSG_CHECKING(whether we are building for a Cyclades TS)
|
AC_MSG_CHECKING(whether we are building for a Cyclades TS)
|
||||||
AC_ARG_WITH(cycladests,
|
AC_ARG_WITH(cycladests,
|
||||||
AS_HELP_STRING([--with-cycladests],[Build for a Cyclades TS]),
|
AS_HELP_STRING([--with-cycladests],[(deprecated - noop) Build for a Cyclades TS]),
|
||||||
[case "$withval" in
|
[case "$withval" in
|
||||||
yes)
|
yes)
|
||||||
AC_DEFINE(FOR_CYCLADES_TS)
|
AC_DEFINE(FOR_CYCLADES_TS)
|
||||||
@ -324,7 +301,6 @@ AC_PROG_MAKE_SET
|
|||||||
dnl ### Compiler characteristics. ##################################
|
dnl ### Compiler characteristics. ##################################
|
||||||
AC_AIX
|
AC_AIX
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_C_PROTOTYPES
|
|
||||||
|
|
||||||
dnl AC_CHECK_SIZEOF(long)
|
dnl AC_CHECK_SIZEOF(long)
|
||||||
dnl if test "$ac_cv_sizeof_long" -gt 4; then
|
dnl if test "$ac_cv_sizeof_long" -gt 4; then
|
||||||
@ -401,6 +377,97 @@ AC_SEARCH_LIBS(crypt,crypt)
|
|||||||
AC_SUBST(CONSLIBS)
|
AC_SUBST(CONSLIBS)
|
||||||
AC_SUBST(CONSCPPFLAGS)
|
AC_SUBST(CONSCPPFLAGS)
|
||||||
AC_SUBST(CONSLDFLAGS)
|
AC_SUBST(CONSLDFLAGS)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(whether to use Unix domain sockets)
|
||||||
|
cons_with_uds="NO"
|
||||||
|
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])
|
||||||
|
cons_with_uds="YES"
|
||||||
|
;;
|
||||||
|
no)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_DEFINE_UNQUOTED(UDSDIR, "$withval")
|
||||||
|
AC_DEFINE(USE_UNIX_DOMAIN_SOCKETS)
|
||||||
|
AC_MSG_RESULT('$withval')
|
||||||
|
cons_with_uds="YES"
|
||||||
|
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
|
||||||
|
|
||||||
|
if test $cons_with_uds = YES; then
|
||||||
|
AC_MSG_CHECKING(whether to trust UDS credentials)
|
||||||
|
AC_ARG_WITH(trust-uds-cred,
|
||||||
|
AS_HELP_STRING([--with-trust-uds-cred],[Trust UDS credentials obtained via socket]),
|
||||||
|
[case "$withval" in
|
||||||
|
yes)
|
||||||
|
AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>],
|
||||||
|
[
|
||||||
|
struct sockpeercred u;
|
||||||
|
u.uid = 0;
|
||||||
|
#if !defined(SO_PEERCRED)
|
||||||
|
#error "no SO_PEERCRED defined"
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(UDS_CRED_STYPE, sockpeercred, [Defined to UDS credential structure name])
|
||||||
|
AC_DEFINE(UDS_CRED_UID, uid, [Defined to UDS credential structure uid field])
|
||||||
|
AC_DEFINE(UDS_CRED_SO, SO_PEERCRED, [Defined to UDS credential socket option])
|
||||||
|
AC_DEFINE(TRUST_UDS_CRED)],
|
||||||
|
[
|
||||||
|
AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>],
|
||||||
|
[
|
||||||
|
struct ucred u;
|
||||||
|
u.euid = 0;
|
||||||
|
#if !defined(SO_PEERCRED)
|
||||||
|
#error "no SO_PEERCRED defined"
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(UDS_CRED_STYPE, ucred, [Defined to UDS credential structure name])
|
||||||
|
AC_DEFINE(UDS_CRED_UID, uid, [Defined to UDS credential structure uid field])
|
||||||
|
AC_DEFINE(UDS_CRED_SO, SO_PEERCRED, [Defined to UDS credential socket option])
|
||||||
|
AC_DEFINE(TRUST_UDS_CRED)],
|
||||||
|
[
|
||||||
|
AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>],
|
||||||
|
[
|
||||||
|
struct peercred_struct u;
|
||||||
|
u.euid = 0;
|
||||||
|
#if !defined(SO_PEERID)
|
||||||
|
#error "no SO_PEERID defined"
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(UDS_CRED_STYPE, peercred_struct, [Defined to UDS credential structure name])
|
||||||
|
AC_DEFINE(UDS_CRED_UID, euid, [Defined to UDS credential structure uid field])
|
||||||
|
AC_DEFINE(UDS_CRED_SO, SO_PEERID, [Defined to UDS credential socket option])
|
||||||
|
AC_DEFINE(TRUST_UDS_CRED)],
|
||||||
|
[AC_MSG_RESULT(no)]),
|
||||||
|
])
|
||||||
|
])
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
;;
|
||||||
|
esac],[AC_MSG_RESULT(no)])
|
||||||
|
fi
|
||||||
|
],[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
cons_with_libwrap="NO"
|
cons_with_libwrap="NO"
|
||||||
AC_ARG_WITH(libwrap,
|
AC_ARG_WITH(libwrap,
|
||||||
AS_HELP_STRING([--with-libwrap@<:@=PATH@:>@],
|
AS_HELP_STRING([--with-libwrap@<:@=PATH@:>@],
|
||||||
@ -487,7 +554,7 @@ AC_ARG_WITH(openssl,
|
|||||||
[LIBS="$LIBS -lssl -lcrypto"
|
[LIBS="$LIBS -lssl -lcrypto"
|
||||||
AC_MSG_CHECKING(for openssl libraries -lssl and -lcrypto)
|
AC_MSG_CHECKING(for openssl libraries -lssl and -lcrypto)
|
||||||
AC_TRY_LINK([#include <openssl/ssl.h>
|
AC_TRY_LINK([#include <openssl/ssl.h>
|
||||||
],[SSL_library_init()],
|
],[SSL_CTX_new(NULL)],
|
||||||
[AC_MSG_RESULT(yes)
|
[AC_MSG_RESULT(yes)
|
||||||
cons_with_openssl="YES"
|
cons_with_openssl="YES"
|
||||||
AC_DEFINE(HAVE_OPENSSL)
|
AC_DEFINE(HAVE_OPENSSL)
|
||||||
@ -545,6 +612,7 @@ AC_ARG_WITH(gssapi,
|
|||||||
[LIBS="$oLIBS -lgssapi"
|
[LIBS="$oLIBS -lgssapi"
|
||||||
AC_MSG_CHECKING(for gssapi library -lgssapi)
|
AC_MSG_CHECKING(for gssapi library -lgssapi)
|
||||||
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
||||||
|
#include <stdio.h>
|
||||||
],[gss_create_empty_oid_set(NULL, NULL)],
|
],[gss_create_empty_oid_set(NULL, NULL)],
|
||||||
[AC_MSG_RESULT(yes)
|
[AC_MSG_RESULT(yes)
|
||||||
cons_with_gssapi="YES"
|
cons_with_gssapi="YES"
|
||||||
@ -554,6 +622,7 @@ AC_ARG_WITH(gssapi,
|
|||||||
LIBS="$oLIBS -lgssglue"
|
LIBS="$oLIBS -lgssglue"
|
||||||
AC_MSG_CHECKING(for gssapi library -lgssglue)
|
AC_MSG_CHECKING(for gssapi library -lgssglue)
|
||||||
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
||||||
|
#include <stdio.h>
|
||||||
],[gss_create_empty_oid_set(NULL, NULL)],
|
],[gss_create_empty_oid_set(NULL, NULL)],
|
||||||
[AC_MSG_RESULT(yes)
|
[AC_MSG_RESULT(yes)
|
||||||
cons_with_gssapi="YES"
|
cons_with_gssapi="YES"
|
||||||
@ -563,12 +632,23 @@ AC_ARG_WITH(gssapi,
|
|||||||
LIBS="$oLIBS -lgss"
|
LIBS="$oLIBS -lgss"
|
||||||
AC_MSG_CHECKING(for gssapi library -lgss)
|
AC_MSG_CHECKING(for gssapi library -lgss)
|
||||||
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
||||||
|
#include <stdio.h>
|
||||||
],[gss_create_empty_oid_set(NULL, NULL)],
|
],[gss_create_empty_oid_set(NULL, NULL)],
|
||||||
[AC_MSG_RESULT(yes)
|
[AC_MSG_RESULT(yes)
|
||||||
cons_with_gssapi="YES"
|
cons_with_gssapi="YES"
|
||||||
AC_DEFINE(HAVE_GSSAPI)
|
AC_DEFINE(HAVE_GSSAPI)
|
||||||
have_gssapi=yes],
|
have_gssapi=yes],
|
||||||
[AC_MSG_RESULT(no)])])])],)
|
[AC_MSG_RESULT(no)
|
||||||
|
LIBS="$oLIBS -lgssapi_krb5"
|
||||||
|
AC_MSG_CHECKING(for gssapi library -lgssapi_krb5)
|
||||||
|
AC_TRY_LINK([#include <gssapi/gssapi.h>
|
||||||
|
],[gss_create_empty_oid_set(NULL, NULL)],
|
||||||
|
[AC_MSG_RESULT(yes)
|
||||||
|
cons_with_gssapi="YES"
|
||||||
|
AC_DEFINE(HAVE_GSSAPI)
|
||||||
|
have_gssapi=yes],
|
||||||
|
[AC_MSG_RESULT(no)])])])])],)
|
||||||
|
|
||||||
|
|
||||||
if test $have_gssapi = no; then
|
if test $have_gssapi = no; then
|
||||||
LIBS="$oLIBS"
|
LIBS="$oLIBS"
|
||||||
@ -592,6 +672,51 @@ AC_ARG_WITH(gssapi,
|
|||||||
fi]
|
fi]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
cons_with_freeipmi="NO"
|
||||||
|
AC_ARG_WITH(freeipmi,
|
||||||
|
AS_HELP_STRING([--with-freeipmi@<:@=PATH@:>@],
|
||||||
|
[Compile in FreeIPMI support]),
|
||||||
|
[if test "$withval" != "no"; then
|
||||||
|
if test "$withval" != "yes"; then
|
||||||
|
FREEIPMICPPFLAGS="-I$withval/include"
|
||||||
|
if test "$use_dash_r" != "yes"; then
|
||||||
|
FREEIPMILDFLAGS="-L$withval/lib"
|
||||||
|
else
|
||||||
|
FREEIPMILDFLAGS="-L$withval/lib -R$withval/lib"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
FREEIPMICPPFLAGS=""
|
||||||
|
FREEIPMILDFLAGS=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
oCPPFLAGS="$CPPFLAGS"
|
||||||
|
oLDFLAGS="$LDFLAGS"
|
||||||
|
oLIBS="$LIBS"
|
||||||
|
have_freeipmi=no
|
||||||
|
|
||||||
|
CPPFLAGS="$CPPFLAGS $FREEIPMICPPFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $FREEIPMILDFLAGS"
|
||||||
|
|
||||||
|
AC_CHECK_HEADER([ipmiconsole.h],
|
||||||
|
[LIBS="$LIBS -lipmiconsole"
|
||||||
|
AC_MSG_CHECKING(for freeipmi libraries -lipmiconsole)
|
||||||
|
AC_TRY_LINK([#include <ipmiconsole.h>
|
||||||
|
],[ipmiconsole_ctx_fd(0)],
|
||||||
|
[AC_MSG_RESULT(yes)
|
||||||
|
cons_with_freeipmi="YES"
|
||||||
|
AC_DEFINE(HAVE_FREEIPMI)
|
||||||
|
CONSLIBS="$CONSLIBS -lipmiconsole"
|
||||||
|
have_freeipmi=yes],
|
||||||
|
[AC_MSG_RESULT(no)])],)
|
||||||
|
|
||||||
|
LIBS="$oLIBS"
|
||||||
|
if test $have_freeipmi = no; then
|
||||||
|
CPPFLAGS="$oCPPFLAGS"
|
||||||
|
LDFLAGS="$oLDFLAGS"
|
||||||
|
fi
|
||||||
|
fi]
|
||||||
|
)
|
||||||
|
|
||||||
cons_with_dmalloc="NO"
|
cons_with_dmalloc="NO"
|
||||||
AC_ARG_WITH(dmalloc,
|
AC_ARG_WITH(dmalloc,
|
||||||
AS_HELP_STRING([--with-dmalloc@<:@=PATH@:>@],
|
AS_HELP_STRING([--with-dmalloc@<:@=PATH@:>@],
|
||||||
@ -703,6 +828,23 @@ AC_ARG_WITH(pam,
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi],[AC_MSG_RESULT(no)])
|
fi],[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
cons_with_ipv6="NO"
|
||||||
|
AC_MSG_CHECKING(whether to support IPv6)
|
||||||
|
AC_ARG_WITH(ipv6,
|
||||||
|
AS_HELP_STRING([--with-ipv6],
|
||||||
|
[(experimental) Use IPv6 for client/server communication]),
|
||||||
|
[case "$withval" in
|
||||||
|
yes)
|
||||||
|
AC_DEFINE(USE_IPV6)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
cons_with_ipv6="YES"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
;;
|
||||||
|
esac],[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
|
||||||
dnl Checks for pty allocation...
|
dnl Checks for pty allocation...
|
||||||
dnl According to the xemacs distribution:
|
dnl According to the xemacs distribution:
|
||||||
dnl getpt() is the preferred pty allocation method on glibc systems.
|
dnl getpt() is the preferred pty allocation method on glibc systems.
|
||||||
@ -718,7 +860,7 @@ AC_CHECK_HEADERS(pty.h libutil.h util.h)
|
|||||||
AC_CHECK_LIB(util, openpty)
|
AC_CHECK_LIB(util, openpty)
|
||||||
AC_CHECK_FUNCS(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 memmove sysconf getlogin inet_aton setproctitle gettimeofday strlcpy)
|
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 gettimeofday strlcpy closefrom nanosleep)
|
||||||
AC_CHECK_FUNC(strcasecmp,
|
AC_CHECK_FUNC(strcasecmp,
|
||||||
[AC_DEFINE(HAVE_STRCASECMP, 1, [Define if strcasecmp is available])],
|
[AC_DEFINE(HAVE_STRCASECMP, 1, [Define if strcasecmp is available])],
|
||||||
[AC_CHECK_FUNC(stricmp,
|
[AC_CHECK_FUNC(stricmp,
|
||||||
@ -734,6 +876,7 @@ AC_CHECK_FUNCS(getaudit getaudit_addr)
|
|||||||
dnl ### Create output files. #######################################
|
dnl ### Create output files. #######################################
|
||||||
AC_CONFIG_FILES([Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile contrib/chat/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_CONFIG_FILES([conserver/conserver.rc], [chmod +x conserver/conserver.rc])
|
||||||
|
AC_CONFIG_FILES([conserver.cf/conserver.cf.man conserver.cf/conserver.passwd.man conserver/conserver.man console/console.man])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -744,11 +887,13 @@ echo " Unix domain sockets (--with-uds) : $cons_with_uds"
|
|||||||
echo " TCP wrappers (--with-libwrap) : $cons_with_libwrap"
|
echo " TCP wrappers (--with-libwrap) : $cons_with_libwrap"
|
||||||
echo " OpenSSL (--with-openssl) : $cons_with_openssl"
|
echo " OpenSSL (--with-openssl) : $cons_with_openssl"
|
||||||
echo " GSS-API (--with-gssapi) : $cons_with_gssapi"
|
echo " GSS-API (--with-gssapi) : $cons_with_gssapi"
|
||||||
|
echo " FreeIPMI (--with-freeipmi) : $cons_with_freeipmi"
|
||||||
if [ $cons_with_gssapi = "YES" ]; then
|
if [ $cons_with_gssapi = "YES" ]; then
|
||||||
echo " strip @REALM (--with-striprealm): $cons_strip_realm"
|
echo " strip @REALM (--with-striprealm): $cons_strip_realm"
|
||||||
fi
|
fi
|
||||||
echo " dmalloc (--with-dmalloc) : $cons_with_dmalloc"
|
echo " dmalloc (--with-dmalloc) : $cons_with_dmalloc"
|
||||||
echo " PAM support (--with-pam) : $cons_with_pam"
|
echo " PAM support (--with-pam) : $cons_with_pam"
|
||||||
|
echo " IPv6 support (--with-ipv6) : $cons_with_ipv6"
|
||||||
echo ""
|
echo ""
|
||||||
echo "=============================================================="
|
echo "=============================================================="
|
||||||
]
|
]
|
@ -5,7 +5,3 @@ then modify extensively. The man page for conserver.cf and conserver.passwd
|
|||||||
should explain the files with enough detail to get you going.
|
should explain the files with enough detail to get you going.
|
||||||
|
|
||||||
That's about it. Good luck.
|
That's about it. Good luck.
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: INSTALL,v 1.4 2005/05/21 13:47:18 bryan Exp $
|
|
||||||
#
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
.\" $Id: conserver.cf.man,v 1.84 2013/09/25 22:10:29 bryan Exp $
|
.TH CONSERVER.CF 5 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver"
|
||||||
.TH CONSERVER.CF 5 "2013/09/25" "conserver-8.1.19" "conserver"
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver.cf \- console configuration file for
|
conserver.cf \- console configuration file for
|
||||||
.BR conserver (8)
|
.BR conserver (8)
|
||||||
@ -212,9 +211,11 @@ connections from the hosts without username authentication.
|
|||||||
.TP
|
.TP
|
||||||
\f3break\fP \f2n\fP
|
\f3break\fP \f2n\fP
|
||||||
.br
|
.br
|
||||||
Define a break sequence where 0 <
|
Define a break sequence where (1 <=
|
||||||
.I n
|
.I n
|
||||||
< 10.
|
<= 9) or (a <=
|
||||||
|
.I n
|
||||||
|
<= z).
|
||||||
Break sequences are accessed via the
|
Break sequences are accessed via the
|
||||||
.RI ``^Ecl n ''
|
.RI ``^Ecl n ''
|
||||||
client escape sequence.
|
client escape sequence.
|
||||||
@ -384,11 +385,14 @@ Turn redirection on or off (see the
|
|||||||
.B \-R
|
.B \-R
|
||||||
command-line flag).
|
command-line flag).
|
||||||
.TP
|
.TP
|
||||||
\f3reinitcheck\fP \f2number\fP
|
\f3reinitcheck\fP \f2number\fP[\f3s\fP|\f3m\fP]
|
||||||
.br
|
.br
|
||||||
Set the number of minutes used between reinitialization checks (see the
|
Set the number of minutes used between reinitialization checks (see the
|
||||||
.B \-O
|
.B \-O
|
||||||
command-line flag).
|
command-line flag).
|
||||||
|
If an `s' or `m' is used after
|
||||||
|
.IR number ,
|
||||||
|
the specified time is interpreted as seconds or minutes.
|
||||||
.TP
|
.TP
|
||||||
\f3secondaryport\fP \f2number\fP|\f2name\fP
|
\f3secondaryport\fP \f2number\fP|\f2name\fP
|
||||||
.br
|
.br
|
||||||
@ -467,7 +471,7 @@ all consoles have an implicit ``include "*";'' at the beginning
|
|||||||
of their definition).
|
of their definition).
|
||||||
.RS
|
.RS
|
||||||
.TP
|
.TP
|
||||||
\f3baud\fP \f3300\fP|\f3600\fP|\f31800\fP|\f32400\fP|\f34800\fP|\f39600\fP|\f319200\fP|\f338400\fP|\f357600\fP|\f3115200\fP
|
\f3baud\fP \f3300\fP|\f3600\fP|\f31800\fP|\f32400\fP|\f34800\fP|\f39600\fP|\f319200\fP|\f338400\fP|\f357600\fP|\f3115200\fP|..|\f34000000\fP
|
||||||
.br
|
.br
|
||||||
Assign the baud rate to the console.
|
Assign the baud rate to the console.
|
||||||
Only consoles of type ``device'' will use this value.
|
Only consoles of type ``device'' will use this value.
|
||||||
@ -539,6 +543,10 @@ value
|
|||||||
.PP
|
.PP
|
||||||
Numeric Replacement
|
Numeric Replacement
|
||||||
.TP
|
.TP
|
||||||
|
.B b
|
||||||
|
.B baud
|
||||||
|
value
|
||||||
|
.TP
|
||||||
.B p
|
.B p
|
||||||
config
|
config
|
||||||
.B port
|
.B port
|
||||||
@ -616,9 +624,9 @@ Assign
|
|||||||
as the host to connect to for accessing the console.
|
as the host to connect to for accessing the console.
|
||||||
You must also set the
|
You must also set the
|
||||||
.B port
|
.B port
|
||||||
option as well.
|
option for consoles of type ``host''.
|
||||||
Normally, only consoles of type ``host'' will use this value, however
|
Normally, only consoles of type ``host'' and ``ipmi'' will use this value,
|
||||||
if the
|
however if the
|
||||||
.BR devicesubst ,
|
.BR devicesubst ,
|
||||||
.BR execsubst ,
|
.BR execsubst ,
|
||||||
or
|
or
|
||||||
@ -652,6 +660,111 @@ If an `s', `m', or `h' is used after
|
|||||||
the specified time is interpreted as seconds, minutes, or hours.
|
the specified time is interpreted as seconds, minutes, or hours.
|
||||||
Set the timeout to zero to disable the idle timeout (the default).
|
Set the timeout to zero to disable the idle timeout (the default).
|
||||||
.TP
|
.TP
|
||||||
|
\f3ipmiciphersuite\fP \f2number\fP
|
||||||
|
.br
|
||||||
|
Set the IPMI cipher suite. Syntactically valid
|
||||||
|
values are -1 (the default) and greater. Check the FreeIPMI documentation
|
||||||
|
for usable values.
|
||||||
|
.TP
|
||||||
|
\f3ipmikg\fP \f2string\fP|\f3""\fP
|
||||||
|
Set the BMC authentication key K_g to
|
||||||
|
.IR string .
|
||||||
|
A K_g value is a simple character string with the exception of `\e':
|
||||||
|
.RS
|
||||||
|
.RS
|
||||||
|
.sp
|
||||||
|
.PD 0
|
||||||
|
.TP 6
|
||||||
|
.B \e\e
|
||||||
|
backslash
|
||||||
|
.TP
|
||||||
|
.BI \e ooo
|
||||||
|
octal representation of a character (where
|
||||||
|
.I ooo
|
||||||
|
is one to three octal digits)
|
||||||
|
.TP
|
||||||
|
.BI \e c
|
||||||
|
character
|
||||||
|
.I c
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.RE
|
||||||
|
.IP
|
||||||
|
The resulting value must be no more than 20 characters.
|
||||||
|
The null string (``\f3""\fP'') is the default.
|
||||||
|
.TP
|
||||||
|
\f3ipmiworkaround\fP [\f3!\fP]option[\f3,\fP...]|\f3""\fP
|
||||||
|
.br
|
||||||
|
You can turn off a workaround by prefixing it with a
|
||||||
|
.RB `` ! ''
|
||||||
|
character.
|
||||||
|
So, to turn off the
|
||||||
|
.B integrity
|
||||||
|
workaround, you would use
|
||||||
|
.BR !integrity .
|
||||||
|
The following are valid
|
||||||
|
.IR option s
|
||||||
|
and their mapping to FreeIPMI settings:
|
||||||
|
.RS
|
||||||
|
.sp
|
||||||
|
.PD 0
|
||||||
|
.TP 21
|
||||||
|
.B activation-status
|
||||||
|
.SM SKIP_SOL_ACTIVATION_STATUS
|
||||||
|
.TP
|
||||||
|
.B auth-capabilites
|
||||||
|
.SM AUTHENTICATION_CAPABILITIES
|
||||||
|
.TP
|
||||||
|
.B channel-payload
|
||||||
|
.SM SKIP_CHANNEL_PAYLOAD_SUPPORT
|
||||||
|
.TP
|
||||||
|
.B checksum
|
||||||
|
.SM NO_CHECKSUM_CHECK
|
||||||
|
.TP
|
||||||
|
.B default
|
||||||
|
.SM DEFAULT
|
||||||
|
.TP
|
||||||
|
.B ignore-payload-size
|
||||||
|
.SM IGNORE_SOL_PAYLOAD_SIZE
|
||||||
|
.TP
|
||||||
|
.B ignore-port
|
||||||
|
.SM IGNORE_SOL_PORT
|
||||||
|
.TP
|
||||||
|
.B integrity
|
||||||
|
.SM NON_EMPTY_INTEGRITY_CHECK_VALUE
|
||||||
|
.TP
|
||||||
|
.B intel-session
|
||||||
|
.SM INTEL_2_0_SESSION
|
||||||
|
.TP
|
||||||
|
.B packet-sequence
|
||||||
|
.SM INCREMENT_SOL_PACKET_SEQUENCE
|
||||||
|
.TP
|
||||||
|
.B privilege
|
||||||
|
.SM OPEN_SESSION_PRIVILEGE
|
||||||
|
.TP
|
||||||
|
.B serial-alerts
|
||||||
|
.SM SERIAL_ALERTS_DEFERRED
|
||||||
|
.TP
|
||||||
|
.B sun-session
|
||||||
|
.SM SUN_2_0_SESSION
|
||||||
|
.TP
|
||||||
|
.B supermicro-session
|
||||||
|
.SM SUPERMICRO_2_0_SESSION
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.IP
|
||||||
|
If no
|
||||||
|
.B ipmiworkaround
|
||||||
|
is specified, the ``\f3default\fP'' workaround will be used.
|
||||||
|
The null string (``\f3""\fP'') unsets all workarounds,
|
||||||
|
including ``\f3default\fP''.
|
||||||
|
See the FreeIPMI documentation for details on what workarounds affect.
|
||||||
|
.TP
|
||||||
|
\f3ipmiprivlevel\fP \f2user\fP|\f2operator\fP|\f2admin\fP
|
||||||
|
.br
|
||||||
|
Set the privilege level for the username used during IPMI authentication.
|
||||||
|
The default privilege level is ``\f2admin\fP''.
|
||||||
|
.TP
|
||||||
\f3include\fP \f2default\fP
|
\f3include\fP \f2default\fP
|
||||||
.br
|
.br
|
||||||
The default block defined using the name
|
The default block defined using the name
|
||||||
@ -932,6 +1045,13 @@ Default is
|
|||||||
Set the parity option for the console.
|
Set the parity option for the console.
|
||||||
Only consoles of type ``device'' will use this value.
|
Only consoles of type ``device'' will use this value.
|
||||||
.TP
|
.TP
|
||||||
|
\f3password\fP \f2password\fP|\f3""\fP
|
||||||
|
.br
|
||||||
|
Use
|
||||||
|
.I password
|
||||||
|
during IPMI authentication.
|
||||||
|
If the null string (``\f3""\fP'') is used (the default), no password will be used.
|
||||||
|
.TP
|
||||||
\f3port\fP \f2number\fP|\f2name\fP
|
\f3port\fP \f2number\fP|\f2name\fP
|
||||||
.br
|
.br
|
||||||
Set the port used to access the console.
|
Set the port used to access the console.
|
||||||
@ -960,7 +1080,7 @@ terminal server by their physical numbering of
|
|||||||
or
|
or
|
||||||
.RI 1.. n
|
.RI 1.. n
|
||||||
(depending on if you like zero-based or one-based numbering).
|
(depending on if you like zero-based or one-based numbering).
|
||||||
Warning: you can generate a \-1 value with this formula,
|
Warning: you can generate a -1 value with this formula,
|
||||||
which will become a very high numbered positive
|
which will become a very high numbered positive
|
||||||
value (since things are stored unsigned).
|
value (since things are stored unsigned).
|
||||||
You must also set the
|
You must also set the
|
||||||
@ -1101,7 +1221,7 @@ A
|
|||||||
.RB ` b '
|
.RB ` b '
|
||||||
can be specified to add logging of break sequences sent to the console.
|
can be specified to add logging of break sequences sent to the console.
|
||||||
.TP
|
.TP
|
||||||
\f3type\fP \f3device\fP|\f3exec\fP|\f3host\fP|\f3noop\fP|\f3uds\fP
|
\f3type\fP \f3device\fP|\f3ipmi\fP|\f3exec\fP|\f3host\fP|\f3noop\fP|\f3uds\fP
|
||||||
.br
|
.br
|
||||||
Set the type of console.
|
Set the type of console.
|
||||||
A type of
|
A type of
|
||||||
@ -1110,6 +1230,16 @@ should be used for local serial ports (also set the
|
|||||||
.B device
|
.B device
|
||||||
value).
|
value).
|
||||||
A type of
|
A type of
|
||||||
|
.RB `` ipmi ''
|
||||||
|
should be used for IPMI serial over LAN consoles (also set the
|
||||||
|
.B host
|
||||||
|
value and possibly the
|
||||||
|
.BR username ,
|
||||||
|
.BR password ,
|
||||||
|
and
|
||||||
|
.BR ipmi *
|
||||||
|
values).
|
||||||
|
A type of
|
||||||
.RB `` exec ''
|
.RB `` exec ''
|
||||||
should be used for command invocations (perhaps also set the
|
should be used for command invocations (perhaps also set the
|
||||||
.B exec
|
.B exec
|
||||||
@ -1153,6 +1283,13 @@ See the
|
|||||||
.B devicesubst
|
.B devicesubst
|
||||||
option for an explanation of the format string.
|
option for an explanation of the format string.
|
||||||
If the null string (``\f3""\fP'') is used, no replacements will be done.
|
If the null string (``\f3""\fP'') is used, no replacements will be done.
|
||||||
|
.TP
|
||||||
|
\f3username\fP \f2username\fP|\f3""\fP
|
||||||
|
.br
|
||||||
|
Use
|
||||||
|
.I username
|
||||||
|
during IPMI authentication.
|
||||||
|
If the null string (``\f3""\fP'') is used (the default), the ``null'' user will be used.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
\f3group\fP \f2name\fP
|
\f3group\fP \f2name\fP
|
@ -1,5 +1,4 @@
|
|||||||
.\" $Id: conserver.passwd.man,v 1.10 2004/01/08 16:12:33 bryan Exp $
|
.TH CONSERVER.PASSWD 5 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver"
|
||||||
.TH CONSERVER.PASSWD 5 "2004/01/08" "conserver-8.1.19" "conserver"
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver.passwd \- user access information for
|
conserver.passwd \- user access information for
|
||||||
.BR conserver (8)
|
.BR conserver (8)
|
@ -1,5 +1,4 @@
|
|||||||
%!PS-Adobe-2.0 EPSF-1.2
|
%!PS-Adobe-2.0 EPSF-1.2
|
||||||
%%$Id: label.ps,v 1.1 2003/11/04 02:36:26 bryan Exp $
|
|
||||||
%%Title: RJ-11
|
%%Title: RJ-11
|
||||||
%%Creator: A Braunsdorf
|
%%Creator: A Braunsdorf
|
||||||
%%CreationDate:
|
%%CreationDate:
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# dummy conserver config file
|
# dummy conserver config file
|
||||||
#
|
#
|
||||||
# $Id: test.cf,v 1.2 2003/07/04 18:04:05 bryan Exp $
|
|
||||||
#
|
|
||||||
default full {
|
default full {
|
||||||
rw *;
|
rw *;
|
||||||
}
|
}
|
||||||
|
280
conserver.html
280
conserver.html
@ -1,280 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
|
|
||||||
<HTML>
|
|
||||||
<HEAD>
|
|
||||||
<META name="generator" content=
|
|
||||||
"HTML Tidy for Solaris (vers 25 March 2009), see www.w3.org">
|
|
||||||
<META name="keywords" content=
|
|
||||||
"conserver,serial,console,serial console,unix,tty,ttya,ttyb, rs-232,rs232,bryan stansell,stansell,console server,terminal server,headless">
|
|
||||||
<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>
|
|
||||||
<STYLE type="text/css">
|
|
||||||
body {
|
|
||||||
background-color: #EEEEEE;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
</STYLE>
|
|
||||||
</HEAD>
|
|
||||||
|
|
||||||
<BODY>
|
|
||||||
<TABLE summary="Logo" bgcolor="black" width="100%" align=
|
|
||||||
"center">
|
|
||||||
<TR>
|
|
||||||
<TD align="center"><IMG src="conserver.jpg" alt=
|
|
||||||
"Conserver"><BR></TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
<TABLE summary="Conserver Page" width="80%" align="center">
|
|
||||||
<TR>
|
|
||||||
<TD colspan="2" align="center">Please pick your closest
|
|
||||||
mirror: <A href=
|
|
||||||
"http://planetmirror.com/pub/conserver/">Australia</A>
|
|
||||||
<A href=
|
|
||||||
"http://conserver.linux-mirror.org/">Germany</A>
|
|
||||||
<A href="http://conserver.rayba.co/">Germany</A>
|
|
||||||
<A href=
|
|
||||||
"http://conserver.cybermirror.org/">Germany</A>
|
|
||||||
<A href=
|
|
||||||
"http://conserver.oss-mirror.org/">Ireland</A>
|
|
||||||
<A href="http://conserver.shape.ws/">Malaysia</A>
|
|
||||||
<A href="http://conserver.rinet.ru/">Russia</A>
|
|
||||||
<A href="http://www.conserver.com/">US-West
|
|
||||||
(Primary)</A><BR>
|
|
||||||
<BR></TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
<!-- empty cell here, then search box on right spans two rows,
|
|
||||||
then we have the text that appears on the left, so things
|
|
||||||
appear in the right order so they look right in lynx
|
|
||||||
--></TD>
|
|
||||||
|
|
||||||
<TD rowspan="2" align="right">
|
|
||||||
<FORM method="get" action=
|
|
||||||
"http://www.conserver.com/cgi-bin/omega">
|
|
||||||
<INPUT type="hidden" name="DEFAULTOP" value="and">
|
|
||||||
<INPUT type="text" size="20" name="P" value="">
|
|
||||||
<INPUT type="submit" value="Search">
|
|
||||||
</FORM>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
<H3>What is conserver?</H3>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
|
||||||
<TD colspan="2">
|
|
||||||
<P>From an email I once sent...</P>
|
|
||||||
|
|
||||||
<P>Conserver is an application that allows multiple users
|
|
||||||
to watch a serial console at the same time. It can log the
|
|
||||||
data, allows users to take write-access of a console (one
|
|
||||||
at a time), and has a variety of bells and whistles to
|
|
||||||
accentuate that basic functionality. The idea is that
|
|
||||||
conserver will log all your serial traffic so you can go
|
|
||||||
back and review why something crashed, look at changes (if
|
|
||||||
done on the console), or tie the console logs into a
|
|
||||||
monitoring system (just watch the logfiles it creates).
|
|
||||||
With multi-user capabilities you can work on equipment with
|
|
||||||
others, mentor, train, etc. It also does all that
|
|
||||||
client-server stuff so that, assuming you have a network
|
|
||||||
connection, you can interact with any of the equipment from
|
|
||||||
home or wherever.</P>
|
|
||||||
|
|
||||||
<H3>The FAQ</H3>Here's the conserver <A href="FAQ">FAQ</A>.
|
|
||||||
Got any additions? Let me know.
|
|
||||||
|
|
||||||
<H3>Mailing Lists</H3>
|
|
||||||
|
|
||||||
<P>There are currently two mailing lists available.
|
|
||||||
<A href="mailto:announce@conserver.com">announce@conserver.com</A>
|
|
||||||
is an announcement-only mailing list for informing of new
|
|
||||||
versions, major developments, etc. <A href=
|
|
||||||
"mailto:users@conserver.com">users@conserver.com</A> is for
|
|
||||||
general Q&A, discussions, ideas, etc. for conserver
|
|
||||||
users. You can sign up by sending a message to <A href=
|
|
||||||
"mailto:announce-request@conserver.com">announce-request@conserver.com</A>
|
|
||||||
or <A href=
|
|
||||||
"mailto:users-request@conserver.com">users-request@conserver.com</A>
|
|
||||||
with a subject of "subscribe" or head over to the online
|
|
||||||
<A href="https://www.conserver.com/mailman/listinfo">web
|
|
||||||
pages</A>.</P>
|
|
||||||
|
|
||||||
<H3>Origin</H3>
|
|
||||||
|
|
||||||
<P>The console server software found here is a heavily
|
|
||||||
modified version originally written by <A href=
|
|
||||||
"http://hea-www.harvard.edu/~fine/">Tom Fine</A> (<A href=
|
|
||||||
"mailto:fine@head-cfa.harvard.edu">fine@head-cfa.harvard.edu</A>)
|
|
||||||
at <A href="http://www.ohio-state.edu/">Ohio State</A> and
|
|
||||||
then Kevin S Braunsdorf (<A href=
|
|
||||||
"mailto:ksb+conserver@sa.fedex.com">ksb+conserver@sa.fedex.com</A>)
|
|
||||||
at <A href="http://www.purdue.edu/">Purdue University</A>.
|
|
||||||
Patches from Robert Olson (<A href=
|
|
||||||
"mailto:olson@mcs.anl.gov">olson@mcs.anl.gov</A>) at
|
|
||||||
<A href="http://www.anl.gov/">Argonne National
|
|
||||||
Laboratory</A> were then applied to get network console
|
|
||||||
support.</P>
|
|
||||||
|
|
||||||
<P>Arnold de Leon (<A href=
|
|
||||||
"mailto:arnold@corp.webtv.net">arnold@corp.webtv.net</A>)
|
|
||||||
then fixed various bugs and added enhancements while at
|
|
||||||
<A href="http://www.synopsys.com/">Synopsys</A>. I then
|
|
||||||
took the result, continued fixing things, and added
|
|
||||||
features we found useful.</P>
|
|
||||||
|
|
||||||
<P><A href="http://www.gnac.com/">GNAC</A> (Global
|
|
||||||
Networking and Computing - currently <A href=
|
|
||||||
"http://www.certaintysolutions.com/">Certainty
|
|
||||||
Solutions</A>) has been supporting my coding efforts (in
|
|
||||||
too many ways to list) since 1996.</P>
|
|
||||||
|
|
||||||
<H3>The conserver.com Distribution</H3>
|
|
||||||
|
|
||||||
<P>The result is a combination of many people's work. This
|
|
||||||
version is being released in hopes that it will help
|
|
||||||
others. There is no warranty or support implied by the
|
|
||||||
distribution of the software.</P>
|
|
||||||
|
|
||||||
<P>So, what the heck is up with all the different conserver
|
|
||||||
versions? Well, the original authors are continuing to
|
|
||||||
distribute their own threads of the software so you have
|
|
||||||
three main threads (as far as I know). First, there's Tom
|
|
||||||
Fine's thread at <A href=
|
|
||||||
"http://hea-www.harvard.edu/~fine/Tech/console-server.html">
|
|
||||||
http://hea-www.harvard.edu/~fine/Tech/console-server.html</A>.
|
|
||||||
He isn't actively developing it, however, according to the
|
|
||||||
website. Next, there's Kevin Braunsdorf's version at
|
|
||||||
<A href=
|
|
||||||
"http://www.npcguild.org/software/pundits/">http://www.npcguild.org/software/pundits/</A>.
|
|
||||||
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 (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
|
|
||||||
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 Sep 26, 2013, is
|
|
||||||
<A href="8.1.19.tar.gz">8.1.19.tar.gz</A>. See the <A href=
|
|
||||||
"CHANGES">CHANGES</A> file for information on the latest
|
|
||||||
updates.</P>
|
|
||||||
|
|
||||||
<P>For those worried about legal issues, the <A href=
|
|
||||||
"LICENSE">LICENSE</A> file should help show it's
|
|
||||||
distributed under a <A href=
|
|
||||||
"http://www.opensource.org/licenses/bsd-license.php">BSD
|
|
||||||
license.</A></P>
|
|
||||||
|
|
||||||
<P>As of version 6.1.7, the packaging and numbering scheme
|
|
||||||
has changed. I used to package conserver as
|
|
||||||
conserver-GNAC-v.vv. Since <A href=
|
|
||||||
"http://www.gnac.com/">GNAC</A> (now <A href=
|
|
||||||
"http://www.certaintysolutions.com/">Certainty
|
|
||||||
Solutions</A>) has changed its name I've decided to drop
|
|
||||||
the GNAC portion and use a three-digit version number
|
|
||||||
(conserver-v.v.v). Why change the version numbering? I need
|
|
||||||
to differentiate this thread of the code from the original
|
|
||||||
authors' and I couldn't come up with a good replacement for
|
|
||||||
the GNAC name - sad, but true.</P>
|
|
||||||
|
|
||||||
<H3>Installation</H3>
|
|
||||||
|
|
||||||
<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
|
|
||||||
successfully 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.</P>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI>AIX 4.3.3/5.1/5.2, native cc</LI>
|
|
||||||
|
|
||||||
<LI>BSDI BSD/OS 3.X, gcc</LI>
|
|
||||||
|
|
||||||
<LI>Cygwin (w2k),gcc 2.95.3</LI>
|
|
||||||
|
|
||||||
<LI>DEC Tru64 4.0, gcc</LI>
|
|
||||||
|
|
||||||
<LI>DEC Tru64 4.0/5.1, native cc</LI>
|
|
||||||
|
|
||||||
<LI>FreeBSD 4.x (i386) gcc</LI>
|
|
||||||
|
|
||||||
<LI>FreeBSD 5.x (i386/amd64/sparc64) gcc</LI>
|
|
||||||
|
|
||||||
<LI>FreeBSD 6.x/7.x (i386/amd64/sparc64/ia64) gcc</LI>
|
|
||||||
|
|
||||||
<LI>HP-UX 10.20, gcc</LI>
|
|
||||||
|
|
||||||
<LI>HP-UX 11.10 parisc and ia64, native cc</LI>
|
|
||||||
|
|
||||||
<LI>Irix 6.15, native cc</LI>
|
|
||||||
|
|
||||||
<LI>Linux 2.2.18 (x86), gcc</LI>
|
|
||||||
|
|
||||||
<LI>Linux 2.4.2 (x86), gcc</LI>
|
|
||||||
|
|
||||||
<LI>Linux ia64, native gcc</LI>
|
|
||||||
|
|
||||||
<LI>Linux RedHat 6.2 and 7.2 (x86), native gcc</LI>
|
|
||||||
|
|
||||||
<LI>MacOS X, native gcc</LI>
|
|
||||||
|
|
||||||
<LI>Solaris 2.5.1 thru 9 (sparc/x86), gcc</LI>
|
|
||||||
|
|
||||||
<LI>Solaris 7/8, native cc</LI>
|
|
||||||
|
|
||||||
<LI>Solaris 10 and Solaris Express (build 33) (x86), gcc
|
|
||||||
and native cc</LI>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<H3>Other Good Information</H3>
|
|
||||||
|
|
||||||
<P>Zonker Harris has fabulous documents regarding the
|
|
||||||
hookup of consoles to terminal servers and other such
|
|
||||||
devices. His <A href="consoles/">Greater Scroll of Console
|
|
||||||
Knowledge</A> is a great place to start.</P>
|
|
||||||
|
|
||||||
<P>User community <A href="contrib/">contributions</A>
|
|
||||||
contain a variety of helpful items.</P>
|
|
||||||
<HR noshade>
|
|
||||||
|
|
||||||
<ADDRESS>
|
|
||||||
Bryan Stansell (<A href=
|
|
||||||
"mailto:bryan@conserver.com">bryan@conserver.com</A>)<BR>
|
|
||||||
</ADDRESS>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
@ -1,6 +1,7 @@
|
|||||||
### Path settings
|
### Path settings
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# $Id: Sun-serial,v 1.1 2003/11/04 02:36:25 bryan Exp $
|
|
||||||
|
|
||||||
If you are going to be hooking Sun consoles to your console server, you
|
If you are going to be hooking Sun consoles to your console server, you
|
||||||
will run into a problem: The sun will halt whenever the cable is unplugged.
|
will run into a problem: The sun will halt whenever the cable is unplugged.
|
||||||
It will also halt when the the console server is powered off and on. To
|
It will also halt when the the console server is powered off and on. To
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: access.c,v 5.73 2004/05/23 16:44:25 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -44,6 +42,12 @@
|
|||||||
#include <readcfg.h>
|
#include <readcfg.h>
|
||||||
#include <main.h>
|
#include <main.h>
|
||||||
|
|
||||||
|
#if USE_IPV6
|
||||||
|
# include <net/if.h>
|
||||||
|
# include <ifaddrs.h>
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Compare an Internet address (IPv4 expected), with an address pattern
|
/* Compare an Internet address (IPv4 expected), with an address pattern
|
||||||
* passed as a character string representing an address in the Internet
|
* passed as a character string representing an address in the Internet
|
||||||
@ -58,13 +62,7 @@
|
|||||||
* Returns 0 if the addresses match, else returns 1.
|
* Returns 0 if the addresses match, else returns 1.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
AddrCmp(struct in_addr *addr, char *pattern)
|
AddrCmp(struct in_addr *addr, char *pattern)
|
||||||
#else
|
|
||||||
AddrCmp(addr, pattern)
|
|
||||||
struct in_addr *addr;
|
|
||||||
char *pattern;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
in_addr_t hostaddr, pattern_addr, netmask;
|
in_addr_t hostaddr, pattern_addr, netmask;
|
||||||
char *p, *slash_posn;
|
char *p, *slash_posn;
|
||||||
@ -125,29 +123,84 @@ AddrCmp(addr, pattern)
|
|||||||
/* return the access type for a given host entry (ksb)
|
/* return the access type for a given host entry (ksb)
|
||||||
*/
|
*/
|
||||||
char
|
char
|
||||||
#if PROTOTYPES
|
AccType(INADDR_STYPE *addr, char **peername)
|
||||||
AccType(struct in_addr *addr, char **peername)
|
|
||||||
#else
|
|
||||||
AccType(addr, peername)
|
|
||||||
struct in_addr *addr;
|
|
||||||
char **peername;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
ACCESS *pACtmp;
|
ACCESS *pACtmp;
|
||||||
socklen_t so;
|
socklen_t so;
|
||||||
|
char ret;
|
||||||
|
#if USE_IPV6
|
||||||
|
int error;
|
||||||
|
char host[NI_MAXHOST];
|
||||||
|
char ipaddr[NI_MAXHOST];
|
||||||
|
#else
|
||||||
struct hostent *he = (struct hostent *)0;
|
struct hostent *he = (struct hostent *)0;
|
||||||
int a;
|
int a;
|
||||||
char ret;
|
# if TRUST_REVERSE_DNS
|
||||||
#if TRUST_REVERSE_DNS
|
|
||||||
char **revNames = (char **)0;
|
char **revNames = (char **)0;
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
CONDDEBUG((1, "AccType(): ip=%s", inet_ntoa(*addr)));
|
CONDDEBUG((1, "AccType(): ip=%s", inet_ntoa(*addr)));
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
|
|
||||||
ret = config->defaultaccess;
|
ret = config->defaultaccess;
|
||||||
so = sizeof(*addr);
|
so = sizeof(*addr);
|
||||||
|
|
||||||
#if TRUST_REVERSE_DNS
|
#if USE_IPV6
|
||||||
|
/*
|
||||||
|
* XXX where is the TRUST_REVERSE_DNS support for IPv6???
|
||||||
|
*
|
||||||
|
* XXX IPv4 should use getnameinfo() et al as well
|
||||||
|
* (if available, they are in IEEE Std 1003.1g-2000)
|
||||||
|
*/
|
||||||
|
error =
|
||||||
|
getnameinfo((struct sockaddr *)addr, so, ipaddr, sizeof(ipaddr),
|
||||||
|
NULL, 0, NI_NUMERICHOST);
|
||||||
|
if (error) {
|
||||||
|
Error("AccType(): getnameinfo failed: %s", gai_strerror(error));
|
||||||
|
goto common_ret;
|
||||||
|
}
|
||||||
|
CONDDEBUG((1, "AccType(): ip=%s (%s)", ipaddr,
|
||||||
|
addr->ss_family == AF_UNSPEC ? "AF_UNSPEC" :
|
||||||
|
addr->ss_family == AF_LOCAL ? "AF_LOCAL" :
|
||||||
|
addr->ss_family == AF_INET ? "AF_INET" :
|
||||||
|
addr->ss_family == AF_INET6 ? "AF_INET6" : "IF_???"));
|
||||||
|
|
||||||
|
error =
|
||||||
|
getnameinfo((struct sockaddr *)addr, so, host, sizeof(host), NULL,
|
||||||
|
0, 0);
|
||||||
|
if (!error)
|
||||||
|
CONDDEBUG((1, "AccType(): host=%s", host));
|
||||||
|
|
||||||
|
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
||||||
|
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||||
|
pACtmp->ctrust));
|
||||||
|
if (addr->ss_family == AF_INET && pACtmp->isCIDR != 0) {
|
||||||
|
if (AddrCmp
|
||||||
|
(&(((struct sockaddr_in *)addr)->sin_addr),
|
||||||
|
pACtmp->pcwho) == 0) {
|
||||||
|
ret = pACtmp->ctrust;
|
||||||
|
goto common_ret;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(ipaddr, pACtmp->pcwho) != NULL) {
|
||||||
|
CONDDEBUG((1, "AccType(): match for ip=%s", ipaddr));
|
||||||
|
ret = pACtmp->ctrust;
|
||||||
|
goto common_ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!error && strstr(host, pACtmp->pcwho) != NULL) {
|
||||||
|
CONDDEBUG((1, "AccType(): match for host=%s", host));
|
||||||
|
ret = pACtmp->ctrust;
|
||||||
|
goto common_ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
common_ret:
|
||||||
|
if (config->loghostnames == FLAGTRUE && !error)
|
||||||
|
*peername = StrDup(host);
|
||||||
|
#else /* !USE_IPV6 */
|
||||||
|
# if TRUST_REVERSE_DNS
|
||||||
/* if we trust reverse dns, we get the names associated with
|
/* if we trust reverse dns, we get the names associated with
|
||||||
* the address we're checking and then check each of those
|
* the address we're checking and then check each of those
|
||||||
* against the access list entries (below).
|
* against the access list entries (below).
|
||||||
@ -177,7 +230,7 @@ AccType(addr, peername)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
||||||
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||||
@ -203,20 +256,20 @@ AccType(addr, peername)
|
|||||||
inet_ntoa(*(struct in_addr *)
|
inet_ntoa(*(struct in_addr *)
|
||||||
(he->h_addr_list[a]))));
|
(he->h_addr_list[a]))));
|
||||||
if (
|
if (
|
||||||
#if HAVE_MEMCMP
|
# if HAVE_MEMCMP
|
||||||
memcmp(&(addr->s_addr), he->h_addr_list[a],
|
memcmp(&(addr->s_addr), he->h_addr_list[a],
|
||||||
he->h_length)
|
he->h_length)
|
||||||
#else
|
# else
|
||||||
bcmp(&(addr->s_addr), he->h_addr_list[a],
|
bcmp(&(addr->s_addr), he->h_addr_list[a],
|
||||||
he->h_length)
|
he->h_length)
|
||||||
#endif
|
# endif
|
||||||
== 0) {
|
== 0) {
|
||||||
ret = pACtmp->ctrust;
|
ret = pACtmp->ctrust;
|
||||||
goto common_ret;
|
goto common_ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if TRUST_REVERSE_DNS
|
# if TRUST_REVERSE_DNS
|
||||||
/* we chop bits off client names so that we can put domain
|
/* we chop bits off client names so that we can put domain
|
||||||
* names in access lists or even top-level domains.
|
* names in access lists or even top-level domains.
|
||||||
* allowed conserver.com, net;
|
* allowed conserver.com, net;
|
||||||
@ -245,43 +298,49 @@ AccType(addr, peername)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
common_ret:
|
common_ret:
|
||||||
if (config->loghostnames == FLAGTRUE && peername != (char **)0) {
|
if (config->loghostnames == FLAGTRUE && peername != (char **)0) {
|
||||||
#if TRUST_REVERSE_DNS
|
# if TRUST_REVERSE_DNS
|
||||||
if (revNames != (char **)0 && revNames[0] != (char *)0)
|
if (revNames != (char **)0 && revNames[0] != (char *)0)
|
||||||
*peername = StrDup(revNames[0]);
|
*peername = StrDup(revNames[0]);
|
||||||
#else
|
# else
|
||||||
if ((he =
|
if ((he =
|
||||||
gethostbyaddr((char *)addr, so,
|
gethostbyaddr((char *)addr, so,
|
||||||
AF_INET)) != (struct hostent *)0) {
|
AF_INET)) != (struct hostent *)0) {
|
||||||
*peername = StrDup(he->h_name);
|
*peername = StrDup(he->h_name);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
#if TRUST_REVERSE_DNS
|
# if TRUST_REVERSE_DNS
|
||||||
common_ret2:
|
common_ret2:
|
||||||
if (revNames != (char **)0) {
|
if (revNames != (char **)0) {
|
||||||
for (a = 0; revNames[a] != (char *)0; a++)
|
for (a = 0; revNames[a] != (char *)0; a++)
|
||||||
free(revNames[a]);
|
free(revNames[a]);
|
||||||
free(revNames);
|
free(revNames);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
SetDefAccess(
|
||||||
SetDefAccess(struct in_addr *pAddr, char *pHost)
|
#if USE_IPV6
|
||||||
|
void
|
||||||
#else
|
#else
|
||||||
SetDefAccess(pAddr, pHost)
|
struct in_addr *pAddr, char *pHost
|
||||||
struct in_addr *pAddr;
|
|
||||||
char *pHost;
|
|
||||||
#endif
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ACCESS *a;
|
ACCESS *a;
|
||||||
|
#if USE_IPV6
|
||||||
|
int error;
|
||||||
|
char addr[NI_MAXHOST];
|
||||||
|
struct ifaddrs *myAddrs, *ifa;
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
|
|
||||||
while (pACList != (ACCESS *)0) {
|
while (pACList != (ACCESS *)0) {
|
||||||
a = pACList->pACnext;
|
a = pACList->pACnext;
|
||||||
@ -289,12 +348,44 @@ SetDefAccess(pAddr, pHost)
|
|||||||
pACList = a;
|
pACList = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
/* get list of all addresses on system */
|
||||||
|
error = getifaddrs(&myAddrs);
|
||||||
|
if (error) {
|
||||||
|
Error("SetDefAccess(): getifaddrs: %s", strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ifa = myAddrs; ifa != NULL; ifa = ifa->ifa_next) {
|
||||||
|
/* skip interfaces without address or in down state */
|
||||||
|
if (ifa->ifa_addr == NULL || !(ifa->ifa_flags & IFF_UP))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
error =
|
||||||
|
getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_storage),
|
||||||
|
addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
|
||||||
|
if (error)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((a = (ACCESS *)calloc(1, sizeof(ACCESS))) == (ACCESS *)0)
|
||||||
|
OutOfMem();
|
||||||
|
if ((a->pcwho = StrDup(addr)) == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
|
||||||
|
a->ctrust = config->defaultaccess;
|
||||||
|
a->pACnext = pACList;
|
||||||
|
pACList = a;
|
||||||
|
|
||||||
|
CONDDEBUG((1, "SetDefAccess(): trust=%c, who=%s", pACList->ctrust,
|
||||||
|
pACList->pcwho));
|
||||||
|
}
|
||||||
|
freeifaddrs(myAddrs);
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
if ((pACList = (ACCESS *)calloc(1, sizeof(ACCESS))) == (ACCESS *)0)
|
if ((pACList = (ACCESS *)calloc(1, sizeof(ACCESS))) == (ACCESS *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
if ((pACList->pcwho = StrDup("127.0.0.1")) == (char *)0)
|
if ((pACList->pcwho = StrDup("127.0.0.1")) == (char *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
pACList->ctrust = 'a';
|
pACList->ctrust = config->defaultaccess;
|
||||||
CONDDEBUG((1, "SetDefAccess(): trust=%c, who=%s", pACList->ctrust,
|
CONDDEBUG((1, "SetDefAccess(): trust=%c, who=%s", pACList->ctrust,
|
||||||
pACList->pcwho));
|
pACList->pcwho));
|
||||||
#else
|
#else
|
||||||
@ -306,7 +397,7 @@ SetDefAccess(pAddr, pHost)
|
|||||||
OutOfMem();
|
OutOfMem();
|
||||||
if ((a->pcwho = StrDup(addr)) == (char *)0)
|
if ((a->pcwho = StrDup(addr)) == (char *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
a->ctrust = 'a';
|
a->ctrust = config->defaultaccess;
|
||||||
a->pACnext = pACList;
|
a->pACnext = pACList;
|
||||||
pACList = a;
|
pACList = a;
|
||||||
|
|
||||||
@ -318,12 +409,7 @@ SetDefAccess(pAddr, pHost)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DestroyAccessList(ACCESS *pACList)
|
DestroyAccessList(ACCESS *pACList)
|
||||||
#else
|
|
||||||
DestroyAccessList(pACList)
|
|
||||||
ACCESS *pACList;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (pACList == (ACCESS *)0)
|
if (pACList == (ACCESS *)0)
|
||||||
return;
|
return;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: access.h,v 5.26 2003/08/10 18:11:20 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -44,6 +42,12 @@ typedef struct access {
|
|||||||
struct access *pACnext; /* next access list */
|
struct access *pACnext; /* next access list */
|
||||||
} ACCESS;
|
} ACCESS;
|
||||||
|
|
||||||
extern char AccType PARAMS((struct in_addr *, char **));
|
extern char AccType(INADDR_STYPE *, char **);
|
||||||
extern void SetDefAccess PARAMS((struct in_addr *, char *));
|
extern void SetDefAccess(
|
||||||
extern void DestroyAccessList PARAMS((ACCESS *));
|
#if USE_IPV6
|
||||||
|
void
|
||||||
|
#else
|
||||||
|
struct in_addr *, char *
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
extern void DestroyAccessList(ACCESS *);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: client.c,v 5.95 2013/09/25 22:10:29 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -43,9 +41,14 @@
|
|||||||
#include <group.h>
|
#include <group.h>
|
||||||
#include <readcfg.h>
|
#include <readcfg.h>
|
||||||
|
|
||||||
|
#if USE_IPV6
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
|
|
||||||
#if defined(USE_LIBWRAP)
|
#if defined(USE_LIBWRAP)
|
||||||
#include <syslog.h>
|
# include <syslog.h>
|
||||||
#include <tcpd.h>
|
# include <tcpd.h>
|
||||||
int allow_severity = LOG_INFO;
|
int allow_severity = LOG_INFO;
|
||||||
int deny_severity = LOG_WARNING;
|
int deny_severity = LOG_WARNING;
|
||||||
#endif
|
#endif
|
||||||
@ -54,12 +57,7 @@ int deny_severity = LOG_WARNING;
|
|||||||
/* find the next guy who wants to write on the console (ksb)
|
/* find the next guy who wants to write on the console (ksb)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
FindWrite(CONSENT *pCE)
|
FindWrite(CONSENT *pCE)
|
||||||
#else
|
|
||||||
FindWrite(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONSCLIENT *pCLfound = (CONSCLIENT *)0;
|
CONSCLIENT *pCLfound = (CONSCLIENT *)0;
|
||||||
CONSCLIENT *pCL;
|
CONSCLIENT *pCL;
|
||||||
@ -91,13 +89,7 @@ FindWrite(pCE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
BumpClient(CONSENT *pCE, char *message)
|
BumpClient(CONSENT *pCE, char *message)
|
||||||
#else
|
|
||||||
BumpClient(pCE, message)
|
|
||||||
CONSENT *pCE;
|
|
||||||
char *message;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if ((CONSCLIENT *)0 == pCE->pCLwr)
|
if ((CONSCLIENT *)0 == pCE->pCLwr)
|
||||||
return;
|
return;
|
||||||
@ -118,20 +110,13 @@ BumpClient(pCE, message)
|
|||||||
#define REPLAYBUFFER 4096
|
#define REPLAYBUFFER 4096
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
Replay(CONSENT *pCE, CONSFILE *fdOut, unsigned short back)
|
Replay(CONSENT *pCE, CONSFILE *fdOut, unsigned short back)
|
||||||
#else
|
|
||||||
Replay(pCE, fdOut, back)
|
|
||||||
CONSENT *pCE;
|
|
||||||
CONSFILE *fdOut;
|
|
||||||
unsigned short back;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONSFILE *fdLog = (CONSFILE *)0;
|
CONSFILE *fdLog = (CONSFILE *)0;
|
||||||
STRING *line = (STRING *)0;
|
STRING *line = (STRING *)0;
|
||||||
off_t file_pos;
|
off_t file_pos;
|
||||||
off_t buf_pos;
|
off_t buf_pos;
|
||||||
char *buf;
|
char *buf = (char *)0;
|
||||||
char *bp = (char *)0;
|
char *bp = (char *)0;
|
||||||
int ch;
|
int ch;
|
||||||
struct stat stLog;
|
struct stat stLog;
|
||||||
@ -386,50 +371,45 @@ typedef struct HLnode {
|
|||||||
} HELP;
|
} HELP;
|
||||||
|
|
||||||
static HELP aHLTable[] = {
|
static HELP aHLTable[] = {
|
||||||
{WHEN_ALWAYS, ". disconnect"},
|
{WHEN_ALWAYS, ". disconnect"},
|
||||||
{WHEN_ALWAYS | IS_LIMITED, "; move to another console"},
|
{WHEN_ALWAYS | IS_LIMITED, "; move to another console"},
|
||||||
{WHEN_ALWAYS, "a attach read/write"},
|
{WHEN_ALWAYS, "a attach read/write"},
|
||||||
{WHEN_ALWAYS, "b send broadcast message"},
|
{WHEN_ALWAYS, "b send broadcast message"},
|
||||||
{WHEN_ATTACH, "c toggle flow control"},
|
{WHEN_ATTACH, "c toggle flow control"},
|
||||||
{WHEN_ATTACH, "d down a console"},
|
{WHEN_ATTACH, "d down a console"},
|
||||||
{WHEN_ALWAYS, "e change escape sequence"},
|
{WHEN_ALWAYS, "e change escape sequence"},
|
||||||
{WHEN_ALWAYS, "f force attach read/write"},
|
{WHEN_ALWAYS, "f force attach read/write"},
|
||||||
{WHEN_ALWAYS, "g group info"},
|
{WHEN_ALWAYS, "g group info"},
|
||||||
{WHEN_ALWAYS, "i information dump"},
|
{WHEN_ALWAYS, "i information dump"},
|
||||||
{WHEN_ATTACH, "L toggle logging on/off"},
|
{WHEN_ATTACH, "L toggle logging on/off"},
|
||||||
{WHEN_ATTACH, "l? break sequence list"},
|
{WHEN_ATTACH, "l? break sequence list"},
|
||||||
{WHEN_ATTACH, "l0 send break per config file"},
|
{WHEN_ATTACH, "l0 send break per config file"},
|
||||||
{WHEN_ATTACH, "l1-9 send specific break sequence"},
|
{WHEN_ATTACH, "l1-9a-z send specific break sequence"},
|
||||||
{WHEN_ALWAYS, "m display the message of the day"},
|
{WHEN_ALWAYS, "m display message of the day"},
|
||||||
{WHEN_ALWAYS, "n write a note to the logfile"},
|
{WHEN_ALWAYS, "n write a note to the logfile"},
|
||||||
{WHEN_ALWAYS, "o (re)open the tty and log file"},
|
{WHEN_ALWAYS, "o (re)open the tty and log file"},
|
||||||
{WHEN_ALWAYS, "p playback the last %hu lines"},
|
{WHEN_ALWAYS, "p playback the last %hu lines"},
|
||||||
{WHEN_ALWAYS, "P set number of playback lines"},
|
{WHEN_ALWAYS, "P set number of playback lines"},
|
||||||
{WHEN_ALWAYS, "r replay the last %hu lines"},
|
{WHEN_ALWAYS, "r replay the last %hu lines"},
|
||||||
{WHEN_ALWAYS, "R set number of replay lines"},
|
{WHEN_ALWAYS, "R set number of replay lines"},
|
||||||
{WHEN_ATTACH, "s spy mode (read only)"},
|
{WHEN_ATTACH, "s spy mode (read only)"},
|
||||||
{WHEN_ALWAYS, "u show host status"},
|
{WHEN_ALWAYS, "u show host status"},
|
||||||
{WHEN_ALWAYS, "v show version info"},
|
{WHEN_ALWAYS, "v show version info"},
|
||||||
{WHEN_ALWAYS, "w who is on this console"},
|
{WHEN_ALWAYS, "w who is on this console"},
|
||||||
{WHEN_ALWAYS, "x show console baud info"},
|
{WHEN_ALWAYS, "x show console baud info"},
|
||||||
{WHEN_ALWAYS | IS_LIMITED, "z suspend the connection"},
|
{WHEN_ALWAYS | IS_LIMITED, "z suspend the connection"},
|
||||||
{WHEN_ATTACH, "! invoke task"},
|
{WHEN_ATTACH, "! invoke task"},
|
||||||
{WHEN_ATTACH | IS_LIMITED, "| attach local command"},
|
{WHEN_ATTACH | IS_LIMITED, "| attach local command"},
|
||||||
{WHEN_ALWAYS, "? print this message"},
|
{WHEN_ALWAYS, "? print this message"},
|
||||||
{WHEN_ALWAYS, "<cr> ignore/abort command"},
|
{WHEN_ALWAYS, "<cr> ignore/abort command"},
|
||||||
{WHEN_ALWAYS, "^R replay the last line"},
|
{WHEN_ALWAYS, "^R replay the last line"},
|
||||||
{WHEN_ATTACH, "\\ooo send character by octal code"},
|
{WHEN_ATTACH, "\\ooo send character by octal code"},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* list the commands we know for the user (ksb)
|
/* list the commands we know for the user (ksb)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
HelpUser(CONSCLIENT *pCL)
|
HelpUser(CONSCLIENT *pCL)
|
||||||
#else
|
|
||||||
HelpUser(pCL, pCE)
|
|
||||||
CONSCLIENT *pCL;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i, j, iCmp;
|
int i, j, iCmp;
|
||||||
static char
|
static char
|
||||||
@ -505,34 +485,19 @@ HelpUser(pCL, pCE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
ClientAccessOk(CONSCLIENT *pCL)
|
ClientAccessOk(CONSCLIENT *pCL)
|
||||||
#else
|
|
||||||
ClientAccessOk(pCL)
|
|
||||||
CONSCLIENT *pCL;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char *peername = (char *)0;
|
char *peername = (char *)0;
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
|
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6 || !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;
|
socklen_t so;
|
||||||
int cfd;
|
int cfd;
|
||||||
struct sockaddr_in in_port;
|
# if USE_IPV6
|
||||||
|
int error;
|
||||||
|
char addr[NI_MAXHOST];
|
||||||
|
# endif
|
||||||
|
SOCKADDR_STYPE in_port;
|
||||||
int getpeer = -1;
|
int getpeer = -1;
|
||||||
|
|
||||||
cfd = FileFDNum(pCL->fd);
|
cfd = FileFDNum(pCL->fd);
|
||||||
@ -559,20 +524,56 @@ ClientAccessOk(pCL)
|
|||||||
retval = 0;
|
retval = 0;
|
||||||
goto setpeer;
|
goto setpeer;
|
||||||
}
|
}
|
||||||
pCL->caccess = AccType(&in_port.sin_addr, &peername);
|
pCL->caccess = AccType(
|
||||||
|
# if USE_IPV6
|
||||||
|
&in_port,
|
||||||
|
# else
|
||||||
|
&in_port.sin_addr,
|
||||||
|
# endif
|
||||||
|
&peername);
|
||||||
if (pCL->caccess == 'r') {
|
if (pCL->caccess == 'r') {
|
||||||
FileWrite(pCL->fd, FLAGFALSE, "access from your host refused\r\n",
|
FileWrite(pCL->fd, FLAGFALSE, "access from your host refused\r\n",
|
||||||
-1);
|
-1);
|
||||||
retval = 0;
|
retval = 0;
|
||||||
}
|
}
|
||||||
setpeer:
|
setpeer:
|
||||||
|
#else
|
||||||
|
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;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pCL->peername != (STRING *)0) {
|
if (pCL->peername != (STRING *)0) {
|
||||||
BuildString((char *)0, pCL->peername);
|
BuildString((char *)0, pCL->peername);
|
||||||
if (peername != (char *)0)
|
if (peername != (char *)0)
|
||||||
BuildString(peername, pCL->peername);
|
BuildString(peername, pCL->peername);
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
else if (getpeer != -1) {
|
||||||
|
error =
|
||||||
|
getnameinfo((struct sockaddr *)&in_port, so, addr,
|
||||||
|
sizeof(addr), NULL, 0, NI_NUMERICHOST);
|
||||||
|
if (error) {
|
||||||
|
FileWrite(pCL->fd, FLAGFALSE, "getnameinfo failed\r\n",
|
||||||
|
-1);
|
||||||
|
Error("ClientAccessOk(): gatenameinfo: %s",
|
||||||
|
gai_strerror(error));
|
||||||
|
retval = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildString(addr, pCL->peername);
|
||||||
|
} else
|
||||||
|
BuildString("<unknown>", pCL->peername);
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
else
|
else
|
||||||
BuildString("127.0.0.1", pCL->peername);
|
BuildString("127.0.0.1", pCL->peername);
|
||||||
#else
|
#else
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: client.h,v 5.44 2013/09/23 22:58:21 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -87,15 +85,15 @@ typedef struct client { /* Connection Information: */
|
|||||||
IOSTATE ioState; /* state of the socket */
|
IOSTATE ioState; /* state of the socket */
|
||||||
time_t stateTimer; /* timer for various ioState states */
|
time_t stateTimer; /* timer for various ioState states */
|
||||||
STRING *accmd; /* the command the user issued */
|
STRING *accmd; /* the command the user issued */
|
||||||
struct sockaddr_in
|
INADDR_STYPE cnct_port; /* where from */
|
||||||
cnct_port; /* where from */
|
|
||||||
FLAG confirmed; /* confirm state */
|
FLAG confirmed; /* confirm state */
|
||||||
CLIENTSTATE cState; /* state needing confirmation */
|
CLIENTSTATE cState; /* state needing confirmation */
|
||||||
char cOption; /* option initiating the confirmation */
|
char cOption; /* option initiating the confirmation */
|
||||||
|
size_t tokenSize; /* buffer size for GSSAPI token */
|
||||||
} CONSCLIENT;
|
} CONSCLIENT;
|
||||||
|
|
||||||
extern void Replay PARAMS((CONSENT *, CONSFILE *, unsigned short));
|
extern void Replay(CONSENT *, CONSFILE *, unsigned short);
|
||||||
extern void HelpUser PARAMS((CONSCLIENT *));
|
extern void HelpUser(CONSCLIENT *);
|
||||||
extern void FindWrite PARAMS((CONSENT *));
|
extern void FindWrite(CONSENT *);
|
||||||
extern int ClientAccessOk PARAMS((CONSCLIENT *));
|
extern int ClientAccessOk(CONSCLIENT *);
|
||||||
extern void BumpClient PARAMS((CONSENT *, char *));
|
extern void BumpClient(CONSENT *, char *);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: consent.c,v 5.153 2013/09/26 17:32:54 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -88,37 +86,76 @@ BAUD baud[] = {
|
|||||||
{"3500000", 32},
|
{"3500000", 32},
|
||||||
{"4000000", 33},
|
{"4000000", 33},
|
||||||
#else /* FOR_CYCLADES_TS */
|
#else /* FOR_CYCLADES_TS */
|
||||||
#if defined(B115200)
|
# if defined(B4000000)
|
||||||
|
{"4000000", B4000000},
|
||||||
|
# endif
|
||||||
|
# if defined(B3500000)
|
||||||
|
{"3500000", B3500000},
|
||||||
|
# endif
|
||||||
|
# if defined(B3000000)
|
||||||
|
{"3000000", B3000000},
|
||||||
|
# endif
|
||||||
|
# if defined(B2500000)
|
||||||
|
{"2500000", B2500000},
|
||||||
|
# endif
|
||||||
|
# if defined(B2000000)
|
||||||
|
{"2000000", B2000000},
|
||||||
|
# endif
|
||||||
|
# if defined(B1500000)
|
||||||
|
{"1500000", B1500000},
|
||||||
|
# endif
|
||||||
|
# if defined(B1152000)
|
||||||
|
{"1152000", B1152000},
|
||||||
|
# endif
|
||||||
|
# if defined(B1000000)
|
||||||
|
{"1000000", B1000000},
|
||||||
|
# endif
|
||||||
|
# if defined(B921600)
|
||||||
|
{"921600", B921600},
|
||||||
|
# endif
|
||||||
|
# if defined(B576000)
|
||||||
|
{"576000", B576000},
|
||||||
|
# endif
|
||||||
|
# if defined(B500000)
|
||||||
|
{"500000", B500000},
|
||||||
|
# endif
|
||||||
|
# if defined(B460800)
|
||||||
|
{"460800", B460800},
|
||||||
|
# endif
|
||||||
|
# if defined(B230400)
|
||||||
|
{"230400", B230400},
|
||||||
|
# endif
|
||||||
|
# if defined(B115200)
|
||||||
{"115200", B115200},
|
{"115200", B115200},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B57600)
|
# if defined(B57600)
|
||||||
{"57600", B57600},
|
{"57600", B57600},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B38400)
|
# if defined(B38400)
|
||||||
{"38400", B38400},
|
{"38400", B38400},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B19200)
|
# if defined(B19200)
|
||||||
{"19200", B19200},
|
{"19200", B19200},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B9600)
|
# if defined(B9600)
|
||||||
{"9600", B9600},
|
{"9600", B9600},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B4800)
|
# if defined(B4800)
|
||||||
{"4800", B4800},
|
{"4800", B4800},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B2400)
|
# if defined(B2400)
|
||||||
{"2400", B2400},
|
{"2400", B2400},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B1800)
|
# if defined(B1800)
|
||||||
{"1800", B1800},
|
{"1800", B1800},
|
||||||
#endif
|
# endif
|
||||||
{"1200", B1200},
|
{"1200", B1200},
|
||||||
#if defined(B600)
|
# if defined(B600)
|
||||||
{"600", B600},
|
{"600", B600},
|
||||||
#endif
|
# endif
|
||||||
#if defined(B300)
|
# if defined(B300)
|
||||||
{"300", B300},
|
{"300", B300},
|
||||||
#endif
|
# endif
|
||||||
#endif /* FOR_CYCLADES_TS */
|
#endif /* FOR_CYCLADES_TS */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -126,12 +163,7 @@ BAUD baud[] = {
|
|||||||
/* find a baud rate for the string "9600x" -> B9600 (ksb)
|
/* find a baud rate for the string "9600x" -> B9600 (ksb)
|
||||||
*/
|
*/
|
||||||
BAUD *
|
BAUD *
|
||||||
#if PROTOTYPES
|
|
||||||
FindBaud(char *pcMode)
|
FindBaud(char *pcMode)
|
||||||
#else
|
|
||||||
FindBaud(pcMode)
|
|
||||||
char *pcMode;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -143,9 +175,9 @@ FindBaud(pcMode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# if !defined(PAREXT)
|
#if !defined(PAREXT)
|
||||||
# define PAREXT 0
|
# define PAREXT 0
|
||||||
# endif
|
#endif
|
||||||
struct parity parity[] = {
|
struct parity parity[] = {
|
||||||
{"even", PARENB | CS7, 0},
|
{"even", PARENB | CS7, 0},
|
||||||
{"mark", PARENB | CS7 | PARODD | PAREXT, 0},
|
{"mark", PARENB | CS7 | PARODD | PAREXT, 0},
|
||||||
@ -157,12 +189,7 @@ struct parity parity[] = {
|
|||||||
/* find a parity "even" or "E" or "ev" -> EVEN
|
/* find a parity "even" or "E" or "ev" -> EVEN
|
||||||
*/
|
*/
|
||||||
PARITY *
|
PARITY *
|
||||||
#if PROTOTYPES
|
|
||||||
FindParity(char *pcMode)
|
FindParity(char *pcMode)
|
||||||
#else
|
|
||||||
FindParity(pcMode)
|
|
||||||
char *pcMode;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -177,12 +204,7 @@ FindParity(pcMode)
|
|||||||
/* setup a tty device (ksb)
|
/* setup a tty device (ksb)
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
#if PROTOTYPES
|
|
||||||
TtyDev(CONSENT *pCE)
|
TtyDev(CONSENT *pCE)
|
||||||
#else
|
|
||||||
TtyDev(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
struct termios termp;
|
struct termios termp;
|
||||||
struct stat stPerm;
|
struct stat stPerm;
|
||||||
@ -290,25 +312,20 @@ TtyDev(pCE)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
# if HAVE_STROPTS_H
|
#if HAVE_STROPTS_H
|
||||||
/*
|
/*
|
||||||
* eat all the streams modules upto and including ttcompat
|
* eat all the streams modules upto and including ttcompat
|
||||||
*/
|
*/
|
||||||
while (ioctl(cofile, I_FIND, "ttcompat") == 1) {
|
while (ioctl(cofile, I_FIND, "ttcompat") == 1) {
|
||||||
ioctl(cofile, I_POP, 0);
|
ioctl(cofile, I_POP, 0);
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
pCE->fup = 1;
|
pCE->fup = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
StopInit(CONSENT *pCE)
|
StopInit(CONSENT *pCE)
|
||||||
#else
|
|
||||||
StopInit(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (pCE->initcmd == (char *)0)
|
if (pCE->initcmd == (char *)0)
|
||||||
return;
|
return;
|
||||||
@ -339,14 +356,52 @@ StopInit(pCE)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
ipmiconsole_ctx_t
|
||||||
|
IpmiSOLCreate(CONSENT *pCE)
|
||||||
|
{
|
||||||
|
ipmiconsole_ctx_t ctx;
|
||||||
|
struct ipmiconsole_ipmi_config ipmi;
|
||||||
|
struct ipmiconsole_protocol_config protocol;
|
||||||
|
struct ipmiconsole_engine_config engine;
|
||||||
|
|
||||||
|
if (ipmiconsole_engine_init(1, 0) < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
ipmi.username = pCE->username;
|
||||||
|
ipmi.password = pCE->password;
|
||||||
|
if (pCE->ipmikg->used <= 1) { /* 1 == NULL only */
|
||||||
|
ipmi.k_g = NULL;
|
||||||
|
ipmi.k_g_len = 0;
|
||||||
|
} else {
|
||||||
|
ipmi.k_g = (unsigned char *)pCE->ipmikg->string;
|
||||||
|
ipmi.k_g_len = pCE->ipmikg->used - 1;
|
||||||
|
}
|
||||||
|
ipmi.privilege_level = pCE->ipmiprivlevel;
|
||||||
|
ipmi.cipher_suite_id = pCE->ipmiciphersuite;
|
||||||
|
ipmi.workaround_flags = pCE->ipmiworkaround;
|
||||||
|
|
||||||
|
protocol.session_timeout_len = -1;
|
||||||
|
protocol.retransmission_timeout_len = -1;
|
||||||
|
protocol.retransmission_backoff_count = -1;
|
||||||
|
protocol.keepalive_timeout_len = -1;
|
||||||
|
protocol.retransmission_keepalive_timeout_len = -1;
|
||||||
|
protocol.acceptable_packet_errors_count = -1;
|
||||||
|
protocol.maximum_retransmission_count = -1;
|
||||||
|
|
||||||
|
engine.engine_flags = IPMICONSOLE_ENGINE_OUTPUT_ON_SOL_ESTABLISHED;
|
||||||
|
engine.behavior_flags = 0;
|
||||||
|
engine.debug_flags = 0;
|
||||||
|
|
||||||
|
ctx = ipmiconsole_ctx_create(pCE->host, &ipmi, &protocol, &engine);
|
||||||
|
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* invoke the initcmd command */
|
/* invoke the initcmd command */
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
StartInit(CONSENT *pCE)
|
StartInit(CONSENT *pCE)
|
||||||
#else
|
|
||||||
StartInit(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
pid_t iNewGrp;
|
pid_t iNewGrp;
|
||||||
@ -438,24 +493,32 @@ StartInit(pCE)
|
|||||||
|
|
||||||
/* setup new process with clean file descriptors
|
/* setup new process with clean file descriptors
|
||||||
*/
|
*/
|
||||||
|
#if HAVE_CLOSEFROM
|
||||||
|
for (i = 3; i <= pout[0] || i <= pin[1]; i++) {
|
||||||
|
if (i != pout[0] && i != pin[1])
|
||||||
|
close(i);
|
||||||
|
}
|
||||||
|
closefrom(i);
|
||||||
|
#else
|
||||||
i = GetMaxFiles();
|
i = GetMaxFiles();
|
||||||
for ( /* i above */ ; --i > 2;) {
|
for ( /* i above */ ; --i > 2;) {
|
||||||
if (i != pout[0] && i != pin[1])
|
if (i != pout[0] && i != pin[1])
|
||||||
close(i);
|
close(i);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* leave 2 until we have to close it */
|
/* leave 2 until we have to close it */
|
||||||
close(1);
|
close(1);
|
||||||
close(0);
|
close(0);
|
||||||
|
|
||||||
# if HAVE_SETSID
|
#if HAVE_SETSID
|
||||||
iNewGrp = setsid();
|
iNewGrp = setsid();
|
||||||
if (-1 == iNewGrp) {
|
if (-1 == iNewGrp) {
|
||||||
Error("[%s] setsid(): %s", pCE->server, strerror(errno));
|
Error("[%s] setsid(): %s", pCE->server, strerror(errno));
|
||||||
iNewGrp = getpid();
|
iNewGrp = getpid();
|
||||||
}
|
}
|
||||||
# else
|
#else
|
||||||
iNewGrp = getpid();
|
iNewGrp = getpid();
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (dup(pout[0]) != 0 || dup(pin[1]) != 1) {
|
if (dup(pout[0]) != 0 || dup(pin[1]) != 1) {
|
||||||
Error("[%s] StartInit(): fd sync error", pCE->server);
|
Error("[%s] StartInit(): fd sync error", pCE->server);
|
||||||
@ -486,17 +549,11 @@ StartInit(pCE)
|
|||||||
|
|
||||||
/* We exit() here, so only call this in a child process before an exec() */
|
/* We exit() here, so only call this in a child process before an exec() */
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
SetupTty(CONSENT *pCE, int fd)
|
SetupTty(CONSENT *pCE, int fd)
|
||||||
#else
|
|
||||||
SetupTty(pCE, fd)
|
|
||||||
CONSENT *pCE;
|
|
||||||
int fd;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
struct termios n_tio;
|
struct termios n_tio;
|
||||||
|
|
||||||
# if HAVE_STROPTS_H && !defined(_AIX)
|
#if HAVE_STROPTS_H && !defined(_AIX)
|
||||||
/* SYSVr4 semantics for opening stream ptys (gregf)
|
/* SYSVr4 semantics for opening stream ptys (gregf)
|
||||||
* under PTX (others?) we have to push the compatibility
|
* under PTX (others?) we have to push the compatibility
|
||||||
* streams modules `ptem', `ld', and `ttcompat'
|
* streams modules `ptem', `ld', and `ttcompat'
|
||||||
@ -504,7 +561,7 @@ SetupTty(pCE, fd)
|
|||||||
ioctl(1, I_PUSH, "ptem");
|
ioctl(1, I_PUSH, "ptem");
|
||||||
ioctl(1, I_PUSH, "ldterm");
|
ioctl(1, I_PUSH, "ldterm");
|
||||||
ioctl(1, I_PUSH, "ttcompat");
|
ioctl(1, I_PUSH, "ttcompat");
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (0 != tcgetattr(1, &n_tio)) {
|
if (0 != tcgetattr(1, &n_tio)) {
|
||||||
exit(EX_OSERR);
|
exit(EX_OSERR);
|
||||||
@ -539,12 +596,7 @@ SetupTty(pCE, fd)
|
|||||||
/* setup a virtual device (ksb)
|
/* setup a virtual device (ksb)
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
#if PROTOTYPES
|
|
||||||
VirtDev(CONSENT *pCE)
|
VirtDev(CONSENT *pCE)
|
||||||
#else
|
|
||||||
VirtDev(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
pid_t iNewGrp;
|
pid_t iNewGrp;
|
||||||
@ -587,25 +639,32 @@ VirtDev(pCE)
|
|||||||
|
|
||||||
/* setup new process with clean filew descriptors
|
/* setup new process with clean filew descriptors
|
||||||
*/
|
*/
|
||||||
|
#if HAVE_CLOSEFROM
|
||||||
|
for (i = 3; i < pCE->execSlaveFD; i++)
|
||||||
|
close(i);
|
||||||
|
i++;
|
||||||
|
closefrom(i);
|
||||||
|
#else
|
||||||
i = GetMaxFiles();
|
i = GetMaxFiles();
|
||||||
for ( /* i above */ ; --i > 2;) {
|
for ( /* i above */ ; --i > 2;) {
|
||||||
if (i != pCE->execSlaveFD)
|
if (i != pCE->execSlaveFD)
|
||||||
close(i);
|
close(i);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* leave 2 until we *have to close it*
|
/* leave 2 until we *have to close it*
|
||||||
*/
|
*/
|
||||||
close(1);
|
close(1);
|
||||||
close(0);
|
close(0);
|
||||||
|
|
||||||
# if HAVE_SETSID
|
#if HAVE_SETSID
|
||||||
iNewGrp = setsid();
|
iNewGrp = setsid();
|
||||||
if (-1 == iNewGrp) {
|
if (-1 == iNewGrp) {
|
||||||
Error("[%s] setsid(): %s", pCE->server, strerror(errno));
|
Error("[%s] setsid(): %s", pCE->server, strerror(errno));
|
||||||
iNewGrp = getpid();
|
iNewGrp = getpid();
|
||||||
}
|
}
|
||||||
# else
|
#else
|
||||||
iNewGrp = getpid();
|
iNewGrp = getpid();
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (dup(pCE->execSlaveFD) != 0 || dup(pCE->execSlaveFD) != 1) {
|
if (dup(pCE->execSlaveFD) != 0 || dup(pCE->execSlaveFD) != 1) {
|
||||||
Error("[%s] fd sync error", pCE->server);
|
Error("[%s] fd sync error", pCE->server);
|
||||||
@ -659,12 +718,7 @@ VirtDev(pCE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
#if PROTOTYPES
|
|
||||||
ConsState(CONSENT *pCE)
|
ConsState(CONSENT *pCE)
|
||||||
#else
|
|
||||||
ConsState(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (!pCE->fup)
|
if (!pCE->fup)
|
||||||
return "down";
|
return "down";
|
||||||
@ -684,6 +738,10 @@ ConsState(pCE)
|
|||||||
return "SSL_accept";
|
return "SSL_accept";
|
||||||
case INSSLSHUTDOWN:
|
case INSSLSHUTDOWN:
|
||||||
return "SSL_shutdown";
|
return "SSL_shutdown";
|
||||||
|
#endif
|
||||||
|
#if HAVE_GSSAPI
|
||||||
|
case INGSSACCEPT:
|
||||||
|
return "GSSAPI_accept";
|
||||||
#endif
|
#endif
|
||||||
case ISFLUSHING:
|
case ISFLUSHING:
|
||||||
return "flushing";
|
return "flushing";
|
||||||
@ -699,14 +757,7 @@ ConsState(pCE)
|
|||||||
* with the "runtime" members of the structure here.
|
* with the "runtime" members of the structure here.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConsDown(CONSENT *pCE, FLAG downHard, FLAG force)
|
ConsDown(CONSENT *pCE, FLAG downHard, FLAG force)
|
||||||
#else
|
|
||||||
ConsDown(pCE, downHard, force)
|
|
||||||
CONSENT *pCE;
|
|
||||||
FLAG downHard;
|
|
||||||
FLAG force;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (force != FLAGTRUE &&
|
if (force != FLAGTRUE &&
|
||||||
!(FileBufEmpty(pCE->fdlog) && FileBufEmpty(pCE->cofile) &&
|
!(FileBufEmpty(pCE->fdlog) && FileBufEmpty(pCE->cofile) &&
|
||||||
@ -728,6 +779,14 @@ ConsDown(pCE, downHard, force)
|
|||||||
FD_CLR(cofile, &winit);
|
FD_CLR(cofile, &winit);
|
||||||
FileClose(&pCE->cofile);
|
FileClose(&pCE->cofile);
|
||||||
}
|
}
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
/* need to do this after cofile close above as
|
||||||
|
* ipmiconsole_ctx_destroy will close the fd */
|
||||||
|
if (pCE->ipmictx != (ipmiconsole_ctx_t) 0) {
|
||||||
|
ipmiconsole_ctx_destroy(pCE->ipmictx);
|
||||||
|
pCE->ipmictx = (ipmiconsole_ctx_t) 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (pCE->fdlog != (CONSFILE *)0) {
|
if (pCE->fdlog != (CONSFILE *)0) {
|
||||||
if (pCE->nolog) {
|
if (pCE->nolog) {
|
||||||
TagLogfile(pCE, "Console logging restored");
|
TagLogfile(pCE, "Console logging restored");
|
||||||
@ -739,6 +798,8 @@ ConsDown(pCE, downHard, force)
|
|||||||
if (pCE->type == EXEC && pCE->execSlaveFD != 0) {
|
if (pCE->type == EXEC && pCE->execSlaveFD != 0) {
|
||||||
close(pCE->execSlaveFD);
|
close(pCE->execSlaveFD);
|
||||||
pCE->execSlaveFD = 0;
|
pCE->execSlaveFD = 0;
|
||||||
|
free(pCE->execSlave);
|
||||||
|
pCE->execSlave = NULL;
|
||||||
}
|
}
|
||||||
pCE->fup = 0;
|
pCE->fup = 0;
|
||||||
pCE->nolog = 0;
|
pCE->nolog = 0;
|
||||||
@ -755,15 +816,10 @@ ConsDown(pCE, downHard, force)
|
|||||||
* We also maintian the select set for the caller.
|
* We also maintian the select set for the caller.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConsInit(CONSENT *pCE)
|
ConsInit(CONSENT *pCE)
|
||||||
#else
|
|
||||||
ConsInit(pCE)
|
|
||||||
CONSENT *pCE;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
time_t tyme;
|
time_t tyme;
|
||||||
extern int FallBack PARAMS((char **, int *));
|
extern int FallBack(char **, int *);
|
||||||
int cofile = -1;
|
int cofile = -1;
|
||||||
int ret;
|
int ret;
|
||||||
#if HAVE_GETTIMEOFDAY
|
#if HAVE_GETTIMEOFDAY
|
||||||
@ -805,7 +861,7 @@ ConsInit(pCE)
|
|||||||
*/
|
*/
|
||||||
if (pCE->fup) {
|
if (pCE->fup) {
|
||||||
ConsDown(pCE, FLAGFALSE, FLAGTRUE);
|
ConsDown(pCE, FLAGFALSE, FLAGTRUE);
|
||||||
usleep(250000); /* pause 0.25 sec to let things settle a bit */
|
Sleep(250000);
|
||||||
}
|
}
|
||||||
|
|
||||||
pCE->autoReUp = 0;
|
pCE->autoReUp = 0;
|
||||||
@ -858,19 +914,98 @@ ConsInit(pCE)
|
|||||||
break;
|
break;
|
||||||
case HOST:
|
case HOST:
|
||||||
{
|
{
|
||||||
|
#if USE_IPV6
|
||||||
|
/* XXX IPv4 should use getaddrinfo() and getnameinfo() as well,
|
||||||
|
* (if available, they are in IEEE Std 1003.1g-2000)
|
||||||
|
*/
|
||||||
|
int error;
|
||||||
|
char host[NI_MAXHOST];
|
||||||
|
char serv[NI_MAXSERV];
|
||||||
|
struct addrinfo *ai, *rp, hints;
|
||||||
|
#else
|
||||||
struct sockaddr_in port;
|
struct sockaddr_in port;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
#if HAVE_SETSOCKOPT
|
#if HAVE_SETSOCKOPT
|
||||||
int one = 1;
|
int one = 1;
|
||||||
#endif
|
#endif
|
||||||
|
Sleep(100000); /* Not all terminal servers can keep up */
|
||||||
|
|
||||||
usleep(100000); /* Not all terminal servers can keep up */
|
#if USE_IPV6
|
||||||
|
# if HAVE_MEMSET /* XXX memset() is C89!!! */
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
# else
|
||||||
|
bzero(&hints, sizeof(hints));
|
||||||
|
# endif
|
||||||
|
|
||||||
#if HAVE_MEMSET
|
hints.ai_flags = AI_ADDRCONFIG;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
snprintf(serv, sizeof(serv), "%hu", pCE->netport);
|
||||||
|
|
||||||
|
error = getaddrinfo(pCE->host, serv, &hints, &ai);
|
||||||
|
if (error) {
|
||||||
|
Error("[%s] getaddrinfo(%s): %s: forcing down",
|
||||||
|
pCE->server, pCE->host, gai_strerror(error));
|
||||||
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rp = ai;
|
||||||
|
while (rp) {
|
||||||
|
error =
|
||||||
|
getnameinfo(rp->ai_addr, rp->ai_addrlen, host,
|
||||||
|
sizeof(host), serv, sizeof(serv),
|
||||||
|
NI_NUMERICHOST | NI_NUMERICSERV);
|
||||||
|
if (error)
|
||||||
|
continue;
|
||||||
|
CONDDEBUG((1,
|
||||||
|
"[%s]: trying hostname=%s, ip=%s, port=%s",
|
||||||
|
pCE->server, pCE->host, host, serv));
|
||||||
|
|
||||||
|
cofile =
|
||||||
|
socket(rp->ai_family, rp->ai_socktype,
|
||||||
|
rp->ai_protocol);
|
||||||
|
if (cofile != -1) {
|
||||||
|
# if HAVE_SETSOCKOPT
|
||||||
|
if (setsockopt
|
||||||
|
(cofile, SOL_SOCKET, SO_KEEPALIVE,
|
||||||
|
(char *)&one, sizeof(one)) < 0) {
|
||||||
|
Error
|
||||||
|
("[%s] %s:%s setsockopt(%u,SO_KEEPALIVE): %s",
|
||||||
|
pCE->server, host, serv, cofile, strerror(errno));
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
if (!SetFlags(cofile, O_NONBLOCK, 0))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
ret = connect(cofile, rp->ai_addr, rp->ai_addrlen);
|
||||||
|
if (ret == 0 || errno == EINPROGRESS)
|
||||||
|
goto success;
|
||||||
|
Error("[%s] %s:%s connect(%u): %s",
|
||||||
|
pCE->server, host, serv, cofile, strerror(errno));
|
||||||
|
fail:
|
||||||
|
close(cofile);
|
||||||
|
} else {
|
||||||
|
Error
|
||||||
|
("[%s] %s:%s socket(AF_INET,SOCK_STREAM): %s",
|
||||||
|
pCE->server, host, serv, strerror(errno));
|
||||||
|
}
|
||||||
|
rp = rp->ai_next;
|
||||||
|
}
|
||||||
|
|
||||||
|
Error("[%s] Unable to connect to %s:%s, forcing down", pCE->server,
|
||||||
|
pCE->host, serv);
|
||||||
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
|
return;
|
||||||
|
success:
|
||||||
|
freeaddrinfo(ai);
|
||||||
|
#else /* !USE_IPV6 */
|
||||||
|
# if HAVE_MEMSET
|
||||||
memset((void *)&port, 0, sizeof(port));
|
memset((void *)&port, 0, sizeof(port));
|
||||||
#else
|
# else
|
||||||
bzero((char *)&port, sizeof(port));
|
bzero((char *)&port, sizeof(port));
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
if ((hp = gethostbyname(pCE->host)) == NULL) {
|
if ((hp = gethostbyname(pCE->host)) == NULL) {
|
||||||
Error("[%s] gethostbyname(%s): %s: forcing down",
|
Error("[%s] gethostbyname(%s): %s: forcing down",
|
||||||
@ -878,13 +1013,13 @@ ConsInit(pCE)
|
|||||||
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if HAVE_MEMCPY
|
# if HAVE_MEMCPY
|
||||||
memcpy(&port.sin_addr.s_addr, hp->h_addr_list[0],
|
memcpy(&port.sin_addr.s_addr, hp->h_addr_list[0],
|
||||||
hp->h_length);
|
hp->h_length);
|
||||||
#else
|
# else
|
||||||
bcopy(hp->h_addr_list[0], &port.sin_addr.s_addr,
|
bcopy(hp->h_addr_list[0], &port.sin_addr.s_addr,
|
||||||
hp->h_length);
|
hp->h_length);
|
||||||
#endif
|
# endif
|
||||||
port.sin_family = hp->h_addrtype;
|
port.sin_family = hp->h_addrtype;
|
||||||
port.sin_port = htons(pCE->netport);
|
port.sin_port = htons(pCE->netport);
|
||||||
|
|
||||||
@ -895,7 +1030,7 @@ ConsInit(pCE)
|
|||||||
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if HAVE_SETSOCKOPT
|
# if HAVE_SETSOCKOPT
|
||||||
if (setsockopt
|
if (setsockopt
|
||||||
(cofile, SOL_SOCKET, SO_KEEPALIVE, (char *)&one,
|
(cofile, SOL_SOCKET, SO_KEEPALIVE, (char *)&one,
|
||||||
sizeof(one)) < 0) {
|
sizeof(one)) < 0) {
|
||||||
@ -906,7 +1041,7 @@ ConsInit(pCE)
|
|||||||
close(cofile);
|
close(cofile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
if (!SetFlags(cofile, O_NONBLOCK, 0)) {
|
if (!SetFlags(cofile, O_NONBLOCK, 0)) {
|
||||||
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
@ -926,6 +1061,7 @@ ConsInit(pCE)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
}
|
}
|
||||||
if ((pCE->cofile =
|
if ((pCE->cofile =
|
||||||
FileOpenFD(cofile, simpleSocket)) == (CONSFILE *)0) {
|
FileOpenFD(cofile, simpleSocket)) == (CONSFILE *)0) {
|
||||||
@ -1039,6 +1175,56 @@ ConsInit(pCE)
|
|||||||
TtyDev(pCE);
|
TtyDev(pCE);
|
||||||
pCE->ioState = ISNORMAL;
|
pCE->ioState = ISNORMAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
case IPMI:
|
||||||
|
if (!(pCE->ipmictx = IpmiSOLCreate(pCE))) {
|
||||||
|
Error("[%s] Could not create IPMI context: forcing down",
|
||||||
|
pCE->server);
|
||||||
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ipmiconsole_engine_submit(pCE->ipmictx, NULL, NULL) < 0) {
|
||||||
|
Error
|
||||||
|
("[%s] Could not connect to IPMI host `%s': forcing down",
|
||||||
|
pCE->server, pCE->host);
|
||||||
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cofile = ipmiconsole_ctx_fd(pCE->ipmictx);
|
||||||
|
if (!SetFlags(cofile, O_NONBLOCK, 0)) {
|
||||||
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pCE->cofile =
|
||||||
|
FileOpenFD(cofile, simpleFile)) == (CONSFILE *)0) {
|
||||||
|
Error("[%s] FileOpenFD(simpleFile) failed: forcing down",
|
||||||
|
pCE->server);
|
||||||
|
ConsDown(pCE, FLAGTRUE, FLAGTRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ipmiconsole_ctx_status(pCE->ipmictx) ==
|
||||||
|
IPMICONSOLE_CTX_STATUS_SOL_ESTABLISHED) {
|
||||||
|
/* Read in the NULL from OUTPUT_ON_SOL_ESTABLISHED flag */
|
||||||
|
char b[1];
|
||||||
|
FileRead(pCE->cofile, b, 1); /* trust it's NULL */
|
||||||
|
pCE->ioState = ISNORMAL;
|
||||||
|
pCE->stateTimer = 0;
|
||||||
|
} else {
|
||||||
|
/* Error status cases will be handled in Kiddie() */
|
||||||
|
pCE->ioState = INCONNECT;
|
||||||
|
pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT;
|
||||||
|
if (timers[T_STATE] == (time_t)0 ||
|
||||||
|
timers[T_STATE] > pCE->stateTimer)
|
||||||
|
timers[T_STATE] = pCE->stateTimer;
|
||||||
|
}
|
||||||
|
pCE->fup = 1;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pCE->fup) {
|
if (!pCE->fup) {
|
||||||
@ -1057,6 +1243,11 @@ ConsInit(pCE)
|
|||||||
Verbose("[%s] port %hu on %s", pCE->server, pCE->netport,
|
Verbose("[%s] port %hu on %s", pCE->server, pCE->netport,
|
||||||
pCE->host);
|
pCE->host);
|
||||||
break;
|
break;
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
case IPMI:
|
||||||
|
Verbose("[%s] on %s", pCE->server);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case NOOP:
|
case NOOP:
|
||||||
Verbose("[%s] noop", pCE->server);
|
Verbose("[%s] noop", pCE->server);
|
||||||
break;
|
break;
|
||||||
@ -1073,7 +1264,12 @@ ConsInit(pCE)
|
|||||||
/* if we're waiting for connect() to finish, watch the
|
/* if we're waiting for connect() to finish, watch the
|
||||||
* write bit, otherwise watch for the read bit
|
* write bit, otherwise watch for the read bit
|
||||||
*/
|
*/
|
||||||
if (pCE->ioState == INCONNECT)
|
if (pCE->ioState == INCONNECT
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
/* We wait for read() with the libipmiconsole */
|
||||||
|
&& pCE->type != IPMI
|
||||||
|
#endif
|
||||||
|
)
|
||||||
FD_SET(cofile, &winit);
|
FD_SET(cofile, &winit);
|
||||||
else
|
else
|
||||||
FD_SET(cofile, &rinit);
|
FD_SET(cofile, &rinit);
|
||||||
@ -1122,48 +1318,95 @@ ConsInit(pCE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
AddrsMatch(char *addr1, char *addr2)
|
AddrsMatch(char *addr1, char *addr2)
|
||||||
#else
|
|
||||||
AddrsMatch(addr1, addr2)
|
|
||||||
char *addr1;
|
|
||||||
char *addr2;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
|
#if USE_IPV6
|
||||||
|
int error, ret = 0;
|
||||||
|
struct addrinfo *ai1, *ai2, *rp1, *rp2, hints;
|
||||||
|
#else
|
||||||
/* so, since we might use inet_addr, we're going to use
|
/* so, since we might use inet_addr, we're going to use
|
||||||
* (in_addr_t)(-1) as a sign of an invalid ip address.
|
* (in_addr_t)(-1) as a sign of an invalid ip address.
|
||||||
* sad, but true.
|
* sad, but true.
|
||||||
*/
|
*/
|
||||||
in_addr_t inAddr1 = (in_addr_t) (-1);
|
in_addr_t inAddr1 = (in_addr_t) (-1);
|
||||||
in_addr_t inAddr2 = (in_addr_t) (-1);
|
in_addr_t inAddr2 = (in_addr_t) (-1);
|
||||||
#if HAVE_INET_ATON
|
# if HAVE_INET_ATON
|
||||||
struct in_addr inetAddr1;
|
struct in_addr inetAddr1;
|
||||||
struct in_addr inetAddr2;
|
struct in_addr inetAddr2;
|
||||||
#endif
|
# endif
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
|
|
||||||
/* first try simple character string match */
|
/* first try simple character string match */
|
||||||
if (strcasecmp(addr1, addr2) == 0)
|
if (strcasecmp(addr1, addr2) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
#if USE_IPV6
|
||||||
|
# if HAVE_MEMSET
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
# else
|
||||||
|
bzero(&hints, sizeof(hints));
|
||||||
|
# endif
|
||||||
|
hints.ai_flags = AI_ADDRCONFIG;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
|
||||||
|
error = getaddrinfo(addr1, NULL, &hints, &ai1);
|
||||||
|
if (error) {
|
||||||
|
Error("getaddrinfo(%s): %s", addr1, gai_strerror(error));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
error = getaddrinfo(addr2, NULL, &hints, &ai2);
|
||||||
|
if (error) {
|
||||||
|
Error("getaddrinfo(%s): %s", addr2, gai_strerror(error));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
rp1 = ai1;
|
||||||
|
rp2 = ai2;
|
||||||
|
for (; rp1 != NULL; rp1 = rp1->ai_next) {
|
||||||
|
for (; rp2 != NULL; rp2 = rp2->ai_next) {
|
||||||
|
if (rp1->ai_addr->sa_family != rp2->ai_addr->sa_family)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (
|
||||||
|
# if HAVE_MEMCMP
|
||||||
|
memcmp(&rp1->ai_addr, &rp2->ai_addr,
|
||||||
|
sizeof(struct sockaddr_storage))
|
||||||
|
# else
|
||||||
|
bcmp(&rp1->ai_addr, &rp2->ai_addr,
|
||||||
|
sizeof(struct sockaddr_storage))
|
||||||
|
# endif
|
||||||
|
== 0) {
|
||||||
|
ret = 1;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
freeaddrinfo(ai1);
|
||||||
|
freeaddrinfo(ai2);
|
||||||
|
Msg("compare %s and %s returns %d", addr1, addr2, ret);
|
||||||
|
return ret;
|
||||||
|
#else
|
||||||
/* now try ip address match (could have leading zeros or something) */
|
/* now try ip address match (could have leading zeros or something) */
|
||||||
#if HAVE_INET_ATON
|
# if HAVE_INET_ATON
|
||||||
if (inet_aton(addr1, &inetAddr1) != 0)
|
if (inet_aton(addr1, &inetAddr1) != 0)
|
||||||
inAddr1 = inetAddr1.s_addr;
|
inAddr1 = inetAddr1.s_addr;
|
||||||
if (inet_aton(addr2, &inetAddr2) != 0)
|
if (inet_aton(addr2, &inetAddr2) != 0)
|
||||||
inAddr2 = inetAddr2.s_addr;
|
inAddr2 = inetAddr2.s_addr;
|
||||||
#else
|
# else
|
||||||
inAddr1 = inet_addr(addr1);
|
inAddr1 = inet_addr(addr1);
|
||||||
inAddr2 = inet_addr(addr2);
|
inAddr2 = inet_addr(addr2);
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* if both are ip addresses, we just match */
|
/* if both are ip addresses, we just match */
|
||||||
if (inAddr1 != (in_addr_t) (-1) && inAddr2 != (in_addr_t) (-1))
|
if (inAddr1 != (in_addr_t) (-1) && inAddr2 != (in_addr_t) (-1))
|
||||||
return !
|
return !
|
||||||
#if HAVE_MEMCMP
|
# if HAVE_MEMCMP
|
||||||
memcmp(&inAddr1, &inAddr2, sizeof(inAddr1))
|
memcmp(&inAddr1, &inAddr2, sizeof(inAddr1))
|
||||||
#else
|
# else
|
||||||
bcmp(&inAddr1, &inAddr2, sizeof(inAddr1))
|
bcmp(&inAddr1, &inAddr2, sizeof(inAddr1))
|
||||||
#endif
|
# endif
|
||||||
;
|
;
|
||||||
|
|
||||||
/* both are hostnames...this sucks 'cause we have to copy one
|
/* both are hostnames...this sucks 'cause we have to copy one
|
||||||
@ -1191,11 +1434,11 @@ AddrsMatch(addr1, addr2)
|
|||||||
if (addrs == (in_addr_t *) 0)
|
if (addrs == (in_addr_t *) 0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
for (i = 0; i < c; i++) {
|
for (i = 0; i < c; i++) {
|
||||||
#if HAVE_MEMCPY
|
# if HAVE_MEMCPY
|
||||||
memcpy(&(addrs[i]), he->h_addr_list[i], he->h_length);
|
memcpy(&(addrs[i]), he->h_addr_list[i], he->h_length);
|
||||||
#else
|
# else
|
||||||
bcopy(he->h_addr_list[i], &(addrs[i]), he->h_length);
|
bcopy(he->h_addr_list[i], &(addrs[i]), he->h_length);
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now process the second hostname */
|
/* now process the second hostname */
|
||||||
@ -1215,12 +1458,12 @@ AddrsMatch(addr1, addr2)
|
|||||||
for (j = 0; he->h_addr_list[j] != (char *)0; j++) {
|
for (j = 0; he->h_addr_list[j] != (char *)0; j++) {
|
||||||
for (i = 0; i < c; i++) {
|
for (i = 0; i < c; i++) {
|
||||||
if (
|
if (
|
||||||
#if HAVE_MEMCMP
|
# if HAVE_MEMCMP
|
||||||
memcmp(&(addrs[i]), he->h_addr_list[j],
|
memcmp(&(addrs[i]), he->h_addr_list[j],
|
||||||
he->h_length)
|
he->h_length)
|
||||||
#else
|
# else
|
||||||
bcmp(&(addrs[i]), he->h_addr_list[j], he->h_length)
|
bcmp(&(addrs[i]), he->h_addr_list[j], he->h_length)
|
||||||
#endif
|
# endif
|
||||||
== 0) {
|
== 0) {
|
||||||
free(addrs);
|
free(addrs);
|
||||||
return 1;
|
return 1;
|
||||||
@ -1254,28 +1497,24 @@ AddrsMatch(addr1, addr2)
|
|||||||
}
|
}
|
||||||
for (i = 0; he->h_addr_list[i] != (char *)0; i++) {
|
for (i = 0; he->h_addr_list[i] != (char *)0; i++) {
|
||||||
if (
|
if (
|
||||||
#if HAVE_MEMCMP
|
# if HAVE_MEMCMP
|
||||||
memcmp(iaddr, he->h_addr_list[i], he->h_length)
|
memcmp(iaddr, he->h_addr_list[i], he->h_length)
|
||||||
#else
|
# else
|
||||||
bcmp(iaddr, he->h_addr_list[i], he->h_length)
|
bcmp(iaddr, he->h_addr_list[i], he->h_length)
|
||||||
#endif
|
# endif
|
||||||
== 0)
|
== 0)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif /* USE_IPV6 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* thread ther list of uniq console server machines, aliases for (ksb)
|
/* thread ther list of uniq console server machines, aliases for (ksb)
|
||||||
* machines will screw us up
|
* machines will screw us up
|
||||||
*/
|
*/
|
||||||
REMOTE *
|
REMOTE *
|
||||||
#if PROTOTYPES
|
|
||||||
FindUniq(REMOTE *pRCAll)
|
FindUniq(REMOTE *pRCAll)
|
||||||
#else
|
|
||||||
FindUniq(pRCAll)
|
|
||||||
REMOTE *pRCAll;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
|
|
||||||
@ -1298,12 +1537,7 @@ FindUniq(pRCAll)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DestroyRemoteConsole(REMOTE *pRCList)
|
DestroyRemoteConsole(REMOTE *pRCList)
|
||||||
#else
|
|
||||||
DestroyRemoteConsole(pRCList)
|
|
||||||
REMOTE *pRCList;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
NAMES *name = (NAMES *)0;
|
NAMES *name = (NAMES *)0;
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: consent.h,v 5.72 2013/09/26 17:32:55 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -57,9 +55,19 @@ typedef enum consType {
|
|||||||
EXEC,
|
EXEC,
|
||||||
HOST,
|
HOST,
|
||||||
NOOP,
|
NOOP,
|
||||||
UDS
|
UDS,
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
IPMI,
|
||||||
|
#endif
|
||||||
} CONSTYPE;
|
} CONSTYPE;
|
||||||
|
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
# define IPMIL_UNKNOWN (0)
|
||||||
|
# define IPMIL_USER (IPMICONSOLE_PRIVILEGE_USER+1)
|
||||||
|
# define IPMIL_OPERATOR (IPMICONSOLE_PRIVILEGE_OPERATOR+1)
|
||||||
|
# define IPMIL_ADMIN (IPMICONSOLE_PRIVILEGE_ADMIN+1)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct names {
|
typedef struct names {
|
||||||
char *name;
|
char *name;
|
||||||
struct names *next;
|
struct names *next;
|
||||||
@ -91,6 +99,17 @@ typedef struct consent { /* console information */
|
|||||||
FLAG ixoff; /* XON/XOFF flow control on input */
|
FLAG ixoff; /* XON/XOFF flow control on input */
|
||||||
#if defined(CRTSCTS)
|
#if defined(CRTSCTS)
|
||||||
FLAG crtscts; /* use hardware flow control */
|
FLAG crtscts; /* use hardware flow control */
|
||||||
|
#endif
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
/* type == IPMI */
|
||||||
|
int ipmiprivlevel; /* IPMI authentication level */
|
||||||
|
ipmiconsole_ctx_t ipmictx; /* IPMI ctx */
|
||||||
|
unsigned int ipmiworkaround; /* IPMI workaround flags */
|
||||||
|
short ipmiwrkset; /* workaround flags set in config */
|
||||||
|
int ipmiciphersuite; /* IPMI cipher suite */
|
||||||
|
char *username; /* Username to log as */
|
||||||
|
char *password; /* Login Password */
|
||||||
|
STRING *ipmikg; /* IPMI k_g auth key */
|
||||||
#endif
|
#endif
|
||||||
/* type == HOST */
|
/* type == HOST */
|
||||||
char *host; /* hostname */
|
char *host; /* hostname */
|
||||||
@ -109,7 +128,7 @@ typedef struct consent { /* console information */
|
|||||||
char *udssubst; /* socket file substitution pattern */
|
char *udssubst; /* socket file substitution pattern */
|
||||||
/* global stuff */
|
/* global stuff */
|
||||||
char *master; /* master hostname */
|
char *master; /* master hostname */
|
||||||
unsigned short breakNum; /* break type [1-9] */
|
unsigned short breakNum; /* break type [1-35] */
|
||||||
char *logfile; /* logfile */
|
char *logfile; /* logfile */
|
||||||
off_t logfilemax; /* size limit for rolling logfile */
|
off_t logfilemax; /* size limit for rolling logfile */
|
||||||
char *initcmd; /* initcmd command */
|
char *initcmd; /* initcmd command */
|
||||||
@ -188,13 +207,13 @@ typedef struct remote { /* console at another host */
|
|||||||
NAMES *aliases; /* aliases for remote server name */
|
NAMES *aliases; /* aliases for remote server name */
|
||||||
} REMOTE;
|
} REMOTE;
|
||||||
|
|
||||||
extern PARITY *FindParity PARAMS((char *));
|
extern PARITY *FindParity(char *);
|
||||||
extern BAUD *FindBaud PARAMS((char *));
|
extern BAUD *FindBaud(char *);
|
||||||
extern void ConsInit PARAMS((CONSENT *));
|
extern void ConsInit(CONSENT *);
|
||||||
extern void ConsDown PARAMS((CONSENT *, FLAG, FLAG));
|
extern void ConsDown(CONSENT *, FLAG, FLAG);
|
||||||
extern REMOTE *FindUniq PARAMS((REMOTE *));
|
extern REMOTE *FindUniq(REMOTE *);
|
||||||
extern void DestroyRemoteConsole PARAMS((REMOTE *));
|
extern void DestroyRemoteConsole(REMOTE *);
|
||||||
extern void StartInit PARAMS((CONSENT *));
|
extern void StartInit(CONSENT *);
|
||||||
extern void StopInit PARAMS((CONSENT *));
|
extern void StopInit(CONSENT *);
|
||||||
extern char *ConsState PARAMS((CONSENT *));
|
extern char *ConsState(CONSENT *);
|
||||||
extern void SetupTty PARAMS((CONSENT *, int));
|
extern void SetupTty(CONSENT *, int);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
.\" @(#)conserver.8 01/06/91 OSU CIS; Thomas A. Fine
|
.TH CONSERVER 8 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver"
|
||||||
.\" $Id: conserver.man,v 1.54 2006/12/31 02:02:48 bryan Exp $
|
|
||||||
.TH CONSERVER 8 "2006/12/31" "conserver-8.1.19" "conserver"
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
conserver \- console server daemon
|
conserver \- console server daemon
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -422,7 +420,7 @@ output, but all consoles, not
|
|||||||
just those without a user, are logged.
|
just those without a user, are logged.
|
||||||
Each line of output is prefixed with the console name.
|
Each line of output is prefixed with the console name.
|
||||||
If a user is attached read/write, a `*' is appended to 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.
|
to allow log watching utilities to ignore potential user-introduced alarms.
|
||||||
.TP
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
Echo the configuration as it is being read (be verbose).
|
Echo the configuration as it is being read (be verbose).
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: convert.c,v 1.12 2006/04/07 15:47:20 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -58,19 +56,12 @@ DestroyDataStructures()
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
#if PROTOTYPES
|
|
||||||
ReadLine2(FILE *fp, STRING *save, int *iLine)
|
ReadLine2(FILE *fp, STRING *save, int *iLine)
|
||||||
#else
|
|
||||||
ReadLine2(fp, save, iLine)
|
|
||||||
FILE *fp;
|
|
||||||
STRING *save;
|
|
||||||
int *iLine;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static char buf[1024];
|
static char buf[1024];
|
||||||
char *wholeline = (char *)0;
|
char *wholeline = (char *)0;
|
||||||
char *ret = (char *)0;
|
char *ret = (char *)0;
|
||||||
int i, buflen, peek, commentCheck = 1, comment = 0;
|
int i, buflen, peek, commentCheck = 1;
|
||||||
static STRING *bufstr = (STRING *)0;
|
static STRING *bufstr = (STRING *)0;
|
||||||
static STRING *wholestr = (STRING *)0;
|
static STRING *wholestr = (STRING *)0;
|
||||||
|
|
||||||
@ -112,7 +103,6 @@ ReadLine2(fp, save, iLine)
|
|||||||
if (!isspace((int)buf[i]))
|
if (!isspace((int)buf[i]))
|
||||||
break;
|
break;
|
||||||
if (buf[i] == '#') {
|
if (buf[i] == '#') {
|
||||||
comment = 1;
|
|
||||||
commentCheck = 0;
|
commentCheck = 0;
|
||||||
} else if (buf[i] != '\000') {
|
} else if (buf[i] != '\000') {
|
||||||
commentCheck = 0;
|
commentCheck = 0;
|
||||||
@ -123,14 +113,11 @@ ReadLine2(fp, save, iLine)
|
|||||||
buflen = strlen(buf);
|
buflen = strlen(buf);
|
||||||
if ((buflen >= 1) && (buf[buflen - 1] == '\n')) {
|
if ((buflen >= 1) && (buf[buflen - 1] == '\n')) {
|
||||||
(*iLine)++; /* Finally have a whole line */
|
(*iLine)++; /* Finally have a whole line */
|
||||||
/* if (comment == 0 && commentCheck == 0) { */
|
|
||||||
/* Finish off the chunk without the \n */
|
/* Finish off the chunk without the \n */
|
||||||
buf[buflen - 1] = '\000';
|
buf[buflen - 1] = '\000';
|
||||||
BuildString(buf, bufstr);
|
BuildString(buf, bufstr);
|
||||||
wholeline = BuildString(bufstr->string, wholestr);
|
wholeline = BuildString(bufstr->string, wholestr);
|
||||||
/* }*/
|
|
||||||
peek = 1;
|
peek = 1;
|
||||||
comment = 0;
|
|
||||||
commentCheck = 1;
|
commentCheck = 1;
|
||||||
BuildString((char *)0, bufstr);
|
BuildString((char *)0, bufstr);
|
||||||
} else {
|
} else {
|
||||||
@ -142,10 +129,6 @@ ReadLine2(fp, save, iLine)
|
|||||||
/* If we hit the EOF and weren't peeking ahead
|
/* If we hit the EOF and weren't peeking ahead
|
||||||
* and it's not a comment
|
* and it's not a comment
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
if (!peek && (ret == (char *)0) && (comment == 0) &&
|
|
||||||
(commentCheck == 0)) {
|
|
||||||
*/
|
|
||||||
if (!peek && (ret == (char *)0)) {
|
if (!peek && (ret == (char *)0)) {
|
||||||
(*iLine)++;
|
(*iLine)++;
|
||||||
wholeline = BuildString(bufstr->string, wholestr);
|
wholeline = BuildString(bufstr->string, wholestr);
|
||||||
@ -162,13 +145,7 @@ ReadLine2(fp, save, iLine)
|
|||||||
* to manage the consoles
|
* to manage the consoles
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ReadCfg(char *pcFile, FILE *fp)
|
ReadCfg(char *pcFile, FILE *fp)
|
||||||
#else
|
|
||||||
ReadCfg(pcFile, fp)
|
|
||||||
char *pcFile;
|
|
||||||
FILE *fp;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int iLine;
|
int iLine;
|
||||||
unsigned char *acIn;
|
unsigned char *acIn;
|
||||||
@ -432,7 +409,6 @@ ReadCfg(pcFile, fp)
|
|||||||
(unsigned char *)ReadLine2(fp, acInSave,
|
(unsigned char *)ReadLine2(fp, acInSave,
|
||||||
&iLine)) != (unsigned char *)0) {
|
&iLine)) != (unsigned char *)0) {
|
||||||
char *pcNext;
|
char *pcNext;
|
||||||
char cType;
|
|
||||||
|
|
||||||
acStart = PruneSpace((char *)acIn);
|
acStart = PruneSpace((char *)acIn);
|
||||||
if (acStart[0] == '#') {
|
if (acStart[0] == '#') {
|
||||||
@ -478,7 +454,6 @@ ReadCfg(pcFile, fp)
|
|||||||
printf("\ttrusted %s;\n", pcNext);
|
printf("\ttrusted %s;\n", pcNext);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cType = ' ';
|
|
||||||
Error("%s(%d) unknown access key `%s'", pcFile, iLine,
|
Error("%s(%d) unknown access key `%s'", pcFile, iLine,
|
||||||
acStart);
|
acStart);
|
||||||
break;
|
break;
|
||||||
@ -490,13 +465,7 @@ ReadCfg(pcFile, fp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
#else
|
|
||||||
main(argc, argv)
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char *pcFile;
|
char *pcFile;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: cutil.h,v 1.69 2009/09/26 09:23:04 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if PROTOTYPES
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#else
|
|
||||||
#include <varargs.h>
|
|
||||||
#endif
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
#include <openssl/ssl.h>
|
# include <openssl/ssl.h>
|
||||||
#include <openssl/err.h>
|
# include <openssl/bn.h>
|
||||||
|
# include <openssl/dh.h>
|
||||||
|
# include <openssl/err.h>
|
||||||
|
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
# define TLS_method SSLv23_method
|
||||||
|
# endif/* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
||||||
|
# if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
|
# define CIPHER_SEC0
|
||||||
|
# else
|
||||||
|
# define CIPHER_SEC0 ":@SECLEVEL=0"
|
||||||
|
# endif/* OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_GSSAPI
|
#if HAVE_GSSAPI
|
||||||
#include <gssapi/gssapi.h>
|
# include <gssapi/gssapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* communication constants
|
/* communication constants
|
||||||
@ -98,15 +102,15 @@ typedef struct consFile {
|
|||||||
|
|
||||||
typedef struct item {
|
typedef struct item {
|
||||||
char *id;
|
char *id;
|
||||||
void (*reg) PARAMS((char *));
|
void (*reg)(char *);
|
||||||
} ITEM;
|
} ITEM;
|
||||||
|
|
||||||
typedef struct section {
|
typedef struct section {
|
||||||
char *id;
|
char *id;
|
||||||
void (*begin) PARAMS((char *));
|
void (*begin)(char *);
|
||||||
void (*end) PARAMS((void));
|
void (*end)(void);
|
||||||
void (*abort) PARAMS((void));
|
void (*abort)(void);
|
||||||
void (*destroy) PARAMS((void));
|
void (*destroy)(void);
|
||||||
ITEM *items;
|
ITEM *items;
|
||||||
} SECTION;
|
} SECTION;
|
||||||
|
|
||||||
@ -119,14 +123,14 @@ typedef enum substToken {
|
|||||||
typedef struct subst {
|
typedef struct subst {
|
||||||
/* function to retrieve a token type based on a character
|
/* function to retrieve a token type based on a character
|
||||||
*/
|
*/
|
||||||
SUBSTTOKEN (*token) PARAMS((char));
|
SUBSTTOKEN (*token)(char);
|
||||||
/* data for callback function
|
/* data for callback function
|
||||||
*/
|
*/
|
||||||
void *data;
|
void *data;
|
||||||
/* function to retrieve a value (as a char* or int or both) for
|
/* function to retrieve a value (as a char* or int or both) for
|
||||||
* a substitution
|
* a substitution
|
||||||
*/
|
*/
|
||||||
int (*value) PARAMS((char, char **, int *));
|
int (*value)(char, char **, int *);
|
||||||
} SUBST;
|
} SUBST;
|
||||||
|
|
||||||
extern int isMultiProc, fDebug, fVerbose, fErrorPrinted;
|
extern int isMultiProc, fDebug, fVerbose, fErrorPrinted;
|
||||||
@ -134,7 +138,9 @@ extern char *progname;
|
|||||||
extern pid_t thepid;
|
extern pid_t thepid;
|
||||||
#define MAXHOSTNAME 1024
|
#define MAXHOSTNAME 1024
|
||||||
extern char myHostname[];
|
extern char myHostname[];
|
||||||
|
#if !USE_IPV6
|
||||||
extern struct in_addr *myAddrs;
|
extern struct in_addr *myAddrs;
|
||||||
|
#endif
|
||||||
extern fd_set rinit;
|
extern fd_set rinit;
|
||||||
extern fd_set winit;
|
extern fd_set winit;
|
||||||
extern int maxfd;
|
extern int maxfd;
|
||||||
@ -145,73 +151,75 @@ extern char *file; /* used by ParseFile */
|
|||||||
extern SECTION sections[]; /* used by ParseFile */
|
extern SECTION sections[]; /* used by ParseFile */
|
||||||
extern int isMaster;
|
extern int isMaster;
|
||||||
|
|
||||||
extern const char *StrTime PARAMS((time_t *));
|
extern const char *StrTime(time_t *);
|
||||||
extern void Debug PARAMS((int, char *, ...));
|
extern void Debug(int, char *, ...);
|
||||||
extern void Error PARAMS((char *, ...));
|
extern void Error(char *, ...);
|
||||||
extern void Msg PARAMS((char *, ...));
|
extern void Msg(char *, ...);
|
||||||
extern void Verbose PARAMS((char *, ...));
|
extern void Verbose(char *, ...);
|
||||||
extern void SimpleSignal PARAMS((int, RETSIGTYPE(*)(int)));
|
extern void SimpleSignal(int, RETSIGTYPE(*)(int));
|
||||||
extern int GetMaxFiles PARAMS(());
|
extern int GetMaxFiles();
|
||||||
extern char *FmtCtl PARAMS((int, STRING *));
|
extern char *FmtCtl(int, STRING *);
|
||||||
extern void FmtCtlStr PARAMS((char *, int, STRING *));
|
extern void FmtCtlStr(char *, int, STRING *);
|
||||||
extern CONSFILE *FileOpenFD PARAMS((int, enum consFileType));
|
extern CONSFILE *FileOpenFD(int, enum consFileType);
|
||||||
extern CONSFILE *FileOpenPipe PARAMS((int, int));
|
extern CONSFILE *FileOpenPipe(int, int);
|
||||||
extern CONSFILE *FileOpen PARAMS((const char *, int, int));
|
extern CONSFILE *FileOpen(const char *, int, int);
|
||||||
extern int FileClose PARAMS((CONSFILE **));
|
extern int FileClose(CONSFILE **);
|
||||||
extern int FileRead PARAMS((CONSFILE *, void *, int));
|
extern int FileRead(CONSFILE *, void *, int);
|
||||||
extern int FileWrite PARAMS((CONSFILE *, FLAG, char *, int));
|
extern int FileWrite(CONSFILE *, FLAG, char *, int);
|
||||||
extern void FileVWrite PARAMS((CONSFILE *, FLAG, char *, va_list));
|
extern void FileVWrite(CONSFILE *, FLAG, char *, va_list);
|
||||||
extern void FilePrint PARAMS((CONSFILE *, FLAG, char *, ...));
|
extern void FilePrint(CONSFILE *, FLAG, char *, ...);
|
||||||
extern int FileStat PARAMS((CONSFILE *, struct stat *));
|
extern int FileStat(CONSFILE *, struct stat *);
|
||||||
extern int FileSeek PARAMS((CONSFILE *, off_t, int));
|
extern int FileSeek(CONSFILE *, off_t, int);
|
||||||
extern int FileSend PARAMS((CONSFILE *, const void *, size_t, int));
|
extern int FileSend(CONSFILE *, const void *, size_t, int);
|
||||||
extern int FileFDNum PARAMS((CONSFILE *));
|
extern int FileFDNum(CONSFILE *);
|
||||||
extern int FileFDOutNum PARAMS((CONSFILE *));
|
extern int FileFDOutNum(CONSFILE *);
|
||||||
extern int FileUnopen PARAMS((CONSFILE *));
|
extern int FileUnopen(CONSFILE *);
|
||||||
extern void OutOfMem PARAMS(());
|
extern void OutOfMem();
|
||||||
extern char *BuildTmpString PARAMS((const char *));
|
extern char *BuildTmpString(const char *);
|
||||||
extern char *BuildTmpStringChar PARAMS((const char));
|
extern char *BuildTmpStringChar(const char);
|
||||||
extern char *BuildTmpStringPrint PARAMS((char *, ...));
|
extern char *BuildTmpStringPrint(char *, ...);
|
||||||
extern char *BuildString PARAMS((const char *, STRING *));
|
extern char *BuildString(const char *, STRING *);
|
||||||
extern char *BuildStringChar PARAMS((const char, STRING *));
|
extern char *BuildStringChar(const char, STRING *);
|
||||||
extern char *BuildStringPrint PARAMS((STRING *, char *, ...));
|
extern char *BuildStringPrint(STRING *, char *, ...);
|
||||||
extern char *BuildStringN PARAMS((const char *, int, STRING *));
|
extern char *BuildStringN(const char *, int, STRING *);
|
||||||
extern char *ShiftString PARAMS((STRING *, int));
|
extern char *ShiftString(STRING *, int);
|
||||||
extern void InitString PARAMS((STRING *));
|
extern void InitString(STRING *);
|
||||||
extern void DestroyString PARAMS((STRING *));
|
extern void DestroyString(STRING *);
|
||||||
extern void DestroyStrings PARAMS((void));
|
extern void DestroyStrings(void);
|
||||||
extern STRING *AllocString PARAMS((void));
|
extern STRING *AllocString(void);
|
||||||
extern char *ReadLine PARAMS((FILE *, STRING *, int *));
|
extern char *ReadLine(FILE *, STRING *, int *);
|
||||||
extern enum consFileType FileGetType PARAMS((CONSFILE *));
|
extern enum consFileType FileGetType(CONSFILE *);
|
||||||
extern void FileSetType PARAMS((CONSFILE *, enum consFileType));
|
extern void FileSetType(CONSFILE *, enum consFileType);
|
||||||
extern void FileSetQuoteIAC PARAMS((CONSFILE *, FLAG));
|
extern void FileSetQuoteIAC(CONSFILE *, FLAG);
|
||||||
extern FLAG FileSawQuoteSusp PARAMS((CONSFILE *));
|
extern FLAG FileSawQuoteSusp(CONSFILE *);
|
||||||
extern FLAG FileSawQuoteExec PARAMS((CONSFILE *));
|
extern FLAG FileSawQuoteExec(CONSFILE *);
|
||||||
extern FLAG FileSawQuoteAbrt PARAMS((CONSFILE *));
|
extern FLAG FileSawQuoteAbrt(CONSFILE *);
|
||||||
extern FLAG FileSawQuoteGoto PARAMS((CONSFILE *));
|
extern FLAG FileSawQuoteGoto(CONSFILE *);
|
||||||
extern void Bye PARAMS((int));
|
extern void Bye(int);
|
||||||
extern void DestroyDataStructures PARAMS((void));
|
extern void DestroyDataStructures(void);
|
||||||
extern int IsMe PARAMS((char *));
|
extern int IsMe(char *);
|
||||||
extern char *PruneSpace PARAMS((char *));
|
extern char *PruneSpace(char *);
|
||||||
extern int FileCanRead PARAMS((CONSFILE *, fd_set *, fd_set *));
|
extern int FileCanRead(CONSFILE *, fd_set *, fd_set *);
|
||||||
extern int FileCanWrite PARAMS((CONSFILE *, fd_set *, fd_set *));
|
extern int FileCanWrite(CONSFILE *, fd_set *, fd_set *);
|
||||||
extern int FileBufEmpty PARAMS((CONSFILE *));
|
extern int FileBufEmpty(CONSFILE *);
|
||||||
extern int SetFlags PARAMS((int, int, int));
|
extern int SetFlags(int, int, int);
|
||||||
extern char *StrDup PARAMS((const char *));
|
extern char *StrDup(const char *);
|
||||||
extern int ParseIACBuf PARAMS((CONSFILE *, void *, int *));
|
extern int ParseIACBuf(CONSFILE *, void *, int *);
|
||||||
extern void *MemMove PARAMS((void *, void *, size_t));
|
extern void *MemMove(void *, void *, size_t);
|
||||||
extern char *StringChar PARAMS((STRING *, int, char));
|
extern char *StringChar(STRING *, int, char);
|
||||||
extern void ParseFile PARAMS((char *, FILE *, int));
|
extern void ParseFile(char *, FILE *, int);
|
||||||
extern void ProbeInterfaces PARAMS((in_addr_t));
|
#if !USE_IPV6
|
||||||
extern void ProcessSubst
|
extern void ProbeInterfaces(in_addr_t);
|
||||||
PARAMS((SUBST *, char **, char **, char *, char *));
|
#endif
|
||||||
extern char *MyVersion PARAMS((void));
|
extern void ProcessSubst(SUBST *, char **, char **, char *, char *);
|
||||||
extern unsigned int AtoU PARAMS((char *));
|
extern char *MyVersion(void);
|
||||||
extern void StrCpy PARAMS((char *, const char *, unsigned int));
|
extern unsigned int AtoU(char *);
|
||||||
#if HAVE_OPENSSL
|
extern void StrCpy(char *, const char *, unsigned int);
|
||||||
extern SSL *FileGetSSL PARAMS((CONSFILE *));
|
extern void Sleep(useconds_t);
|
||||||
extern void FileSetSSL PARAMS((CONSFILE *, SSL *));
|
#if HAVE_OPENSSL
|
||||||
extern int SSLVerifyCallback PARAMS((int, X509_STORE_CTX *));
|
extern SSL *FileGetSSL(CONSFILE *);
|
||||||
extern int FileSSLAccept PARAMS((CONSFILE *));
|
extern void FileSetSSL(CONSFILE *, SSL *);
|
||||||
extern int FileCanSSLAccept PARAMS((CONSFILE *, fd_set *, fd_set *));
|
extern int SSLVerifyCallback(int, X509_STORE_CTX *);
|
||||||
|
extern int FileSSLAccept(CONSFILE *);
|
||||||
|
extern int FileCanSSLAccept(CONSFILE *, fd_set *, fd_set *);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: fallback.c,v 5.61 2004/04/16 16:58:09 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -27,44 +25,38 @@
|
|||||||
* packages, i think things are ok...hopefully it's true!
|
* packages, i think things are ok...hopefully it's true!
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
#if PROTOTYPES
|
|
||||||
GetPseudoTTY(STRING *slave, int *slaveFD)
|
GetPseudoTTY(STRING *slave, int *slaveFD)
|
||||||
#else
|
|
||||||
GetPseudoTTY(slave, slaveFD)
|
|
||||||
STRING *slave;
|
|
||||||
int *slaveFD;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#if HAVE_OPENPTY
|
#if HAVE_OPENPTY
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
int sfd = -1;
|
int sfd = -1;
|
||||||
int opty = 0;
|
int opty = 0;
|
||||||
char *pcName;
|
char *pcName;
|
||||||
#if HAVE_SIGACTION
|
# if HAVE_SIGACTION
|
||||||
sigset_t oldmask, newmask;
|
sigset_t oldmask, newmask;
|
||||||
#else
|
# else
|
||||||
extern RETSIGTYPE FlagReapVirt PARAMS((int));
|
extern RETSIGTYPE FlagReapVirt(int);
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#if HAVE_SIGACTION
|
# if HAVE_SIGACTION
|
||||||
sigemptyset(&newmask);
|
sigemptyset(&newmask);
|
||||||
sigaddset(&newmask, SIGCHLD);
|
sigaddset(&newmask, SIGCHLD);
|
||||||
if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
|
if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
|
||||||
Error("GetPseudoTTY(): sigprocmask(SIG_BLOCK): %s",
|
Error("GetPseudoTTY(): sigprocmask(SIG_BLOCK): %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#else
|
# else
|
||||||
SimpleSignal(SIGCHLD, SIG_DFL);
|
SimpleSignal(SIGCHLD, SIG_DFL);
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
opty = openpty(&fd, &sfd, NULL, NULL, NULL);
|
opty = openpty(&fd, &sfd, NULL, NULL, NULL);
|
||||||
|
|
||||||
#if HAVE_SIGACTION
|
# if HAVE_SIGACTION
|
||||||
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
|
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
|
||||||
Error("GetPseudoTTY(): sigprocmask(SIG_SETMASK): %s",
|
Error("GetPseudoTTY(): sigprocmask(SIG_SETMASK): %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#else
|
# else
|
||||||
SimpleSignal(SIGCHLD, FlagReapVirt);
|
SimpleSignal(SIGCHLD, FlagReapVirt);
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
if (opty != 0) {
|
if (opty != 0) {
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
@ -84,15 +76,15 @@ GetPseudoTTY(slave, slaveFD)
|
|||||||
*slaveFD = sfd;
|
*slaveFD = sfd;
|
||||||
return fd;
|
return fd;
|
||||||
#else
|
#else
|
||||||
#if (HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT) || defined(_AIX)
|
# if (HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT) || defined(_AIX)
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
int sfd = -1;
|
int sfd = -1;
|
||||||
char *pcName;
|
char *pcName;
|
||||||
#if HAVE_SIGACTION
|
# if HAVE_SIGACTION
|
||||||
sigset_t oldmask, newmask;
|
sigset_t oldmask, newmask;
|
||||||
#else
|
# else
|
||||||
extern RETSIGTYPE FlagReapVirt PARAMS((int));
|
extern RETSIGTYPE FlagReapVirt(int);
|
||||||
#endif
|
# endif
|
||||||
int c;
|
int c;
|
||||||
/* clone list and idea stolen from xemacs distribution */
|
/* clone list and idea stolen from xemacs distribution */
|
||||||
static char *clones[] = {
|
static char *clones[] = {
|
||||||
@ -111,48 +103,48 @@ GetPseudoTTY(slave, slaveFD)
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if HAVE_SIGACTION
|
# if HAVE_SIGACTION
|
||||||
sigemptyset(&newmask);
|
sigemptyset(&newmask);
|
||||||
sigaddset(&newmask, SIGCHLD);
|
sigaddset(&newmask, SIGCHLD);
|
||||||
if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
|
if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
|
||||||
Error("GetPseudoTTY(): sigprocmask(SIG_BLOCK): %s",
|
Error("GetPseudoTTY(): sigprocmask(SIG_BLOCK): %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#else
|
# else
|
||||||
SimpleSignal(SIGCHLD, SIG_DFL);
|
SimpleSignal(SIGCHLD, SIG_DFL);
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#if HAVE_GRANTPT
|
# if HAVE_GRANTPT
|
||||||
grantpt(fd); /* change permission of slave */
|
grantpt(fd); /* change permission of slave */
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#if HAVE_SIGACTION
|
# if HAVE_SIGACTION
|
||||||
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
|
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
|
||||||
Error("GetPseudoTTY(): sigprocmask(SIG_SETMASK): %s",
|
Error("GetPseudoTTY(): sigprocmask(SIG_SETMASK): %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#else
|
# else
|
||||||
SimpleSignal(SIGCHLD, FlagReapVirt);
|
SimpleSignal(SIGCHLD, FlagReapVirt);
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#if HAVE_UNLOCKPT
|
# if HAVE_UNLOCKPT
|
||||||
unlockpt(fd); /* unlock slave */
|
unlockpt(fd); /* unlock slave */
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#if defined(_AIX)
|
# if defined(_AIX)
|
||||||
if ((pcName = ttyname(fd)) == (char *)0) {
|
if ((pcName = ttyname(fd)) == (char *)0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
# else
|
||||||
# if HAVE_PTSNAME
|
# if HAVE_PTSNAME
|
||||||
if ((pcName = ptsname(fd)) == (char *)0) {
|
if ((pcName = ptsname(fd)) == (char *)0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* go ahead and open the slave */
|
/* go ahead and open the slave */
|
||||||
if ((sfd = open(pcName, O_RDWR, 0)) < 0) {
|
if ((sfd = open(pcName, O_RDWR, 0)) < 0) {
|
||||||
@ -166,7 +158,7 @@ GetPseudoTTY(slave, slaveFD)
|
|||||||
|
|
||||||
*slaveFD = sfd;
|
*slaveFD = sfd;
|
||||||
return fd;
|
return fd;
|
||||||
#else
|
# else
|
||||||
/*
|
/*
|
||||||
* Below is the string for finding /dev/ptyXX. For each architecture we
|
* 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
|
* leave some pty's world writable because we don't have source for
|
||||||
@ -234,7 +226,7 @@ GetPseudoTTY(slave, slaveFD)
|
|||||||
|
|
||||||
*slaveFD = sfd;
|
*slaveFD = sfd;
|
||||||
return fd;
|
return fd;
|
||||||
#endif /* (HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT) || defined(_AIX) */
|
# endif/* (HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT) || defined(_AIX) */
|
||||||
#endif /* HAVE_OPENPTY */
|
#endif /* HAVE_OPENPTY */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,13 +234,7 @@ GetPseudoTTY(slave, slaveFD)
|
|||||||
* get a pty using the GetPseudoTTY code above
|
* get a pty using the GetPseudoTTY code above
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
FallBack(char **slave, int *sfd)
|
FallBack(char **slave, int *sfd)
|
||||||
#else
|
|
||||||
FallBack(slave, sfd)
|
|
||||||
char **slave;
|
|
||||||
int *sfd;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
static STRING *pcTSlave = (STRING *)0;
|
static STRING *pcTSlave = (STRING *)0;
|
||||||
|
1040
conserver/group.c
1040
conserver/group.c
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: group.h,v 5.51 2013/09/23 23:17:42 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -64,25 +62,27 @@ typedef struct grpent { /* group info */
|
|||||||
|
|
||||||
extern time_t timers[];
|
extern time_t timers[];
|
||||||
|
|
||||||
extern void Spawn PARAMS((GRPENT *, int));
|
extern void Spawn(GRPENT *, int);
|
||||||
extern int CheckPass PARAMS((char *, char *, FLAG));
|
extern int CheckPass(char *, char *, FLAG);
|
||||||
extern void TagLogfile PARAMS((const CONSENT *, char *, ...));
|
extern void TagLogfile(const CONSENT *, char *, ...);
|
||||||
extern void TagLogfileAct PARAMS((const CONSENT *, char *, ...));
|
extern void TagLogfileAct(const CONSENT *, char *, ...);
|
||||||
extern void DestroyGroup PARAMS((GRPENT *));
|
extern void DestroyGroup(GRPENT *);
|
||||||
extern void DestroyConsent PARAMS((GRPENT *, CONSENT *));
|
extern void DestroyConsent(GRPENT *, CONSENT *);
|
||||||
extern void SendClientsMsg PARAMS((CONSENT *, char *));
|
extern void SendClientsMsg(CONSENT *, char *);
|
||||||
extern void ResetMark PARAMS((void));
|
extern void ResetMark(void);
|
||||||
extern void DestroyConsentUsers PARAMS((CONSENTUSERS **));
|
extern void DestroyConsentUsers(CONSENTUSERS **);
|
||||||
extern CONSENTUSERS *ConsentFindUser PARAMS((CONSENTUSERS *, char *));
|
extern CONSENTUSERS *ConsentFindUser(CONSENTUSERS *, char *);
|
||||||
extern int ConsentUserOk PARAMS((CONSENTUSERS *, char *));
|
extern int ConsentUserOk(CONSENTUSERS *, char *);
|
||||||
extern void DisconnectClient
|
extern void DisconnectClient(GRPENT *, CONSCLIENT *, char *, FLAG);
|
||||||
PARAMS((GRPENT *, CONSCLIENT *, char *, FLAG));
|
extern int ClientAccess(CONSENT *, char *);
|
||||||
extern int ClientAccess PARAMS((CONSENT *, char *));
|
extern void DestroyClient(CONSCLIENT *);
|
||||||
extern void DestroyClient PARAMS((CONSCLIENT *));
|
extern int CheckPasswd(CONSCLIENT *, char *, FLAG);
|
||||||
extern int CheckPasswd PARAMS((CONSCLIENT *, char *, FLAG));
|
extern void DeUtmp(GRPENT *, int);
|
||||||
extern void DeUtmp PARAMS((GRPENT *, int));
|
extern void ClientWantsWrite(CONSCLIENT *);
|
||||||
extern void ClientWantsWrite PARAMS((CONSCLIENT *));
|
extern void SendIWaitClientsMsg(CONSENT *, char *);
|
||||||
extern void SendIWaitClientsMsg PARAMS((CONSENT *, char *));
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
extern int AttemptSSL PARAMS((CONSCLIENT *));
|
extern int AttemptSSL(CONSCLIENT *);
|
||||||
|
#endif
|
||||||
|
#if HAVE_GSSAPI
|
||||||
|
extern int AttemptGSSAPI(CONSCLIENT *);
|
||||||
#endif
|
#endif
|
||||||
|
505
conserver/main.c
505
conserver/main.c
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: main.c,v 5.208 2013/09/25 22:10:29 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -54,9 +52,15 @@ int fAll = 0, fNoinit = 0, fVersion = 0, fStrip = 0, fReopen =
|
|||||||
|
|
||||||
char *pcConfig = CONFIGFILE;
|
char *pcConfig = CONFIGFILE;
|
||||||
int cMaxMemb = MAXMEMB;
|
int cMaxMemb = MAXMEMB;
|
||||||
|
#if USE_IPV6
|
||||||
|
struct addrinfo *bindAddr = (struct addrinfo *)0;
|
||||||
|
struct addrinfo *bindBaseAddr = (struct addrinfo *)0;
|
||||||
|
#else
|
||||||
in_addr_t bindAddr = INADDR_ANY;
|
in_addr_t bindAddr = INADDR_ANY;
|
||||||
unsigned short bindPort;
|
unsigned short bindPort;
|
||||||
unsigned short bindBasePort;
|
unsigned short bindBasePort;
|
||||||
|
struct sockaddr_in in_port;
|
||||||
|
#endif
|
||||||
static STRING *startedMsg = (STRING *)0;
|
static STRING *startedMsg = (STRING *)0;
|
||||||
CONFIG *optConf = (CONFIG *)0;
|
CONFIG *optConf = (CONFIG *)0;
|
||||||
CONFIG *config = (CONFIG *)0;
|
CONFIG *config = (CONFIG *)0;
|
||||||
@ -73,7 +77,6 @@ CONFIG defConfig =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sockaddr_in in_port;
|
|
||||||
CONSFILE *unifiedlog = (CONSFILE *)0;
|
CONSFILE *unifiedlog = (CONSFILE *)0;
|
||||||
|
|
||||||
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
||||||
@ -81,19 +84,80 @@ unsigned long dmallocMarkMain = 0;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
|
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
int
|
||||||
|
DH_set0_pqg(DH *dh, BIGNUM * p, BIGNUM * q, BIGNUM * g)
|
||||||
|
{
|
||||||
|
/* If the fields p and g in d are NULL, the corresponding input
|
||||||
|
* parameters MUST be non-NULL. q may remain NULL.
|
||||||
|
*/
|
||||||
|
if ((dh->p == NULL && p == NULL)
|
||||||
|
|| (dh->g == NULL && g == NULL))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (p != NULL) {
|
||||||
|
BN_free(dh->p);
|
||||||
|
dh->p = p;
|
||||||
|
}
|
||||||
|
if (q != NULL) {
|
||||||
|
BN_free(dh->q);
|
||||||
|
dh->q = q;
|
||||||
|
}
|
||||||
|
if (g != NULL) {
|
||||||
|
BN_free(dh->g);
|
||||||
|
dh->g = g;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (q != NULL) {
|
||||||
|
dh->length = BN_num_bits(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
# endif/* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
||||||
|
|
||||||
SSL_CTX *ctx = (SSL_CTX *)0;
|
SSL_CTX *ctx = (SSL_CTX *)0;
|
||||||
DH *dh512 = (DH *)0;
|
DH *dh512 = (DH *)0;
|
||||||
DH *dh1024 = (DH *)0;
|
DH *dh1024 = (DH *)0;
|
||||||
DH *dh2048 = (DH *)0;
|
DH *dh2048 = (DH *)0;
|
||||||
DH *dh4096 = (DH *)0;
|
DH *dh4096 = (DH *)0;
|
||||||
|
|
||||||
|
DH *
|
||||||
|
DHFromArray(unsigned char *dh_p, size_t dh_p_size, unsigned char *dh_g,
|
||||||
|
size_t dh_g_size)
|
||||||
|
{
|
||||||
|
DH *dh;
|
||||||
|
BIGNUM *p, *g;
|
||||||
|
|
||||||
|
p = BN_bin2bn(dh_p, dh_p_size, NULL);
|
||||||
|
if (p == NULL) {
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
g = BN_bin2bn(dh_g, dh_g_size, NULL);
|
||||||
|
if (g == NULL) {
|
||||||
|
BN_free(g);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dh = DH_new()) == NULL) {
|
||||||
|
BN_free(p);
|
||||||
|
BN_free(g);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!DH_set0_pqg(dh, p, NULL, g)) {
|
||||||
|
BN_free(p);
|
||||||
|
BN_free(g);
|
||||||
|
DH_free(dh);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dh);
|
||||||
|
}
|
||||||
|
|
||||||
DH *
|
DH *
|
||||||
#if PROTOTYPES
|
|
||||||
GetDH512(void)
|
GetDH512(void)
|
||||||
#else
|
|
||||||
GetDH512()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static unsigned char dh512_p[] = {
|
static unsigned char dh512_p[] = {
|
||||||
0xF5, 0x2A, 0xFF, 0x3C, 0xE1, 0xB1, 0x29, 0x40, 0x18, 0x11, 0x8D,
|
0xF5, 0x2A, 0xFF, 0x3C, 0xE1, 0xB1, 0x29, 0x40, 0x18, 0x11, 0x8D,
|
||||||
@ -107,25 +171,12 @@ GetDH512()
|
|||||||
static unsigned char dh512_g[] = {
|
static unsigned char dh512_g[] = {
|
||||||
0x02,
|
0x02,
|
||||||
};
|
};
|
||||||
DH *dh;
|
|
||||||
|
|
||||||
if ((dh = DH_new()) == NULL)
|
return DHFromArray(dh512_p, sizeof(dh512_p), dh512_g, sizeof(dh512_g));
|
||||||
return (NULL);
|
|
||||||
dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
|
|
||||||
dh->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
|
|
||||||
if ((dh->p == NULL) || (dh->g == NULL)) {
|
|
||||||
DH_free(dh);
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
return (dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DH *
|
DH *
|
||||||
#if PROTOTYPES
|
|
||||||
GetDH1024(void)
|
GetDH1024(void)
|
||||||
#else
|
|
||||||
GetDH1024()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static unsigned char dh1024_p[] = {
|
static unsigned char dh1024_p[] = {
|
||||||
0xF4, 0x88, 0xFD, 0x58, 0x4E, 0x49, 0xDB, 0xCD, 0x20, 0xB4, 0x9D,
|
0xF4, 0x88, 0xFD, 0x58, 0x4E, 0x49, 0xDB, 0xCD, 0x20, 0xB4, 0x9D,
|
||||||
@ -145,25 +196,13 @@ GetDH1024()
|
|||||||
static unsigned char dh1024_g[] = {
|
static unsigned char dh1024_g[] = {
|
||||||
0x02,
|
0x02,
|
||||||
};
|
};
|
||||||
DH *dh;
|
|
||||||
|
|
||||||
if ((dh = DH_new()) == NULL)
|
return DHFromArray(dh1024_p, sizeof(dh1024_p), dh1024_g,
|
||||||
return (NULL);
|
sizeof(dh1024_g));
|
||||||
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
|
|
||||||
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
|
|
||||||
if ((dh->p == NULL) || (dh->g == NULL)) {
|
|
||||||
DH_free(dh);
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
return (dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DH *
|
DH *
|
||||||
#if PROTOTYPES
|
|
||||||
GetDH2048(void)
|
GetDH2048(void)
|
||||||
#else
|
|
||||||
GetDH2048()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static unsigned char dh2048_p[] = {
|
static unsigned char dh2048_p[] = {
|
||||||
0xF6, 0x42, 0x57, 0xB7, 0x08, 0x7F, 0x08, 0x17, 0x72, 0xA2, 0xBA,
|
0xF6, 0x42, 0x57, 0xB7, 0x08, 0x7F, 0x08, 0x17, 0x72, 0xA2, 0xBA,
|
||||||
@ -196,25 +235,13 @@ GetDH2048()
|
|||||||
static unsigned char dh2048_g[] = {
|
static unsigned char dh2048_g[] = {
|
||||||
0x02,
|
0x02,
|
||||||
};
|
};
|
||||||
DH *dh;
|
|
||||||
|
|
||||||
if ((dh = DH_new()) == NULL)
|
return DHFromArray(dh2048_p, sizeof(dh2048_p), dh2048_g,
|
||||||
return (NULL);
|
sizeof(dh2048_g));
|
||||||
dh->p = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
|
|
||||||
dh->g = BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
|
|
||||||
if ((dh->p == NULL) || (dh->g == NULL)) {
|
|
||||||
DH_free(dh);
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
return (dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DH *
|
DH *
|
||||||
#if PROTOTYPES
|
|
||||||
GetDH4096(void)
|
GetDH4096(void)
|
||||||
#else
|
|
||||||
GetDH4096()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static unsigned char dh4096_p[] = {
|
static unsigned char dh4096_p[] = {
|
||||||
0xFA, 0x14, 0x72, 0x52, 0xC1, 0x4D, 0xE1, 0x5A, 0x49, 0xD4, 0xEF,
|
0xFA, 0x14, 0x72, 0x52, 0xC1, 0x4D, 0xE1, 0x5A, 0x49, 0xD4, 0xEF,
|
||||||
@ -273,28 +300,13 @@ GetDH4096()
|
|||||||
static unsigned char dh4096_g[] = {
|
static unsigned char dh4096_g[] = {
|
||||||
0x02,
|
0x02,
|
||||||
};
|
};
|
||||||
DH *dh;
|
|
||||||
|
|
||||||
if ((dh = DH_new()) == NULL)
|
return DHFromArray(dh4096_p, sizeof(dh4096_p), dh4096_g,
|
||||||
return (NULL);
|
sizeof(dh4096_g));
|
||||||
dh->p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), NULL);
|
|
||||||
dh->g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), NULL);
|
|
||||||
if ((dh->p == NULL) || (dh->g == NULL)) {
|
|
||||||
DH_free(dh);
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
return (dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DH *
|
DH *
|
||||||
#if PROTOTYPES
|
|
||||||
TmpDHCallback(SSL *ssl, int is_export, int keylength)
|
TmpDHCallback(SSL *ssl, int is_export, int keylength)
|
||||||
#else
|
|
||||||
TmpDHCallback(ssl, is_export, keylength)
|
|
||||||
SSL *ssl;
|
|
||||||
int is_export;
|
|
||||||
int keylength;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TmpDHCallback(): asked for a DH key length %u",
|
CONDDEBUG((1, "TmpDHCallback(): asked for a DH key length %u",
|
||||||
keylength));
|
keylength));
|
||||||
@ -319,21 +331,19 @@ TmpDHCallback(ssl, is_export, keylength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
SetupSSL(void)
|
SetupSSL(void)
|
||||||
#else
|
|
||||||
SetupSSL()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (ctx == (SSL_CTX *)0) {
|
if (ctx == (SSL_CTX *)0) {
|
||||||
char *ciphers;
|
char *ciphers;
|
||||||
int verifymode;
|
int verifymode;
|
||||||
|
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
if (!SSL_library_init()) {
|
if (!SSL_library_init()) {
|
||||||
Error("SetupSSL(): SSL_library_init() failed");
|
Error("SetupSSL(): SSL_library_init() failed");
|
||||||
Bye(EX_SOFTWARE);
|
Bye(EX_SOFTWARE);
|
||||||
}
|
}
|
||||||
if ((ctx = SSL_CTX_new(SSLv23_method())) == (SSL_CTX *)0) {
|
# endif/* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
||||||
|
if ((ctx = SSL_CTX_new(TLS_method())) == (SSL_CTX *)0) {
|
||||||
Error("SetupSSL(): SSL_CTX_new() failed");
|
Error("SetupSSL(): SSL_CTX_new() failed");
|
||||||
Bye(EX_SOFTWARE);
|
Bye(EX_SOFTWARE);
|
||||||
}
|
}
|
||||||
@ -359,7 +369,7 @@ SetupSSL()
|
|||||||
}
|
}
|
||||||
ciphers = "ALL:!LOW:!EXP:!MD5:!aNULL:@STRENGTH";
|
ciphers = "ALL:!LOW:!EXP:!MD5:!aNULL:@STRENGTH";
|
||||||
} else {
|
} else {
|
||||||
ciphers = "ALL:!LOW:!EXP:!MD5:@STRENGTH";
|
ciphers = "ALL:aNULL:!LOW:!EXP:!MD5:@STRENGTH" CIPHER_SEC0;
|
||||||
}
|
}
|
||||||
if (config->sslcacertificatefile != (char *)0) {
|
if (config->sslcacertificatefile != (char *)0) {
|
||||||
STACK_OF(X509_NAME) * cert_names;
|
STACK_OF(X509_NAME) * cert_names;
|
||||||
@ -411,11 +421,7 @@ gss_name_t gss_myname = GSS_C_NO_NAME;
|
|||||||
gss_cred_id_t gss_mycreds = GSS_C_NO_CREDENTIAL;
|
gss_cred_id_t gss_mycreds = GSS_C_NO_CREDENTIAL;
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
SetupGSSAPI(void)
|
SetupGSSAPI(void)
|
||||||
#else
|
|
||||||
SetupGSSAPI()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
OM_uint32 stmaj, stmin;
|
OM_uint32 stmaj, stmin;
|
||||||
char namestr[128];
|
char namestr[128];
|
||||||
@ -443,11 +449,7 @@ SetupGSSAPI()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ReopenLogfile(void)
|
ReopenLogfile(void)
|
||||||
#else
|
|
||||||
ReopenLogfile()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static int tag = 1;
|
static int tag = 1;
|
||||||
/* redirect stdout and stderr to the logfile.
|
/* redirect stdout and stderr to the logfile.
|
||||||
@ -489,11 +491,7 @@ ReopenLogfile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ReopenUnifiedlog(void)
|
ReopenUnifiedlog(void)
|
||||||
#else
|
|
||||||
ReopenUnifiedlog()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/* close any existing */
|
/* close any existing */
|
||||||
if (unifiedlog != (CONSFILE *)0)
|
if (unifiedlog != (CONSFILE *)0)
|
||||||
@ -516,11 +514,7 @@ ReopenUnifiedlog()
|
|||||||
/* become a daemon (ksb)
|
/* become a daemon (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
Daemonize(void)
|
||||||
Daemonize()
|
|
||||||
#else
|
|
||||||
Daemonize()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
#if !HAVE_SETSID
|
#if !HAVE_SETSID
|
||||||
@ -581,12 +575,7 @@ Daemonize()
|
|||||||
/* output a long message to the user (ksb)
|
/* output a long message to the user (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
Usage(int wantfull)
|
Usage(int wantfull)
|
||||||
#else
|
|
||||||
Usage(wantfull)
|
|
||||||
int wantfull;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static char u_terse[] =
|
static char u_terse[] =
|
||||||
"[-7dDEFhinoRSuvV] [-a type] [-m max] [-M master] [-p port] [-b port] [-c cred] [-C config] [-P passwd] [-L logfile] [-O min] [-U logfile]";
|
"[-7dDEFhinoRSuvV] [-a type] [-m max] [-M master] [-p port] [-b port] [-c cred] [-C config] [-P passwd] [-L logfile] [-O min] [-U logfile]";
|
||||||
@ -645,11 +634,7 @@ Usage(wantfull)
|
|||||||
/* show the user our version info (ksb)
|
/* show the user our version info (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
Version(void)
|
||||||
Version()
|
|
||||||
#else
|
|
||||||
Version()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static STRING *acA1 = (STRING *)0;
|
static STRING *acA1 = (STRING *)0;
|
||||||
static STRING *acA2 = (STRING *)0;
|
static STRING *acA2 = (STRING *)0;
|
||||||
@ -658,6 +643,9 @@ Version()
|
|||||||
#if HAVE_DMALLOC
|
#if HAVE_DMALLOC
|
||||||
"dmalloc",
|
"dmalloc",
|
||||||
#endif
|
#endif
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
"freeipmi",
|
||||||
|
#endif
|
||||||
#if USE_LIBWRAP
|
#if USE_LIBWRAP
|
||||||
"libwrap",
|
"libwrap",
|
||||||
#endif
|
#endif
|
||||||
@ -720,14 +708,23 @@ Version()
|
|||||||
BuildStringChar('0' + DMALLOC_VERSION_MINOR, acA1);
|
BuildStringChar('0' + DMALLOC_VERSION_MINOR, acA1);
|
||||||
BuildStringChar('.', acA1);
|
BuildStringChar('.', acA1);
|
||||||
BuildStringChar('0' + DMALLOC_VERSION_PATCH, acA1);
|
BuildStringChar('0' + DMALLOC_VERSION_PATCH, acA1);
|
||||||
#if defined(DMALLOC_VERSION_BETA)
|
# if defined(DMALLOC_VERSION_BETA)
|
||||||
if (DMALLOC_VERSION_BETA != 0) {
|
if (DMALLOC_VERSION_BETA != 0) {
|
||||||
BuildString("-b", acA1);
|
BuildString("-b", acA1);
|
||||||
BuildStringChar('0' + DMALLOC_VERSION_BETA, acA1);
|
BuildStringChar('0' + DMALLOC_VERSION_BETA, acA1);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
Msg("dmalloc version: %s", acA1->string);
|
Msg("dmalloc version: %s", acA1->string);
|
||||||
#endif
|
#endif
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
BuildString((char *)0, acA1);
|
||||||
|
BuildStringChar('0' + LIBIPMICONSOLE_VERSION_MAJOR, acA1);
|
||||||
|
BuildStringChar('.', acA1);
|
||||||
|
BuildStringChar('0' + LIBIPMICONSOLE_VERSION_MINOR, acA1);
|
||||||
|
BuildStringChar('.', acA1);
|
||||||
|
BuildStringChar('0' + LIBIPMICONSOLE_VERSION_PATCH, acA1);
|
||||||
|
Msg("freeipmi version: %s", acA1->string);
|
||||||
|
#endif
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
Msg("openssl version: %s", OPENSSL_VERSION_TEXT);
|
Msg("openssl version: %s", OPENSSL_VERSION_TEXT);
|
||||||
#endif
|
#endif
|
||||||
@ -739,11 +736,7 @@ Version()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DestroyDataStructures(void)
|
DestroyDataStructures(void)
|
||||||
#else
|
|
||||||
DestroyDataStructures()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
GRPENT *pGE;
|
GRPENT *pGE;
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
@ -786,8 +779,16 @@ DestroyDataStructures()
|
|||||||
DH_free(dh4096);
|
DH_free(dh4096);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if USE_IPV6
|
||||||
|
/* clean up addrinfo stucts */
|
||||||
|
if ((struct addrinfo *)0 != bindAddr)
|
||||||
|
freeaddrinfo(bindAddr);
|
||||||
|
if ((struct addrinfo *)0 != bindBaseAddr)
|
||||||
|
freeaddrinfo(bindBaseAddr);
|
||||||
|
#else
|
||||||
if (myAddrs != (struct in_addr *)0)
|
if (myAddrs != (struct in_addr *)0)
|
||||||
free(myAddrs);
|
free(myAddrs);
|
||||||
|
#endif
|
||||||
|
|
||||||
DestroyBreakList();
|
DestroyBreakList();
|
||||||
DestroyTaskList();
|
DestroyTaskList();
|
||||||
@ -798,11 +799,7 @@ DestroyDataStructures()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
SummarizeDataStructures(void)
|
SummarizeDataStructures(void)
|
||||||
#else
|
|
||||||
SummarizeDataStructures()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
GRPENT *pGE;
|
GRPENT *pGE;
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
@ -854,6 +851,12 @@ SummarizeDataStructures()
|
|||||||
size += strlen(pCE->tasklist);
|
size += strlen(pCE->tasklist);
|
||||||
if (pCE->breaklist != (char *)0)
|
if (pCE->breaklist != (char *)0)
|
||||||
size += strlen(pCE->breaklist);
|
size += strlen(pCE->breaklist);
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
if (pCE->username != (char *)0)
|
||||||
|
size += strlen(pCE->username);
|
||||||
|
if (pCE->password != (char *)0)
|
||||||
|
size += strlen(pCE->password);
|
||||||
|
#endif
|
||||||
if (pCE->fdlog != (CONSFILE *)0)
|
if (pCE->fdlog != (CONSFILE *)0)
|
||||||
size += sizeof(CONSFILE);
|
size += sizeof(CONSFILE);
|
||||||
if (pCE->cofile != (CONSFILE *)0)
|
if (pCE->cofile != (CONSFILE *)0)
|
||||||
@ -925,17 +928,18 @@ SummarizeDataStructures()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DumpDataStructures(void)
|
DumpDataStructures(void)
|
||||||
#else
|
|
||||||
DumpDataStructures()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
GRPENT *pGE;
|
GRPENT *pGE;
|
||||||
CONSENT *pCE;
|
CONSENT *pCE;
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
int i;
|
int i;
|
||||||
TASKS *t;
|
TASKS *t;
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
static STRING *tmpString = (STRING *)0;
|
||||||
|
if (tmpString == (STRING *)0)
|
||||||
|
tmpString = AllocString();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
#if HAVE_DMALLOC && DMALLOC_MARK_MAIN
|
||||||
CONDDEBUG((1, "DumpDataStructures(): dmalloc / MarkMain"));
|
CONDDEBUG((1, "DumpDataStructures(): dmalloc / MarkMain"));
|
||||||
@ -979,6 +983,27 @@ DumpDataStructures()
|
|||||||
pCE->execuid, pCE->execgid));
|
pCE->execuid, pCE->execgid));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
#if HAVE_FREEIPMI
|
||||||
|
case IPMI:
|
||||||
|
CONDDEBUG((1,
|
||||||
|
"DumpDataStructures(): server=%s, type=IPMI",
|
||||||
|
EMPTYSTR(pCE->server)));
|
||||||
|
CONDDEBUG((1,
|
||||||
|
"DumpDataStructures(): host=%s, username=%s, password=%s, ipmiprivlevel=%d",
|
||||||
|
EMPTYSTR(pCE->host),
|
||||||
|
EMPTYSTR(pCE->username),
|
||||||
|
EMPTYSTR(pCE->password),
|
||||||
|
pCE->ipmiprivlevel));
|
||||||
|
CONDDEBUG((1,
|
||||||
|
"DumpDataStructures(): ipmiwrkset=%d, ipmiworkaround=%u, ipmiciphersuite=%d",
|
||||||
|
pCE->ipmiwrkset, pCE->ipmiworkaround,
|
||||||
|
pCE->ipmiciphersuite));
|
||||||
|
FmtCtlStr(pCE->ipmikg->string, pCE->ipmikg->used - 1,
|
||||||
|
tmpString);
|
||||||
|
CONDDEBUG((1, "DumpDataStructures(): ipmikg=%s",
|
||||||
|
EMPTYSTR(tmpString->string)));
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case HOST:
|
case HOST:
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
"DumpDataStructures(): server=%s, type=HOST",
|
"DumpDataStructures(): server=%s, type=HOST",
|
||||||
@ -1085,9 +1110,10 @@ DumpDataStructures()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < 9; i++) {
|
for (i = 0; i < BREAKLISTSIZE; i++) {
|
||||||
CONDDEBUG((1,
|
CONDDEBUG((1,
|
||||||
"DumpDataStructures(): break: string=%s, delay=%d, confirm=%s",
|
"DumpDataStructures(): break: #%c, string=%s, delay=%d, confirm=%s",
|
||||||
|
'1' + i + (i > 8 ? BREAKALPHAOFFSET : 0),
|
||||||
EMPTYSTR(breakList[i].seq->string), breakList[i].delay,
|
EMPTYSTR(breakList[i].seq->string), breakList[i].delay,
|
||||||
FLAGSTR(breakList[i].confirm)));
|
FLAGSTR(breakList[i].confirm)));
|
||||||
}
|
}
|
||||||
@ -1105,17 +1131,14 @@ DumpDataStructures()
|
|||||||
*/
|
*/
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_UNIX_DOMAIN_SOCKETS
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
VerifyEmptyDirectory(char *d)
|
VerifyEmptyDirectory(char *d)
|
||||||
#else
|
|
||||||
VerifyEmptyDirectory(d)
|
|
||||||
char *d;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
struct stat dstat;
|
struct stat dstat;
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
|
# if 0 /* See below */
|
||||||
STRING *path = (STRING *)0;
|
STRING *path = (STRING *)0;
|
||||||
|
# endif
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -1156,7 +1179,7 @@ VerifyEmptyDirectory(d)
|
|||||||
* database, config files, etc. too many important files could be
|
* database, config files, etc. too many important files could be
|
||||||
* shredded with a small typo.
|
* shredded with a small typo.
|
||||||
*/
|
*/
|
||||||
#if 0
|
# if 0
|
||||||
if (path == (STRING *)0)
|
if (path == (STRING *)0)
|
||||||
path = AllocString();
|
path = AllocString();
|
||||||
BuildStringPrint(path, "%s/%s", d, de->d_name);
|
BuildStringPrint(path, "%s/%s", d, de->d_name);
|
||||||
@ -1178,11 +1201,16 @@ VerifyEmptyDirectory(d)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if 0 /* See above */
|
||||||
if (path != (STRING *)0)
|
if (path != (STRING *)0)
|
||||||
DestroyString(path);
|
DestroyString(path);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* free dir data structure */
|
||||||
|
closedir(dir);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -1197,13 +1225,7 @@ VerifyEmptyDirectory(d)
|
|||||||
* exit happy
|
* exit happy
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
#else
|
|
||||||
main(argc, argv)
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
FILE *fpConfig = (FILE *)0;
|
FILE *fpConfig = (FILE *)0;
|
||||||
@ -1216,9 +1238,14 @@ main(argc, argv)
|
|||||||
int curuid = 0;
|
int curuid = 0;
|
||||||
GRPENT *pGE = (GRPENT *)0;
|
GRPENT *pGE = (GRPENT *)0;
|
||||||
#if !USE_UNIX_DOMAIN_SOCKETS
|
#if !USE_UNIX_DOMAIN_SOCKETS
|
||||||
#if HAVE_INET_ATON
|
# if USE_IPV6
|
||||||
|
int s;
|
||||||
|
struct addrinfo hints;
|
||||||
|
# else
|
||||||
|
# if HAVE_INET_ATON
|
||||||
struct in_addr inetaddr;
|
struct in_addr inetaddr;
|
||||||
#endif
|
# endif
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
isMultiProc = 1; /* make sure stuff has the pid */
|
isMultiProc = 1; /* make sure stuff has the pid */
|
||||||
@ -1249,6 +1276,9 @@ main(argc, argv)
|
|||||||
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
|
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Initialize the break list */
|
||||||
|
InitBreakList();
|
||||||
|
|
||||||
/* prep the config options */
|
/* prep the config options */
|
||||||
if ((optConf = (CONFIG *)calloc(1, sizeof(CONFIG)))
|
if ((optConf = (CONFIG *)calloc(1, sizeof(CONFIG)))
|
||||||
== (CONFIG *)0)
|
== (CONFIG *)0)
|
||||||
@ -1335,7 +1365,7 @@ main(argc, argv)
|
|||||||
break;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
/* How often to try opening all down consoles, in minutes */
|
/* How often to try opening all down consoles, in minutes */
|
||||||
optConf->reinitcheck = atoi(optarg);
|
optConf->reinitcheck = atoi(optarg) * 60;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if ((optConf->primaryport = StrDup(optarg)) == (char *)0)
|
if ((optConf->primaryport = StrDup(optarg)) == (char *)0)
|
||||||
@ -1416,7 +1446,119 @@ main(argc, argv)
|
|||||||
if (fSyntaxOnly)
|
if (fSyntaxOnly)
|
||||||
Msg("performing configuration file syntax check");
|
Msg("performing configuration file syntax check");
|
||||||
|
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
/* must do all this so IsMe() works right */
|
||||||
|
if (gethostname(myHostname, MAXHOSTNAME) != 0) {
|
||||||
|
Error("gethostname(): %s", strerror(errno));
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
}
|
||||||
|
#if !USE_IPV6
|
||||||
|
ProbeInterfaces(bindAddr);
|
||||||
|
#endif
|
||||||
|
#if !HAVE_CLOSEFROM
|
||||||
|
i = GetMaxFiles();
|
||||||
|
CONDDEBUG((1, "main(): GetMaxFiles=%d", i));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* initialize the timers */
|
||||||
|
for (i = 0; i < T_MAX; i++)
|
||||||
|
timers[i] = (time_t)0;
|
||||||
|
|
||||||
|
/* read the config file */
|
||||||
|
if ((FILE *)0 == (fpConfig = fopen(pcConfig, "r"))) {
|
||||||
|
Error("fopen(%s): %s", pcConfig, strerror(errno));
|
||||||
|
Bye(EX_NOINPUT);
|
||||||
|
}
|
||||||
|
ReadCfg(pcConfig, fpConfig);
|
||||||
|
fclose(fpConfig);
|
||||||
|
|
||||||
|
#if !USE_UNIX_DOMAIN_SOCKETS
|
||||||
|
/* set up the port to bind to */
|
||||||
|
if (optConf->primaryport != (char *)0)
|
||||||
|
config->primaryport = StrDup(optConf->primaryport);
|
||||||
|
else if (pConfig->primaryport != (char *)0)
|
||||||
|
config->primaryport = StrDup(pConfig->primaryport);
|
||||||
|
else
|
||||||
|
config->primaryport = StrDup(defConfig.primaryport);
|
||||||
|
if (config->primaryport == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
|
||||||
|
# if !USE_IPV6
|
||||||
|
/* Look for non-numeric characters */
|
||||||
|
for (i = 0; config->primaryport[i] != '\000'; i++)
|
||||||
|
if (!isdigit((int)config->primaryport[i]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (config->primaryport[i] == '\000') {
|
||||||
|
/* numeric only */
|
||||||
|
bindPort = atoi(config->primaryport);
|
||||||
|
} else {
|
||||||
|
/* non-numeric only */
|
||||||
|
struct servent *pSE;
|
||||||
|
if ((struct servent *)0 ==
|
||||||
|
(pSE = getservbyname(config->primaryport, "tcp"))) {
|
||||||
|
Error("getservbyname(%s) failed", config->primaryport);
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
} else {
|
||||||
|
bindPort = ntohs((unsigned short)pSE->s_port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* set up the secondary port to bind to */
|
||||||
|
if (optConf->secondaryport != (char *)0)
|
||||||
|
config->secondaryport = StrDup(optConf->secondaryport);
|
||||||
|
else if (pConfig->secondaryport != (char *)0)
|
||||||
|
config->secondaryport = StrDup(pConfig->secondaryport);
|
||||||
|
else
|
||||||
|
config->secondaryport = StrDup(defConfig.secondaryport);
|
||||||
|
if (config->secondaryport == (char *)0)
|
||||||
|
OutOfMem();
|
||||||
|
|
||||||
|
# if !USE_IPV6
|
||||||
|
/* Look for non-numeric characters */
|
||||||
|
for (i = 0; config->secondaryport[i] != '\000'; i++)
|
||||||
|
if (!isdigit((int)config->secondaryport[i]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (config->secondaryport[i] == '\000') {
|
||||||
|
/* numeric only */
|
||||||
|
bindBasePort = atoi(config->secondaryport);
|
||||||
|
} else {
|
||||||
|
/* non-numeric only */
|
||||||
|
struct servent *pSE;
|
||||||
|
if ((struct servent *)0 ==
|
||||||
|
(pSE = getservbyname(config->secondaryport, "tcp"))) {
|
||||||
|
Error("getservbyname(%s) failed", config->secondaryport);
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
} else {
|
||||||
|
bindBasePort = ntohs((unsigned short)pSE->s_port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_IPV6
|
||||||
|
/* set up the address to bind to */
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
hints.ai_family = AF_UNSPEC;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
hints.ai_flags |= AI_PASSIVE;
|
||||||
|
|
||||||
|
/* create list or IPs suitable for primaryport */
|
||||||
|
s = getaddrinfo(interface, config->primaryport, &hints, &bindAddr);
|
||||||
|
if (s) {
|
||||||
|
Error("getaddrinfo(%s): %s", interface, gai_strerror(s));
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create list or IPs suitable for secondaryport */
|
||||||
|
s = getaddrinfo(interface, config->secondaryport, &hints,
|
||||||
|
&bindBaseAddr);
|
||||||
|
if (s) {
|
||||||
|
Error("getaddrinfo(%s): %s", interface, gai_strerror(s));
|
||||||
|
Bye(EX_OSERR);
|
||||||
|
}
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
/* Don't do any redirects if we're purely local
|
/* Don't do any redirects if we're purely local
|
||||||
* (but it allows them to see where remote consoles are)
|
* (but it allows them to see where remote consoles are)
|
||||||
*/
|
*/
|
||||||
@ -1450,87 +1592,6 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* must do all this so IsMe() works right */
|
|
||||||
if (gethostname(myHostname, MAXHOSTNAME) != 0) {
|
|
||||||
Error("gethostname(): %s", strerror(errno));
|
|
||||||
Bye(EX_OSERR);
|
|
||||||
}
|
|
||||||
ProbeInterfaces(bindAddr);
|
|
||||||
|
|
||||||
/* initialize the timers */
|
|
||||||
for (i = 0; i < T_MAX; i++)
|
|
||||||
timers[i] = (time_t)0;
|
|
||||||
|
|
||||||
/* read the config file */
|
|
||||||
if ((FILE *)0 == (fpConfig = fopen(pcConfig, "r"))) {
|
|
||||||
Error("fopen(%s): %s", pcConfig, strerror(errno));
|
|
||||||
Bye(EX_NOINPUT);
|
|
||||||
}
|
|
||||||
ReadCfg(pcConfig, fpConfig);
|
|
||||||
fclose(fpConfig);
|
|
||||||
|
|
||||||
#if !USE_UNIX_DOMAIN_SOCKETS
|
|
||||||
/* set up the port to bind to */
|
|
||||||
if (optConf->primaryport != (char *)0)
|
|
||||||
config->primaryport = StrDup(optConf->primaryport);
|
|
||||||
else if (pConfig->primaryport != (char *)0)
|
|
||||||
config->primaryport = StrDup(pConfig->primaryport);
|
|
||||||
else
|
|
||||||
config->primaryport = StrDup(defConfig.primaryport);
|
|
||||||
if (config->primaryport == (char *)0)
|
|
||||||
OutOfMem();
|
|
||||||
|
|
||||||
/* Look for non-numeric characters */
|
|
||||||
for (i = 0; config->primaryport[i] != '\000'; i++)
|
|
||||||
if (!isdigit((int)config->primaryport[i]))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (config->primaryport[i] == '\000') {
|
|
||||||
/* numeric only */
|
|
||||||
bindPort = atoi(config->primaryport);
|
|
||||||
} else {
|
|
||||||
/* non-numeric only */
|
|
||||||
struct servent *pSE;
|
|
||||||
if ((struct servent *)0 ==
|
|
||||||
(pSE = getservbyname(config->primaryport, "tcp"))) {
|
|
||||||
Error("getservbyname(%s) failed", config->primaryport);
|
|
||||||
Bye(EX_OSERR);
|
|
||||||
} else {
|
|
||||||
bindPort = ntohs((unsigned short)pSE->s_port);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* set up the secondary port to bind to */
|
|
||||||
if (optConf->secondaryport != (char *)0)
|
|
||||||
config->secondaryport = StrDup(optConf->secondaryport);
|
|
||||||
else if (pConfig->secondaryport != (char *)0)
|
|
||||||
config->secondaryport = StrDup(pConfig->secondaryport);
|
|
||||||
else
|
|
||||||
config->secondaryport = StrDup(defConfig.secondaryport);
|
|
||||||
if (config->secondaryport == (char *)0)
|
|
||||||
OutOfMem();
|
|
||||||
|
|
||||||
/* Look for non-numeric characters */
|
|
||||||
for (i = 0; config->secondaryport[i] != '\000'; i++)
|
|
||||||
if (!isdigit((int)config->secondaryport[i]))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (config->secondaryport[i] == '\000') {
|
|
||||||
/* numeric only */
|
|
||||||
bindBasePort = atoi(config->secondaryport);
|
|
||||||
} else {
|
|
||||||
/* non-numeric only */
|
|
||||||
struct servent *pSE;
|
|
||||||
if ((struct servent *)0 ==
|
|
||||||
(pSE = getservbyname(config->secondaryport, "tcp"))) {
|
|
||||||
Error("getservbyname(%s) failed", config->secondaryport);
|
|
||||||
Bye(EX_OSERR);
|
|
||||||
} else {
|
|
||||||
bindBasePort = ntohs((unsigned short)pSE->s_port);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (optConf->passwdfile != (char *)0)
|
if (optConf->passwdfile != (char *)0)
|
||||||
config->passwdfile = StrDup(optConf->passwdfile);
|
config->passwdfile = StrDup(optConf->passwdfile);
|
||||||
else if (pConfig->passwdfile != (char *)0)
|
else if (pConfig->passwdfile != (char *)0)
|
||||||
@ -1683,7 +1744,11 @@ main(argc, argv)
|
|||||||
/* if no one can use us we need to come up with a default
|
/* if no one can use us we need to come up with a default
|
||||||
*/
|
*/
|
||||||
if (pACList == (ACCESS *)0)
|
if (pACList == (ACCESS *)0)
|
||||||
|
#if USE_IPV6
|
||||||
|
SetDefAccess();
|
||||||
|
#else
|
||||||
SetDefAccess(myAddrs, myHostname);
|
SetDefAccess(myAddrs, myHostname);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* spawn all the children, so fix kids has an initial pid
|
/* spawn all the children, so fix kids has an initial pid
|
||||||
*/
|
*/
|
||||||
@ -1705,13 +1770,15 @@ main(argc, argv)
|
|||||||
local += pGE->imembers;
|
local += pGE->imembers;
|
||||||
for (pRC = pRCList; (REMOTE *)0 != pRC; pRC = pRC->pRCnext)
|
for (pRC = pRCList; (REMOTE *)0 != pRC; pRC = pRC->pRCnext)
|
||||||
remote++;
|
remote++;
|
||||||
# if USE_UNIX_DOMAIN_SOCKETS
|
setproctitle("master: port %hu, %d local, %d remote",
|
||||||
setproctitle("master: port 0, %d local, %d remote", local,
|
# if USE_IPV6
|
||||||
remote);
|
(unsigned short)strtol(config->primaryport, NULL, 10),
|
||||||
#else
|
# elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
setproctitle("master: port %hu, %d local, %d remote", bindPort,
|
(unsigned short)0,
|
||||||
|
# else
|
||||||
|
bindPort,
|
||||||
|
# endif
|
||||||
local, remote);
|
local, remote);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: main.h,v 5.54 2009/09/26 09:23:04 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -36,14 +34,18 @@
|
|||||||
|
|
||||||
/* program options and stuff
|
/* program options and stuff
|
||||||
*/
|
*/
|
||||||
extern char rcsid[];
|
|
||||||
extern int fAll, fNoinit, fInteractive, fStrip, fDaemon, fReopen,
|
extern int fAll, fNoinit, fInteractive, fStrip, fDaemon, fReopen,
|
||||||
fNoautoreup, fSyntaxOnly;
|
fNoautoreup, fSyntaxOnly;
|
||||||
|
#if USE_IPV6
|
||||||
|
extern struct addrinfo *bindAddr;
|
||||||
|
extern struct addrinfo *bindBaseAddr;
|
||||||
|
#else
|
||||||
extern in_addr_t bindAddr;
|
extern in_addr_t bindAddr;
|
||||||
|
extern struct sockaddr_in in_port;
|
||||||
|
#endif
|
||||||
extern unsigned short bindPort, bindBasePort;
|
extern unsigned short bindPort, bindBasePort;
|
||||||
extern char *pcConfig;
|
extern char *pcConfig;
|
||||||
extern int cMaxMemb;
|
extern int cMaxMemb;
|
||||||
extern struct sockaddr_in in_port;
|
|
||||||
extern CONFIG *optConf;
|
extern CONFIG *optConf;
|
||||||
extern CONFIG *config;
|
extern CONFIG *config;
|
||||||
extern CONFIG defConfig;
|
extern CONFIG defConfig;
|
||||||
@ -58,6 +60,6 @@ extern SSL_CTX *ctx;
|
|||||||
extern gss_name_t gss_myname;
|
extern gss_name_t gss_myname;
|
||||||
extern gss_cred_id_t gss_mycreds;
|
extern gss_cred_id_t gss_mycreds;
|
||||||
#endif
|
#endif
|
||||||
extern void ReopenLogfile PARAMS((void));
|
extern void ReopenLogfile(void);
|
||||||
extern void ReopenUnifiedlog PARAMS((void));
|
extern void ReopenUnifiedlog(void);
|
||||||
extern void DumpDataStructures PARAMS((void));
|
extern void DumpDataStructures(void);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: master.c,v 5.139 2013/09/23 23:17:42 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -49,12 +47,7 @@ static unsigned long dmallocMarkClientConnection = 0;
|
|||||||
|
|
||||||
|
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagSawCHLD(int sig)
|
FlagSawCHLD(int sig)
|
||||||
#else
|
|
||||||
FlagSawCHLD(sig)
|
|
||||||
int sig;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawCHLD = 1;
|
fSawCHLD = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -66,12 +59,7 @@ FlagSawCHLD(sig)
|
|||||||
* Called when master process receives SIGCHLD
|
* Called when master process receives SIGCHLD
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
FixKids(int msfd)
|
FixKids(int msfd)
|
||||||
#else
|
|
||||||
FixKids(msfd)
|
|
||||||
int msfd;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int UWbuf;
|
int UWbuf;
|
||||||
@ -135,12 +123,7 @@ FixKids(msfd)
|
|||||||
* Called when master process receives SIGTERM
|
* Called when master process receives SIGTERM
|
||||||
*/
|
*/
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagQuitIt(int arg)
|
FlagQuitIt(int arg)
|
||||||
#else
|
|
||||||
FlagQuitIt(arg)
|
|
||||||
int arg;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawQuit = 1;
|
fSawQuit = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -152,12 +135,7 @@ FlagQuitIt(arg)
|
|||||||
* want to do something special on SIGINT at some point.
|
* want to do something special on SIGINT at some point.
|
||||||
*/
|
*/
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagSawINT(int arg)
|
FlagSawINT(int arg)
|
||||||
#else
|
|
||||||
FlagSawINT(arg)
|
|
||||||
int arg;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawQuit = 1;
|
fSawQuit = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -166,12 +144,7 @@ FlagSawINT(arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagSawHUP(int arg)
|
FlagSawHUP(int arg)
|
||||||
#else
|
|
||||||
FlagSawHUP(arg)
|
|
||||||
int arg;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawHUP = 1;
|
fSawHUP = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -180,12 +153,7 @@ FlagSawHUP(arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagSawUSR2(int arg)
|
FlagSawUSR2(int arg)
|
||||||
#else
|
|
||||||
FlagSawUSR2(arg)
|
|
||||||
int arg;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawUSR2 = 1;
|
fSawUSR2 = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -194,12 +162,7 @@ FlagSawUSR2(arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagSawUSR1(int arg)
|
FlagSawUSR1(int arg)
|
||||||
#else
|
|
||||||
FlagSawUSR1(arg)
|
|
||||||
int arg;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawUSR1 = 1;
|
fSawUSR1 = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -210,12 +173,7 @@ FlagSawUSR1(arg)
|
|||||||
/* Signal all the kids...
|
/* Signal all the kids...
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
SignalKids(int arg)
|
SignalKids(int arg)
|
||||||
#else
|
|
||||||
SignalKids(arg)
|
|
||||||
int arg;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
GRPENT *pGE;
|
GRPENT *pGE;
|
||||||
|
|
||||||
@ -232,12 +190,7 @@ SignalKids(arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
REMOTE *
|
REMOTE *
|
||||||
#if PROTOTYPES
|
|
||||||
FindRemoteConsole(char *args)
|
FindRemoteConsole(char *args)
|
||||||
#else
|
|
||||||
FindRemoteConsole(args)
|
|
||||||
char *args;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
NAMES *name;
|
NAMES *name;
|
||||||
@ -254,13 +207,7 @@ FindRemoteConsole(args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
CommandCall(CONSCLIENT *pCL, char *args)
|
CommandCall(CONSCLIENT *pCL, char *args)
|
||||||
#else
|
|
||||||
CommandCall(pCL, args)
|
|
||||||
CONSCLIENT *pCL;
|
|
||||||
char *args;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int found;
|
int found;
|
||||||
REMOTE *pRC, *pRCFound;
|
REMOTE *pRC, *pRCFound;
|
||||||
@ -383,13 +330,7 @@ CommandCall(pCL, args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DropMasterClient(CONSCLIENT *pCLServing, FLAG force)
|
DropMasterClient(CONSCLIENT *pCLServing, FLAG force)
|
||||||
#else
|
|
||||||
DropMasterClient(pCLServing, force)
|
|
||||||
CONSCLIENT *pCLServing;
|
|
||||||
FLAG force;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/* if we have data buffered and aren't forced to close,
|
/* if we have data buffered and aren't forced to close,
|
||||||
* we can't close quite yet
|
* we can't close quite yet
|
||||||
@ -425,12 +366,7 @@ DropMasterClient(pCLServing, force)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DoNormalRead(CONSCLIENT *pCLServing)
|
DoNormalRead(CONSCLIENT *pCLServing)
|
||||||
#else
|
|
||||||
DoNormalRead(pCLServing)
|
|
||||||
CONSCLIENT *pCLServing;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char *pcCmd;
|
char *pcCmd;
|
||||||
char *pcArgs;
|
char *pcArgs;
|
||||||
@ -586,11 +522,9 @@ DoNormalRead(pCLServing)
|
|||||||
int iSep = 1;
|
int iSep = 1;
|
||||||
|
|
||||||
if ((GRPENT *)0 != pGroups) {
|
if ((GRPENT *)0 != pGroups) {
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6 || !USE_UNIX_DOMAIN_SOCKETS
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, "@0");
|
SOCKADDR_STYPE lcl;
|
||||||
iSep = 0;
|
|
||||||
#else
|
|
||||||
struct sockaddr_in lcl;
|
|
||||||
socklen_t so = sizeof(lcl);
|
socklen_t so = sizeof(lcl);
|
||||||
if (-1 ==
|
if (-1 ==
|
||||||
getsockname(FileFDNum(pCLServing->fd),
|
getsockname(FileFDNum(pCLServing->fd),
|
||||||
@ -602,19 +536,37 @@ DoNormalRead(pCLServing)
|
|||||||
FileFDNum(pCLServing->fd), strerror(errno));
|
FileFDNum(pCLServing->fd), strerror(errno));
|
||||||
iSep = -1;
|
iSep = -1;
|
||||||
} else {
|
} else {
|
||||||
|
# if USE_IPV6
|
||||||
|
int error;
|
||||||
|
char addr[NI_MAXHOST];
|
||||||
|
error =
|
||||||
|
getnameinfo((struct sockaddr *)&lcl, so, addr,
|
||||||
|
sizeof(addr), NULL, 0,
|
||||||
|
NI_NUMERICHOST);
|
||||||
|
if (!error)
|
||||||
|
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
||||||
|
addr);
|
||||||
|
# else
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
FilePrint(pCLServing->fd, FLAGTRUE, "@%s",
|
||||||
inet_ntoa(lcl.sin_addr));
|
inet_ntoa(lcl.sin_addr));
|
||||||
|
# endif
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
FilePrint(pCLServing->fd, FLAGTRUE, "@0");
|
||||||
|
iSep = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (iSep >= 0) {
|
if (iSep >= 0) {
|
||||||
if (config->redirect == FLAGTRUE) {
|
if (config->redirect == FLAGTRUE) {
|
||||||
REMOTE *pRC;
|
REMOTE *pRC;
|
||||||
|
char *s;
|
||||||
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
|
for (pRC = pRCUniq; (REMOTE *)0 != pRC;
|
||||||
pRC = pRC->pRCuniq) {
|
pRC = pRC->pRCuniq) {
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE,
|
s = ":@%s";
|
||||||
":@%s" + iSep, pRC->rhost);
|
s += iSep;
|
||||||
|
FilePrint(pCLServing->fd, FLAGTRUE, s,
|
||||||
|
pRC->rhost);
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -693,12 +645,14 @@ DoNormalRead(pCLServing)
|
|||||||
strcmp(pcCmd, "groups") == 0) {
|
strcmp(pcCmd, "groups") == 0) {
|
||||||
int iSep = 1;
|
int iSep = 1;
|
||||||
GRPENT *pGE;
|
GRPENT *pGE;
|
||||||
|
char *s;
|
||||||
|
|
||||||
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
|
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
|
||||||
if (0 == pGE->imembers)
|
if (0 == pGE->imembers)
|
||||||
continue;
|
continue;
|
||||||
FilePrint(pCLServing->fd, FLAGTRUE, ":%hu" + iSep,
|
s = ":%hu";
|
||||||
pGE->port);
|
s += iSep;
|
||||||
|
FilePrint(pCLServing->fd, FLAGTRUE, s, pGE->port);
|
||||||
iSep = 0;
|
iSep = 0;
|
||||||
}
|
}
|
||||||
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", 2);
|
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", 2);
|
||||||
@ -723,24 +677,24 @@ DoNormalRead(pCLServing)
|
|||||||
/* this routine is used by the master console server process (ksb)
|
/* this routine is used by the master console server process (ksb)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
Master(void)
|
Master(void)
|
||||||
#else
|
|
||||||
Master()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int cfd;
|
int cfd;
|
||||||
int msfd;
|
int msfd;
|
||||||
socklen_t so;
|
socklen_t so;
|
||||||
fd_set rmask, wmask;
|
fd_set rmask, wmask;
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6 || !USE_UNIX_DOMAIN_SOCKETS
|
||||||
|
# if USE_IPV6
|
||||||
|
struct addrinfo *rp;
|
||||||
|
# else
|
||||||
|
struct sockaddr_in master_port;
|
||||||
|
# endif
|
||||||
|
# if HAVE_SETSOCKOPT
|
||||||
|
int sock_opt_true = 1;
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
struct sockaddr_un master_port;
|
struct sockaddr_un master_port;
|
||||||
static STRING *portPath = (STRING *)0;
|
static STRING *portPath = (STRING *)0;
|
||||||
#else
|
|
||||||
struct sockaddr_in master_port;
|
|
||||||
# if HAVE_SETSOCKOPT
|
|
||||||
int true = 1;
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
CONSCLIENT *pCLServing = (CONSCLIENT *)0;
|
CONSCLIENT *pCLServing = (CONSCLIENT *)0;
|
||||||
@ -780,13 +734,44 @@ Master()
|
|||||||
|
|
||||||
/* set up port for master to listen on
|
/* set up port for master to listen on
|
||||||
*/
|
*/
|
||||||
#if HAVE_MEMSET
|
#if !USE_IPV6
|
||||||
|
# if HAVE_MEMSET
|
||||||
memset((void *)&master_port, 0, sizeof(master_port));
|
memset((void *)&master_port, 0, sizeof(master_port));
|
||||||
#else
|
# else
|
||||||
bzero((char *)&master_port, sizeof(master_port));
|
bzero((char *)&master_port, sizeof(master_port));
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
for (rp = bindAddr; rp != NULL; rp = rp->ai_next) {
|
||||||
|
if ((msfd =
|
||||||
|
socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
# if HAVE_SETSOCKOPT
|
||||||
|
if (setsockopt
|
||||||
|
(msfd, SOL_SOCKET, SO_REUSEADDR, (char *)&sock_opt_true,
|
||||||
|
sizeof(sock_opt_true)) < 0)
|
||||||
|
goto fail;
|
||||||
|
# endif
|
||||||
|
if (!SetFlags(msfd, O_NONBLOCK, 0))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
if (bind(msfd, rp->ai_addr, rp->ai_addrlen) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
close(msfd);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listen(msfd, SOMAXCONN) < 0) {
|
||||||
|
Error("Master(): listen(): %s", strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* save addrlen for accept */
|
||||||
|
so = rp->ai_addrlen;
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
master_port.sun_family = AF_UNIX;
|
master_port.sun_family = AF_UNIX;
|
||||||
|
|
||||||
if (portPath == (STRING *)0)
|
if (portPath == (STRING *)0)
|
||||||
@ -819,6 +804,11 @@ Master()
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
# ifdef TRUST_UDS_CRED
|
||||||
|
/* Allow everyone to connect, but we later auth them via SO_PEERCRED */
|
||||||
|
chmod(master_port.sun_path, 0666);
|
||||||
|
# endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
master_port.sin_family = AF_INET;
|
master_port.sin_family = AF_INET;
|
||||||
master_port.sin_addr.s_addr = bindAddr;
|
master_port.sin_addr.s_addr = bindAddr;
|
||||||
@ -831,8 +821,8 @@ Master()
|
|||||||
}
|
}
|
||||||
# if HAVE_SETSOCKOPT
|
# if HAVE_SETSOCKOPT
|
||||||
if (setsockopt
|
if (setsockopt
|
||||||
(msfd, SOL_SOCKET, SO_REUSEADDR, (char *)&true,
|
(msfd, SOL_SOCKET, SO_REUSEADDR, (char *)&sock_opt_true,
|
||||||
sizeof(true)) < 0) {
|
sizeof(sock_opt_true)) < 0) {
|
||||||
Error("Master(): setsockopt(%u,SO_REUSEADDR): %s", msfd,
|
Error("Master(): setsockopt(%u,SO_REUSEADDR): %s", msfd,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return;
|
return;
|
||||||
@ -955,8 +945,8 @@ Master()
|
|||||||
CONDDEBUG((1, "Master(): flushing fd %d",
|
CONDDEBUG((1, "Master(): flushing fd %d",
|
||||||
FileFDNum(pCLServing->fd)));
|
FileFDNum(pCLServing->fd)));
|
||||||
if (FileWrite
|
if (FileWrite
|
||||||
(pCLServing->fd, FLAGFALSE, (char *)0,
|
(pCLServing->fd, FLAGFALSE, (char *)0, 0)
|
||||||
0) < 0) {
|
< 0) {
|
||||||
DropMasterClient(pCLServing, FLAGTRUE);
|
DropMasterClient(pCLServing, FLAGTRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -985,7 +975,9 @@ Master()
|
|||||||
dmallocMarkClientConnection = dmalloc_mark();
|
dmallocMarkClientConnection = dmalloc_mark();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !USE_IPV6
|
||||||
so = sizeof(struct sockaddr_in);
|
so = sizeof(struct sockaddr_in);
|
||||||
|
#endif
|
||||||
for (cfd = 0; cfd == 0;) {
|
for (cfd = 0; cfd == 0;) {
|
||||||
cfd =
|
cfd =
|
||||||
accept(msfd, (struct sockaddr *)&pCLmfree->cnct_port, &so);
|
accept(msfd, (struct sockaddr *)&pCLmfree->cnct_port, &so);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: master.h,v 5.17 2003/10/03 14:23:37 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -39,5 +37,5 @@
|
|||||||
*/
|
*/
|
||||||
extern CONSCLIENT *pCLmall;
|
extern CONSCLIENT *pCLmall;
|
||||||
extern CONSCLIENT *pCLmfree;
|
extern CONSCLIENT *pCLmfree;
|
||||||
extern void Master PARAMS((void));
|
extern void Master(void);
|
||||||
extern void SignalKids PARAMS((int));
|
extern void SignalKids(int);
|
||||||
|
1620
conserver/readcfg.c
1620
conserver/readcfg.c
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: readcfg.h,v 5.49 2013/09/23 22:58:21 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BREAKDELAYDEFAULT 250
|
#define BREAKDELAYDEFAULT 250
|
||||||
|
#define BREAKLISTSIZE 35 /* ('z'-('a'-1))+('9'-('1'-1)) */
|
||||||
|
#define BREAKALPHAOFFSET 39 /* ('a'-('9'+1)) */
|
||||||
|
|
||||||
typedef struct config {
|
typedef struct config {
|
||||||
STRING *name;
|
STRING *name;
|
||||||
@ -18,7 +18,7 @@ typedef struct config {
|
|||||||
char *primaryport;
|
char *primaryport;
|
||||||
FLAG redirect;
|
FLAG redirect;
|
||||||
FLAG loghostnames;
|
FLAG loghostnames;
|
||||||
int reinitcheck;
|
int reinitcheck; /* stored in sec, configured in min or sec */
|
||||||
char *secondaryport;
|
char *secondaryport;
|
||||||
char *unifiedlog;
|
char *unifiedlog;
|
||||||
int initdelay;
|
int initdelay;
|
||||||
@ -57,18 +57,19 @@ extern REMOTE *pRCUniq; /* list of uniq console servers */
|
|||||||
extern ACCESS *pACList; /* `who do you love' (or trust) */
|
extern ACCESS *pACList; /* `who do you love' (or trust) */
|
||||||
extern CONSENTUSERS *pADList; /* list of admin users */
|
extern CONSENTUSERS *pADList; /* list of admin users */
|
||||||
extern CONSENTUSERS *pLUList; /* list of limited users */
|
extern CONSENTUSERS *pLUList; /* list of limited users */
|
||||||
extern BREAKS breakList[9]; /* list of break sequences */
|
extern BREAKS breakList[BREAKLISTSIZE]; /* list of break sequences */
|
||||||
extern TASKS *taskList; /* list of tasks */
|
extern TASKS *taskList; /* list of tasks */
|
||||||
extern SUBST *taskSubst; /* substitution function data for tasks */
|
extern SUBST *taskSubst; /* substitution function data for tasks */
|
||||||
extern CONFIG *pConfig; /* settings seen by config parser */
|
extern CONFIG *pConfig; /* settings seen by config parser */
|
||||||
extern SUBST *substData; /* substitution function data */
|
extern SUBST *substData; /* substitution function data */
|
||||||
|
|
||||||
extern void ReadCfg PARAMS((char *, FILE *));
|
extern void ReadCfg(char *, FILE *);
|
||||||
extern void ReReadCfg PARAMS((int, int));
|
extern void ReReadCfg(int, int);
|
||||||
extern void DestroyBreakList PARAMS((void));
|
extern void DestroyBreakList(void);
|
||||||
extern void DestroyTaskList PARAMS((void));
|
extern void InitBreakList(void);
|
||||||
extern void DestroyUserList PARAMS((void));
|
extern void DestroyTaskList(void);
|
||||||
extern void DestroyConfig PARAMS((CONFIG *));
|
extern void DestroyUserList(void);
|
||||||
extern NAMES *FindUserList PARAMS((char *));
|
extern void DestroyConfig(CONFIG *);
|
||||||
extern NAMES *AddUserList PARAMS((char *));
|
extern NAMES *FindUserList(char *);
|
||||||
extern CONSENT *FindConsoleName PARAMS((CONSENT *, char *));
|
extern NAMES *AddUserList(char *);
|
||||||
|
extern CONSENT *FindConsoleName(CONSENT *, char *);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: version.h,v 1.78 2013/09/13 20:54:09 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -14,8 +12,9 @@
|
|||||||
@(#) Copyright 2000 conserver.com.\n\
|
@(#) Copyright 2000 conserver.com.\n\
|
||||||
All rights reserved.\n"
|
All rights reserved.\n"
|
||||||
|
|
||||||
|
#define VERSION_DATE "2022/07/07"
|
||||||
#define VERSION_MAJOR 8
|
#define VERSION_MAJOR 8
|
||||||
#define VERSION_MINOR 1
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_REV 19
|
#define VERSION_REV 7
|
||||||
#define VERSION_TEXT "conserver.com version"
|
#define VERSION_TEXT "conserver.com version"
|
||||||
#define VERSION_UINT (VERSION_MAJOR * 1000000 + VERSION_MINOR * 1000 + VERSION_REV)
|
#define VERSION_UINT (VERSION_MAJOR * 1000000 + VERSION_MINOR * 1000 + VERSION_REV)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
### Path settings
|
### Path settings
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: console.c,v 5.188 2013/09/18 14:31:39 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -36,12 +34,14 @@
|
|||||||
#include <readconf.h>
|
#include <readconf.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
#include <openssl/ssl.h>
|
# include <openssl/opensslv.h>
|
||||||
#include <openssl/err.h>
|
|
||||||
#include <openssl/opensslv.h>
|
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_GSSAPI
|
#if HAVE_GSSAPI
|
||||||
#include <gssapi/gssapi.h>
|
# include <gssapi/gssapi.h>
|
||||||
|
#endif
|
||||||
|
#if USE_IPV6
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -70,20 +70,18 @@ struct winsize ws;
|
|||||||
SSL_CTX *ctx = (SSL_CTX *)0;
|
SSL_CTX *ctx = (SSL_CTX *)0;
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
SetupSSL(void)
|
SetupSSL(void)
|
||||||
#else
|
|
||||||
SetupSSL()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (ctx == (SSL_CTX *)0) {
|
if (ctx == (SSL_CTX *)0) {
|
||||||
char *ciphers;
|
char *ciphers;
|
||||||
|
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
if (!SSL_library_init()) {
|
if (!SSL_library_init()) {
|
||||||
Error("SSL library initialization failed");
|
Error("SSL library initialization failed");
|
||||||
Bye(EX_UNAVAILABLE);
|
Bye(EX_UNAVAILABLE);
|
||||||
}
|
}
|
||||||
if ((ctx = SSL_CTX_new(SSLv23_method())) == (SSL_CTX *)0) {
|
# endif/* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
||||||
|
if ((ctx = SSL_CTX_new(TLS_method())) == (SSL_CTX *)0) {
|
||||||
Error("Creating SSL context failed");
|
Error("Creating SSL context failed");
|
||||||
Bye(EX_UNAVAILABLE);
|
Bye(EX_UNAVAILABLE);
|
||||||
}
|
}
|
||||||
@ -120,11 +118,11 @@ SetupSSL()
|
|||||||
}
|
}
|
||||||
ciphers = "ALL:!LOW:!EXP:!MD5:!aNULL:@STRENGTH";
|
ciphers = "ALL:!LOW:!EXP:!MD5:!aNULL:@STRENGTH";
|
||||||
} else {
|
} else {
|
||||||
#if defined(REQ_SERVER_CERT)
|
# if defined(REQ_SERVER_CERT)
|
||||||
ciphers = "ALL:!LOW:!EXP:!MD5:!aNULL:@STRENGTH";
|
ciphers = "ALL:!LOW:!EXP:!MD5:!aNULL:@STRENGTH";
|
||||||
#else
|
# else
|
||||||
ciphers = "ALL:!LOW:!EXP:!MD5:@STRENGTH";
|
ciphers = "ALL:aNULL:!LOW:!EXP:!MD5:@STRENGTH" CIPHER_SEC0;
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, SSLVerifyCallback);
|
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, SSLVerifyCallback);
|
||||||
SSL_CTX_set_options(ctx,
|
SSL_CTX_set_options(ctx,
|
||||||
@ -142,12 +140,7 @@ SetupSSL()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
AttemptSSL(CONSFILE *pcf)
|
AttemptSSL(CONSFILE *pcf)
|
||||||
#else
|
|
||||||
AttemptSSL(pcf)
|
|
||||||
CONSFILE *pcf;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
|
|
||||||
@ -174,17 +167,13 @@ AttemptSSL(pcf)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_GSSAPI
|
#if HAVE_GSSAPI
|
||||||
|
#define MAX_GSSAPI_TOKSIZE 64*1024
|
||||||
gss_name_t gss_server_name = GSS_C_NO_NAME;
|
gss_name_t gss_server_name = GSS_C_NO_NAME;
|
||||||
gss_ctx_id_t secctx = GSS_C_NO_CONTEXT;
|
gss_ctx_id_t secctx = GSS_C_NO_CONTEXT;
|
||||||
gss_buffer_desc mytok = GSS_C_EMPTY_BUFFER;
|
gss_buffer_desc mytok = GSS_C_EMPTY_BUFFER;
|
||||||
|
|
||||||
int
|
size_t
|
||||||
#if PROTOTYPES
|
|
||||||
CanGetGSSContext(const char *servername)
|
CanGetGSSContext(const char *servername)
|
||||||
#else
|
|
||||||
CanGetGSSContext(servername)
|
|
||||||
const char *servername;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char namestr[128];
|
char namestr[128];
|
||||||
gss_buffer_desc namebuf, dbuf;
|
gss_buffer_desc namebuf, dbuf;
|
||||||
@ -220,23 +209,22 @@ CanGetGSSContext(servername)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
AttemptGSSAPI(CONSFILE *pcf, size_t toksize)
|
||||||
AttemptGSSAPI(CONSFILE *pcf)
|
|
||||||
#else
|
|
||||||
AttemptGSSAPI(pcf)
|
|
||||||
CONSFILE *pcf;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
OM_uint32 stmaj, stmin;
|
OM_uint32 stmaj, stmin;
|
||||||
gss_buffer_desc servertok;
|
gss_buffer_desc servertok;
|
||||||
char buf[1024];
|
char *buf = NULL;
|
||||||
int nr;
|
int nr;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
buf = malloc(toksize);
|
||||||
|
if (buf == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
FileSetQuoteIAC(pcf, FLAGFALSE);
|
FileSetQuoteIAC(pcf, FLAGFALSE);
|
||||||
FileWrite(pcf, FLAGFALSE, mytok.value, mytok.length);
|
FileWrite(pcf, FLAGFALSE, mytok.value, mytok.length);
|
||||||
FileSetQuoteIAC(pcf, FLAGTRUE);
|
FileSetQuoteIAC(pcf, FLAGTRUE);
|
||||||
nr = FileRead(pcf, buf, sizeof(buf));
|
nr = FileRead(pcf, buf, toksize);
|
||||||
servertok.length = nr;
|
servertok.length = nr;
|
||||||
servertok.value = buf;
|
servertok.value = buf;
|
||||||
|
|
||||||
@ -250,6 +238,7 @@ AttemptGSSAPI(pcf)
|
|||||||
|
|
||||||
ret = (stmaj == GSS_S_COMPLETE);
|
ret = (stmaj == GSS_S_COMPLETE);
|
||||||
gss_release_name(&stmin, &gss_server_name);
|
gss_release_name(&stmin, &gss_server_name);
|
||||||
|
free(buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -257,13 +246,7 @@ AttemptGSSAPI(pcf)
|
|||||||
/* output a control (or plain) character as a UNIX user would expect it (ksb)
|
/* output a control (or plain) character as a UNIX user would expect it (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
PutCtlc(int c, FILE *fp)
|
PutCtlc(int c, FILE *fp)
|
||||||
#else
|
|
||||||
PutCtlc(c, fp)
|
|
||||||
int c;
|
|
||||||
FILE *fp;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (0 != (0200 & c)) {
|
if (0 != (0200 & c)) {
|
||||||
putc('M', fp);
|
putc('M', fp);
|
||||||
@ -285,12 +268,7 @@ PutCtlc(c, fp)
|
|||||||
/* output a long message to the user
|
/* output a long message to the user
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
Usage(int wantfull)
|
Usage(int wantfull)
|
||||||
#else
|
|
||||||
Usage(wantfull)
|
|
||||||
int wantfull;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static char *full[] = {
|
static char *full[] = {
|
||||||
"7 strip the high bit off all console data",
|
"7 strip the high bit off all console data",
|
||||||
@ -313,6 +291,7 @@ Usage(wantfull)
|
|||||||
"f(F) force read/write connection (and replay)",
|
"f(F) force read/write connection (and replay)",
|
||||||
"h output this message",
|
"h output this message",
|
||||||
"i(I) display status info in machine-parseable form (on master)",
|
"i(I) display status info in machine-parseable form (on master)",
|
||||||
|
"k abort connection if the console is not 'up'",
|
||||||
"l user use username instead of current username",
|
"l user use username instead of current username",
|
||||||
"M master master server to poll first",
|
"M master master server to poll first",
|
||||||
"n do not read system-wide config file",
|
"n do not read system-wide config file",
|
||||||
@ -340,7 +319,7 @@ Usage(wantfull)
|
|||||||
%s [generic-args] [-iIuwWx] [console]\n\
|
%s [generic-args] [-iIuwWx] [console]\n\
|
||||||
%s [generic-args] [-hPqQrRV] [-[bB] message] [-d [user][@console]]\n\
|
%s [generic-args] [-hPqQrRV] [-[bB] message] [-d [user][@console]]\n\
|
||||||
[-t [user][@console] message] [-[zZ] cmd]\n\n\
|
[-t [user][@console] message] [-[zZ] cmd]\n\n\
|
||||||
generic-args: [-7DEnUv] [-c cred] [-C config] [-M master]\n\
|
generic-args: [-7DEknUv] [-c cred] [-C config] [-M master]\n\
|
||||||
[-p port] [-l username]\n", progname, progname, progname);
|
[-p port] [-l username]\n", progname, progname, progname);
|
||||||
|
|
||||||
if (wantfull) {
|
if (wantfull) {
|
||||||
@ -354,11 +333,7 @@ Usage(wantfull)
|
|||||||
/* expain who we are and which revision we are (ksb)
|
/* expain who we are and which revision we are (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
Version(void)
|
||||||
Version()
|
|
||||||
#else
|
|
||||||
Version()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
static STRING *acA1 = (STRING *)0;
|
static STRING *acA1 = (STRING *)0;
|
||||||
@ -376,9 +351,6 @@ Version()
|
|||||||
#if HAVE_GSSAPI
|
#if HAVE_GSSAPI
|
||||||
"gssapi",
|
"gssapi",
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_PAM
|
|
||||||
"pam",
|
|
||||||
#endif
|
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_UNIX_DOMAIN_SOCKETS
|
||||||
"uds",
|
"uds",
|
||||||
#endif
|
#endif
|
||||||
@ -392,12 +364,12 @@ Version()
|
|||||||
|
|
||||||
Msg(MyVersion());
|
Msg(MyVersion());
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_UNIX_DOMAIN_SOCKETS
|
||||||
Msg("default socket directory `%s\'", UDSDIR);
|
Msg("default socket directory `%s'", UDSDIR);
|
||||||
#else
|
#else
|
||||||
Msg("default initial master server `%s\'", MASTERHOST);
|
Msg("default initial master server `%s'", MASTERHOST);
|
||||||
Msg("default port referenced as `%s'", DEFPORT);
|
Msg("default port referenced as `%s'", DEFPORT);
|
||||||
#endif
|
#endif
|
||||||
Msg("default escape sequence `%s%s\'", FmtCtl(DEFATTN, acA1),
|
Msg("default escape sequence `%s%s'", FmtCtl(DEFATTN, acA1),
|
||||||
FmtCtl(DEFESC, acA2));
|
FmtCtl(DEFESC, acA2));
|
||||||
Msg("default site-wide configuration in `%s'", CLIENTCONFIGFILE);
|
Msg("default site-wide configuration in `%s'", CLIENTCONFIGFILE);
|
||||||
Msg("default per-user configuration in `%s'", "$HOME/.consolerc");
|
Msg("default per-user configuration in `%s'", "$HOME/.consolerc");
|
||||||
@ -421,12 +393,12 @@ Version()
|
|||||||
BuildStringChar('0' + DMALLOC_VERSION_MINOR, acA1);
|
BuildStringChar('0' + DMALLOC_VERSION_MINOR, acA1);
|
||||||
BuildStringChar('.', acA1);
|
BuildStringChar('.', acA1);
|
||||||
BuildStringChar('0' + DMALLOC_VERSION_PATCH, acA1);
|
BuildStringChar('0' + DMALLOC_VERSION_PATCH, acA1);
|
||||||
#if defined(DMALLOC_VERSION_BETA)
|
# if defined(DMALLOC_VERSION_BETA)
|
||||||
if (DMALLOC_VERSION_BETA != 0) {
|
if (DMALLOC_VERSION_BETA != 0) {
|
||||||
BuildString("-b", acA1);
|
BuildString("-b", acA1);
|
||||||
BuildStringChar('0' + DMALLOC_VERSION_BETA, acA1);
|
BuildStringChar('0' + DMALLOC_VERSION_BETA, acA1);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
Msg("dmalloc version: %s", acA1->string);
|
Msg("dmalloc version: %s", acA1->string);
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
@ -444,12 +416,7 @@ Version()
|
|||||||
* c a plain character
|
* c a plain character
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
#if PROTOTYPES
|
|
||||||
ParseChar(char **ppcSrc, char *pcOut)
|
ParseChar(char **ppcSrc, char *pcOut)
|
||||||
#else
|
|
||||||
ParseChar(ppcSrc, pcOut)
|
|
||||||
char **ppcSrc, *pcOut;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int cvt, n;
|
int cvt, n;
|
||||||
char *pcScan = *ppcSrc;
|
char *pcScan = *ppcSrc;
|
||||||
@ -493,11 +460,7 @@ ParseChar(ppcSrc, pcOut)
|
|||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
ValidateEsc(void)
|
||||||
ValidateEsc()
|
|
||||||
#else
|
|
||||||
ValidateEsc()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
unsigned char c1, c2;
|
unsigned char c1, c2;
|
||||||
|
|
||||||
@ -520,12 +483,7 @@ ValidateEsc()
|
|||||||
/* find the two characters that makeup the users escape sequence (ksb)
|
/* find the two characters that makeup the users escape sequence (ksb)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
ParseEsc(char *pcText)
|
ParseEsc(char *pcText)
|
||||||
#else
|
|
||||||
ParseEsc(pcText)
|
|
||||||
char *pcText;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char *pcTemp;
|
char *pcTemp;
|
||||||
char c1, c2;
|
char c1, c2;
|
||||||
@ -550,30 +508,85 @@ ParseEsc(pcText)
|
|||||||
* as a side effect we set ThisHost to a short name for this host
|
* as a side effect we set ThisHost to a short name for this host
|
||||||
*/
|
*/
|
||||||
CONSFILE *
|
CONSFILE *
|
||||||
#if PROTOTYPES
|
|
||||||
GetPort(char *pcToHost, unsigned short sPort)
|
GetPort(char *pcToHost, unsigned short sPort)
|
||||||
#else
|
|
||||||
GetPort(pcToHost, sPort)
|
|
||||||
char *pcToHost;
|
|
||||||
unsigned short sPort;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
int error;
|
||||||
|
char host[NI_MAXHOST];
|
||||||
|
char serv[NI_MAXSERV];
|
||||||
|
struct addrinfo *ai, *rp, hints;
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
struct sockaddr_un port;
|
struct sockaddr_un port;
|
||||||
static STRING *portPath = (STRING *)0;
|
static STRING *portPath = (STRING *)0;
|
||||||
#else
|
#else
|
||||||
struct hostent *hp = (struct hostent *)0;
|
struct hostent *hp = (struct hostent *)0;
|
||||||
struct sockaddr_in port;
|
struct sockaddr_in port;
|
||||||
#endif
|
#endif
|
||||||
|
#if HAVE_SETSOCKOPT
|
||||||
#if HAVE_MEMSET
|
int one = 1;
|
||||||
memset((void *)(&port), '\000', sizeof(port));
|
|
||||||
#else
|
|
||||||
bzero((char *)(&port), sizeof(port));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
# if HAVE_MEMSET
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
# else
|
||||||
|
bzero(&hints, sizeof(hints));
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# if HAVE_MEMSET
|
||||||
|
memset((void *)(&port), '\000', sizeof(port));
|
||||||
|
# else
|
||||||
|
bzero((char *)(&port), sizeof(port));
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_IPV6
|
||||||
|
hints.ai_flags = AI_ADDRCONFIG;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
snprintf(serv, sizeof(serv), "%hu", sPort);
|
||||||
|
|
||||||
|
error = getaddrinfo(pcToHost, serv, &hints, &ai);
|
||||||
|
if (error) {
|
||||||
|
Error("getaddrinfo(%s): %s", pcToHost, gai_strerror(error));
|
||||||
|
return (CONSFILE *)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
rp = ai;
|
||||||
|
while (rp) {
|
||||||
|
error =
|
||||||
|
getnameinfo(rp->ai_addr, rp->ai_addrlen, host, sizeof(host),
|
||||||
|
serv, sizeof(serv),
|
||||||
|
NI_NUMERICHOST | NI_NUMERICSERV);
|
||||||
|
if (error) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
CONDDEBUG((1, "GetPort: hostname=%s, ip=%s, port=%s", pcToHost,
|
||||||
|
host, serv));
|
||||||
|
|
||||||
|
/* set up the socket to talk to the server for all consoles
|
||||||
|
* (it will tell us who to talk to to get a real connection)
|
||||||
|
*/
|
||||||
|
s = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
|
||||||
|
if (s != -1) {
|
||||||
|
# if HAVE_SETSOCKOPT
|
||||||
|
if (setsockopt
|
||||||
|
(s, SOL_SOCKET, SO_KEEPALIVE, (char *)&one,
|
||||||
|
sizeof(one)) < 0)
|
||||||
|
goto fail;
|
||||||
|
# endif
|
||||||
|
if (connect(s, rp->ai_addr, rp->ai_addrlen) == 0)
|
||||||
|
goto success;
|
||||||
|
fail:
|
||||||
|
close(s);
|
||||||
|
}
|
||||||
|
rp = rp->ai_next;
|
||||||
|
}
|
||||||
|
Error("Unable to connect to %s:%s", host, serv);
|
||||||
|
return (CONSFILE *)0;
|
||||||
|
success:
|
||||||
|
freeaddrinfo(ai);
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
if (portPath == (STRING *)0)
|
if (portPath == (STRING *)0)
|
||||||
portPath = AllocString();
|
portPath = AllocString();
|
||||||
BuildStringPrint(portPath, "%s/%hu", config->master, sPort);
|
BuildStringPrint(portPath, "%s/%hu", config->master, sPort);
|
||||||
@ -641,10 +654,19 @@ GetPort(pcToHost, sPort)
|
|||||||
Error("socket(AF_INET,SOCK_STREAM): %s", strerror(errno));
|
Error("socket(AF_INET,SOCK_STREAM): %s", strerror(errno));
|
||||||
return (CONSFILE *)0;
|
return (CONSFILE *)0;
|
||||||
}
|
}
|
||||||
|
# if HAVE_SETSOCKOPT
|
||||||
|
if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof(one))
|
||||||
|
< 0) {
|
||||||
|
Error("setsockopt(SO_KEEPALIVE): %s", strerror(errno));
|
||||||
|
close(s);
|
||||||
|
return (CONSFILE *)0;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (connect(s, (struct sockaddr *)(&port), sizeof(port)) < 0) {
|
if (connect(s, (struct sockaddr *)(&port), sizeof(port)) < 0) {
|
||||||
Error("connect(): %hu@%s: %s", ntohs(port.sin_port), pcToHost,
|
Error("connect(): %hu@%s: %s", ntohs(port.sin_port), pcToHost,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
close(s);
|
||||||
return (CONSFILE *)0;
|
return (CONSFILE *)0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -666,11 +688,7 @@ static struct termios o_tios;
|
|||||||
* we really use cbreak at PUCC because we need even parity...
|
* we really use cbreak at PUCC because we need even parity...
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
C2Raw(void)
|
||||||
C2Raw()
|
|
||||||
#else
|
|
||||||
C2Raw()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
struct termios n_tios;
|
struct termios n_tios;
|
||||||
|
|
||||||
@ -698,11 +716,7 @@ C2Raw()
|
|||||||
* put the tty back as it was, however that was
|
* put the tty back as it was, however that was
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
C2Cooked(void)
|
||||||
C2Cooked()
|
|
||||||
#else
|
|
||||||
C2Cooked()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (!screwy)
|
if (!screwy)
|
||||||
return;
|
return;
|
||||||
@ -711,11 +725,7 @@ C2Cooked()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DestroyDataStructures(void)
|
DestroyDataStructures(void)
|
||||||
#else
|
|
||||||
DestroyDataStructures()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
C2Cooked();
|
C2Cooked();
|
||||||
if (cfstdout != (CONSFILE *)0)
|
if (cfstdout != (CONSFILE *)0)
|
||||||
@ -724,21 +734,17 @@ DestroyDataStructures()
|
|||||||
DestroyConfig(optConf);
|
DestroyConfig(optConf);
|
||||||
DestroyConfig(config);
|
DestroyConfig(config);
|
||||||
DestroyTerminal(pTerm);
|
DestroyTerminal(pTerm);
|
||||||
|
#if !USE_IPV6
|
||||||
if (myAddrs != (struct in_addr *)0)
|
if (myAddrs != (struct in_addr *)0)
|
||||||
free(myAddrs);
|
free(myAddrs);
|
||||||
|
#endif
|
||||||
DestroyStrings();
|
DestroyStrings();
|
||||||
if (substData != (SUBST *)0)
|
if (substData != (SUBST *)0)
|
||||||
free(substData);
|
free(substData);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
#if PROTOTYPES
|
|
||||||
ReadReply(CONSFILE *fd, FLAG toEOF)
|
ReadReply(CONSFILE *fd, FLAG toEOF)
|
||||||
#else
|
|
||||||
ReadReply(fd, toEOF)
|
|
||||||
CONSFILE *fd;
|
|
||||||
FLAG toEOF;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int nr;
|
int nr;
|
||||||
static char buf[1024];
|
static char buf[1024];
|
||||||
@ -790,11 +796,7 @@ ReadReply(fd, toEOF)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
ReapVirt(void)
|
ReapVirt(void)
|
||||||
#else
|
|
||||||
ReapVirt()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int UWbuf;
|
int UWbuf;
|
||||||
@ -835,12 +837,7 @@ static sig_atomic_t fSawReapVirt = 0;
|
|||||||
static
|
static
|
||||||
#endif
|
#endif
|
||||||
RETSIGTYPE
|
RETSIGTYPE
|
||||||
#if PROTOTYPES
|
|
||||||
FlagReapVirt(int sig)
|
FlagReapVirt(int sig)
|
||||||
#else
|
|
||||||
FlagReapVirt(sig)
|
|
||||||
int sig;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fSawReapVirt = 1;
|
fSawReapVirt = 1;
|
||||||
#if !HAVE_SIGACTION
|
#if !HAVE_SIGACTION
|
||||||
@ -850,11 +847,7 @@ FlagReapVirt(sig)
|
|||||||
|
|
||||||
/* invoke the execcmd command */
|
/* invoke the execcmd command */
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ExecCmd(void)
|
ExecCmd(void)
|
||||||
#else
|
|
||||||
ExecCmd()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
pid_t iNewGrp;
|
pid_t iNewGrp;
|
||||||
@ -924,23 +917,31 @@ ExecCmd()
|
|||||||
/* setup new process with clean file descriptors
|
/* setup new process with clean file descriptors
|
||||||
* stderr still goes to stderr...so user sees it
|
* stderr still goes to stderr...so user sees it
|
||||||
*/
|
*/
|
||||||
i = GetMaxFiles();
|
#ifdef HAVE_CLOSEFROM
|
||||||
for ( /* i above */ ; --i > 3;) {
|
for (i = 3; i <= pout[0] || i <= pin[1]; i++) {
|
||||||
if (i != pout[0] && i != pin[1])
|
if (i != pout[0] && i != pin[1])
|
||||||
close(i);
|
close(i);
|
||||||
}
|
}
|
||||||
|
closefrom(i);
|
||||||
|
#else
|
||||||
|
i = GetMaxFiles();
|
||||||
|
for ( /* i above */ ; --i > 2;) {
|
||||||
|
if (i != pout[0] && i != pin[1])
|
||||||
|
close(i);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
close(1);
|
close(1);
|
||||||
close(0);
|
close(0);
|
||||||
|
|
||||||
# if HAVE_SETSID
|
#if HAVE_SETSID
|
||||||
iNewGrp = setsid();
|
iNewGrp = setsid();
|
||||||
if (-1 == iNewGrp) {
|
if (-1 == iNewGrp) {
|
||||||
Error("ExecCmd(): setsid(): %s", strerror(errno));
|
Error("ExecCmd(): setsid(): %s", strerror(errno));
|
||||||
iNewGrp = thepid;
|
iNewGrp = thepid;
|
||||||
}
|
}
|
||||||
# else
|
#else
|
||||||
iNewGrp = thepid;
|
iNewGrp = thepid;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (dup(pout[0]) != 0 || dup(pin[1]) != 1) {
|
if (dup(pout[0]) != 0 || dup(pin[1]) != 1) {
|
||||||
Error("ExecCmd(): fd sync error");
|
Error("ExecCmd(): fd sync error");
|
||||||
@ -960,12 +961,7 @@ ExecCmd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
GetUserInput(STRING *str)
|
GetUserInput(STRING *str)
|
||||||
#else
|
|
||||||
GetUserInput(str)
|
|
||||||
STRING *str;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
@ -1011,12 +1007,7 @@ GetUserInput(str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DoExec(CONSFILE *pcf)
|
DoExec(CONSFILE *pcf)
|
||||||
#else
|
|
||||||
DoExec(pcf)
|
|
||||||
CONSFILE *pcf;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
showExecData = 1;
|
showExecData = 1;
|
||||||
FileWrite(cfstdout, FLAGFALSE, "exec: ", 6);
|
FileWrite(cfstdout, FLAGFALSE, "exec: ", 6);
|
||||||
@ -1066,13 +1057,7 @@ DoExec(pcf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ExpandString(char *str, CONSFILE *c)
|
ExpandString(char *str, CONSFILE *c)
|
||||||
#else
|
|
||||||
ExpandString(str, c)
|
|
||||||
char *str;
|
|
||||||
CONSFILE *c;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char s;
|
char s;
|
||||||
short backslash = 0;
|
short backslash = 0;
|
||||||
@ -1162,15 +1147,7 @@ ExpandString(str, c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
PrintSubst(CONSFILE *pcf, char *pcMach, char *string, char *subst)
|
PrintSubst(CONSFILE *pcf, char *pcMach, char *string, char *subst)
|
||||||
#else
|
|
||||||
PrintSubst(pcf, pcMach, string, subst)
|
|
||||||
CONSFILE *pcf;
|
|
||||||
char *pcMach;
|
|
||||||
char *string;
|
|
||||||
char *subst;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (string == (char *)0)
|
if (string == (char *)0)
|
||||||
return;
|
return;
|
||||||
@ -1189,13 +1166,7 @@ PrintSubst(pcf, pcMach, string, subst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
Interact(CONSFILE *pcf, char *pcMach)
|
Interact(CONSFILE *pcf, char *pcMach)
|
||||||
#else
|
|
||||||
Interact(pcf, pcMach)
|
|
||||||
CONSFILE *pcf;
|
|
||||||
char *pcMach;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int nc;
|
int nc;
|
||||||
@ -1418,14 +1389,8 @@ Interact(pcf, pcMach)
|
|||||||
/* interact with a group server (ksb)
|
/* interact with a group server (ksb)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
CallUp(CONSFILE *pcf, char *pcMaster, char *pcMach, char *pcHow,
|
CallUp(CONSFILE *pcf, char *pcMaster, char *pcMach, char *pcHow,
|
||||||
char *result)
|
char *result)
|
||||||
#else
|
|
||||||
CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|
||||||
CONSFILE *pcf;
|
|
||||||
char *pcMaster, *pcMach, *pcHow, *result;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int fIn = '-';
|
int fIn = '-';
|
||||||
char *r = (char *)0;
|
char *r = (char *)0;
|
||||||
@ -1513,8 +1478,13 @@ CallUp(pcf, pcMaster, pcMach, pcHow, result)
|
|||||||
/* try to grok the state of the console */
|
/* try to grok the state of the console */
|
||||||
FilePrint(pcf, FLAGFALSE, "%c%c=", chAttn, chEsc);
|
FilePrint(pcf, FLAGFALSE, "%c%c=", chAttn, chEsc);
|
||||||
r = ReadReply(pcf, FLAGFALSE);
|
r = ReadReply(pcf, FLAGFALSE);
|
||||||
if (strncmp(r, "[unknown", 8) != 0 && strncmp(r, "[up]", 4) != 0)
|
if (strncmp(r, "[unknown", 8) != 0 && strncmp(r, "[up]", 4) != 0) {
|
||||||
FileWrite(cfstdout, FLAGFALSE, r, -1);
|
FileWrite(cfstdout, FLAGFALSE, r, -1);
|
||||||
|
if (config->exitdown == FLAGTRUE) {
|
||||||
|
Error("Console is not 'up'. Exiting. (-k)");
|
||||||
|
Bye(EX_UNAVAILABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* try to grok the version of the server */
|
/* try to grok the version of the server */
|
||||||
FilePrint(pcf, FLAGFALSE, "%c%c%c", chAttn, chEsc, 0xD6);
|
FilePrint(pcf, FLAGFALSE, "%c%c%c", chAttn, chEsc, 0xD6);
|
||||||
@ -1609,14 +1579,7 @@ char *cmdarg = (char *)0;
|
|||||||
* and ask the machine master at pop.stat for more group leaders
|
* and ask the machine master at pop.stat for more group leaders
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
DoCmds(char *master, char *pports, int cmdi)
|
DoCmds(char *master, char *pports, int cmdi)
|
||||||
#else
|
|
||||||
DoCmds(master, pports, cmdi)
|
|
||||||
char *master;
|
|
||||||
char *pports;
|
|
||||||
int cmdi;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONSFILE *pcf;
|
CONSFILE *pcf;
|
||||||
char *t;
|
char *t;
|
||||||
@ -1629,7 +1592,7 @@ DoCmds(master, pports, cmdi)
|
|||||||
char *pcopy;
|
char *pcopy;
|
||||||
char *serverName;
|
char *serverName;
|
||||||
#if HAVE_GSSAPI
|
#if HAVE_GSSAPI
|
||||||
int toksize;
|
size_t toksize;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((pcopy = ports = StrDup(pports)) == (char *)0)
|
if ((pcopy = ports = StrDup(pports)) == (char *)0)
|
||||||
@ -1660,7 +1623,9 @@ DoCmds(master, pports, cmdi)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (*ports == '\000') {
|
if (*ports == '\000') {
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
port = bindPort;
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
port = 0;
|
port = 0;
|
||||||
#else
|
#else
|
||||||
port = htons(bindPort);
|
port = htons(bindPort);
|
||||||
@ -1669,7 +1634,9 @@ DoCmds(master, pports, cmdi)
|
|||||||
Error("invalid port spec for %s: `%s'", serverName, ports);
|
Error("invalid port spec for %s: `%s'", serverName, ports);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
#if USE_UNIX_DOMAIN_SOCKETS
|
#if USE_IPV6
|
||||||
|
port = (short)atoi(ports);
|
||||||
|
#elif USE_UNIX_DOMAIN_SOCKETS
|
||||||
port = (short)atoi(ports);
|
port = (short)atoi(ports);
|
||||||
#else
|
#else
|
||||||
port = htons((short)atoi(ports));
|
port = htons((short)atoi(ports));
|
||||||
@ -1710,10 +1677,16 @@ DoCmds(master, pports, cmdi)
|
|||||||
#endif
|
#endif
|
||||||
#if HAVE_GSSAPI
|
#if HAVE_GSSAPI
|
||||||
if ((toksize = CanGetGSSContext(server)) > 0) {
|
if ((toksize = CanGetGSSContext(server)) > 0) {
|
||||||
|
if (toksize > MAX_GSSAPI_TOKSIZE) {
|
||||||
|
Error("Maximum support GSSAPI token size is %lu, "
|
||||||
|
"GSSAPI context creation reported %lu. "
|
||||||
|
"Server will reject authentication.",
|
||||||
|
MAX_GSSAPI_TOKSIZE, toksize);
|
||||||
|
}
|
||||||
FilePrint(pcf, FLAGFALSE, "gssapi %d\r\n", toksize);
|
FilePrint(pcf, FLAGFALSE, "gssapi %d\r\n", toksize);
|
||||||
t = ReadReply(pcf, FLAGFALSE);
|
t = ReadReply(pcf, FLAGFALSE);
|
||||||
if (strcmp(t, "ok\r\n") == 0) {
|
if (strcmp(t, "ok\r\n") == 0) {
|
||||||
if (AttemptGSSAPI(pcf)) {
|
if (AttemptGSSAPI(pcf, toksize)) {
|
||||||
goto gssapi_logged_me_in;
|
goto gssapi_logged_me_in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1808,6 +1781,12 @@ DoCmds(master, pports, cmdi)
|
|||||||
}
|
}
|
||||||
FileWrite(pcf, FLAGFALSE, "exit\r\n", 6);
|
FileWrite(pcf, FLAGFALSE, "exit\r\n", 6);
|
||||||
t = ReadReply(pcf, FLAGTRUE);
|
t = ReadReply(pcf, FLAGTRUE);
|
||||||
|
} else if (interact == FLAGFALSE && result[0] == '[' &&
|
||||||
|
cmdi > 0) {
|
||||||
|
FileClose(&pcf);
|
||||||
|
/* reconnect to same, but with the next command (info, examine, etc) */
|
||||||
|
DoCmds(master, pports, cmdi - 1);
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
/* if we're not trying to connect to a console */
|
/* if we're not trying to connect to a console */
|
||||||
if (interact == FLAGFALSE) {
|
if (interact == FLAGFALSE) {
|
||||||
@ -1912,7 +1891,7 @@ DoCmds(master, pports, cmdi)
|
|||||||
FileClose(&pcf);
|
FileClose(&pcf);
|
||||||
|
|
||||||
/* this would only be true if we got extra redirects (@... above) */
|
/* this would only be true if we got extra redirects (@... above) */
|
||||||
if (cmds[cmdi][0] == 'c' && interact == FLAGTRUE)
|
if (cmds[cmdi][0] == 'c')
|
||||||
DoCmds(server, result, cmdi);
|
DoCmds(server, result, cmdi);
|
||||||
else if (cmdi > 0)
|
else if (cmdi > 0)
|
||||||
DoCmds(server, result, cmdi - 1);
|
DoCmds(server, result, cmdi - 1);
|
||||||
@ -1936,13 +1915,7 @@ DoCmds(master, pports, cmdi)
|
|||||||
* exit happy or sad
|
* exit happy or sad
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
#else
|
|
||||||
main(argc, argv)
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char *pcCmd;
|
char *pcCmd;
|
||||||
struct passwd *pwdMe = (struct passwd *)0;
|
struct passwd *pwdMe = (struct passwd *)0;
|
||||||
@ -1950,7 +1923,7 @@ main(argc, argv)
|
|||||||
int fLocal;
|
int fLocal;
|
||||||
static STRING *acPorts = (STRING *)0;
|
static STRING *acPorts = (STRING *)0;
|
||||||
static char acOpts[] =
|
static char acOpts[] =
|
||||||
"7aAb:B:c:C:d:De:EfFhiIl:M:np:PqQrRsSt:uUvVwWxz:Z:";
|
"7aAb:B:c:C:d:De:EfFhikIl:M:np:PqQrRsSt:uUvVwWxz:Z:";
|
||||||
extern int optind;
|
extern int optind;
|
||||||
extern int optopt;
|
extern int optopt;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
@ -2080,6 +2053,10 @@ main(argc, argv)
|
|||||||
pcCmd = "info";
|
pcCmd = "info";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'k':
|
||||||
|
optConf->exitdown = FLAGTRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
if ((optConf->username = StrDup(optarg)) == (char *)0)
|
if ((optConf->username = StrDup(optarg)) == (char *)0)
|
||||||
OutOfMem();
|
OutOfMem();
|
||||||
@ -2233,8 +2210,9 @@ main(argc, argv)
|
|||||||
Version();
|
Version();
|
||||||
Bye(EX_OK);
|
Bye(EX_OK);
|
||||||
}
|
}
|
||||||
|
#if !USE_IPV6
|
||||||
ProbeInterfaces(INADDR_ANY);
|
ProbeInterfaces(INADDR_ANY);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (readSystemConf)
|
if (readSystemConf)
|
||||||
ReadConf(CLIENTCONFIGFILE, FLAGFALSE);
|
ReadConf(CLIENTCONFIGFILE, FLAGFALSE);
|
||||||
@ -2276,6 +2254,13 @@ main(argc, argv)
|
|||||||
else
|
else
|
||||||
config->striphigh = FLAGFALSE;
|
config->striphigh = FLAGFALSE;
|
||||||
|
|
||||||
|
if (optConf->exitdown != FLAGUNKNOWN)
|
||||||
|
config->exitdown = optConf->exitdown;
|
||||||
|
else if (pConfig->exitdown != FLAGUNKNOWN)
|
||||||
|
config->exitdown = pConfig->exitdown;
|
||||||
|
else
|
||||||
|
config->exitdown = FLAGFALSE;
|
||||||
|
|
||||||
if (optConf->escape != (char *)0)
|
if (optConf->escape != (char *)0)
|
||||||
ParseEsc(optConf->escape);
|
ParseEsc(optConf->escape);
|
||||||
else if (pConfig->escape != (char *)0)
|
else if (pConfig->escape != (char *)0)
|
||||||
@ -2488,11 +2473,11 @@ main(argc, argv)
|
|||||||
#if defined(TIOCGWINSZ)
|
#if defined(TIOCGWINSZ)
|
||||||
if (interact == FLAGTRUE) {
|
if (interact == FLAGTRUE) {
|
||||||
int fd;
|
int fd;
|
||||||
#if HAVE_MEMSET
|
# if HAVE_MEMSET
|
||||||
memset((void *)(&ws), '\000', sizeof(ws));
|
memset((void *)(&ws), '\000', sizeof(ws));
|
||||||
#else
|
# else
|
||||||
bzero((char *)(&ws), sizeof(ws));
|
bzero((char *)(&ws), sizeof(ws));
|
||||||
#endif
|
# endif
|
||||||
if ((fd = open("/dev/tty", O_RDONLY)) != -1) {
|
if ((fd = open("/dev/tty", O_RDONLY)) != -1) {
|
||||||
ioctl(fd, TIOCGWINSZ, &ws);
|
ioctl(fd, TIOCGWINSZ, &ws);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
.\" $Id: console.man,v 1.65 2013/09/25 22:10:30 bryan Exp $
|
.TH CONSOLE 1 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver"
|
||||||
.TH CONSOLE 1 "2013/09/25" "conserver-8.1.19" "conserver"
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
console \- console server client program
|
console \- console server client program
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -29,7 +28,7 @@ console \- console server client program
|
|||||||
.IR cmd ]
|
.IR cmd ]
|
||||||
.PP
|
.PP
|
||||||
.IR generic-args :
|
.IR generic-args :
|
||||||
.RB [ \-7DEnUv ]
|
.RB [ \-7DEknUv ]
|
||||||
.RB [ \-c
|
.RB [ \-c
|
||||||
.IR cred ]
|
.IR cred ]
|
||||||
.RB [ \-C
|
.RB [ \-C
|
||||||
@ -179,6 +178,10 @@ Same as
|
|||||||
.B \-i
|
.B \-i
|
||||||
but just acts on the primary server.
|
but just acts on the primary server.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-k
|
||||||
|
Abort the connection if the console is not in the `up' state immediately
|
||||||
|
upon connecting.
|
||||||
|
.TP
|
||||||
.BI \-l user
|
.BI \-l user
|
||||||
Set the login name used for authentication to
|
Set the login name used for authentication to
|
||||||
.IR user .
|
.IR user .
|
||||||
@ -857,7 +860,7 @@ list the break sequences available
|
|||||||
.B l0
|
.B l0
|
||||||
send the break sequence associated with this console
|
send the break sequence associated with this console
|
||||||
.TP
|
.TP
|
||||||
.B l1-9
|
.B l1-9a-z
|
||||||
send the specific break sequence
|
send the specific break sequence
|
||||||
.TP
|
.TP
|
||||||
.B m
|
.B m
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: getpassword.c,v 1.8 2003/11/20 13:56:41 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -31,12 +29,7 @@ static STRING *pass = (STRING *)0;
|
|||||||
* we really use cbreak at PUCC because we need even parity...
|
* we really use cbreak at PUCC because we need even parity...
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
C2Raw(int fd)
|
C2Raw(int fd)
|
||||||
#else
|
|
||||||
C2Raw(fd)
|
|
||||||
int fd;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
struct termios n_tios;
|
struct termios n_tios;
|
||||||
|
|
||||||
@ -64,12 +57,7 @@ C2Raw(fd)
|
|||||||
* put the tty back as it was, however that was
|
* put the tty back as it was, however that was
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
#if PROTOTYPES
|
|
||||||
C2Normal(int fd)
|
C2Normal(int fd)
|
||||||
#else
|
|
||||||
C2Normal(fd)
|
|
||||||
int fd;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (!screwy)
|
if (!screwy)
|
||||||
return;
|
return;
|
||||||
@ -78,12 +66,7 @@ C2Normal(fd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
#if PROTOTYPES
|
|
||||||
GetPassword(char *prompt)
|
GetPassword(char *prompt)
|
||||||
#else
|
|
||||||
GetPassword(prompt)
|
|
||||||
char *prompt;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int nc;
|
int nc;
|
||||||
@ -140,11 +123,7 @@ GetPassword(prompt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ClearPassword(void)
|
ClearPassword(void)
|
||||||
#else
|
|
||||||
ClearPassword()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (pass == (STRING *)0 || pass->allocated == 0)
|
if (pass == (STRING *)0 || pass->allocated == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: getpassword.h,v 1.3 2003/09/11 09:10:58 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern char *GetPassword PARAMS((char *));
|
extern char *GetPassword(char *);
|
||||||
extern void *ClearPassword PARAMS((void));
|
extern void *ClearPassword(void);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: readconf.c,v 5.7 2013/09/18 14:31:39 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -19,12 +17,7 @@ TERM *parserTermDefault = (TERM *)0;
|
|||||||
TERM *pTerm = (TERM *)0;
|
TERM *pTerm = (TERM *)0;
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DestroyConfig(CONFIG *c)
|
DestroyConfig(CONFIG *c)
|
||||||
#else
|
|
||||||
DestroyConfig(c)
|
|
||||||
CONFIG *c;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (c == (CONFIG *)0)
|
if (c == (CONFIG *)0)
|
||||||
return;
|
return;
|
||||||
@ -48,12 +41,7 @@ DestroyConfig(c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ApplyConfigDefault(CONFIG *c)
|
ApplyConfigDefault(CONFIG *c)
|
||||||
#else
|
|
||||||
ApplyConfigDefault(c)
|
|
||||||
CONFIG *c;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (parserConfigDefault == (CONFIG *)0)
|
if (parserConfigDefault == (CONFIG *)0)
|
||||||
return;
|
return;
|
||||||
@ -121,12 +109,7 @@ ApplyConfigDefault(c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigBegin(char *id)
|
ConfigBegin(char *id)
|
||||||
#else
|
|
||||||
ConfigBegin(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigBegin(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigBegin(%s) [%s:%d]", id, file, line));
|
||||||
if (id == (char *)0 || id[0] == '\000') {
|
if (id == (char *)0 || id[0] == '\000') {
|
||||||
@ -144,11 +127,7 @@ ConfigBegin(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigEnd(void)
|
ConfigEnd(void)
|
||||||
#else
|
|
||||||
ConfigEnd()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigEnd() [%s:%d]", file, line));
|
CONDDEBUG((1, "ConfigEnd() [%s:%d]", file, line));
|
||||||
|
|
||||||
@ -170,11 +149,7 @@ ConfigEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigAbort(void)
|
ConfigAbort(void)
|
||||||
#else
|
|
||||||
ConfigAbort()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigAbort() [%s:%d]", file, line));
|
CONDDEBUG((1, "ConfigAbort() [%s:%d]", file, line));
|
||||||
if (parserConfigTemp == (CONFIG *)0)
|
if (parserConfigTemp == (CONFIG *)0)
|
||||||
@ -185,11 +160,7 @@ ConfigAbort()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigDestroy(void)
|
ConfigDestroy(void)
|
||||||
#else
|
|
||||||
ConfigDestroy()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigDestroy() [%s:%d]", file, line));
|
CONDDEBUG((1, "ConfigDestroy() [%s:%d]", file, line));
|
||||||
|
|
||||||
@ -206,12 +177,7 @@ ConfigDestroy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
DestroyTerminal(TERM *t)
|
DestroyTerminal(TERM *t)
|
||||||
#else
|
|
||||||
DestroyTerminal(t)
|
|
||||||
TERM *t;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (t == (TERM *)0)
|
if (t == (TERM *)0)
|
||||||
return;
|
return;
|
||||||
@ -227,12 +193,7 @@ DestroyTerminal(t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ApplyTermDefault(TERM *t)
|
ApplyTermDefault(TERM *t)
|
||||||
#else
|
|
||||||
ApplyTermDefault(t)
|
|
||||||
TERM *t;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (parserTermDefault == (TERM *)0)
|
if (parserTermDefault == (TERM *)0)
|
||||||
return;
|
return;
|
||||||
@ -266,12 +227,7 @@ ApplyTermDefault(t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalBegin(char *id)
|
TerminalBegin(char *id)
|
||||||
#else
|
|
||||||
TerminalBegin(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalBegin(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "TerminalBegin(%s) [%s:%d]", id, file, line));
|
||||||
if (id == (char *)0 || id[0] == '\000') {
|
if (id == (char *)0 || id[0] == '\000') {
|
||||||
@ -289,11 +245,7 @@ TerminalBegin(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalEnd(void)
|
TerminalEnd(void)
|
||||||
#else
|
|
||||||
TerminalEnd()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
static char *term = (char *)0;
|
static char *term = (char *)0;
|
||||||
|
|
||||||
@ -323,11 +275,7 @@ TerminalEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalAbort(void)
|
TerminalAbort(void)
|
||||||
#else
|
|
||||||
TerminalAbort()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalAbort() [%s:%d]", file, line));
|
CONDDEBUG((1, "TerminalAbort() [%s:%d]", file, line));
|
||||||
if (parserTermTemp == (TERM *)0)
|
if (parserTermTemp == (TERM *)0)
|
||||||
@ -338,11 +286,7 @@ TerminalAbort()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalDestroy(void)
|
TerminalDestroy(void)
|
||||||
#else
|
|
||||||
TerminalDestroy()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalDestroy() [%s:%d]", file, line));
|
CONDDEBUG((1, "TerminalDestroy() [%s:%d]", file, line));
|
||||||
|
|
||||||
@ -359,13 +303,7 @@ TerminalDestroy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ProcessYesNo(char *id, FLAG *flag)
|
ProcessYesNo(char *id, FLAG *flag)
|
||||||
#else
|
|
||||||
ProcessYesNo(id, flag)
|
|
||||||
char *id;
|
|
||||||
FLAG *flag;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (id == (char *)0 || id[0] == '\000')
|
if (id == (char *)0 || id[0] == '\000')
|
||||||
*flag = FLAGFALSE;
|
*flag = FLAGFALSE;
|
||||||
@ -378,12 +316,7 @@ ProcessYesNo(id, flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemEscape(char *id)
|
ConfigItemEscape(char *id)
|
||||||
#else
|
|
||||||
ConfigItemEscape(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemEscape(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemEscape(%s) [%s:%d]", id, file, line));
|
||||||
|
|
||||||
@ -399,12 +332,7 @@ ConfigItemEscape(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemMaster(char *id)
|
ConfigItemMaster(char *id)
|
||||||
#else
|
|
||||||
ConfigItemMaster(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemMaster(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemMaster(%s) [%s:%d]", id, file, line));
|
||||||
|
|
||||||
@ -420,12 +348,7 @@ ConfigItemMaster(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemPlayback(char *id)
|
ConfigItemPlayback(char *id)
|
||||||
#else
|
|
||||||
ConfigItemPlayback(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -449,12 +372,7 @@ ConfigItemPlayback(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemPort(char *id)
|
ConfigItemPort(char *id)
|
||||||
#else
|
|
||||||
ConfigItemPort(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemPort(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemPort(%s) [%s:%d]", id, file, line));
|
||||||
|
|
||||||
@ -470,12 +388,7 @@ ConfigItemPort(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemReplay(char *id)
|
ConfigItemReplay(char *id)
|
||||||
#else
|
|
||||||
ConfigItemReplay(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -499,12 +412,7 @@ ConfigItemReplay(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemSslcredentials(char *id)
|
ConfigItemSslcredentials(char *id)
|
||||||
#else
|
|
||||||
ConfigItemSslcredentials(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemSslcredentials(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemSslcredentials(%s) [%s:%d]", id, file, line));
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
@ -525,12 +433,7 @@ ConfigItemSslcredentials(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemSslcacertificatefile(char *id)
|
ConfigItemSslcacertificatefile(char *id)
|
||||||
#else
|
|
||||||
ConfigItemSslcacertificatefile(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemSslcacertificatefile(%s) [%s:%d]", id, file,
|
CONDDEBUG((1, "ConfigItemSslcacertificatefile(%s) [%s:%d]", id, file,
|
||||||
line));
|
line));
|
||||||
@ -552,12 +455,7 @@ ConfigItemSslcacertificatefile(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemSslcacertificatepath(char *id)
|
ConfigItemSslcacertificatepath(char *id)
|
||||||
#else
|
|
||||||
ConfigItemSslcacertificatepath(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemSslcacertificatepath(%s) [%s:%d]", id, file,
|
CONDDEBUG((1, "ConfigItemSslcacertificatepath(%s) [%s:%d]", id, file,
|
||||||
line));
|
line));
|
||||||
@ -579,12 +477,7 @@ ConfigItemSslcacertificatepath(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemSslrequired(char *id)
|
ConfigItemSslrequired(char *id)
|
||||||
#else
|
|
||||||
ConfigItemSslrequired(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemSslrequired(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemSslrequired(%s) [%s:%d]", id, file, line));
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
@ -597,12 +490,7 @@ ConfigItemSslrequired(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemSslenabled(char *id)
|
ConfigItemSslenabled(char *id)
|
||||||
#else
|
|
||||||
ConfigItemSslenabled(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemSslenabled(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemSslenabled(%s) [%s:%d]", id, file, line));
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
@ -614,24 +502,14 @@ ConfigItemSslenabled(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemStriphigh(char *id)
|
ConfigItemStriphigh(char *id)
|
||||||
#else
|
|
||||||
ConfigItemStriphigh(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemStriphigh(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemStriphigh(%s) [%s:%d]", id, file, line));
|
||||||
ProcessYesNo(id, &(parserConfigTemp->striphigh));
|
ProcessYesNo(id, &(parserConfigTemp->striphigh));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ConfigItemUsername(char *id)
|
ConfigItemUsername(char *id)
|
||||||
#else
|
|
||||||
ConfigItemUsername(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "ConfigItemUsername(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "ConfigItemUsername(%s) [%s:%d]", id, file, line));
|
||||||
|
|
||||||
@ -649,12 +527,7 @@ ConfigItemUsername(id)
|
|||||||
SUBST *substData = (SUBST *)0;
|
SUBST *substData = (SUBST *)0;
|
||||||
|
|
||||||
SUBSTTOKEN
|
SUBSTTOKEN
|
||||||
#if PROTOTYPES
|
|
||||||
SubstToken(char c)
|
SubstToken(char c)
|
||||||
#else
|
|
||||||
SubstToken(c)
|
|
||||||
char c;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'u':
|
case 'u':
|
||||||
@ -666,14 +539,7 @@ SubstToken(c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
#if PROTOTYPES
|
|
||||||
SubstValue(char c, char **s, int *i)
|
SubstValue(char c, char **s, int *i)
|
||||||
#else
|
|
||||||
SubstValue(c, s, i)
|
|
||||||
char c;
|
|
||||||
char **s;
|
|
||||||
int *i;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
@ -696,11 +562,7 @@ SubstValue(c, s, i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
InitSubstCallback(void)
|
InitSubstCallback(void)
|
||||||
#else
|
|
||||||
InitSubstCallback()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (substData == (SUBST *)0) {
|
if (substData == (SUBST *)0) {
|
||||||
if ((substData = (SUBST *)calloc(1, sizeof(SUBST))) == (SUBST *)0)
|
if ((substData = (SUBST *)calloc(1, sizeof(SUBST))) == (SUBST *)0)
|
||||||
@ -712,12 +574,7 @@ InitSubstCallback()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalItemAttach(char *id)
|
TerminalItemAttach(char *id)
|
||||||
#else
|
|
||||||
TerminalItemAttach(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalItemAttach(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "TerminalItemAttach(%s) [%s:%d]", id, file, line));
|
||||||
|
|
||||||
@ -733,12 +590,7 @@ TerminalItemAttach(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalItemAttachsubst(char *id)
|
TerminalItemAttachsubst(char *id)
|
||||||
#else
|
|
||||||
TerminalItemAttachsubst(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalItemAttachsubst(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "TerminalItemAttachsubst(%s) [%s:%d]", id, file, line));
|
||||||
ProcessSubst(substData, (char **)0, &(parserTermTemp->attachsubst),
|
ProcessSubst(substData, (char **)0, &(parserTermTemp->attachsubst),
|
||||||
@ -746,12 +598,7 @@ TerminalItemAttachsubst(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalItemDetach(char *id)
|
TerminalItemDetach(char *id)
|
||||||
#else
|
|
||||||
TerminalItemDetach(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalItemDetach(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "TerminalItemDetach(%s) [%s:%d]", id, file, line));
|
||||||
|
|
||||||
@ -767,12 +614,7 @@ TerminalItemDetach(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
TerminalItemDetachsubst(char *id)
|
TerminalItemDetachsubst(char *id)
|
||||||
#else
|
|
||||||
TerminalItemDetachsubst(id)
|
|
||||||
char *id;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
CONDDEBUG((1, "TerminalItemDetachsubst(%s) [%s:%d]", id, file, line));
|
CONDDEBUG((1, "TerminalItemDetachsubst(%s) [%s:%d]", id, file, line));
|
||||||
ProcessSubst(substData, (char **)0, &(parserTermTemp->detachsubst),
|
ProcessSubst(substData, (char **)0, &(parserTermTemp->detachsubst),
|
||||||
@ -812,13 +654,7 @@ SECTION sections[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
#if PROTOTYPES
|
|
||||||
ReadConf(char *filename, FLAG verbose)
|
ReadConf(char *filename, FLAG verbose)
|
||||||
#else
|
|
||||||
ReadConf(filename, verbose)
|
|
||||||
char *filename;
|
|
||||||
FLAG verbose;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: readconf.h,v 5.6 2013/09/18 14:31:39 bryan Exp $
|
|
||||||
*
|
|
||||||
* Copyright conserver.com, 2000
|
* Copyright conserver.com, 2000
|
||||||
*
|
*
|
||||||
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
* Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
|
||||||
@ -14,6 +12,7 @@ typedef struct config {
|
|||||||
char *port;
|
char *port;
|
||||||
char *escape;
|
char *escape;
|
||||||
FLAG striphigh;
|
FLAG striphigh;
|
||||||
|
FLAG exitdown;
|
||||||
unsigned short replay;
|
unsigned short replay;
|
||||||
unsigned short playback;
|
unsigned short playback;
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
@ -37,6 +36,6 @@ extern CONFIG *pConfig;
|
|||||||
extern TERM *pTerm;
|
extern TERM *pTerm;
|
||||||
extern SUBST *substData;
|
extern SUBST *substData;
|
||||||
|
|
||||||
extern void ReadConf PARAMS((char *, FLAG));
|
extern void ReadConf(char *, FLAG);
|
||||||
extern void DestroyConfig PARAMS((CONFIG *));
|
extern void DestroyConfig(CONFIG *);
|
||||||
extern void DestroyTerminal PARAMS((TERM *));
|
extern void DestroyTerminal(TERM *);
|
||||||
|
@ -22,7 +22,3 @@ I can't verify that these scripts will work for everyone. Hopefully they
|
|||||||
will be helpful.
|
will be helpful.
|
||||||
|
|
||||||
Bryan Stansell
|
Bryan Stansell
|
||||||
|
|
||||||
#
|
|
||||||
# $Id: README,v 1.4 2003/09/29 14:29:37 bryan Exp $
|
|
||||||
#
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
# platform that doesn't have red hat rpm >= 4.0.2 installed.
|
# platform that doesn't have red hat rpm >= 4.0.2 installed.
|
||||||
#
|
#
|
||||||
|
|
||||||
%define pkg conserver
|
%define pkg conserver
|
||||||
%define ver 8.1.19
|
%define ver
|
||||||
|
|
||||||
# define the name of the machine on which the main conserver
|
# define the name of the machine on which the main conserver
|
||||||
# daemon will be running if you don't want to use the default
|
# daemon will be running if you don't want to use the default
|
||||||
@ -16,10 +16,11 @@
|
|||||||
|
|
||||||
# compile arguments. defaults to 0
|
# compile arguments. defaults to 0
|
||||||
# example: rpmbuild -bb conserver.spec --with openssl
|
# example: rpmbuild -bb conserver.spec --with openssl
|
||||||
%define with_openssl %{?_with_openssl: 1} %{?!_with_openssl: 0}
|
%define with_openssl %{?_with_openssl: 1} %{?!_with_openssl: 0}
|
||||||
%define with_libwrap %{?_with_libwrap: 1} %{?!_with_libwrap: 0}
|
%define with_libwrap %{?_with_libwrap: 1} %{?!_with_libwrap: 0}
|
||||||
%define with_pam %{?_with_pam: 1} %{?!_with_pam: 0}
|
%define with_pam %{?_with_pam: 1} %{?!_with_pam: 0}
|
||||||
%define with_dmalloc %{?_with_dmalloc: 1} %{?!_with_dmalloc: 0}
|
%define with_dmalloc %{?_with_dmalloc: 1} %{?!_with_dmalloc: 0}
|
||||||
|
%define with_freeipmi %{?_with_freeipmi: 1} %{?!_with_freeipmi: 0}
|
||||||
|
|
||||||
# additionally you can use macros logfile pidfile
|
# additionally you can use macros logfile pidfile
|
||||||
# example: rpmbuild -bb conserver.spec --define "pidfile /var/run/conserver/pid"
|
# example: rpmbuild -bb conserver.spec --define "pidfile /var/run/conserver/pid"
|
||||||
@ -34,6 +35,7 @@ URL: http://www.conserver.com/
|
|||||||
Source: http://www.conserver.com/%{pkg}-%{ver}.tar.gz
|
Source: http://www.conserver.com/%{pkg}-%{ver}.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{pkg}-buildroot
|
BuildRoot: %{_tmppath}/%{pkg}-buildroot
|
||||||
%if %{with_openssl}
|
%if %{with_openssl}
|
||||||
|
Requires: openssl
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
%endif
|
%endif
|
||||||
%if %{with_pam}
|
%if %{with_pam}
|
||||||
@ -46,6 +48,10 @@ Requires: tcp_wrappers
|
|||||||
Requires: dmalloc
|
Requires: dmalloc
|
||||||
BuildRequires: dmalloc
|
BuildRequires: dmalloc
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with_freeipmi}
|
||||||
|
Requires: freeipmi
|
||||||
|
BuildRequires: freeipmi-devel
|
||||||
|
%endif
|
||||||
Prefix: %{_prefix}
|
Prefix: %{_prefix}
|
||||||
|
|
||||||
%package server
|
%package server
|
||||||
@ -83,7 +89,7 @@ f="conserver/Makefile.in"
|
|||||||
%{__mv} $f $f.orig
|
%{__mv} $f $f.orig
|
||||||
%{__sed} -e 's/^.*conserver\.rc.*$//' < $f.orig > $f
|
%{__sed} -e 's/^.*conserver\.rc.*$//' < $f.orig > $f
|
||||||
|
|
||||||
%configure %{?_with_openssl} %{?_with_libwrap} %{?_with_dmalloc} %{?_with_pam} %{?logfile: --with-logfile=%{logfile}} %{?pidfile: --with-pidfile=%{pidfile}} %{?master: --with-master=%{master}}
|
%configure %{?_with_openssl} %{?_with_libwrap} %{?_with_dmalloc} %{?_with_freeipmi} %{?_with_pam} %{?logfile: --with-logfile=%{logfile}} %{?pidfile: --with-pidfile=%{pidfile}} %{?master: --with-master=%{master}}
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
PKG="conserver"
|
PKG="conserver"
|
||||||
NAME="Console server and client"
|
NAME="Console server and client"
|
||||||
CATEGORY="system"
|
CATEGORY="system"
|
||||||
VERSION="8.1.19"
|
VERSION=
|
||||||
DESC="Console server and client"
|
DESC="Console server and client"
|
||||||
CLASSES=none
|
CLASSES=none
|
||||||
ARCH=sparc
|
ARCH=sparc
|
||||||
|
22
gen-version
Executable file
22
gen-version
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# awk gets stdin from /dev/null 'cause when autoconf runs this via m4_esyscmd_s,
|
||||||
|
# stdin is closed and awk assumes there will always be an open stdin and you end
|
||||||
|
# up with a bogus message:
|
||||||
|
#
|
||||||
|
# awk: i/o error occurred while closing /dev/stdin
|
||||||
|
# input record number 20, file conserver/version.h
|
||||||
|
# source line number 1
|
||||||
|
#
|
||||||
|
#
|
||||||
|
case "$1" in
|
||||||
|
number)
|
||||||
|
awk '$2=="VERSION_MAJOR"{maj=$NF} $2=="VERSION_MINOR"{min=$NF} $2=="VERSION_REV"{rev=$NF} END{print maj "." min "." rev}' conserver/version.h < /dev/null
|
||||||
|
;;
|
||||||
|
|
||||||
|
date)
|
||||||
|
awk '$2=="VERSION_DATE"{print $NF}' conserver/version.h < /dev/null | tr -d '"'
|
||||||
|
;;
|
||||||
|
esac
|
26
package/README.md
Normal file
26
package/README.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
Testing Locally
|
||||||
|
---------------
|
||||||
|
|
||||||
|
You can run `./package/make-and-stage-release local` and the current code will be
|
||||||
|
packaged into `./build` so anyone can configure and build code in a confined space.
|
||||||
|
|
||||||
|
Creating a new release
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
- Create a new release branch `git checkout -b release-vx.y.z`
|
||||||
|
- Edit `conserver/version.h`
|
||||||
|
- Update `CHANGES` with output of `./package/create-changes vx.y.z..`
|
||||||
|
- Double-check and merge release branch
|
||||||
|
- Run `GITHUB_TOKEN=xxxx ./package/make-and-stage-release` to tag release, create distribution, pgp sign, and push to github
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
|
||||||
|
- autoconf
|
||||||
|
- githubrelease (pypi)
|
||||||
|
- gpg
|
||||||
|
|
||||||
|
Publishing a release
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
- Use github to promote from draft or use the command output from `make-and-stage-release`
|
||||||
|
- Send announcement on mailing lists
|
1327
config.guess → package/config.guess
vendored
Executable file → Normal file
1327
config.guess → package/config.guess
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1795
package/config.sub
vendored
Normal file
1795
package/config.sub
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
package/create-changes
Executable file
10
package/create-changes
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
[ -z "$1" ] && echo "Usage: $0 tag" && exit 1
|
||||||
|
range="$1"
|
||||||
|
date=`./gen-version date`
|
||||||
|
changedate=`date -j -f '%Y/%m/%d' "$date" '+%B %-d, %Y'`
|
||||||
|
echo "version `./gen-version number` ($changedate):"
|
||||||
|
git log --no-merges --pretty=tformat:' - %s (%an <%ae>)' "$range" | tail -r | awk '{if (! l[$0]) {l[$0]++; print}}' | sed -e 's/ *(Bryan Stansell <bryan@conserver.com>)$//'
|
65
package/make-and-stage-release
Executable file
65
package/make-and-stage-release
Executable file
@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case $(sed --help 2>&1) in
|
||||||
|
*GNU*) sed_i () { sed -i "$@"; };;
|
||||||
|
*) sed_i () { sed -i '' "$@"; };;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local=false && [ "$1" = "local" ] && local=true
|
||||||
|
|
||||||
|
[ -f conserver/version.h ] || { echo "you are in the wrong place" ; exit 1; }
|
||||||
|
|
||||||
|
ver=`./gen-version number`
|
||||||
|
|
||||||
|
if ! $local; then
|
||||||
|
echo "Ready to tag release v$ver (y/N)?"
|
||||||
|
read i
|
||||||
|
if [ "$i" = "y" ]; then
|
||||||
|
echo "Adding git tag v$ver"
|
||||||
|
git tag -a -m "Release $ver" v$ver
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ../conserver-$ver.tar.gz ] || $local; then
|
||||||
|
(
|
||||||
|
[ -d build ] && rm -rf build
|
||||||
|
mkdir build
|
||||||
|
archtag=v$ver
|
||||||
|
$local && archtag=HEAD
|
||||||
|
git archive --format=tar.gz --prefix=conserver-$ver/ $archtag | (cd build; tar zxf -)
|
||||||
|
cd build/conserver-$ver
|
||||||
|
../../package/setup-configure
|
||||||
|
rm -rf package
|
||||||
|
sed_i -e "/^%define ver/s| ver.*| ver $ver|" contrib/redhat-rpm/conserver.spec
|
||||||
|
sed_i -e "/^VERSION=/s|.*|VERSION=\"$ver\"|" contrib/solaris-package/pkginfo
|
||||||
|
)
|
||||||
|
$local && exit
|
||||||
|
echo "Creating ../conserver-$ver.tar.gz"
|
||||||
|
tar zcf ../conserver-$ver.tar.gz -C build conserver-$ver
|
||||||
|
rm -rf build
|
||||||
|
|
||||||
|
[ -f ../conserver-$ver.tar.gz.asc ] && rm ../conserver-$ver.tar.gz.asc
|
||||||
|
fi
|
||||||
|
if [ ! -f ../conserver-$ver.tar.gz.asc ]; then
|
||||||
|
echo "Signing ../conserver-$ver.tar.gz"
|
||||||
|
gpg -ab --local-user bryan@conserver.com ../conserver-$ver.tar.gz
|
||||||
|
fi
|
||||||
|
body="\`\`\`
|
||||||
|
`sed -ne '/^ver/,/^$/p' CHANGES | sed -e '/^$/,$d'`
|
||||||
|
\`\`\`"
|
||||||
|
|
||||||
|
ls -l ../conserver-$ver.tar.gz*
|
||||||
|
echo "Ready to push (y/N)?"
|
||||||
|
read i
|
||||||
|
if [ "$i" = "y" ]; then
|
||||||
|
git push --tags
|
||||||
|
githubrelease release bstansell/conserver create --name conserver-$ver --body "$body" v$ver ../conserver-$ver.tar.gz*
|
||||||
|
echo You can publish this release on the website or with:
|
||||||
|
echo " "githubrelease release bstansell/conserver publish v$ver
|
||||||
|
else
|
||||||
|
echo Ok, here is the command I would have used:
|
||||||
|
echo " "git push --tags
|
||||||
|
echo " "githubrelease release bstansell/conserver create --name conserver-$ver --body \""$body"\" v$ver ../conserver-$ver.tar.gz*
|
||||||
|
fi
|
15
package/run-gindent
Executable file
15
package/run-gindent
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
gindent -npro -i4 -ip4 -cli4 -br -brs -cdw -ce -npcs -ncs -nhnl -l75 -lc75 -nbbo -ppi1 `
|
||||||
|
echo -T SOCKADDR_STYPE
|
||||||
|
echo -T INADDR_STYPE
|
||||||
|
echo -T time_t
|
||||||
|
echo -T X509_STORE_CTX
|
||||||
|
echo -T FILE
|
||||||
|
echo -T SSL
|
||||||
|
echo -T fd_set
|
||||||
|
echo -T pam_handle_t
|
||||||
|
echo -T SSL_CTX
|
||||||
|
echo -T DH
|
||||||
|
sed -ne '/typedef/,/}/p' */*.[ch] | grep '^[ ]*}' | sed -e 's/[ ]*}/-T/' -e 's/;//' | sort -u
|
||||||
|
` */*.[ch]
|
21
package/setup-configure
Executable file
21
package/setup-configure
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
curl -s -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess'
|
||||||
|
curl -s -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub'
|
||||||
|
|
||||||
|
grep ^timestamp config.guess >/dev/null 2>&1 || cp package/config.guess .
|
||||||
|
grep ^timestamp config.sub >/dev/null 2>&1 || cp package/config.sub .
|
||||||
|
|
||||||
|
# We set lang to avoid this with the gcc docker image on cirrus:
|
||||||
|
#
|
||||||
|
# ./package/setup-configure
|
||||||
|
# perl: warning: Setting locale failed.
|
||||||
|
# perl: warning: Please check that your locale settings:
|
||||||
|
# LANGUAGE = (unset),
|
||||||
|
# LC_ALL = (unset),
|
||||||
|
# LANG = "en_US.UTF-8"
|
||||||
|
# are supported and installed on your system.
|
||||||
|
|
||||||
|
LANG=C autoreconf
|
@ -1,3 +1,3 @@
|
|||||||
shellb on at Local
|
shellb on at Local
|
||||||
shella on at Local
|
shella on at Local
|
||||||
shell on at Local
|
shell on at Local
|
||||||
|
@ -1 +1 @@
|
|||||||
shell on at Local
|
shell on at Local
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
[Enter `^Ec?' for help]
|
[Enter `^Ec?' for help]
|
||||||
[help]
|
[help]
|
||||||
. disconnect ; move to another console
|
. disconnect ; move to another console
|
||||||
a attach read/write b send broadcast message
|
a attach read/write b send broadcast message
|
||||||
c toggle flow control d down a console
|
c toggle flow control d down a console
|
||||||
e change escape sequence f force attach read/write
|
e change escape sequence f force attach read/write
|
||||||
g group info i information dump
|
g group info i information dump
|
||||||
L toggle logging on/off l? break sequence list
|
L toggle logging on/off l? break sequence list
|
||||||
l0 send break per config file l1-9 send specific break sequence
|
l0 send break per config file l1-9a-z send specific break sequence
|
||||||
m display the message of the day n write a note to the logfile
|
m display message of the day n write a note to the logfile
|
||||||
o (re)open the tty and log file p playback the last 60 lines
|
o (re)open the tty and log file p playback the last 60 lines
|
||||||
P set number of playback lines r replay the last 20 lines
|
P set number of playback lines r replay the last 20 lines
|
||||||
R set number of replay lines s spy mode (read only)
|
R set number of replay lines s spy mode (read only)
|
||||||
u show host status v show version info
|
u show host status v show version info
|
||||||
w who is on this console x show console baud info
|
w who is on this console x show console baud info
|
||||||
z suspend the connection ! invoke task
|
z suspend the connection ! invoke task
|
||||||
| attach local command ? print this message
|
| attach local command ? print this message
|
||||||
<cr> ignore/abort command ^R replay the last line
|
<cr> ignore/abort command ^R replay the last line
|
||||||
\ooo send character by octal code
|
\ooo send character by octal code
|
||||||
[disconnect]
|
[disconnect]
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
[Enter `^Ec?' for help]
|
[Enter `^Ec?' for help]
|
||||||
[help]
|
[help]
|
||||||
. disconnect ; move to another console
|
. disconnect ; move to another console
|
||||||
a attach read/write b send broadcast message
|
a attach read/write b send broadcast message
|
||||||
c toggle flow control d down a console
|
c toggle flow control d down a console
|
||||||
e change escape sequence f force attach read/write
|
e change escape sequence f force attach read/write
|
||||||
g group info i information dump
|
g group info i information dump
|
||||||
L toggle logging on/off l? break sequence list
|
L toggle logging on/off l? break sequence list
|
||||||
l0 send break per config file l1-9 send specific break sequence
|
l0 send break per config file l1-9a-z send specific break sequence
|
||||||
m display the message of the day n write a note to the logfile
|
m display message of the day n write a note to the logfile
|
||||||
o (re)open the tty and log file p playback the last 60 lines
|
o (re)open the tty and log file p playback the last 60 lines
|
||||||
P set number of playback lines r replay the last 20 lines
|
P set number of playback lines r replay the last 20 lines
|
||||||
R set number of replay lines s spy mode (read only)
|
R set number of replay lines s spy mode (read only)
|
||||||
u show host status v show version info
|
u show host status v show version info
|
||||||
w who is on this console x show console baud info
|
w who is on this console x show console baud info
|
||||||
z suspend the connection ! invoke task
|
z suspend the connection ! invoke task
|
||||||
| attach local command ? print this message
|
| attach local command ? print this message
|
||||||
<cr> ignore/abort command ^R replay the last line
|
<cr> ignore/abort command ^R replay the last line
|
||||||
\ooo send character by octal code
|
\ooo send character by octal code
|
||||||
[disconnect]
|
[disconnect]
|
||||||
|
@ -7,6 +7,9 @@ default * {
|
|||||||
timestamp "";
|
timestamp "";
|
||||||
include full;
|
include full;
|
||||||
}
|
}
|
||||||
|
config * {
|
||||||
|
reinitcheck 1s;
|
||||||
|
}
|
||||||
break 5 {
|
break 5 {
|
||||||
string "\rtest\r";
|
string "\rtest\r";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user