Update NEWS and ChangeLog files master
authorAlexander Barton <alex@barton.de>
Sun, 31 May 2020 17:38:59 +0000 (19:38 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 31 May 2020 17:38:59 +0000 (19:38 +0200)
61 files changed:
.gitignore
.mailmap
.travis.yml
AUTHORS
ChangeLog
INSTALL [deleted file]
INSTALL.md [new file with mode: 0644]
Makefile.am
NEWS
README [deleted file]
README.md [new file with mode: 0644]
config.guess [changed mode: 0644->0755]
config.sub [changed mode: 0644->0755]
configure.ng
contrib/Debian/changelog
contrib/Debian/control
contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
contrib/ngircd.spec
contrib/nglog.sh
doc/HowToRelease.txt
doc/Makefile.am
doc/Platforms.txt
doc/sample-ngircd.conf.tmpl
man/ngircd.8.tmpl
man/ngircd.conf.5.tmpl
src/ngircd/channel.c
src/ngircd/client.c
src/ngircd/conf-ssl.h
src/ngircd/conf.c
src/ngircd/conf.h
src/ngircd/conn-func.c
src/ngircd/conn-func.h
src/ngircd/conn-ssl.c
src/ngircd/conn.c
src/ngircd/conn.h
src/ngircd/irc-info.c
src/ngircd/irc-login.c
src/ngircd/irc-oper.c
src/ngircd/irc-server.c
src/ngircd/ngircd.c
src/portab/portab.h
src/testsuite/Makefile.ng
src/testsuite/cleanup-server3 [new file with mode: 0755]
src/testsuite/connect-ssl-cert1-test.e [new file with mode: 0644]
src/testsuite/connect-ssl-cert2-test.e [new file with mode: 0644]
src/testsuite/join-test.e
src/testsuite/ngircd-test1.conf
src/testsuite/ngircd-test3.conf [new file with mode: 0644]
src/testsuite/prep-server3 [new file with mode: 0755]
src/testsuite/reload-server.sh [new file with mode: 0755]
src/testsuite/reload-server3 [new file with mode: 0755]
src/testsuite/server-login-test.e
src/testsuite/ssl/cert-my-first-domain-tld.pem [new file with mode: 0644]
src/testsuite/ssl/cert-my-second-domain-tld.pem [new file with mode: 0644]
src/testsuite/ssl/dhparams-my-first-domain-tld.pem [new file with mode: 0644]
src/testsuite/ssl/dhparams-my-second-domain-tld.pem [new file with mode: 0644]
src/testsuite/ssl/key-my-first-domain-tld.pem [new file with mode: 0644]
src/testsuite/ssl/key-my-second-domain-tld.pem [new file with mode: 0644]
src/testsuite/start-server3 [new file with mode: 0755]
src/testsuite/stop-server3 [new file with mode: 0755]
src/testsuite/switch-server3 [new file with mode: 0755]

index 0f4768a964fc03bf1c6b7299d1e3ba3cf3834dcb..231ffc4b03abc028bbf7d5b260980121d0c5dcf1 100644 (file)
@@ -44,7 +44,11 @@ src/portab/portabtest
 src/portab/portabtest.exe
 src/testsuite/*.e_
 src/testsuite/channel-test
+src/testsuite/connect-ssl-cert1-test
+src/testsuite/connect-ssl-cert2-test
 src/testsuite/connect-test
+src/testsuite/connect-tls-cert1-test
+src/testsuite/connect-tls-cert2-test
 src/testsuite/invite-test
 src/testsuite/join-test
 src/testsuite/kick-test
@@ -56,13 +60,20 @@ src/testsuite/ngircd-test1.log
 src/testsuite/ngircd-test1.motd
 src/testsuite/ngircd-test2.log
 src/testsuite/ngircd-test2.motd
+src/testsuite/ngircd-test3.log
+src/testsuite/ngircd-test3.motd
 src/testsuite/opless-channel-test
 src/testsuite/server-link-test
 src/testsuite/server-login-test
+src/testsuite/ssl/cert.pem
+src/testsuite/ssl/dhparams.pem
+src/testsuite/ssl/key.pem
 src/testsuite/T-ngircd1
 src/testsuite/T-ngircd1.exe
 src/testsuite/T-ngircd2
 src/testsuite/T-ngircd2.exe
+src/testsuite/T-ngircd3
+src/testsuite/T-ngircd3.exe
 src/testsuite/tests
 src/testsuite/tests-skipped.lst
 src/testsuite/who-test
index 7dfa21bac2e343db367cde5f2560fe5402c019dd..860a23741b5c3fa2ae9b920c103510ac14ac3258 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -6,6 +6,8 @@ Alexander Barton <alex@barton.de> <alex@kfreebsd.barton.de>
 
 Ali Shemiran <ashemira@ucsd.edu>
 
+Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de> <debian.axhn@manchmal.in-ulm.de>
+
 Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> <dana@cs.ucsd.edu>
 Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> <dana+70@cs.ucsd.edu>
 
@@ -14,3 +16,7 @@ DNS <dns@rbose.org>
 Götz Hoffart <goetz@hoffart.de>
 
 LucentW <lucent@zebes.info> <LucentW@users.noreply.github.com>
+
+Michi <michi+ngircd@dataswamp.org>
+
+Sam James <sam@cmpct.info> <11667869+thesamesam@users.noreply.github.com>
index 3b82280a87459972032698c2f41ddb8076f3c891..3131cbb620413c1c83ca9bda07257496f0a7932b 100644 (file)
@@ -1,5 +1,4 @@
 language: c
-sudo: false
 addons:
   apt:
     packages:
diff --git a/AUTHORS b/AUTHORS
index 4c555dbce6689cdbedf6144968fdab2fa856ba51..74cb5a0da8397bdabbfb7109c1d4d6474681d264 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -40,21 +40,27 @@ Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu>
 David Kingston <deathking1337@aim.com>
 DNS <dns@rbose.org>
 Eric Grunow <egrunow@ucsd.edu>
+Fabrice Fontaine <fontaine.fabrice@gmail.com>
 Federico G. Schwindt <fgsch@lodoss.net>
 Gabor Adam Toth <tg@tgbit.net>
 Götz Hoffart <goetz@hoffart.de>
+Hilko Bengen <bengen@hilluzination.de>
 Ian Chard <ian@chard.org>
 Ilja Osthoff <i.osthoff@gmx.net>
 ItsOnlyBinary <ItsOnlyBinary@users.noreply.github.com>
 James Lu <james@overdrivenetworks.com>
 Jari Aalto <jari.aalto@cante.net>
+Johann Hartwig Hauschild <git@hauschild.it>
+JRMU <jrmu@lecturify.com>
 LucentW <lucent@zebes.info>
 Mantas Mikulėnas <grawity@gmail.com>
+Michi <michi+ngircd@dataswamp.org>
 Neale Pickett <neale@woozle.org>
 Peter Powell <petpow@saberuk.com>
 Rolf Eike Beer <eike@sf-mail.de>
 Rosen Penev <rosenp@gmail.com>
 Roy Sindre Norangshol <roy.sindre@norangshol.no>
+Sam James <sam@cmpct.info>
 Scott Perry <scperry@ucsd.edu>
 Sean Reifschneider <jafo-rpms@tummy.com>
 Sebastian Köhler <sebkoehler@whoami.org.uk>
@@ -63,6 +69,7 @@ Tassilo Schweyer <dev@welterde.de>
 Tom Ryder <tom@sanctum.geek.nz>
 Unit 193 <unit193@ubuntu.com>
 William Pitcock <nenolod@dereferenced.org>
+Windree <57554809+Windree@users.noreply.github.com>
 xor <xorboy@gmail.com>
 Yecheng Fu <cofyc.jackson@gmail.com>
 
index 06dc4f8315b8de612fdb474ec21cbac4a0c52bad..75adf7011dbc750190aa1d873d94a5a079678ac1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,129 @@
 
                                -- ChangeLog --
 
+ngIRCd 26
+
+  ngIRCd 26~rc2
+  - ngircd.spec: Fix names of README.md and INSTALL.md, add ".md" extension.
+  - Update description texts in the README.md file, the RPM and Debian package
+    files and the manual page: bring them in line with the updated homepage.
+  - Server-Server protocol: Fix use-after-free when unregistering a directly
+    connected server sending a SQUIT for itself.
+  - Server-Server protocol: Detect bogus SERVER commands lacking a prefix.
+    Thanks Hilko Bengen (hillu) for finding & reporting this as well for the
+    patch & pull request (even if fixed differently).
+    Closes #275.
+  - Fix the PING-PONG logic: In ngIRCd 26~rc1 this was completely broken (while
+    trying to fix timeouts during server handshakes in bigger networks): the
+    daemon never disconnected any stale peers but kept sending out PINGs over
+    and over again ...
+  - Test suite: Add missing files needed to test SSL support to "EXTRA_DIST",
+    so that they are included in distribution archives: in rc1, "make check"
+    fails when using sources from an archive and enabling SSL support.
+    Thanks to Hilko Bengen <bengen@hilluzination.de> for the patch!
+
+  ngIRCd 26~rc1 (2020-05-10)
+  - Tweak & update doc/HowToRelease.txt, .mailmap and AUTHORS files.
+  - Allow up to 512 characters per line in MOTD and help text files (but keep
+    in mind that lines can't get that long, because they have to be prefixed
+    before being sent to the client). But this allows for more fancy MOTDs :-)
+    Closes #271.
+  - Show the actually allowed channel types in the ISUPPORT(005) numeric which
+    are configured by the "AllowedChannelTypes" configuration variable.
+    Closes #273.
+  - Handle commands in the read buffer before reading more data and don't wait
+    for the network in this case: If there are more bytes in the read buffer
+    already than a single valid IRC command can get long (513 bytes), wait for
+    this/those command(s) to be handled first and don't try to read even more
+    data from the network (which most probably would overflow the read buffer
+    of this connection soon).
+  - Update Travis-CI configuration, "sudo" is deprecated.
+  - Log G-/K-Line changes only when not initiated by a server: this prevents
+    the log from becoming spammed during "net bursts".
+  - Update test suite to include SSL tests, including checking for reloading
+    certificates during runtime.
+  - Makefile.am: Replace "make" with "${MAKE}". This fixes warnings like this:
+    "warning: jobserver unavailable: using -j1. Add `+' to parent make rule."
+    Thanks to Sam James (sam_c) <sam@cmpct.info>!
+    Closes #270.
+  - Add support for GnuTLS certificate reload, which is quite handy when using
+    Let's Encrypt, for example. Until now this was only supported when linked
+    with OpenSSL. Thanks a lot, Hilko Bengen <bengen@hilluzination.de>!
+  - Remove deprecated legacy configuration options and related functions that
+    have been marked for removal for quite some time:
+    - PredefChannelsOnly (v22)
+    - NoticeAuth (v24)
+    - NoXXX (v19)
+    - Old '[GLOBAL]' section handling (v19)
+    Thanks to Michi <michi+ngircd@dataswamp.org> for the patch!
+  - Fix recursion bug on write errors: Depending on the stack size, too many
+    clients on the same channel quitting at the same time would trigger a crash
+    due to too many recursive calls to Conn_Close(). Thanks to Michi
+    <michi+ngircd@dataswamp.org> for the patch!
+  - Fix builds using GCC option -fno-common, which is the default starting with
+    GCC 10. Thanks to Michi <michi+ngircd@dataswamp.org> for the patch!
+    Closes #266.
+  - Convert INSTALL and README files to Markdown.
+  - Allow setting arbitrary channel modes in the configuration file by handling
+    them like in MODE commands, and allow multiple "Modes =" lines per [Channel]
+    section. Thanks to Michi <michi+ngircd@dataswamp.org>!
+    Closes #55.
+  - Add "FNC" (forced nick changes) to ISUPPORT(005) numeric. Most probably
+    this doesn't make any difference to any client, but it seems correct.
+    See <http://www.irc.org/tech_docs/005.html> for details.
+  - Reuse old SSL key if loading a new one failed.
+  - Remove outdated OpenBSD/NetBSD systrace.policy.
+  - Enhance handling of command line errors, and return with exit code 0 ("no
+    error") when "--help" or "--version" is used (which resulted in exit code 1,
+    "error" before). Exit with code 2 ("command line error") for all other
+    invalid command line options, and show the error message itself on stderr
+    (instead of stdout and exit code 1, "generic error", as before).
+    This new behaviour is more in line with the GNU "coding standards",
+    see <https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html>.
+  - Fix and update Xcode project: Reference correct contrib/Makefile.am file,
+    correctly sort contrib/nglog.sh and add "ORGANIZATIONNAME" setting.
+  - contrib/ngindent.sh: Add more GNU indent options for better results, and
+    add the ".sh" suffix to bring this script in line with the others in the
+    contrib/ folder.
+  - Add ./contrib/nglog.sh: This script parses the log output of ngircd(8),
+    and colorizes the messages according to their log level. Example usage:
+    ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
+  - Log received signals with their names using strsignal(3), when available.
+  - Make test suite compatible with Haiku OS.
+  - Fix host mask cloaking bug, don't cloak multiple times: Previously, each
+    server would cloak every user's host mask. The problem is that if a network
+    has more than one server, then a user's host mask would get cloaked twice.
+    This patch ensures that a server only cloaks the host mask if it has not yet
+    been cloaked (the period indicates it's still an IP address). Thanks to
+    JRMU <jrmu@lecturify.com> for the patch!
+    Closes #228.
+  - Enlarge buffers of info texts to 128 bytes. This includes:
+    - "Real name" of a client (4th filed of the USER command).
+    - Server info text ("Info" configuration option).
+    - Admin info texts and email address ("AdminInfo1", "AdminInfo2" and
+      "AdminEmail" configuration options).
+    - Network name ("Network" configuration option).
+    The limit was 64 bytes before ...
+    Closes #258.
+  - Streamline handling of invalid and unset server name: Don't exit during
+    runtime (REHASH command, HUP signal), because the server name can't be
+    changed in this case anyway and the new invalid name will be ignored.
+  - Fix and extend documentation: Fix some typos, fix syntax of LINKS and LIST
+    commands, whitespace and spelling fixes, update dependencies and add some
+    more information about IRCv3 support.
+    Thanks to Thanks Windree, Étienne Mollier <etienne.mollier@mailoo.org> and
+    Christoph Biedl <debian.axhn@manchmal.in-ulm.de>.
+    Closes #264.
+  - Slightly reorder startup steps, and enhance logging:
+    - Show name of configuration file at the beginning of start up.
+    - Add a message when ngIRCd is ready, including its host name.
+    - Show name of configuration file on REHASH (SIGHUP), too.
+    - Change level of "done message" to NOTICE, like "starting" & "ready".
+    - Initialize IO functions before channels, connections, clients, ...
+  - configure.ng: OpenSSL can depends on lz or latomic so use pkg-config to
+    find those dependencies and fallback to existing mechanism.
+    Closes #256.
+  - ngircd.conf.5: Fix wording as suggested by lintian.
 
 ngIRCd 25 (2019-01-23)
 
diff --git a/INSTALL b/INSTALL
deleted file mode 100644 (file)
index 1dc75eb..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,370 +0,0 @@
-
-                     ngIRCd - Next Generation IRC Server
-                           http://ngircd.barton.de/
-
-               (c)2001-2020 Alexander Barton and Contributors.
-               ngIRCd is free software and published under the
-                   terms of the GNU General Public License.
-
-                                -- INSTALL --
-
-
-I. Upgrade Information
-~~~~~~~~~~~~~~~~~~~~~~
-
-Differences to version 22.x
-
-- The "NoticeAuth" ngircd.conf configuration variable has been renamed to
-  "NoticeBeforeRegistration". The old "NoticeAuth" variable still works but
-  is deprecated now.
-
-- The default value of the SSL "CipherList" variable has been changed to
-  "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0"
-  (GnuTLS) to disable the old SSLv3 protocol by default.
-  To enable connections of clients still requiring the weak SSLv3 protocol,
-  the "CipherList" must be set to its old value (not recommended!), which
-  was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below.
-
-Differences to version 20.x
-
-- Starting with ngIRCd 21, the ciphers used by SSL are configurable and
-  default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
-  Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT"
-  and "NORMAL" respectively.
-
-- When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
-  the new mask will be KILL'ed. This was not the case with earlier versions
-  that only added the mask but didn't kill already connected users.
-
-- The "PredefChannelsOnly" configuration variable has been superseded by the
-  new "AllowedChannelTypes" variable. It is still supported and translated to
-  the appropriate "AllowedChannelTypes" setting but is deprecated now.
-
-Differences to version 19.x
-
-- Starting with ngIRCd 20, users can "cloak" their hostname only when the
-  configuration variable "CloakHostModeX" (introduced in 19.2) is set.
-  Otherwise, only IRC operators, other servers, and services are allowed to
-  set mode +x. This prevents regular users from changing their hostmask to
-  the name of the IRC server itself, which confused quite a few people ;-)
-
-Differences to version 17.x
-
-- Support for ZeroConf/Bonjour/Rendezvous service registration has been
-  removed. The configuration option "NoZeroconf" is no longer available.
-
-- The structure of ngircd.conf has been cleaned up and three new configuration
-  sections have been introduced: [Limits], [Options], and [SSL].
-  Lots of configuration variables stored in the [Global] section are now
-  deprecated there and should be stored in one of these new sections (but
-  still work in [Global]):
-    "AllowRemoteOper"    -> [Options]
-    "ChrootDir"          -> [Options]
-    "ConnectIPv4"        -> [Options]
-    "ConnectIPv6"        -> [Options]
-    "ConnectRetry"       -> [Limits]
-    "MaxConnections"     -> [Limits]
-    "MaxConnectionsIP"   -> [Limits]
-    "MaxJoins"           -> [Limits]
-    "MaxNickLength"      -> [Limits]
-    "NoDNS"              -> [Options], and renamed to "DNS"
-    "NoIdent"            -> [Options], and renamed to "Ident"
-    "NoPAM"              -> [Options], and renamed to "PAM"
-    "OperCanUseMode"     -> [Options]
-    "OperServerMode"     -> [Options]
-    "PingTimeout"        -> [Limits]
-    "PongTimeout"        -> [Limits]
-    "PredefChannelsOnly" -> [Options]
-    "SSLCertFile"        -> [SSL], and renamed to "CertFile"
-    "SSLDHFile"          -> [SSL], and renamed to "DHFile"
-    "SSLKeyFile"         -> [SSL], and renamed to "KeyFile"
-    "SSLKeyFilePassword" -> [SSL], and renamed to "KeyFilePassword"
-    "SSLPorts"           -> [SSL], and renamed to "Ports"
-    "SyslogFacility"     -> [Options]
-    "WebircPassword"     -> [Options]
-  You should adjust your ngircd.conf and run "ngircd --configtest" to make
-  sure that your settings are correct and up to date!
-
-Differences to version 16.x
-
-- Changes to the "MotdFile" specified in ngircd.conf now require a ngircd
-  configuration reload to take effect (HUP signal, REHASH command).
-
-Differences to version 0.9.x
-
-- The option of the configure script to enable support for Zeroconf/Bonjour/
-  Rendezvous/WhateverItIsNamedToday has been renamed:
-    --with-rendezvous  ->  --with-zeroconf
-
-Differences to version 0.8.x
-
-- The maximum length of passwords has been raised to 20 characters (instead
-  of 8 characters). If your passwords are longer than 8 characters then they
-  are cut at an other position now.
-
-Differences to version 0.6.x
-
-- Some options of the configure script have been renamed:
-    --disable-syslog  ->  --without-syslog
-    --disable-zlib    ->  --without-zlib
-  Please call "./configure --help" to review the full list of options!
-
-Differences to version 0.5.x
-
-- Starting with version 0.6.0, other servers are identified using asynchronous
-  passwords: therefore the variable "Password" in [Server]-sections has been
-  replaced by "MyPassword" and "PeerPassword".
-
-- New configuration variables, section [Global]: MaxConnections, MaxJoins
-  (see example configuration file "doc/sample-ngircd.conf"!).
-
-
-II. Standard Installation
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-ngIRCd is developed for UNIX-based systems, which means that the installation
-on modern UNIX-like systems that are supported by GNU autoconf and GNU
-automake ("configure") should be no problem.
-
-The normal installation procedure after getting (and expanding) the source
-files (using a distribution archive or Git) is as following:
-
-  0) Satisfy prerequisites
-  1) ./autogen.sh  [only necessary when using Git]
-  2) ./configure
-  3) make
-  4) make install
-
-(Please see details below!)
-
-Now the newly compiled executable "ngircd" is installed in its standard
-location, /usr/local/sbin/.
-
-The next step is to configure and afterwards starting the daemon. Please
-have a look at the ngircd(8) and ngircd.conf(5) manual pages for details
-and all possible options -- and don't forget to run "ngircd --configtest"
-to validate your configuration file!
-
-If no previous version of the configuration file exists (the standard name
-is /usr/local/etc/ngircd.conf), a sample configuration file containing all
-possible options will be installed there. You'll find its template in the
-doc/ directory: sample-ngircd.conf.
-
-
-0): Satisfy prerequisites
-
-When building from source, you'll need some other software to build ngIRCd:
-for example a working C compiler, make tool, and a few libraries depending on
-the feature set you want to enable at compile time (like IDENT, SSL, and PAM).
-
-And if you aren't using a distribution archive ("tar.gz" file), but cloned the
-plain source archive, you need a few additional tools to generate the build
-system itself: GNU automake and autoconf, as well as pkg-config.
-
-If you are using one of the "big" operating systems or Linux distributions,
-you can use the following commands to install all the required packages to
-build the sources including all optional features and to run the test suite:
-
-* Red Hat / Fedora based distributions:
-
-  yum install \
-    autoconf automake expect gcc glibc-devel gnutls-devel \
-    libident-devel make pam-devel pkg-config tcp_wrappers-devel telnet zlib-devel
-
-* Debian / Ubuntu based distributions:
-
-  apt-get install \
-    autoconf automake build-essential expect libgnutls28-dev \
-    libident-dev libpam-dev pkg-config libwrap0-dev libz-dev telnet
-
-
-1): "autogen.sh"
-
-The first step, autogen.sh, is ONLY necessary if the "configure" script itself
-isn't already generated. This never happens in official ("stable") releases in
-"tar.gz" archives, but when cloning the source code repository using Git.
-
-This step is therefore only interesting for developers.
-
-autogen.sh produces the Makefile.in's, which are necessary for the configure
-script itself, and some more files for make. To run autogen.sh you'll need
-GNU autoconf, GNU automake and pkg-config: at least autoconf 2.61 and automake
-1.10 are required, newer is better. But don't use automake 1.12 or newer for
-creating distribution archives: it will work but lack "de-ANSI-fication" support
-in the generated Makefile's! Stick with automake 1.11.x for this purpose ...
-So automake 1.11.x and autoconf 2.67+ is recommended.
-
-Again: "end users" do not need this step and neither need GNU autoconf nor GNU
-automake at all!
-
-
-2): "./configure"
-
-The configure-script is used to detect local system dependencies.
-
-In the perfect case, configure should recognize all needed libraries, header
-files and so on. If this shouldn't work, "./configure --help" shows all
-possible options.
-
-In addition, you can pass some command line options to "configure" to enable
-and/or disable some features of ngIRCd. All these options are shown using
-"./configure --help", too.
-
-Compiling a static binary will avoid you the hassle of feeding a chroot dir
-(if you want use the chroot feature). Just do something like:
-  CFLAGS=-static ./configure [--your-options ...]
-Then you can use a void directory as ChrootDir (like OpenSSH's /var/empty).
-
-
-3): "make"
-
-The make command uses the Makefiles produced by configure and compiles the
-ngIRCd daemon.
-
-
-4): "make install"
-
-Use "make install" to install the server and a sample configuration file on
-the local system. Normally, root privileges are necessary to complete this
-step. If there is already an older configuration file present, it won't be
-overwritten.
-
-These files and folders will be installed by default:
-
-- /usr/local/sbin/ngircd: executable server
-- /usr/local/etc/ngircd.conf: sample configuration (if not already present)
-- /usr/local/share/doc/ngircd/: documentation
-- /usr/local/share/man/: manual pages
-
-
-III. Additional features
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-The following optional features can be compiled into the daemon by passing
-options to the "configure" script. Most options can handle a <path> argument
-which will be used to search for the required libraries and header files in
-the given paths ("<path>/lib/...", "<path>/include/...") in addition to the
-standard locations.
-
-* Syslog Logging (autodetected by default):
-  --with-syslog[=<path>] / --without-syslog
-
-  Enable (disable) support for logging to "syslog", which should be
-  available on most modern UNIX-like operating systems by default.
-
-* ZLib Compression (autodetected by default):
-  --with-zlib[=<path>] / --without-zlib
-
-  Enable (disable) support for compressed server-server links.
-  The Z compression library ("libz") is required for this option.
-
-* IO Backend (autodetected by default):
-  --with-select[=<path>] / --without-select
-  --with-poll[=<path>] / --without-poll
-  --with-devpoll[=<path>] / --without-devpoll
-  --with-epoll[=<path>] / --without-epoll
-  --with-kqueue[=<path>] / --without-kqueue
-
-  ngIRCd can use different IO "backends": the "old school" select() and poll()
-  API which should be supported by most UNIX-like operating systems, or the
-  more efficient and flexible epoll() (Linux >=2.6), kqueue() (BSD) and
-  /dev/poll APIs.
-  By default the IO backend is autodetected, but you can use "--without-xxx"
-  to disable a more enhanced API.
-  When using the epoll() API, support for select() is compiled in as well by
-  default to enable the binary to run on older Linux kernels (<2.6), too.
-
-* IDENT-Support:
-  --with-ident[=<path>]
-
-  Include support for IDENT ("AUTH") lookups. The "ident" library is
-  required for this option.
-
-* TCP-Wrappers:
-  --with-tcp-wrappers[=<path>]
-
-  Include support for Wietse Venemas "TCP Wrappers" to limit client access
-  to the daemon, for example by using "/etc/hosts.{allow|deny}".
-  The "libwrap" is required for this option.
-
-* PAM:
-  --with-pam[=<path>]
-
-  Enable support for PAM, the Pluggable Authentication Modules library.
-  See doc/PAM.txt for details.
-
-* SSL:
-  --with-openssl[=<path>]
-  --with-gnutls[=<path>]
-
-  Enable support for SSL/TLS using OpenSSL or gnutls libraries.
-  See doc/SSL.txt for details.
-
-* IPv6:
-  --enable-ipv6
-
-  Adds support for version 6 of the Internet Protocol.
-
-
-IV. Useful make-targets
-~~~~~~~~~~~~~~~~~~~~~~~
-
-The Makefile produced by the configure-script contains always these useful
-targets:
-
- - clean: delete every product from the compiler/linker
-   next step: -> make
-
- - distclean: the above plus erase all generated Makefiles
-   next step: -> ./configure
-
- - maintainer-clean: erase all automatic generated files
-   next step: -> ./autogen.sh
-
-
-V. Sample configuration file ngircd.conf
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In the sample configuration file, there are comments beginning with "#" OR
-";" -- this is only for the better understanding of the file.
-
-The file is separated in five blocks: [Global], [Features], [Operator],
-[Server], and [Channel].
-
-In the [Global] section, there is the main configuration like the server
-name and the ports, on which the server should be listening. Options in
-the [Features] section enable or disable functionality in the daemon.
-IRC operators of this server are defined in [Operator] blocks, remote
-servers are configured in [Server] sections, and [Channel] blocks are
-used to configure pre-defined ("persistent") IRC channels.
-
-The meaning of the variables in the configuration file is explained in the
-"doc/sample-ngircd.conf", which is used as sample configuration file in
-/usr/local/etc after running "make install" (if you don't already have one)
-and in the ngircd.conf(5) manual page.
-
-
-VI. Command line options
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-These parameters could be passed to the ngIRCd:
-
--f, --config <file>
-       The daemon uses the file <file> as configuration file rather than
-       the standard configuration /usr/local/etc/ngircd.conf.
-
--n, --nodaemon
-       ngIRCd should be running as a foreground process.
-
--p, --passive
-       Server-links won't be automatically established.
-
--t, --configtest
-       Reads, validates and dumps the configuration file as interpreted
-       by the server. Then exits.
-
-Use "--help" to see a short help text describing all available parameters
-the server understands, with "--version" the ngIRCd shows its version
-number. In both cases the server exits after the output.
-
-Please see the ngircd(8) manual page for complete details!
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644 (file)
index 0000000..5d521b5
--- /dev/null
@@ -0,0 +1,411 @@
+# [ngIRCd](https://ngircd.barton.de) - Internet Relay Chat Server
+
+This document explains how to install ngIRCd, the lightweight Internet Relay
+Chat (IRC) server.
+
+The first section lists noteworthy changes to earlier releases; you definitely
+should read this when upgrading your setup! But you can skip over this section
+when you do a fresh installation.
+
+All the subsequent sections describe the steps required to install and
+configure ngIRCd.
+
+## Upgrade Information
+
+Differences to version 25
+
+- **Attention**:
+  All already deprecated legacy options (besides the newly deprecated *Key* and
+  *MaxUsers* settings, see below) were removed in ngIRCd 26, so make sure to
+  update your configuration before upgrading, if you haven't done so already
+  (you got a warning on daemon startup when using deprecated options): you can
+  check your configuration using `ngircd --configtest` -- which is a good idea
+  anyway ;-)
+
+- Setting modes for predefined channels in *[Channel]* sections has been
+  enhanced: now you can set *all* modes, like in IRC "MODE" commands, and have
+  this setting multiple times per *[Channel]* block. Modifying lists (ban list,
+  invite list, exception list) is supported, too.
+
+  Both the *Key* and *MaxUsers* settings are now deprecated and should be
+  replaced by `Modes = +l <limit>` and `Modes = +k <key>` respectively.
+
+Differences to version 22.x
+
+- The *NoticeAuth* `ngircd.conf` configuration variable has been renamed to
+  *NoticeBeforeRegistration*. The old *NoticeAuth* variable still works but
+  is deprecated now.
+
+- The default value of the SSL *CipherList* variable has been changed to
+  "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0"
+  (GnuTLS) to disable the old SSLv3 protocol by default.
+
+  To enable connections of clients still requiring the weak SSLv3 protocol,
+  the *CipherList* must be set to its old value (not recommended!), which
+  was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below.
+
+Differences to version 20.x
+
+- Starting with ngIRCd 21, the ciphers used by SSL are configurable and
+  default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
+  Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT"
+  and "NORMAL" respectively.
+
+- When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
+  the new mask will be KILL'ed. This was not the case with earlier versions
+  that only added the mask but didn't kill already connected users.
+
+- The *PredefChannelsOnly* configuration variable has been superseded by the
+  new *AllowedChannelTypes* variable. It is still supported and translated to
+  the appropriate *AllowedChannelTypes* setting but is deprecated now.
+
+Differences to version 19.x
+
+- Starting with ngIRCd 20, users can "cloak" their hostname only when the
+  configuration variable *CloakHostModeX* (introduced in 19.2) is set.
+  Otherwise, only IRC operators, other servers, and services are allowed to
+  set mode +x. This prevents regular users from changing their hostmask to
+  the name of the IRC server itself, which confused quite a few people ;-)
+
+Differences to version 17.x
+
+- Support for ZeroConf/Bonjour/Rendezvous service registration has been
+  removed. The configuration option *NoZeroconf* is no longer available.
+
+- The structure of `ngircd.conf` has been cleaned up and three new configuration
+  sections have been introduced: *[Limits]*, *[Options]*, and *[SSL]*.
+
+  Lots of configuration variables stored in the *[Global]* section are now
+  deprecated there and should be stored in one of these new sections (but
+  still work in *[Global]*):
+
+  - *AllowRemoteOper*    -> [Options]
+  - *ChrootDir*          -> [Options]
+  - *ConnectIPv4*        -> [Options]
+  - *ConnectIPv6*        -> [Options]
+  - *ConnectRetry*       -> [Limits]
+  - *MaxConnections*     -> [Limits]
+  - *MaxConnectionsIP*   -> [Limits]
+  - *MaxJoins*           -> [Limits]
+  - *MaxNickLength*      -> [Limits]
+  - *NoDNS*              -> [Options], and renamed to *DNS*
+  - *NoIdent*            -> [Options], and renamed to *Ident*
+  - *NoPAM*              -> [Options], and renamed to *PAM*
+  - *OperCanUseMode*     -> [Options]
+  - *OperServerMode*     -> [Options]
+  - *PingTimeout*        -> [Limits]
+  - *PongTimeout*        -> [Limits]
+  - *PredefChannelsOnly* -> [Options]
+  - *SSLCertFile*        -> [SSL], and renamed to *CertFile*
+  - *SSLDHFile*          -> [SSL], and renamed to *DHFile*
+  - *SSLKeyFile*         -> [SSL], and renamed to *KeyFile*
+  - *SSLKeyFilePassword* -> [SSL], and renamed to *KeyFilePassword*
+  - *SSLPorts*           -> [SSL], and renamed to *Ports*
+  - *SyslogFacility*     -> [Options]
+  - *WebircPassword*     -> [Options]
+
+  You should adjust your `ngircd.conf` and run `ngircd --configtest` to make
+  sure that your settings are correct and up to date!
+
+Differences to version 16.x
+
+- Changes to the *MotdFile* specified in `ngircd.conf` now require a ngIRCd
+  configuration reload to take effect (HUP signal, *REHASH* command).
+
+Differences to version 0.9.x
+
+- The option of the configure script to enable support for Zeroconf/Bonjour/
+  Rendezvous/WhateverItIsNamedToday has been renamed:
+
+  - `--with-rendezvous`  ->  `--with-zeroconf`
+
+Differences to version 0.8.x
+
+- The maximum length of passwords has been raised to 20 characters (instead
+  of 8 characters). If your passwords are longer than 8 characters then they
+  are cut at an other position now.
+
+Differences to version 0.6.x
+
+- Some options of the configure script have been renamed:
+
+  - `--disable-syslog`  ->  `--without-syslog`
+  - `--disable-zlib`    ->  `--without-zlib`
+
+  Please call `./configure --help` to review the full list of options!
+
+Differences to version 0.5.x
+
+- Starting with version 0.6.0, other servers are identified using asynchronous
+  passwords: therefore the variable *Password* in *[Server]*-sections has been
+  replaced by *MyPassword* and *PeerPassword*.
+
+- New configuration variables, section *[Global]*: *MaxConnections*, *MaxJoins*
+  (see example configuration file `doc/sample-ngircd.conf`!).
+
+## Standard Installation
+
+*Note*: This sections describes installing ngIRCd *from sources*. If you use
+packages available for your operating system distribution you should skip over
+and continue with the *Configuration* section, see below.
+
+ngIRCd is developed for UNIX-based systems, which means that the installation
+on modern UNIX-like systems that are supported by GNU autoconf and GNU
+automake ("`configure` script") should be no problem.
+
+The normal installation procedure after getting (and expanding) the source
+files (using a distribution archive or Git) is as following:
+
+1) Satisfy prerequisites
+2) `./autogen.sh` [only necessary when using "raw" sources with Git]
+3) `./configure`
+4) `make`
+5) `make install`
+
+(Please see details below!)
+
+Now the newly compiled executable "ngircd" is installed in its standard
+location, `/usr/local/sbin/`.
+
+If no previous version of the configuration file exists (the standard name
+is `/usr/local/etc/ngircd.conf)`, a sample configuration file containing all
+possible options will be installed there. You'll find its template in the
+`doc/` directory: `sample-ngircd.conf`.
+
+The next step is to configure and afterwards start the daemon. See the section
+*Configuration* below.
+
+### Satisfy prerequisites
+
+When building from source, you'll need some other software to build ngIRCd:
+for example a working C compiler, make tool, and a few libraries depending on
+the feature set you want to enable at compile time (like IDENT, SSL, and PAM).
+
+And if you aren't using a distribution archive ("tar.gz" file), but cloned the
+plain source archive, you need a few additional tools to generate the build
+system itself: GNU automake and autoconf, as well as pkg-config.
+
+If you are using one of the "big" operating systems or Linux distributions,
+you can use the following commands to install all the required packages to
+build the sources including all optional features and to run the test suite:
+
+#### Red Hat / Fedora based distributions
+
+``` shell
+  yum install \
+    autoconf automake expect gcc glibc-devel gnutls-devel \
+    libident-devel make pam-devel pkg-config tcp_wrappers-devel \
+    telnet zlib-devel
+```
+
+#### Debian / Ubuntu based distributions
+
+``` shell
+  apt-get install \
+    autoconf automake build-essential expect libgnutls28-dev \
+    libident-dev libpam-dev pkg-config libwrap0-dev libz-dev telnet
+```
+
+### `./autogen.sh`
+
+The first step, to run `./autogen.sh`, is *only* necessary if the `configure`
+script itself isn't already generated and available. This never happens in
+official ("stable") releases in "tar.gz" archives, but when cloning the source
+code repository using Git.
+
+**This step is therefore only interesting for developers!**
+
+The `autogen.sh` script produces the `Makefile.in`'s, which are necessary for
+the configure script itself, and some more files for `make(1)`.
+
+To run `autogen.sh` you'll need GNU autoconf, GNU automake and pkg-config: at
+least autoconf 2.61 and automake 1.10 are required, newer is better. But don't
+use automake 1.12 or newer for creating distribution archives: it will work
+but lack "de-ANSI-fication" support in the generated Makefile's! Stick with
+automake 1.11.x for this purpose ...
+
+So *automake 1.11.x* and *autoconf 2.67+* is recommended.
+
+Again: "end users" do not need this step and neither need GNU autoconf nor GNU
+automake at all!
+
+### `./configure`
+
+The `configure` script is used to detect local system dependencies.
+
+In the perfect case, `configure` should recognize all needed libraries, header
+files and so on. If this shouldn't work, `./configure --help` shows all
+possible options.
+
+In addition, you can pass some command line options to `configure` to enable
+and/or disable some features of ngIRCd. All these options are shown using
+`./configure --help`, too.
+
+Compiling a static binary will avoid you the hassle of feeding a chroot dir
+(if you want use the chroot feature). Just do something like:
+
+``` shell
+  CFLAGS=-static ./configure [--your-options ...]
+```
+
+Then you can use a void directory as ChrootDir (like OpenSSH's `/var/empty`).
+
+### `make`
+
+The `make(1)` command uses the `Makefile`'s produced by `configure` and
+compiles the ngIRCd daemon.
+
+### `make install`
+
+Use `make install` to install the server and a sample configuration file on
+the local system. Normally, root privileges are necessary to complete this
+step. If there is already an older configuration file present, it won't be
+overwritten.
+
+These files and folders will be installed by default:
+
+- `/usr/local/sbin/ngircd`: executable server
+- `/usr/local/etc/ngircd.conf`: sample configuration (if not already present)
+- `/usr/local/share/doc/ngircd/`: documentation
+- `/usr/local/share/man/`: manual pages
+
+### Additional features
+
+The following optional features can be compiled into the daemon by passing
+options to the `configure` script. Most options can handle a `<path>` argument
+which will be used to search for the required libraries and header files in
+the given paths (`<path>/lib/...`, `<path>/include/...`) in addition to the
+standard locations.
+
+- Syslog Logging (autodetected by default):
+
+  `--with-syslog[=<path>]` / `--without-syslog`
+
+  Enable (disable) support for logging to "syslog", which should be
+  available on most modern UNIX-like operating systems by default.
+
+- ZLib Compression (autodetected by default):
+
+  `--with-zlib[=<path>]` / `--without-zlib`
+
+  Enable (disable) support for compressed server-server links.
+  The Z compression library ("libz") is required for this option.
+
+- IO Backend (autodetected by default):
+
+  - `--with-select[=<path>]` / `--without-select`
+  - `--with-poll[=<path>]` / `--without-poll`
+  - `--with-devpoll[=<path>]` / `--without-devpoll`
+  - `--with-epoll[=<path>]` / `--without-epoll`
+  - `--with-kqueue[=<path>]` / `--without-kqueue`
+
+  ngIRCd can use different IO "backends": the "old school" `select(2)` and
+  `poll(2)` API which should be supported by most UNIX-like operating systems,
+  or the more efficient and flexible `epoll(7)` (Linux >=2.6), `kqueue(2)`
+  (BSD) and `/dev/poll` APIs.
+
+  By default the IO backend is autodetected, but you can use `--without-xxx`
+  to disable a more enhanced API.
+
+  When using the `epoll(7)` API, support for `select(2)` is compiled in as
+  well by default, to enable the binary to run on older Linux kernels (<2.6),
+  too.
+
+- IDENT-Support:
+
+  `--with-ident[=<path>]`
+
+  Include support for IDENT ("AUTH") lookups. The "ident" library is
+  required for this option.
+
+- TCP-Wrappers:
+
+  `--with-tcp-wrappers[=<path>]`
+
+  Include support for Wietse Venemas "TCP Wrappers" to limit client access
+  to the daemon, for example by using `/etc/hosts.{allow|deny}`.
+  The "libwrap" is required for this option.
+
+- PAM:
+
+  `--with-pam[=<path>]`
+
+  Enable support for PAM, the Pluggable Authentication Modules library.
+  See `doc/PAM.txt` for details.
+
+- SSL:
+
+  - `--with-openssl[=<path>]`
+  - `--with-gnutls[=<path>]`
+
+  Enable support for SSL/TLS using OpenSSL or GnuTLS libraries.
+  See `doc/SSL.txt` for details.
+
+- IPv6:
+
+  `--enable-ipv6`
+
+  Adds support for version 6 of the Internet Protocol.
+
+## Configuration
+
+Please have a look at the `ngircd(8)` and `ngircd.conf(5)` manual pages for
+details and all possible command line and configuration options -- **and don't
+forget to run `ngircd --configtest` to validate your configuration file!**
+
+After installing ngIRCd, a sample configuration file will be set up (if it
+does not exist already). By default, when installing from sources, the file is
+named `/usr/local/etc/ngircd.conf` (other common names, especially for
+distribution packages, are `/etc/ngircd.conf` or `/etc/ngircd/ngircd.conf`).
+
+You can find the template of the sample configuration file in the `doc/`
+directory as `sample-ngircd.conf` and
+[online](https://ngircd.barton.de/doc/sample-ngircd.conf) on the homepage. It
+contains all available options.
+
+In the sample configuration file, there are comments beginning with `#` *or*
+`;` -- this is only for the better understanding of the file, both comment
+styles are equal.
+
+The file is separated in five blocks: *[Global]*, *[Features]*, *[Operator]*,
+*[Server]*, and *[Channel]*.
+
+In the *[Global]* section, there is the main configuration like the server
+name and the ports, on which the server should be listening. Options in
+the *[Features]* section enable or disable functionality in the daemon.
+IRC operators of this server are defined in *[Operator]* blocks, remote
+servers are configured in *[Server]* sections, and *[Channel]* blocks are
+used to configure pre-defined ("persistent") IRC channels.
+
+### Manual Pages Online
+
+- Daemon: [ngircd.8](https://manpages.debian.org/ngircd.8)
+- Configutation file: [ngircd.conf.5](https://manpages.debian.org/ngircd.conf.5)
+
+## Command line options
+
+ngIRCd supports the following command line options:
+
+- `-f`, `--config <file>`
+
+  The daemon uses the file `<file>` as configuration file rather than
+  the standard configuration `/usr/local/etc/ngircd.conf`.
+
+- `-n`, `--nodaemon`
+
+  ngIRCd should be running as a foreground process.
+
+- `-p`, `--passive`
+
+  Server-links won't be automatically established.
+
+- `-t`, `--configtest`
+
+  Reads, validates and dumps the configuration file as interpreted
+  by the server. Then exits.
+
+Use `--help` to see a short help text describing all available parameters
+the server understands, with `--version` the ngIRCd shows its version
+number. In both cases the server exits after the output.
+
+Please see the `ngircd(8)` manual page for more details!
index d7ff72bc7b3df7ea0da788edf4a5ed964c4b9095..ec9c4447c0b9cf61a826bbffd77fd278385de5de 100644 (file)
@@ -9,11 +9,9 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 
-AUTOMAKE_OPTIONS = gnu
-
 SUBDIRS = doc src man contrib
 
-EXTRA_DIST = autogen.sh configure.ng .clang_complete .mailmap
+EXTRA_DIST = README.md INSTALL.md autogen.sh configure.ng .clang_complete .mailmap
 
 clean-local: osxpkg-clean
        rm -f build-stamp*
@@ -25,13 +23,13 @@ maintainer-clean-local:
        rm -f config.log debian
 
 testsuite:
-       cd src/testsuite && make check
+       cd src/testsuite && ${MAKE} check
 
 lint:
-       cd src/ngircd && make lint
+       cd src/ngircd && ${MAKE} lint
 
 srcdoc:
-       cd doc && make srcdoc
+       cd doc && ${MAKE} srcdoc
 
 have-xcodebuild:
        @xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -list \
@@ -66,7 +64,7 @@ osxpkg: have-packagemaker osxpkg-dest
         --out ../../$(distdir).mpkg
        rm -f $(distdir).mpkg.zip
        zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
-       make osxpkg-clean
+       ${MAKE} osxpkg-clean
 
 osxpkg-clean:
        [ ! -r ngircd.dest ] || sudo -n rm -rf ngircd.dest
@@ -74,12 +72,12 @@ osxpkg-clean:
 
 osxpkg-dest: have-xcodebuild osxpkg-clean clean
        ./configure --prefix=/opt/ngircd
-       make xcode
-       make -C contrib/MacOSX de.barton.ngircd.plist
+       ${MAKE} xcode
+       ${MAKE} -C contrib/MacOSX de.barton.ngircd.plist
        mkdir -p ngircd.dest/opt/ngircd/sbin
-       DESTDIR="$$PWD/ngircd.dest" make -C doc install
-       DESTDIR="$$PWD/ngircd.dest" make -C contrib install
-       DESTDIR="$$PWD/ngircd.dest" make -C man install
+       DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C doc install
+       DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C contrib install
+       DESTDIR="$$PWD/ngircd.dest" ${MAKE} -C man install
        cp contrib/MacOSX/build/Default/ngIRCd \
         ngircd.dest/opt/ngircd/sbin/ngircd
        rm ngircd.dest/opt/ngircd/etc/ngircd.conf
diff --git a/NEWS b/NEWS
index 91f7cc69dea45de009a5c34958cc1594288db704..b3d22706a0c5cdda16fac0c80291370a09f68dec 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,70 @@
 
                                   -- NEWS --
 
+ngIRCd 26
+
+  ngIRCd 26~rc2
+  - Various bug fixes, see the ChangeLog. No new or changed functionality.
+
+  ngIRCd 26~rc1 (2020-05-10)
+  - Allow up to 512 characters per line in MOTD and help text files (but keep
+    in mind that lines can't get that long, because they have to be prefixed
+    before being sent to the client). But this allows for more fancy MOTDs :-)
+    Closes #271.
+  - Show the actually allowed channel types in the ISUPPORT(005) numeric which
+    are configured by the "AllowedChannelTypes" configuration variable.
+    Closes #273.
+  - Handle commands in the read buffer before reading more data and don't wait
+    for the network in this case: If there are more bytes in the read buffer
+    already than a single valid IRC command can get long (513 bytes), wait for
+    this/those command(s) to be handled first and don't try to read even more
+    data from the network (which most probably would overflow the read buffer
+    of this connection soon).
+  - Log G-/K-Line changes only when not initiated by a server: this prevents
+    the log from becoming spammed during "net bursts".
+  - Update test suite to include SSL tests, including checking for reloading
+    certificates during runtime.
+  - Add support for GnuTLS certificate reload, which is quite handy when using
+    Let's Encrypt, for example. Until now this was only supported when linked
+    with OpenSSL. Thanks a lot, Hilko Bengen <bengen@hilluzination.de>!
+  - Allow setting arbitrary channel modes in the configuration file by handling
+    them like in MODE commands, and allow multiple "Modes =" lines per [Channel]
+    section. Thanks to Michi <michi+ngircd@dataswamp.org>!
+    Closes #55.
+  - Add "FNC" (forced nick changes) to ISUPPORT(005) numeric. Most probably
+    this doesn't make any difference to any client, but it seems correct.
+    See <http://www.irc.org/tech_docs/005.html> for details.
+  - Enhance handling of command line errors, and return with exit code 0 ("no
+    error") when "--help" or "--version" is used (which resulted in exit code 1,
+    "error" before). Exit with code 2 ("command line error") for all other
+    invalid command line options, and show the error message itself on stderr
+    (instead of stdout and exit code 1, "generic error", as before).
+    This new behaviour is more in line with the GNU "coding standards",
+    see <https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html>.
+  - Add ./contrib/nglog.sh: This script parses the log output of ngircd(8),
+    and colorizes the messages according to their log level. Example usage:
+    ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
+  - Enlarge buffers of info texts to 128 bytes. This includes:
+    - "Real name" of a client (4th filed of the USER command).
+    - Server info text ("Info" configuration option).
+    - Admin info texts and email address ("AdminInfo1", "AdminInfo2" and
+      "AdminEmail" configuration options).
+    - Network name ("Network" configuration option).
+    The limit was 64 bytes before ...
+    Closes #258.
+  - Streamline handling of invalid and unset server name: Don't exit during
+    runtime (REHASH command, HUP signal), because the server name can't be
+    changed in this case anyway and the new invalid name will be ignored.
+  - Slightly reorder startup steps, and enhance logging:
+    - Show name of configuration file at the beginning of start up.
+    - Add a message when ngIRCd is ready, including its host name.
+    - Show name of configuration file on REHASH (SIGHUP), too.
+    - Change level of "done message" to NOTICE, like "starting" & "ready".
+    - Initialize IO functions before channels, connections, clients, ...
+  - configure.ng: OpenSSL can depends on lz or latomic so use pkg-config to
+    find those dependencies and fallback to existing mechanism.
+    Closes #256.
+
 ngIRCd 25 (2019-01-23)
 
   - Implement new configuration option "MaxPenaltyTime", which configures the
@@ -29,7 +93,7 @@ ngIRCd 25 (2019-01-23)
 
   ngIRCd 25~rc1 (2018-08-11)
   - Only send TOPIC updates to a channel when the topic actually changed:
-    This prevents the channel from becoming flooded by unecessary TOPIC update
+    This prevents the channel from becoming flooded by unnecessary TOPIC update
     messages, that can happen when IRC services try to enforce a certain topic
     but which is already set (at least on the local server), for example.
     Therefore still forward it to all servers, but don't inform local clients
diff --git a/README b/README
deleted file mode 100644 (file)
index e9aadba..0000000
--- a/README
+++ /dev/null
@@ -1,89 +0,0 @@
-
-                     ngIRCd - Next Generation IRC Server
-                           http://ngircd.barton.de/
-
-               (c)2001-2020 Alexander Barton and Contributors.
-               ngIRCd is free software and published under the
-                   terms of the GNU General Public License.
-
-                                -- README --
-
-
-I. Introduction
-~~~~~~~~~~~~~~~
-
-ngIRCd is a free, portable and lightweight Internet Relay Chat server for
-small or private networks, developed under the GNU General Public License
-(GPL; please see the file COPYING for details). It is simple to configure,
-can cope with dynamic IP addresses, and supports IPv6 as well as SSL. It is
-written from scratch and not based on the original IRCd.
-
-The name ngIRCd means next generation IRC daemon, which is a little bit
-exaggerated: lightweight Internet Relay Chat server most probably would be a
-better name :-)
-
-Please see the INSTALL document for installation and upgrade information!
-
-
-II. Status
-~~~~~~~~~~~
-
-ngIRCd should be quite feature complete and stable to be used as daemon in
-real world IRC networks.
-
-It is not the goal of ngIRCd to implement all the nasty behaviors of the
-original ircd, but to implement most of the useful commands and semantics
-specified by the RFCs that are used by existing clients.
-
-
-III. Features (or: why use ngIRCd?)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-- Well arranged (lean) configuration file.
-- Simple to build, install, configure, and maintain.
-- Supports IPv6 and SSL.
-- Can use PAM for user authentication.
-- Lots of popular user and channel modes are implemented.
-- Supports "cloaking" of users.
-- No problems with servers that have dynamic IP addresses.
-- Freely available, modern, portable and tidy C source.
-- Wide field of supported platforms, including AIX, A/UX, FreeBSD, HP-UX,
-  IRIX, Linux, Mac OS X, NetBSD, OpenBSD, Solaris, and Windows with Cygwin.
-- ngIRCd is being actively developed since 2001.
-
-
-IV. Documentation
-~~~~~~~~~~~~~~~~~
-
-More documentation can be found in the "doc/" directory and the homepage of
-ngIRCd: <http://ngircd.barton.de/>.
-
-
-V. Download
-~~~~~~~~~~~
-
-The homepage of the ngIRCd is <http://ngircd.barton.de/>; you will find
-the newest information about the ngIRCd and the most recent ("stable")
-releases there.
-
-Visit our source code repository at GitHub if you are interested in the
-latest development version: <https://github.com/ngircd/ngircd>.
-
-
-VI. Problems, Bugs, Patches
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Please don't hesitate to contact us if you encounter problems:
-
-- On IRC: <irc://irc.barton.de/ngircd>
-- Via the mailing list: <ngircd-ml@ngircd.barton.de>
-
-See <http://ngircd.barton.de/support.php> for details.
-
-If you find bugs in ngIRCd (which will be there most probably ...), please
-report them to our issue tracker at GitHub:
-
-- Bug tracker: <https://github.com/ngircd/ngircd/issues>
-- Patches, "pull requests": <https://github.com/ngircd/ngircd/pulls>
-
-There you can read about known bugs and limitations, too.
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..f0856d7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,78 @@
+# [ngIRCd](https://ngircd.barton.de) - Internet Relay Chat Server
+
+## Introduction
+
+*ngIRCd* is a free, portable and lightweight *Internet Relay Chat* ([IRC])
+server for small or private networks, developed under the terms of the GNU
+General Public License ([GPL]); please see the file `COPYING` for licensing
+information.
+
+The server is quite easy to configure, can handle dynamic IP addresses, and
+optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+user authentication as well as character set conversion for legacy clients. The
+server has been written from scratch and is not based on the "forefather", the
+daemon of the IRCNet.
+
+The name ngIRCd means *next-generation IRC daemon*, which is a little bit
+exaggerated: *lightweight Internet Relay Chat server* most probably would have
+been a better name :-)
+
+Please see the `INSTALL.md` document for installation and upgrade information,
+online available here: <https://ngircd.barton.de/doc/INSTALL.md>!
+
+## Status
+
+ngIRCd should be quite feature-complete and stable to be used as a daemon in
+real-world IRC networks.
+
+It is not the goal of ngIRCd to implement all the nasty behaviors of the
+original ircd, but to implement most of the useful commands and semantics
+specified by the RFCs that are used by existing clients.
+
+## Features (or: why use ngIRCd?)
+
+- Well arranged (lean) configuration file.
+- Simple to build, install, configure, and maintain.
+- Supports IPv6 and SSL.
+- Can use PAM for user authentication.
+- Lots of popular user and channel modes are implemented.
+- Supports "cloaking" of users.
+- No problems with servers that have dynamic IP addresses.
+- Freely available, modern, portable and tidy C source.
+- Wide field of supported platforms, including AIX, A/UX, FreeBSD, HP-UX,
+  IRIX, Linux, macOS, NetBSD, OpenBSD, Solaris, and Windows with Cygwin.
+- ngIRCd is being actively developed since 2001.
+
+## Documentation
+
+The **homepage** of the ngIRCd project is <https://ngircd.barton.de>.
+
+More documentation can be found in the `doc/` directory and
+[online](https://ngircd.barton.de/documentation).
+
+## Downloads & Source Code
+
+You can find the latest information about the ngIRCd and the most recent
+stable release on the [news](https://ngircd.barton.de/news) and
+[downloads](https://ngircd.barton.de/download) pages of the homepage.
+
+Visit our source code repository at [GitHub](https://github.com) if you are
+interested in the latest development code: <https://github.com/ngircd/ngircd>.
+
+## Problems, Bugs, Patches
+
+Please don't hesitate to contact us if you encounter problems:
+
+- On IRC: <irc://irc.barton.de/ngircd>
+- Via the mailing list: <ngircd-ml@ngircd.barton.de>
+
+See <http://ngircd.barton.de/support> for details.
+
+If you find any bugs in ngIRCd (which most probably will be there ...), please
+report them to our issue tracker at GitHub:
+
+- Bug tracker: <https://github.com/ngircd/ngircd/issues>
+- Patches, "pull requests": <https://github.com/ngircd/ngircd/pulls>
+
+[IRC]: https://wikipedia.org/wiki/Internet_Relay_Chat
+[GPL]: https://wikipedia.org/wiki/GNU_General_Public_License
old mode 100644 (file)
new mode 100755 (executable)
index 256083a..11fda52
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2018 Free Software Foundation, Inc.
+#   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2018-03-08'
+timestamp='2020-04-26'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2018 Free Software Foundation, Inc.
+Copyright 1992-2020 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > "$dummy.c" ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+    # prevent multiple calls if $tmp is already set
+    test "$tmp" && return 0
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+       { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+       { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+       { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+       ,,)    echo "int x;" > "$dummy.c"
+              for driver in cc gcc c89 c99 ; do
+                  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+                      CC_FOR_BUILD="$driver"
+                      break
+                  fi
+              done
+              if test x"$CC_FOR_BUILD" = x ; then
+                  CC_FOR_BUILD=no_compiler_found
+              fi
+              ;;
+       ,,*)   CC_FOR_BUILD=$CC ;;
+       ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -138,7 +142,7 @@ Linux|GNU|GNU/*)
        # We could probably try harder.
        LIBC=gnu
 
-       eval "$set_cc_for_build"
+       set_cc_for_build
        cat <<-EOF > "$dummy.c"
        #include <features.h>
        #if defined(__UCLIBC__)
@@ -199,7 +203,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
                os=netbsdelf
                ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval "$set_cc_for_build"
+               set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -237,7 +241,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "$machine-${os}${release}${abi}"
+       echo "$machine-${os}${release}${abi-}"
        exit ;;
     *:Bitrig:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -260,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:SolidBSD:*:*)
        echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
        exit ;;
+    *:OS108:*:*)
+       echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
+       exit ;;
     macppc:MirBSD:*:*)
        echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
@@ -269,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:Sortix:*:*)
        echo "$UNAME_MACHINE"-unknown-sortix
        exit ;;
+    *:Twizzler:*:*)
+       echo "$UNAME_MACHINE"-unknown-twizzler
+       exit ;;
     *:Redox:*:*)
        echo "$UNAME_MACHINE"-unknown-redox
        exit ;;
     mips:OSF1:*.*)
-        echo mips-dec-osf1
-        exit ;;
+       echo mips-dec-osf1
+       exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -389,7 +399,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval "$set_cc_for_build"
+       set_cc_for_build
        SUN_ARCH=i386
        # If there is a compiler, see if it is configured for 64-bit objects.
        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -482,7 +492,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo clipper-intergraph-clix"$UNAME_RELEASE"
        exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval "$set_cc_for_build"
+       set_cc_for_build
        sed 's/^        //' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
@@ -579,7 +589,7 @@ EOF
        exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval "$set_cc_for_build"
+               set_cc_for_build
                sed 's/^                //' << EOF > "$dummy.c"
                #include <sys/systemcfg.h>
 
@@ -660,7 +670,7 @@ EOF
                    esac
                fi
                if [ "$HP_ARCH" = "" ]; then
-                   eval "$set_cc_for_build"
+                   set_cc_for_build
                    sed 's/^            //' << EOF > "$dummy.c"
 
                #define _HPUX_SOURCE
@@ -700,7 +710,7 @@ EOF
        esac
        if [ "$HP_ARCH" = hppa2.0w ]
        then
-           eval "$set_cc_for_build"
+           set_cc_for_build
 
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -726,7 +736,7 @@ EOF
        echo ia64-hp-hpux"$HPUX_REV"
        exit ;;
     3050*:HI-UX:*:*)
-       eval "$set_cc_for_build"
+       set_cc_for_build
        sed 's/^        //' << EOF > "$dummy.c"
        #include <unistd.h>
        int
@@ -840,6 +850,17 @@ EOF
     *:BSD/OS:*:*)
        echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
+    arm:FreeBSD:*:*)
+       UNAME_PROCESSOR=`uname -p`
+       set_cc_for_build
+       if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_PCS_VFP
+       then
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+       else
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+       fi
+       exit ;;
     *:FreeBSD:*:*)
        UNAME_PROCESSOR=`/usr/bin/uname -p`
        case "$UNAME_PROCESSOR" in
@@ -881,7 +902,7 @@ EOF
        echo "$UNAME_MACHINE"-pc-uwin
        exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-       echo x86_64-unknown-cygwin
+       echo x86_64-pc-cygwin
        exit ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
@@ -894,8 +915,8 @@ EOF
        # other systems with GNU libc and userland
        echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
        exit ;;
-    i*86:Minix:*:*)
-       echo "$UNAME_MACHINE"-pc-minix
+    *:Minix:*:*)
+       echo "$UNAME_MACHINE"-unknown-minix
        exit ;;
     aarch64:Linux:*:*)
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -905,7 +926,7 @@ EOF
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
          EV56)  UNAME_MACHINE=alphaev56 ;;
          PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -922,7 +943,7 @@ EOF
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arm*:Linux:*:*)
-       eval "$set_cc_for_build"
+       set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
@@ -971,23 +992,51 @@ EOF
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-       eval "$set_cc_for_build"
+       set_cc_for_build
+       IS_GLIBC=0
+       test x"${LIBC}" = xgnu && IS_GLIBC=1
        sed 's/^        //' << EOF > "$dummy.c"
        #undef CPU
-       #undef ${UNAME_MACHINE}
-       #undef ${UNAME_MACHINE}el
+       #undef mips
+       #undef mipsel
+       #undef mips64
+       #undef mips64el
+       #if ${IS_GLIBC} && defined(_ABI64)
+       LIBCABI=gnuabi64
+       #else
+       #if ${IS_GLIBC} && defined(_ABIN32)
+       LIBCABI=gnuabin32
+       #else
+       LIBCABI=${LIBC}
+       #endif
+       #endif
+
+       #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+       CPU=mipsisa64r6
+       #else
+       #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+       CPU=mipsisa32r6
+       #else
+       #if defined(__mips64)
+       CPU=mips64
+       #else
+       CPU=mips
+       #endif
+       #endif
+       #endif
+
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=${UNAME_MACHINE}el
+       MIPS_ENDIAN=el
        #else
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=${UNAME_MACHINE}
+       MIPS_ENDIAN=
        #else
-       CPU=
+       MIPS_ENDIAN=
        #endif
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
-       test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+       test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
        ;;
     mips64el:Linux:*:*)
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -1100,7 +1149,7 @@ EOF
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
+       echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
@@ -1284,38 +1333,39 @@ EOF
        echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
-       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       eval "$set_cc_for_build"
-       if test "$UNAME_PROCESSOR" = unknown ; then
-           UNAME_PROCESSOR=powerpc
+       UNAME_PROCESSOR=`uname -p`
+       case $UNAME_PROCESSOR in
+           unknown) UNAME_PROCESSOR=powerpc ;;
+       esac
+       if command -v xcode-select > /dev/null 2> /dev/null && \
+               ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+           # Avoid executing cc if there is no toolchain installed as
+           # cc will be a stub that puts up a graphical alert
+           # prompting the user to install developer tools.
+           CC_FOR_BUILD=no_compiler_found
+       else
+           set_cc_for_build
        fi
-       if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
-           if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-               if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-                      grep IS_64BIT_ARCH >/dev/null
-               then
-                   case $UNAME_PROCESSOR in
-                       i386) UNAME_PROCESSOR=x86_64 ;;
-                       powerpc) UNAME_PROCESSOR=powerpc64 ;;
-                   esac
-               fi
-               # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
-               if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
-                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-                      grep IS_PPC >/dev/null
-               then
-                   UNAME_PROCESSOR=powerpc
-               fi
+       if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+           if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                  (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                  grep IS_64BIT_ARCH >/dev/null
+           then
+               case $UNAME_PROCESSOR in
+                   i386) UNAME_PROCESSOR=x86_64 ;;
+                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
+               esac
+           fi
+           # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+           if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+                  (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                  grep IS_PPC >/dev/null
+           then
+               UNAME_PROCESSOR=powerpc
            fi
        elif test "$UNAME_PROCESSOR" = i386 ; then
-           # Avoid executing cc on OS X 10.9, as it ships with a stub
-           # that puts up a graphical alert prompting to install
-           # developer tools.  Any system running Mac OS X 10.7 or
-           # later (Darwin 11 and later) is required to have a 64-bit
-           # processor. This is not true of the ARM version of Darwin
-           # that Apple uses in portable devices.
-           UNAME_PROCESSOR=x86_64
+           # uname -m returns i386 or x86_64
+           UNAME_PROCESSOR=$UNAME_MACHINE
        fi
        echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
@@ -1358,6 +1408,7 @@ EOF
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
        # operating systems.
+       # shellcheck disable=SC2154
        if test "$cputype" = 386; then
            UNAME_MACHINE=i386
        else
@@ -1414,8 +1465,148 @@ EOF
     amd64:Isilon\ OneFS:*:*)
        echo x86_64-unknown-onefs
        exit ;;
+    *:Unleashed:*:*)
+       echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+       exit ;;
 esac
 
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+  "4"
+#else
+  ""
+#endif
+  ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+  struct utsname un;
+
+  uname(&un);
+  if (strncmp(un.version, "V2", 2) == 0) {
+    printf ("i386-sequent-ptx2\n"); exit (0);
+  }
+  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+    printf ("i386-sequent-ptx1\n"); exit (0);
+  }
+  printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+  printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+  printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname un;
+  uname (&un);
+  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname *un;
+  uname (&un);
+  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+       { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
 echo "$0: unable to guess system type" >&2
 
 case "$UNAME_MACHINE:$UNAME_SYSTEM" in
@@ -1438,6 +1629,12 @@ copies of config.guess and config.sub with the latest versions from:
   https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
   https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+EOF
+
+year=`echo $timestamp | sed 's,-.*,,'`
+# shellcheck disable=SC2003
+if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
+   cat >&2 <<EOF
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches@gnu.org to
@@ -1465,6 +1662,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
 UNAME_SYSTEM  = "$UNAME_SYSTEM"
 UNAME_VERSION = "$UNAME_VERSION"
 EOF
+fi
 
 exit 1
 
old mode 100644 (file)
new mode 100755 (executable)
index 9ccf09a..973a298
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2018 Free Software Foundation, Inc.
+#   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2018-03-08'
+timestamp='2020-05-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2018 Free Software Foundation, Inc.
+Copyright 1992-2020 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -89,7 +89,7 @@ while test $# -gt 0 ; do
     - )        # Use stdin as input.
        break ;;
     -* )
-       echo "$me: invalid option $1$help"
+       echo "$me: invalid option $1$help" >&2
        exit 1 ;;
 
     *local*)
@@ -110,1223 +110,1164 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
-    if [ "$basic_machine" != "$1" ]
-    then os=`echo "$1" | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray | -microblaze*)
-               os=
-               basic_machine=$1
-               ;;
-       -bluegene*)
-               os=-cnk
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco6)
-               os=-sco5v6
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5v6*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*178)
-               os=-lynxos178
-               ;;
-       -lynx*5)
-               os=-lynxos5
+# Separate into logical components for further validation
+case $1 in
+       *-*-*-*-*)
+               echo Invalid configuration \`"$1"\': more than four components >&2
+               exit 1
                ;;
-       -lynx*)
-               os=-lynxos
+       *-*-*-*)
+               basic_machine=$field1-$field2
+               os=$field3-$field4
                ;;
-       -ptx*)
-               basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
+       *-*-*)
+               # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+               # parts
+               maybe_os=$field2-$field3
+               case $maybe_os in
+                       nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+                       | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+                       | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+                       | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+                       | storm-chaos* | os2-emx* | rtmk-nova*)
+                               basic_machine=$field1
+                               os=$maybe_os
+                               ;;
+                       android-linux)
+                               basic_machine=$field1-unknown
+                               os=linux-android
+                               ;;
+                       *)
+                               basic_machine=$field1-$field2
+                               os=$field3
+                               ;;
+               esac
                ;;
-       -psos*)
-               os=-psos
+       *-*)
+               # A lone config we happen to match not fitting any pattern
+               case $field1-$field2 in
+                       decstation-3100)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       *-*)
+                               # Second component is usually, but not always the OS
+                               case $field2 in
+                                       # Prevent following clause from handling this valid os
+                                       sun*os*)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                                       # Manufacturers
+                                       dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+                                       | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+                                       | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+                                       | convergent* | ncr* | news | 32* | 3600* | 3100* \
+                                       | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+                                       | ultra | tti* | harris | dolphin | highlevel | gould \
+                                       | cbm | ns | masscomp | apple | axis | knuth | cray \
+                                       | microblaze* | sim | cisco \
+                                       | oki | wec | wrs | winbond)
+                                               basic_machine=$field1-$field2
+                                               os=
+                                               ;;
+                                       *)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                               esac
+                       ;;
+               esac
                ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
+       *)
+               # Convert single-component short-hands not valid as part of
+               # multi-component configurations.
+               case $field1 in
+                       386bsd)
+                               basic_machine=i386-pc
+                               os=bsd
+                               ;;
+                       a29khif)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       adobe68k)
+                               basic_machine=m68010-adobe
+                               os=scout
+                               ;;
+                       alliant)
+                               basic_machine=fx80-alliant
+                               os=
+                               ;;
+                       altos | altos3068)
+                               basic_machine=m68k-altos
+                               os=
+                               ;;
+                       am29k)
+                               basic_machine=a29k-none
+                               os=bsd
+                               ;;
+                       amdahl)
+                               basic_machine=580-amdahl
+                               os=sysv
+                               ;;
+                       amiga)
+                               basic_machine=m68k-unknown
+                               os=
+                               ;;
+                       amigaos | amigados)
+                               basic_machine=m68k-unknown
+                               os=amigaos
+                               ;;
+                       amigaunix | amix)
+                               basic_machine=m68k-unknown
+                               os=sysv4
+                               ;;
+                       apollo68)
+                               basic_machine=m68k-apollo
+                               os=sysv
+                               ;;
+                       apollo68bsd)
+                               basic_machine=m68k-apollo
+                               os=bsd
+                               ;;
+                       aros)
+                               basic_machine=i386-pc
+                               os=aros
+                               ;;
+                       aux)
+                               basic_machine=m68k-apple
+                               os=aux
+                               ;;
+                       balance)
+                               basic_machine=ns32k-sequent
+                               os=dynix
+                               ;;
+                       blackfin)
+                               basic_machine=bfin-unknown
+                               os=linux
+                               ;;
+                       cegcc)
+                               basic_machine=arm-unknown
+                               os=cegcc
+                               ;;
+                       convex-c1)
+                               basic_machine=c1-convex
+                               os=bsd
+                               ;;
+                       convex-c2)
+                               basic_machine=c2-convex
+                               os=bsd
+                               ;;
+                       convex-c32)
+                               basic_machine=c32-convex
+                               os=bsd
+                               ;;
+                       convex-c34)
+                               basic_machine=c34-convex
+                               os=bsd
+                               ;;
+                       convex-c38)
+                               basic_machine=c38-convex
+                               os=bsd
+                               ;;
+                       cray)
+                               basic_machine=j90-cray
+                               os=unicos
+                               ;;
+                       crds | unos)
+                               basic_machine=m68k-crds
+                               os=
+                               ;;
+                       da30)
+                               basic_machine=m68k-da30
+                               os=
+                               ;;
+                       decstation | pmax | pmin | dec3100 | decstatn)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       delta88)
+                               basic_machine=m88k-motorola
+                               os=sysv3
+                               ;;
+                       dicos)
+                               basic_machine=i686-pc
+                               os=dicos
+                               ;;
+                       djgpp)
+                               basic_machine=i586-pc
+                               os=msdosdjgpp
+                               ;;
+                       ebmon29k)
+                               basic_machine=a29k-amd
+                               os=ebmon
+                               ;;
+                       es1800 | OSE68k | ose68k | ose | OSE)
+                               basic_machine=m68k-ericsson
+                               os=ose
+                               ;;
+                       gmicro)
+                               basic_machine=tron-gmicro
+                               os=sysv
+                               ;;
+                       go32)
+                               basic_machine=i386-pc
+                               os=go32
+                               ;;
+                       h8300hms)
+                               basic_machine=h8300-hitachi
+                               os=hms
+                               ;;
+                       h8300xray)
+                               basic_machine=h8300-hitachi
+                               os=xray
+                               ;;
+                       h8500hms)
+                               basic_machine=h8500-hitachi
+                               os=hms
+                               ;;
+                       harris)
+                               basic_machine=m88k-harris
+                               os=sysv3
+                               ;;
+                       hp300 | hp300hpux)
+                               basic_machine=m68k-hp
+                               os=hpux
+                               ;;
+                       hp300bsd)
+                               basic_machine=m68k-hp
+                               os=bsd
+                               ;;
+                       hppaosf)
+                               basic_machine=hppa1.1-hp
+                               os=osf
+                               ;;
+                       hppro)
+                               basic_machine=hppa1.1-hp
+                               os=proelf
+                               ;;
+                       i386mach)
+                               basic_machine=i386-mach
+                               os=mach
+                               ;;
+                       isi68 | isi)
+                               basic_machine=m68k-isi
+                               os=sysv
+                               ;;
+                       m68knommu)
+                               basic_machine=m68k-unknown
+                               os=linux
+                               ;;
+                       magnum | m3230)
+                               basic_machine=mips-mips
+                               os=sysv
+                               ;;
+                       merlin)
+                               basic_machine=ns32k-utek
+                               os=sysv
+                               ;;
+                       mingw64)
+                               basic_machine=x86_64-pc
+                               os=mingw64
+                               ;;
+                       mingw32)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       mingw32ce)
+                               basic_machine=arm-unknown
+                               os=mingw32ce
+                               ;;
+                       monitor)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       morphos)
+                               basic_machine=powerpc-unknown
+                               os=morphos
+                               ;;
+                       moxiebox)
+                               basic_machine=moxie-unknown
+                               os=moxiebox
+                               ;;
+                       msdos)
+                               basic_machine=i386-pc
+                               os=msdos
+                               ;;
+                       msys)
+                               basic_machine=i686-pc
+                               os=msys
+                               ;;
+                       mvs)
+                               basic_machine=i370-ibm
+                               os=mvs
+                               ;;
+                       nacl)
+                               basic_machine=le32-unknown
+                               os=nacl
+                               ;;
+                       ncr3000)
+                               basic_machine=i486-ncr
+                               os=sysv4
+                               ;;
+                       netbsd386)
+                               basic_machine=i386-pc
+                               os=netbsd
+                               ;;
+                       netwinder)
+                               basic_machine=armv4l-rebel
+                               os=linux
+                               ;;
+                       news | news700 | news800 | news900)
+                               basic_machine=m68k-sony
+                               os=newsos
+                               ;;
+                       news1000)
+                               basic_machine=m68030-sony
+                               os=newsos
+                               ;;
+                       necv70)
+                               basic_machine=v70-nec
+                               os=sysv
+                               ;;
+                       nh3000)
+                               basic_machine=m68k-harris
+                               os=cxux
+                               ;;
+                       nh[45]000)
+                               basic_machine=m88k-harris
+                               os=cxux
+                               ;;
+                       nindy960)
+                               basic_machine=i960-intel
+                               os=nindy
+                               ;;
+                       mon960)
+                               basic_machine=i960-intel
+                               os=mon960
+                               ;;
+                       nonstopux)
+                               basic_machine=mips-compaq
+                               os=nonstopux
+                               ;;
+                       os400)
+                               basic_machine=powerpc-ibm
+                               os=os400
+                               ;;
+                       OSE68000 | ose68000)
+                               basic_machine=m68000-ericsson
+                               os=ose
+                               ;;
+                       os68k)
+                               basic_machine=m68k-none
+                               os=os68k
+                               ;;
+                       paragon)
+                               basic_machine=i860-intel
+                               os=osf
+                               ;;
+                       parisc)
+                               basic_machine=hppa-unknown
+                               os=linux
+                               ;;
+                       pw32)
+                               basic_machine=i586-unknown
+                               os=pw32
+                               ;;
+                       rdos | rdos64)
+                               basic_machine=x86_64-pc
+                               os=rdos
+                               ;;
+                       rdos32)
+                               basic_machine=i386-pc
+                               os=rdos
+                               ;;
+                       rom68k)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       sa29200)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       sei)
+                               basic_machine=mips-sei
+                               os=seiux
+                               ;;
+                       sequent)
+                               basic_machine=i386-sequent
+                               os=
+                               ;;
+                       sps7)
+                               basic_machine=m68k-bull
+                               os=sysv2
+                               ;;
+                       st2000)
+                               basic_machine=m68k-tandem
+                               os=
+                               ;;
+                       stratus)
+                               basic_machine=i860-stratus
+                               os=sysv4
+                               ;;
+                       sun2)
+                               basic_machine=m68000-sun
+                               os=
+                               ;;
+                       sun2os3)
+                               basic_machine=m68000-sun
+                               os=sunos3
+                               ;;
+                       sun2os4)
+                               basic_machine=m68000-sun
+                               os=sunos4
+                               ;;
+                       sun3)
+                               basic_machine=m68k-sun
+                               os=
+                               ;;
+                       sun3os3)
+                               basic_machine=m68k-sun
+                               os=sunos3
+                               ;;
+                       sun3os4)
+                               basic_machine=m68k-sun
+                               os=sunos4
+                               ;;
+                       sun4)
+                               basic_machine=sparc-sun
+                               os=
+                               ;;
+                       sun4os3)
+                               basic_machine=sparc-sun
+                               os=sunos3
+                               ;;
+                       sun4os4)
+                               basic_machine=sparc-sun
+                               os=sunos4
+                               ;;
+                       sun4sol2)
+                               basic_machine=sparc-sun
+                               os=solaris2
+                               ;;
+                       sun386 | sun386i | roadrunner)
+                               basic_machine=i386-sun
+                               os=
+                               ;;
+                       sv1)
+                               basic_machine=sv1-cray
+                               os=unicos
+                               ;;
+                       symmetry)
+                               basic_machine=i386-sequent
+                               os=dynix
+                               ;;
+                       t3e)
+                               basic_machine=alphaev5-cray
+                               os=unicos
+                               ;;
+                       t90)
+                               basic_machine=t90-cray
+                               os=unicos
+                               ;;
+                       toad1)
+                               basic_machine=pdp10-xkl
+                               os=tops20
+                               ;;
+                       tpf)
+                               basic_machine=s390x-ibm
+                               os=tpf
+                               ;;
+                       udi29k)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       ultra3)
+                               basic_machine=a29k-nyu
+                               os=sym1
+                               ;;
+                       v810 | necv810)
+                               basic_machine=v810-nec
+                               os=none
+                               ;;
+                       vaxv)
+                               basic_machine=vax-dec
+                               os=sysv
+                               ;;
+                       vms)
+                               basic_machine=vax-dec
+                               os=vms
+                               ;;
+                       vsta)
+                               basic_machine=i386-pc
+                               os=vsta
+                               ;;
+                       vxworks960)
+                               basic_machine=i960-wrs
+                               os=vxworks
+                               ;;
+                       vxworks68)
+                               basic_machine=m68k-wrs
+                               os=vxworks
+                               ;;
+                       vxworks29k)
+                               basic_machine=a29k-wrs
+                               os=vxworks
+                               ;;
+                       xbox)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       ymp)
+                               basic_machine=ymp-cray
+                               os=unicos
+                               ;;
+                       *)
+                               basic_machine=$1
+                               os=
+                               ;;
+               esac
                ;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # Some are omitted here because they have special meanings below.
-       1750a | 580 \
-       | a29k \
-       | aarch64 | aarch64_be \
-       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-       | am33_2.0 \
-       | arc | arceb \
-       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-       | avr | avr32 \
-       | ba \
-       | be32 | be64 \
-       | bfin \
-       | c4x | c8051 | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | e2k | epiphany \
-       | fido | fr30 | frv | ft32 \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | hexagon \
-       | i370 | i860 | i960 | ia16 | ia64 \
-       | ip2k | iq2000 \
-       | k1om \
-       | le32 | le64 \
-       | lm32 \
-       | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-       | mips64octeon | mips64octeonel \
-       | mips64orion | mips64orionel \
-       | mips64r5900 | mips64r5900el \
-       | mips64vr | mips64vrel \
-       | mips64vr4100 | mips64vr4100el \
-       | mips64vr4300 | mips64vr4300el \
-       | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
-       | mipsisa32 | mipsisa32el \
-       | mipsisa32r2 | mipsisa32r2el \
-       | mipsisa32r6 | mipsisa32r6el \
-       | mipsisa64 | mipsisa64el \
-       | mipsisa64r2 | mipsisa64r2el \
-       | mipsisa64r6 | mipsisa64r6el \
-       | mipsisa64sb1 | mipsisa64sb1el \
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipsr5900 | mipsr5900el \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
-       | moxie \
-       | mt \
-       | msp430 \
-       | nds32 | nds32le | nds32be \
-       | nios | nios2 | nios2eb | nios2el \
-       | ns16k | ns32k \
-       | open8 | or1k | or1knd | or32 \
-       | pdp10 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle \
-       | pru \
-       | pyramid \
-       | riscv32 | riscv64 \
-       | rl78 | rx \
-       | score \
-       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu \
-       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-       | ubicom32 \
-       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-       | visium \
-       | wasm32 \
-       | x86 | xc16x | xstormy16 | xtensa \
-       | z8k | z80)
-               basic_machine=$basic_machine-unknown
-               ;;
-       c54x)
-               basic_machine=tic54x-unknown
-               ;;
-       c55x)
-               basic_machine=tic55x-unknown
-               ;;
-       c6x)
-               basic_machine=tic6x-unknown
-               ;;
-       leon|leon[3-9])
-               basic_machine=sparc-$basic_machine
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       # Here we handle the default manufacturer of certain CPU types.  It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               cpu=hppa1.1
+               vendor=winbond
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
+       op50n)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-       ms1)
-               basic_machine=mt-unknown
+       op60c)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-
-       strongarm | thumb | xscale)
-               basic_machine=arm-unknown
+       ibm*)
+               cpu=i370
+               vendor=ibm
                ;;
-       xgate)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       orion105)
+               cpu=clipper
+               vendor=highlevel
                ;;
-       xscaleeb)
-               basic_machine=armeb-unknown
+       mac | mpw | mac-mpw)
+               cpu=m68k
+               vendor=apple
                ;;
-
-       xscaleel)
-               basic_machine=armel-unknown
+       pmac | pmac-mpw)
+               cpu=powerpc
+               vendor=apple
                ;;
 
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-       # (2) the word "unknown" tends to confuse beginning users.
-       i*86 | x86_64)
-         basic_machine=$basic_machine-pc
-         ;;
-       # Object if more than one company name word.
-       *-*-*)
-               echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
-               exit 1
-               ;;
-       # Recognize the basic CPU types with company name.
-       580-* \
-       | a29k-* \
-       | aarch64-* | aarch64_be-* \
-       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* | avr32-* \
-       | ba-* \
-       | be32-* | be64-* \
-       | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | c8051-* | clipper-* | craynv-* | cydra-* \
-       | d10v-* | d30v-* | dlx-* \
-       | e2k-* | elxsi-* \
-       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-       | h8300-* | h8500-* \
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | hexagon-* \
-       | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
-       | ip2k-* | iq2000-* \
-       | k1om-* \
-       | le32-* | le64-* \
-       | lm32-* \
-       | m32c-* | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-       | microblaze-* | microblazeel-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-       | mips16-* \
-       | mips64-* | mips64el-* \
-       | mips64octeon-* | mips64octeonel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64r5900-* | mips64r5900el-* \
-       | mips64vr-* | mips64vrel-* \
-       | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* \
-       | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
-       | mipsisa32-* | mipsisa32el-* \
-       | mipsisa32r2-* | mipsisa32r2el-* \
-       | mipsisa32r6-* | mipsisa32r6el-* \
-       | mipsisa64-* | mipsisa64el-* \
-       | mipsisa64r2-* | mipsisa64r2el-* \
-       | mipsisa64r6-* | mipsisa64r6el-* \
-       | mipsisa64sb1-* | mipsisa64sb1el-* \
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipsr5900-* | mipsr5900el-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
-       | mt-* \
-       | msp430-* \
-       | nds32-* | nds32le-* | nds32be-* \
-       | nios-* | nios2-* | nios2eb-* | nios2el-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | open8-* \
-       | or1k*-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-       | pru-* \
-       | pyramid-* \
-       | riscv32-* | riscv64-* \
-       | rl78-* | romp-* | rs6000-* | rx-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-       | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
-       | tahoe-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tile*-* \
-       | tron-* \
-       | ubicom32-* \
-       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-       | vax-* \
-       | visium-* \
-       | wasm32-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* \
-       | xstormy16-* | xtensa*-* \
-       | ymp-* \
-       | z8k-* | z80-*)
-               ;;
-       # Recognize the basic CPU types without company name, with glob match.
-       xtensa*)
-               basic_machine=$basic_machine-unknown
-               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-               basic_machine=i386-pc
-               os=-bsd
-               ;;
        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-               basic_machine=m68000-att
+               cpu=m68000
+               vendor=att
                ;;
        3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       abacus)
-               basic_machine=abacus-unknown
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amd64)
-               basic_machine=x86_64-pc
-               ;;
-       amd64-*)
-               basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aros)
-               basic_machine=i386-pc
-               os=-aros
-               ;;
-       asmjs)
-               basic_machine=asmjs-unknown
-               ;;
-       aux)
-               basic_machine=m68k-apple
-               os=-aux
-               ;;
-       balance)
-               basic_machine=ns32k-sequent
-               os=-dynix
-               ;;
-       blackfin)
-               basic_machine=bfin-unknown
-               os=-linux
-               ;;
-       blackfin-*)
-               basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=we32k
+               vendor=att
                ;;
        bluegene*)
-               basic_machine=powerpc-ibm
-               os=-cnk
-               ;;
-       c54x-*)
-               basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       c55x-*)
-               basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       c6x-*)
-               basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       c90)
-               basic_machine=c90-cray
-               os=-unicos
-               ;;
-       cegcc)
-               basic_machine=arm-unknown
-               os=-cegcc
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       craynv)
-               basic_machine=craynv-cray
-               os=-unicosmp
-               ;;
-       cr16 | cr16-*)
-               basic_machine=cr16-unknown
-               os=-elf
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       crisv32 | crisv32-* | etraxfs*)
-               basic_machine=crisv32-axis
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       crx)
-               basic_machine=crx-unknown
-               os=-elf
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
+               cpu=powerpc
+               vendor=ibm
+               os=cnk
                ;;
        decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
+               cpu=pdp10
+               vendor=dec
+               os=tops10
                ;;
        decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
+               cpu=pdp10
+               vendor=dec
+               os=tops20
                ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
-               ;;
-       dicos)
-               basic_machine=i686-pc
-               os=-dicos
-               ;;
-       djgpp)
-               basic_machine=i586-pc
-               os=-msdosdjgpp
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
+               cpu=m68k
+               vendor=motorola
                ;;
        dpx2*)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       e500v[12])
-               basic_machine=powerpc-unknown
-               os=$os"spe"
-               ;;
-       e500v[12]-*)
-               basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               os=$os"spe"
-               ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
+               cpu=m68k
+               vendor=bull
+               os=sysv3
                ;;
        encore | umax | mmax)
-               basic_machine=ns32k-encore
+               cpu=ns32k
+               vendor=encore
                ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
+       elxsi)
+               cpu=elxsi
+               vendor=elxsi
+               os=${os:-bsd}
                ;;
        fx2800)
-               basic_machine=i860-alliant
+               cpu=i860
+               vendor=alliant
                ;;
        genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
+               cpu=ns32k
+               vendor=ns
                ;;
        h3050r* | hiux*)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       h8300hms)
-               basic_machine=h8300-hitachi
-               os=-hms
-               ;;
-       h8300xray)
-               basic_machine=h8300-hitachi
-               os=-xray
-               ;;
-       h8500hms)
-               basic_machine=h8500-hitachi
-               os=-hms
-               ;;
-       harris)
-               basic_machine=m88k-harris
-               os=-sysv3
-               ;;
-       hp300-*)
-               basic_machine=m68k-hp
-               ;;
-       hp300bsd)
-               basic_machine=m68k-hp
-               os=-bsd
-               ;;
-       hp300hpux)
-               basic_machine=m68k-hp
-               os=-hpux
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
+               cpu=m68000
+               vendor=hp
                ;;
        hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
+               cpu=m68k
+               vendor=hp
                ;;
        hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k78[0-9] | hp78[0-9])
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hppaosf)
-               basic_machine=hppa1.1-hp
-               os=-osf
-               ;;
-       hppro)
-               basic_machine=hppa1.1-hp
-               os=-proelf
-               ;;
-       i370-ibm* | ibm*)
-               basic_machine=i370-ibm
+               cpu=hppa1.0
+               vendor=hp
                ;;
        i*86v32)
-               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv32
                ;;
        i*86v4*)
-               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv4
                ;;
        i*86v)
-               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-               os=-sysv
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv
                ;;
        i*86sol2)
-               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
-               ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=solaris2
                ;;
-       vsta)
-               basic_machine=i386-unknown
-               os=-vsta
+       j90 | j90-cray)
+               cpu=j90
+               vendor=cray
+               os=${os:-unicos}
                ;;
        iris | iris4d)
-               basic_machine=mips-sgi
+               cpu=mips
+               vendor=sgi
                case $os in
-                   -irix*)
+                   irix*)
                        ;;
                    *)
-                       os=-irix4
+                       os=irix4
                        ;;
                esac
                ;;
-       isi68 | isi)
-               basic_machine=m68k-isi
-               os=-sysv
-               ;;
-       leon-*|leon[3-9]-*)
-               basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
-               ;;
-       m68knommu)
-               basic_machine=m68k-unknown
-               os=-linux
-               ;;
-       m68knommu-*)
-               basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               os=-linux
-               ;;
-       magnum | m3230)
-               basic_machine=mips-mips
-               os=-sysv
-               ;;
-       merlin)
-               basic_machine=ns32k-utek
-               os=-sysv
-               ;;
-       microblaze*)
-               basic_machine=microblaze-xilinx
-               ;;
-       mingw64)
-               basic_machine=x86_64-pc
-               os=-mingw64
-               ;;
-       mingw32)
-               basic_machine=i686-pc
-               os=-mingw32
-               ;;
-       mingw32ce)
-               basic_machine=arm-unknown
-               os=-mingw32ce
-               ;;
        miniframe)
-               basic_machine=m68000-convergent
-               ;;
-       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-       mips3*-*)
-               basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
-               ;;
-       mips3*)
-               basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
-               ;;
-       monitor)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       morphos)
-               basic_machine=powerpc-unknown
-               os=-morphos
-               ;;
-       moxiebox)
-               basic_machine=moxie-unknown
-               os=-moxiebox
-               ;;
-       msdos)
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-       ms1-*)
-               basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
-               ;;
-       msys)
-               basic_machine=i686-pc
-               os=-msys
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
-               ;;
-       nacl)
-               basic_machine=le32-unknown
-               os=-nacl
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
+               cpu=m68000
+               vendor=convergent
                ;;
-       netbsd386)
-               basic_machine=i386-unknown
-               os=-netbsd
-               ;;
-       netwinder)
-               basic_machine=armv4l-rebel
-               os=-linux
-               ;;
-       news | news700 | news800 | news900)
-               basic_machine=m68k-sony
-               os=-newsos
-               ;;
-       news1000)
-               basic_machine=m68030-sony
-               os=-newsos
+       *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               cpu=m68k
+               vendor=atari
+               os=mint
                ;;
        news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
+               cpu=mips
+               vendor=sony
+               os=newsos
                ;;
        next | m*-next)
-               basic_machine=m68k-next
+               cpu=m68k
+               vendor=next
                case $os in
-                   -nextstep* )
+                   openstep*)
+                       ;;
+                   nextstep*)
                        ;;
-                   -ns2*)
-                     os=-nextstep2
+                   ns2*)
+                     os=nextstep2
                        ;;
                    *)
-                     os=-nextstep3
+                     os=nextstep3
                        ;;
                esac
                ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
        np1)
-               basic_machine=np1-gould
-               ;;
-       neo-tandem)
-               basic_machine=neo-tandem
-               ;;
-       nse-tandem)
-               basic_machine=nse-tandem
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
-               ;;
-       nsv-tandem)
-               basic_machine=nsv-tandem
-               ;;
-       nsx-tandem)
-               basic_machine=nsx-tandem
+               cpu=np1
+               vendor=gould
                ;;
        op50n-* | op60c-*)
-               basic_machine=hppa1.1-oki
-               os=-proelf
-               ;;
-       openrisc | openrisc-*)
-               basic_machine=or32-unknown
-               ;;
-       os400)
-               basic_machine=powerpc-ibm
-               os=-os400
-               ;;
-       OSE68000 | ose68000)
-               basic_machine=m68000-ericsson
-               os=-ose
-               ;;
-       os68k)
-               basic_machine=m68k-none
-               os=-os68k
+               cpu=hppa1.1
+               vendor=oki
+               os=proelf
                ;;
        pa-hitachi)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       paragon)
-               basic_machine=i860-intel
-               os=-osf
-               ;;
-       parisc)
-               basic_machine=hppa-unknown
-               os=-linux
-               ;;
-       parisc-*)
-               basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        pbd)
-               basic_machine=sparc-tti
+               cpu=sparc
+               vendor=tti
                ;;
        pbb)
-               basic_machine=m68k-tti
+               cpu=m68k
+               vendor=tti
                ;;
-       pc532 | pc532-*)
-               basic_machine=ns32k-pc532
-               ;;
-       pc98)
-               basic_machine=i386-pc
-               ;;
-       pc98-*)
-               basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-       pentiumpro | p6 | 6x86 | athlon | athlon_*)
-               basic_machine=i686-pc
-               ;;
-       pentiumii | pentium2 | pentiumiii | pentium3)
-               basic_machine=i686-pc
-               ;;
-       pentium4)
-               basic_machine=i786-pc
-               ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-               basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       pentium4-*)
-               basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+       pc532)
+               cpu=ns32k
+               vendor=pc532
                ;;
        pn)
-               basic_machine=pn-gould
+               cpu=pn
+               vendor=gould
                ;;
-       power)  basic_machine=power-ibm
+       power)
+               cpu=power
+               vendor=ibm
                ;;
-       ppc | ppcbe)    basic_machine=powerpc-unknown
-               ;;
-       ppc-* | ppcbe-*)
-               basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       ppcle | powerpclittle)
-               basic_machine=powerpcle-unknown
-               ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
+       ps2)
+               cpu=i386
+               vendor=ibm
                ;;
-       ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+       rm[46]00)
+               cpu=mips
+               vendor=siemens
                ;;
-       ppc64le | powerpc64little)
-               basic_machine=powerpc64le-unknown
+       rtpc | rtpc-*)
+               cpu=romp
+               vendor=ibm
                ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+       sde)
+               cpu=mipsisa32
+               vendor=sde
+               os=${os:-elf}
                ;;
-       ps2)
-               basic_machine=i386-ibm
+       simso-wrs)
+               cpu=sparclite
+               vendor=wrs
+               os=vxworks
                ;;
-       pw32)
-               basic_machine=i586-unknown
-               os=-pw32
+       tower | tower-32)
+               cpu=m68k
+               vendor=ncr
                ;;
-       rdos | rdos64)
-               basic_machine=x86_64-pc
-               os=-rdos
+       vpp*|vx|vx-*)
+               cpu=f301
+               vendor=fujitsu
                ;;
-       rdos32)
-               basic_machine=i386-pc
-               os=-rdos
+       w65)
+               cpu=w65
+               vendor=wdc
                ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
+       w89k-*)
+               cpu=hppa1.1
+               vendor=winbond
+               os=proelf
                ;;
-       rm[46]00)
-               basic_machine=mips-siemens
+       none)
+               cpu=none
+               vendor=none
                ;;
-       rtpc | rtpc-*)
-               basic_machine=romp-ibm
+       leon|leon[3-9])
+               cpu=sparc
+               vendor=$basic_machine
                ;;
-       s390 | s390-*)
-               basic_machine=s390-ibm
+       leon-*|leon[3-9]-*)
+               cpu=sparc
+               vendor=`echo "$basic_machine" | sed 's/-.*//'`
                ;;
-       s390x | s390x-*)
-               basic_machine=s390x-ibm
+
+       *-*)
+               # shellcheck disable=SC2162
+               IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
                ;;
-       sa29200)
-               basic_machine=a29k-amd
-               os=-udi
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+               cpu=$basic_machine
+               vendor=pc
                ;;
-       sb1)
-               basic_machine=mipsisa64sb1-unknown
+       # These rules are duplicated from below for sake of the special case above;
+       # i.e. things that normalized to x86 arches should also default to "pc"
+       pc98)
+               cpu=i386
+               vendor=pc
                ;;
-       sb1el)
-               basic_machine=mipsisa64sb1el-unknown
+       x64 | amd64)
+               cpu=x86_64
+               vendor=pc
                ;;
-       sde)
-               basic_machine=mipsisa32-sde
-               os=-elf
+       # Recognize the basic CPU types without company name.
+       *)
+               cpu=$basic_machine
+               vendor=unknown
                ;;
-       sei)
-               basic_machine=mips-sei
-               os=-seiux
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+       # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       craynv-unknown)
+               vendor=cray
+               os=${os:-unicosmp}
                ;;
-       sequent)
-               basic_machine=i386-sequent
+       c90-unknown | c90-cray)
+               vendor=cray
+               os=${os:-unicos}
                ;;
-       sh5el)
-               basic_machine=sh5le-unknown
+       fx80-unknown)
+               vendor=alliant
                ;;
-       simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
+       romp-unknown)
+               vendor=ibm
                ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
+       mmix-unknown)
+               vendor=knuth
                ;;
-       spur)
-               basic_machine=spur-unknown
+       microblaze-unknown | microblazeel-unknown)
+               vendor=xilinx
                ;;
-       st2000)
-               basic_machine=m68k-tandem
+       rs6000-unknown)
+               vendor=ibm
                ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
+       vax-unknown)
+               vendor=dec
                ;;
-       strongarm-* | thumb-*)
-               basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+       pdp11-unknown)
+               vendor=dec
                ;;
-       sun2)
-               basic_machine=m68000-sun
+       we32k-unknown)
+               vendor=att
                ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
+       cydra-unknown)
+               vendor=cydrome
                ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
+       i370-ibm*)
+               vendor=ibm
                ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
+       orion-unknown)
+               vendor=highlevel
                ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
+       xps-unknown | xps100-unknown)
+               cpu=xps100
+               vendor=honeywell
                ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
+
+       # Here we normalize CPU types with a missing or matching vendor
+       dpx20-unknown | dpx20-bull)
+               cpu=rs6000
+               vendor=bull
+               os=${os:-bosx}
                ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
+
+       # Here we normalize CPU types irrespective of the vendor
+       amd64-*)
+               cpu=x86_64
                ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
+       blackfin-*)
+               cpu=bfin
+               os=linux
                ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
+       c54x-*)
+               cpu=tic54x
                ;;
-       sun4)
-               basic_machine=sparc-sun
+       c55x-*)
+               cpu=tic55x
                ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
+       c6x-*)
+               cpu=tic6x
                ;;
-       sv1)
-               basic_machine=sv1-cray
-               os=-unicos
+       e500v[12]-*)
+               cpu=powerpc
+               os=$os"spe"
                ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
+       mips3*-*)
+               cpu=mips64
                ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
+       ms1-*)
+               cpu=mt
                ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
+       m68knommu-*)
+               cpu=m68k
+               os=linux
                ;;
-       tile*)
-               basic_machine=$basic_machine-unknown
-               os=-linux-gnu
+       m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+               cpu=s12z
                ;;
-       tx39)
-               basic_machine=mipstx39-unknown
+       openrisc-*)
+               cpu=or32
                ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
+       parisc-*)
+               cpu=hppa
+               os=linux
                ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               cpu=i586
                ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
+       pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+               cpu=i686
                ;;
-       tpf)
-               basic_machine=s390x-ibm
-               os=-tpf
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               cpu=i686
                ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
+       pentium4-*)
+               cpu=i786
                ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
+       pc98-*)
+               cpu=i386
                ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
+       ppc-* | ppcbe-*)
+               cpu=powerpc
                ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
+       ppcle-* | powerpclittle-*)
+               cpu=powerpcle
                ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
+       ppc64-*)
+               cpu=powerpc64
                ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
+       ppc64le-* | powerpc64little-*)
+               cpu=powerpc64le
                ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
+       sb1-*)
+               cpu=mipsisa64sb1
                ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
+       sb1el-*)
+               cpu=mipsisa64sb1el
                ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
+       sh5e[lb]-*)
+               cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
                ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
+       spur-*)
+               cpu=spur
                ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
+       strongarm-* | thumb-*)
+               cpu=arm
                ;;
-       x64)
-               basic_machine=x86_64-pc
+       tx39-*)
+               cpu=mipstx39
                ;;
-       xbox)
-               basic_machine=i686-pc
-               os=-mingw32
+       tx39el-*)
+               cpu=mipstx39el
                ;;
-       xps | xps100)
-               basic_machine=xps100-honeywell
+       x64-*)
+               cpu=x86_64
                ;;
        xscale-* | xscalee[bl]-*)
-               basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
-               ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
-               ;;
-       none)
-               basic_machine=none-none
-               os=-none
+               cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
                ;;
 
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-       w89k)
-               basic_machine=hppa1.1-winbond
-               ;;
-       op50n)
-               basic_machine=hppa1.1-oki
-               ;;
-       op60c)
-               basic_machine=hppa1.1-oki
-               ;;
-       romp)
-               basic_machine=romp-ibm
+       # Recognize the canonical CPU Types that limit and/or modify the
+       # company names they are paired with.
+       cr16-*)
+               os=${os:-elf}
                ;;
-       mmix)
-               basic_machine=mmix-knuth
+       crisv32-* | etraxfs*-*)
+               cpu=crisv32
+               vendor=axis
                ;;
-       rs6000)
-               basic_machine=rs6000-ibm
+       cris-* | etrax*-*)
+               cpu=cris
+               vendor=axis
                ;;
-       vax)
-               basic_machine=vax-dec
+       crx-*)
+               os=${os:-elf}
                ;;
-       pdp11)
-               basic_machine=pdp11-dec
-               ;;
-       we32k)
-               basic_machine=we32k-att
+       neo-tandem)
+               cpu=neo
+               vendor=tandem
                ;;
-       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
+       nse-tandem)
+               cpu=nse
+               vendor=tandem
                ;;
-       cydra)
-               basic_machine=cydra-cydrome
+       nsr-tandem)
+               cpu=nsr
+               vendor=tandem
                ;;
-       orion)
-               basic_machine=orion-highlevel
+       nsv-tandem)
+               cpu=nsv
+               vendor=tandem
                ;;
-       orion105)
-               basic_machine=clipper-highlevel
+       nsx-tandem)
+               cpu=nsx
+               vendor=tandem
                ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
+       s390-*)
+               cpu=s390
+               vendor=ibm
                ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
+       s390x-*)
+               cpu=s390x
+               vendor=ibm
                ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
+       tile*-*)
+               os=${os:-linux-gnu}
                ;;
+
        *)
-               echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
-               exit 1
+               # Recognize the canonical CPU types that are allowed with any
+               # company name.
+               case $cpu in
+                       1750a | 580 \
+                       | a29k \
+                       | aarch64 | aarch64_be \
+                       | abacus \
+                       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+                       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+                       | alphapca5[67] | alpha64pca5[67] \
+                       | am33_2.0 \
+                       | amdgcn \
+                       | arc | arceb \
+                       | arm  | arm[lb]e | arme[lb] | armv* \
+                       | avr | avr32 \
+                       | asmjs \
+                       | ba \
+                       | be32 | be64 \
+                       | bfin | bpf | bs2000 \
+                       | c[123]* | c30 | [cjt]90 | c4x \
+                       | c8051 | clipper | craynv | csky | cydra \
+                       | d10v | d30v | dlx | dsp16xx \
+                       | e2k | elxsi | epiphany \
+                       | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+                       | h8300 | h8500 \
+                       | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+                       | hexagon \
+                       | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+                       | ip2k | iq2000 \
+                       | k1om \
+                       | le32 | le64 \
+                       | lm32 \
+                       | m32c | m32r | m32rle \
+                       | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+                       | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+                       | m88110 | m88k | maxq | mb | mcore | mep | metag \
+                       | microblaze | microblazeel \
+                       | mips | mipsbe | mipseb | mipsel | mipsle \
+                       | mips16 \
+                       | mips64 | mips64eb | mips64el \
+                       | mips64octeon | mips64octeonel \
+                       | mips64orion | mips64orionel \
+                       | mips64r5900 | mips64r5900el \
+                       | mips64vr | mips64vrel \
+                       | mips64vr4100 | mips64vr4100el \
+                       | mips64vr4300 | mips64vr4300el \
+                       | mips64vr5000 | mips64vr5000el \
+                       | mips64vr5900 | mips64vr5900el \
+                       | mipsisa32 | mipsisa32el \
+                       | mipsisa32r2 | mipsisa32r2el \
+                       | mipsisa32r6 | mipsisa32r6el \
+                       | mipsisa64 | mipsisa64el \
+                       | mipsisa64r2 | mipsisa64r2el \
+                       | mipsisa64r6 | mipsisa64r6el \
+                       | mipsisa64sb1 | mipsisa64sb1el \
+                       | mipsisa64sr71k | mipsisa64sr71kel \
+                       | mipsr5900 | mipsr5900el \
+                       | mipstx39 | mipstx39el \
+                       | mmix \
+                       | mn10200 | mn10300 \
+                       | moxie \
+                       | mt \
+                       | msp430 \
+                       | nds32 | nds32le | nds32be \
+                       | nfp \
+                       | nios | nios2 | nios2eb | nios2el \
+                       | none | np1 | ns16k | ns32k | nvptx \
+                       | open8 \
+                       | or1k* \
+                       | or32 \
+                       | orion \
+                       | picochip \
+                       | pdp10 | pdp11 | pj | pjl | pn | power \
+                       | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+                       | pru \
+                       | pyramid \
+                       | riscv | riscv32 | riscv64 \
+                       | rl78 | romp | rs6000 | rx \
+                       | score \
+                       | sh | shl \
+                       | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+                       | sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+                       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+                       | sparclite \
+                       | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+                       | spu \
+                       | tahoe \
+                       | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+                       | tron \
+                       | ubicom32 \
+                       | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+                       | vax \
+                       | visium \
+                       | w65 \
+                       | wasm32 | wasm64 \
+                       | we32k \
+                       | x86 | x86_64 | xc16x | xgate | xps100 \
+                       | xstormy16 | xtensa* \
+                       | ymp \
+                       | z8k | z80)
+                               ;;
+
+                       *)
+                               echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+                               exit 1
+                               ;;
+               esac
                ;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
+case $vendor in
+       digital*)
+               vendor=dec
                ;;
-       *-commodore*)
-               basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
+       commodore*)
+               vendor=cbm
                ;;
        *)
                ;;
@@ -1334,199 +1275,243 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
        # First match some system type aliases that might get confused
        # with valid system types.
-       # -solaris* is a basic system type, with this one exception.
-       -auroraux)
-               os=-auroraux
+       # solaris* is a basic system type, with this one exception.
+       auroraux)
+               os=auroraux
                ;;
-       -solaris1 | -solaris1.*)
+       bluegene*)
+               os=cnk
+               ;;
+       solaris1 | solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
-       -solaris)
-               os=-solaris2
+       solaris)
+               os=solaris2
                ;;
-       -unixware*)
-               os=-sysv4.2uw
+       unixware*)
+               os=sysv4.2uw
                ;;
-       -gnu/linux*)
+       gnu/linux*)
                os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
                ;;
        # es1800 is here to avoid being matched by es* (a different OS)
-       -es1800*)
-               os=-ose
+       es1800*)
+               os=ose
+               ;;
+       # Some version numbers need modification
+       chorusos*)
+               os=chorusos
+               ;;
+       isc)
+               os=isc2.2
+               ;;
+       sco6)
+               os=sco5v6
+               ;;
+       sco5)
+               os=sco3.2v5
+               ;;
+       sco4)
+               os=sco3.2v4
+               ;;
+       sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               ;;
+       sco3.2v[4-9]* | sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               ;;
+       scout)
+               # Don't match below
+               ;;
+       sco*)
+               os=sco3.2v2
+               ;;
+       psos*)
+               os=psos
                ;;
        # Now accept the basic system types.
        # The portable systems comes first.
        # Each alternative MUST end in a * to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-             | -sym* | -kopensolaris* | -plan9* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* | -cloudabi* | -sortix* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
-             | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
-             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
-             | -midnightbsd*)
+       # sysv* is not here because it comes later, after sysvr4.
+       gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+            | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+            | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+            | sym* | kopensolaris* | plan9* \
+            | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+            | aos* | aros* | cloudabi* | sortix* | twizzler* \
+            | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+            | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+            | knetbsd* | mirbsd* | netbsd* \
+            | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
+            | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+            | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+            | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+            | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+            | chorusrdb* | cegcc* | glidix* \
+            | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+            | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+            | linux-newlib* | linux-musl* | linux-uclibc* \
+            | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+            | interix* | uwin* | mks* | rhapsody* | darwin* \
+            | openstep* | oskit* | conix* | pw32* | nonstopux* \
+            | storm-chaos* | tops10* | tenex* | tops20* | its* \
+            | os2* | vos* | palmos* | uclinux* | nucleus* \
+            | morphos* | superux* | rtmk* | windiss* \
+            | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+            | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+            | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+            | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+            | nsk* | powerunix* | genode*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
+       qnx*)
+               case $cpu in
+                   x86 | i*86)
                        ;;
                    *)
-                       os=-nto$os
+                       os=nto-$os
                        ;;
                esac
                ;;
-       -nto-qnx*)
+       hiux*)
+               os=hiuxwe2
                ;;
-       -nto*)
-               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+       nto-qnx*)
                ;;
-       -sim | -xray | -os68k* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+       nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
-       -mac*)
-               os=`echo "$os" | sed -e 's|mac|macos|'`
+       sim | xray | os68k* | v88r* \
+           | windows* | osx | abug | netware* | os9* \
+           | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
                ;;
-       -linux-dietlibc)
-               os=-linux-dietlibc
+       linux-dietlibc)
+               os=linux-dietlibc
                ;;
-       -linux*)
+       linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
-       -sunos5*)
-               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+       lynx*178)
+               os=lynxos178
                ;;
-       -sunos6*)
-               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+       lynx*5)
+               os=lynxos5
+               ;;
+       lynx*)
+               os=lynxos
                ;;
-       -opened*)
-               os=-openedition
+       mac*)
+               os=`echo "$os" | sed -e 's|mac|macos|'`
                ;;
-       -os400*)
-               os=-os400
+       opened*)
+               os=openedition
                ;;
-       -wince*)
-               os=-wince
+       os400*)
+               os=os400
                ;;
-       -utek*)
-               os=-bsd
+       sunos5*)
+               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
                ;;
-       -dynix*)
-               os=-bsd
+       sunos6*)
+               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
                ;;
-       -acis*)
-               os=-aos
+       wince*)
+               os=wince
                ;;
-       -atheos*)
-               os=-atheos
+       utek*)
+               os=bsd
                ;;
-       -syllable*)
-               os=-syllable
+       dynix*)
+               os=bsd
                ;;
-       -386bsd)
-               os=-bsd
+       acis*)
+               os=aos
                ;;
-       -ctix* | -uts*)
-               os=-sysv
+       atheos*)
+               os=atheos
                ;;
-       -nova*)
-               os=-rtmk-nova
+       syllable*)
+               os=syllable
                ;;
-       -ns2)
-               os=-nextstep2
+       386bsd)
+               os=bsd
                ;;
-       -nsk*)
-               os=-nsk
+       ctix* | uts*)
+               os=sysv
+               ;;
+       nova*)
+               os=rtmk-nova
+               ;;
+       ns2)
+               os=nextstep2
                ;;
        # Preserve the version number of sinix5.
-       -sinix5.*)
+       sinix5.*)
                os=`echo $os | sed -e 's|sinix|sysv|'`
                ;;
-       -sinix*)
-               os=-sysv4
+       sinix*)
+               os=sysv4
                ;;
-       -tpf*)
-               os=-tpf
+       tpf*)
+               os=tpf
                ;;
-       -triton*)
-               os=-sysv3
+       triton*)
+               os=sysv3
                ;;
-       -oss*)
-               os=-sysv3
+       oss*)
+               os=sysv3
                ;;
-       -svr4*)
-               os=-sysv4
+       svr4*)
+               os=sysv4
                ;;
-       -svr3)
-               os=-sysv3
+       svr3)
+               os=sysv3
                ;;
-       -sysvr4)
-               os=-sysv4
+       sysvr4)
+               os=sysv4
                ;;
-       # This must come after -sysvr4.
-       -sysv*)
+       # This must come after sysvr4.
+       sysv*)
                ;;
-       -ose*)
-               os=-ose
+       ose*)
+               os=ose
                ;;
-       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+               os=mint
                ;;
-       -zvmoe)
-               os=-zvmoe
+       zvmoe)
+               os=zvmoe
                ;;
-       -dicos*)
-               os=-dicos
+       dicos*)
+               os=dicos
                ;;
-       -pikeos*)
+       pikeos*)
                # Until real need of OS specific support for
                # particular features comes up, bare metal
                # configurations are quite functional.
-               case $basic_machine in
+               case $cpu in
                    arm*)
-                       os=-eabi
+                       os=eabi
                        ;;
                    *)
-                       os=-elf
+                       os=elf
                        ;;
                esac
                ;;
-       -nacl*)
+       nacl*)
                ;;
-       -ios)
+       ios)
                ;;
-       -none)
+       none)
+               ;;
+       *-eabi)
                ;;
        *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
                echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
                exit 1
                ;;
@@ -1543,254 +1528,261 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
        score-*)
-               os=-elf
+               os=elf
                ;;
        spu-*)
-               os=-elf
+               os=elf
                ;;
        *-acorn)
-               os=-riscix1.2
+               os=riscix1.2
                ;;
        arm*-rebel)
-               os=-linux
+               os=linux
                ;;
        arm*-semi)
-               os=-aout
+               os=aout
                ;;
        c4x-* | tic4x-*)
-               os=-coff
+               os=coff
                ;;
        c8051-*)
-               os=-elf
+               os=elf
+               ;;
+       clipper-intergraph)
+               os=clix
                ;;
        hexagon-*)
-               os=-elf
+               os=elf
                ;;
        tic54x-*)
-               os=-coff
+               os=coff
                ;;
        tic55x-*)
-               os=-coff
+               os=coff
                ;;
        tic6x-*)
-               os=-coff
+               os=coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
-               os=-tops20
+               os=tops20
                ;;
        pdp11-*)
-               os=-none
+               os=none
                ;;
        *-dec | vax-*)
-               os=-ultrix4.2
+               os=ultrix4.2
                ;;
        m68*-apollo)
-               os=-domain
+               os=domain
                ;;
        i386-sun)
-               os=-sunos4.0.2
+               os=sunos4.0.2
                ;;
        m68000-sun)
-               os=-sunos3
+               os=sunos3
                ;;
        m68*-cisco)
-               os=-aout
+               os=aout
                ;;
        mep-*)
-               os=-elf
+               os=elf
                ;;
        mips*-cisco)
-               os=-elf
+               os=elf
                ;;
        mips*-*)
-               os=-elf
+               os=elf
                ;;
        or32-*)
-               os=-coff
+               os=coff
                ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
+               os=sysv3
                ;;
        sparc-* | *-sun)
-               os=-sunos4.1.1
+               os=sunos4.1.1
                ;;
        pru-*)
-               os=-elf
+               os=elf
                ;;
        *-be)
-               os=-beos
+               os=beos
                ;;
        *-ibm)
-               os=-aix
+               os=aix
                ;;
        *-knuth)
-               os=-mmixware
+               os=mmixware
                ;;
        *-wec)
-               os=-proelf
+               os=proelf
                ;;
        *-winbond)
-               os=-proelf
+               os=proelf
                ;;
        *-oki)
-               os=-proelf
+               os=proelf
                ;;
        *-hp)
-               os=-hpux
+               os=hpux
                ;;
        *-hitachi)
-               os=-hiux
+               os=hiux
                ;;
        i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
+               os=sysv
                ;;
        *-cbm)
-               os=-amigaos
+               os=amigaos
                ;;
        *-dg)
-               os=-dgux
+               os=dgux
                ;;
        *-dolphin)
-               os=-sysv3
+               os=sysv3
                ;;
        m68k-ccur)
-               os=-rtu
+               os=rtu
                ;;
        m88k-omron*)
-               os=-luna
+               os=luna
                ;;
        *-next)
-               os=-nextstep
+               os=nextstep
                ;;
        *-sequent)
-               os=-ptx
+               os=ptx
                ;;
        *-crds)
-               os=-unos
+               os=unos
                ;;
        *-ns)
-               os=-genix
+               os=genix
                ;;
        i370-*)
-               os=-mvs
+               os=mvs
                ;;
        *-gould)
-               os=-sysv
+               os=sysv
                ;;
        *-highlevel)
-               os=-bsd
+               os=bsd
                ;;
        *-encore)
-               os=-bsd
+               os=bsd
                ;;
        *-sgi)
-               os=-irix
+               os=irix
                ;;
        *-siemens)
-               os=-sysv4
+               os=sysv4
                ;;
        *-masscomp)
-               os=-rtu
+               os=rtu
                ;;
        f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
+               os=uxpv
                ;;
        *-rom68k)
-               os=-coff
+               os=coff
                ;;
        *-*bug)
-               os=-coff
+               os=coff
                ;;
        *-apple)
-               os=-macos
+               os=macos
                ;;
        *-atari*)
-               os=-mint
+               os=mint
+               ;;
+       *-wrs)
+               os=vxworks
                ;;
        *)
-               os=-none
+               os=none
                ;;
 esac
 fi
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-       *-unknown)
+case $vendor in
+       unknown)
                case $os in
-                       -riscix*)
+                       riscix*)
                                vendor=acorn
                                ;;
-                       -sunos*)
+                       sunos*)
                                vendor=sun
                                ;;
-                       -cnk*|-aix*)
+                       cnk*|-aix*)
                                vendor=ibm
                                ;;
-                       -beos*)
+                       beos*)
                                vendor=be
                                ;;
-                       -hpux*)
+                       hpux*)
                                vendor=hp
                                ;;
-                       -mpeix*)
+                       mpeix*)
                                vendor=hp
                                ;;
-                       -hiux*)
+                       hiux*)
                                vendor=hitachi
                                ;;
-                       -unos*)
+                       unos*)
                                vendor=crds
                                ;;
-                       -dgux*)
+                       dgux*)
                                vendor=dg
                                ;;
-                       -luna*)
+                       luna*)
                                vendor=omron
                                ;;
-                       -genix*)
+                       genix*)
                                vendor=ns
                                ;;
-                       -mvs* | -opened*)
+                       clix*)
+                               vendor=intergraph
+                               ;;
+                       mvs* | opened*)
                                vendor=ibm
                                ;;
-                       -os400*)
+                       os400*)
                                vendor=ibm
                                ;;
-                       -ptx*)
+                       ptx*)
                                vendor=sequent
                                ;;
-                       -tpf*)
+                       tpf*)
                                vendor=ibm
                                ;;
-                       -vxsim* | -vxworks* | -windiss*)
+                       vxsim* | vxworks* | windiss*)
                                vendor=wrs
                                ;;
-                       -aux*)
+                       aux*)
                                vendor=apple
                                ;;
-                       -hms*)
+                       hms*)
                                vendor=hitachi
                                ;;
-                       -mpw* | -macos*)
+                       mpw* | macos*)
                                vendor=apple
                                ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
                                vendor=atari
                                ;;
-                       -vos*)
+                       vos*)
                                vendor=stratus
                                ;;
                esac
-               basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
                ;;
 esac
 
-echo "$basic_machine$os"
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
index a3855dbebee95b1bd33059ce16b16a87abb9a4a5..59d9d9fe8fd5e469650799e6b4cb0b0b3afad2eb 100644 (file)
@@ -29,7 +29,7 @@ AC_CONFIG_SRCDIR([src/ngircd/ngircd.c])
 AC_CONFIG_HEADER([src/config.h])
 AC_CANONICAL_HOST
 
-AM_INIT_AUTOMAKE([-Wall 1.10 ]ng_color_tests)
+AM_INIT_AUTOMAKE([-Wall 1.10 foreign ]ng_color_tests)
 
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
@@ -506,6 +506,8 @@ if test "$x_ssl_openssl" = "yes"; then
        x_ssl_lib=openssl
 fi
 
+AM_CONDITIONAL(HAVE_SSL, [test $x_ssl_lib != "no"])
+
 # use TCP wrappers?
 
 x_tcpwrap_on=no
index bd88c26ac9779fefad232a919d583efdf6d3b066..c5f254b17b1ea959d2af33f46b4b625f0ffb5833 100644 (file)
@@ -1,3 +1,9 @@
+ngircd (26~rc1-0ab1) unstable; urgency=low
+
+  * New "upstream" release candidate 1 for ngIRCd Release 26.
+
+ -- Alexander Barton <alex@barton.de>  Sun, 10 May 2020 17:13:17 +0200
+
 ngircd (25-0ab1) unstable; urgency=low
 
   * New "upstream" release: ngIRCd 25.
index 82e506c13cb12954524dd4dd245f6492627cecb8..93482d998e56b05c1a8f530b90df0da934c31256 100644 (file)
@@ -19,16 +19,21 @@ Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Provides: ircd
 Description: lightweight Internet Relay Chat server
- This package provides ngIRCd, a portable and lightweight Internet Relay
- Chat server for small or private networks, developed under the GNU
- General Public License (GPL). It is simple to configure, can cope with
- dynamic IP addresses, and supports IPv6 as well as SSL. It is written
- from scratch and not based on the original IRCd.
+ ngIRCd is a free, portable and lightweight Internet Relay Chat server
+ for small or private networks, developed under the GNU General Public
+ License (GPL).
+ .
+ The server is quite easy to configure, can handle dynamic IP addresses, and
+ optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+ user authentication as well as character set conversion for legacy clients. The
+ server has been written from scratch and is not based on the "forefather", the
+ daemon of IRCNet.
  .
  This package contains the "standard distribution", including support for
  syslog logging and compressed server-links using zlib. Please have a look
- at the "ngircd-full" package if you need advanced functionality like support
- for IPv6 or SSL.
+ at the "ngircd-full" package if you need "more advanced" functionality like
+ support for TCP wrappers, IDENT requests, the IPv6 protocol, PAM and
+ SSL encrypted client and server links.
 
 Package: ngircd-full
 Architecture: any
@@ -36,14 +41,18 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
 Provides: ircd
 Conflicts: ngircd, ngircd-dbg
 Description: lightweight Internet Relay Chat server
- This package provides ngIRCd, a portable and lightweight Internet Relay
- Chat server for small or private networks, developed under the GNU
- General Public License (GPL). It is simple to configure, can cope with
- dynamic IP addresses, and supports IPv6 as well as SSL. It is written
- from scratch and not based on the original IRCd.
+ ngIRCd is a free, portable and lightweight Internet Relay Chat server
+ for small or private networks, developed under the GNU General Public
+ License (GPL).
+ .
+ The server is quite easy to configure, can handle dynamic IP addresses, and
+ optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+ user authentication as well as character set conversion for legacy clients. The
+ server has been written from scratch and is not based on the "forefather", the
+ daemon of IRCNet.
  .
  In addition to the features of the "standard package", this package
- includes support for TCP wrappers, IDENT requests, the IPv6 protocol and
+ includes support for TCP wrappers, IDENT requests, the IPv6 protocol, PAM and
  SSL encrypted client and server links.
 
 Package: ngircd-full-dbg
@@ -52,14 +61,18 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
 Provides: ircd
 Conflicts: ngircd, ngircd-full
 Description: lightweight Internet Relay Chat server
- This package provides ngIRCd, a portable and lightweight Internet Relay
- Chat server for small or private networks, developed under the GNU
- General Public License (GPL). It is simple to configure, can cope with
- dynamic IP addresses, and supports IPv6 as well as SSL. It is written
- from scratch and not based on the original IRCd.
+ ngIRCd is a free, portable and lightweight Internet Relay Chat server
+ for small or private networks, developed under the GNU General Public
+ License (GPL).
+ .
+ The server is quite easy to configure, can handle dynamic IP addresses, and
+ optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+ user authentication as well as character set conversion for legacy clients. The
+ server has been written from scratch and is not based on the "forefather", the
+ daemon of IRCNet.
  .
  In addition to the features of the "standard package", this package
- includes support for TCP wrappers, IDENT requests, the IPv6 protocol and
+ includes support for TCP wrappers, IDENT requests, the IPv6 protocol, PAM and
  SSL encrypted client and server links.
  .
  And in addition to the "full" variant, the binaries contained in this
index c687bf7fe29357075897bf41ab7da389c1b984d4..989a002bd5dbca033a32490c0ef5b8fbdd580f52 100644 (file)
                FA322D5E0CEF750F001761B3 /* config.guess */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; name = config.guess; path = ../../config.guess; sourceTree = SOURCE_ROOT; };
                FA322D5F0CEF750F001761B3 /* config.sub */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; name = config.sub; path = ../../config.sub; sourceTree = SOURCE_ROOT; };
                FA322D610CEF750F001761B3 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = COPYING; path = ../../COPYING; sourceTree = SOURCE_ROOT; };
-               FA322D620CEF750F001761B3 /* INSTALL */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = INSTALL; path = ../../INSTALL; sourceTree = SOURCE_ROOT; };
+               FA322D620CEF750F001761B3 /* INSTALL.md */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = net.daringfireball.markdown; name = INSTALL.md; path = ../../INSTALL.md; sourceTree = SOURCE_ROOT; };
                FA322D630CEF750F001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = Makefile.am; path = ../../Makefile.am; sourceTree = SOURCE_ROOT; };
                FA322D640CEF750F001761B3 /* NEWS */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = NEWS; path = ../../NEWS; sourceTree = SOURCE_ROOT; };
-               FA322D650CEF750F001761B3 /* README */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = README; path = ../../README; sourceTree = SOURCE_ROOT; };
+               FA322D650CEF750F001761B3 /* README.md */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../../README.md; sourceTree = SOURCE_ROOT; };
                FA322D6A0CEF7523001761B3 /* changelog */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = changelog; sourceTree = "<group>"; };
                FA322D6B0CEF7523001761B3 /* compat */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = compat; sourceTree = "<group>"; };
                FA322D6C0CEF7523001761B3 /* control */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = control; sourceTree = "<group>"; };
                FA6BBC621605F0AC0004247A /* irc-encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "irc-encoding.h"; sourceTree = "<group>"; };
                FA6BBC651605F6D60004247A /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = ../../../../../../../usr/lib/libiconv.dylib; sourceTree = "<group>"; };
                FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sample-ngircd.conf.tmpl"; sourceTree = "<group>"; };
+               FA7E9FEE242FFC4500A04296 /* server-link-test.e */ = {isa = PBXFileReference; lastKnownFileType = text; path = "server-link-test.e"; sourceTree = "<group>"; };
+               FA7E9FF0242FFC6C00A04296 /* server-login-test.e */ = {isa = PBXFileReference; lastKnownFileType = text; path = "server-login-test.e"; sourceTree = "<group>"; };
                FA85178A0FA061EC006A1F5A /* op.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = op.h; sourceTree = "<group>"; };
                FA85178B0FA061EC006A1F5A /* op.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = op.c; sourceTree = "<group>"; };
                FA99428A10E82A27007F27ED /* proc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proc.h; sourceTree = "<group>"; };
                                FA322D5A0CEF750F001761B3 /* AUTHORS */,
                                FA322D5C0CEF750F001761B3 /* ChangeLog */,
                                FA322D610CEF750F001761B3 /* COPYING */,
-                               FA322D620CEF750F001761B3 /* INSTALL */,
+                               FA322D620CEF750F001761B3 /* INSTALL.md */,
                                FA322D640CEF750F001761B3 /* NEWS */,
-                               FA322D650CEF750F001761B3 /* README */,
+                               FA322D650CEF750F001761B3 /* README.md */,
                                FA322D5B0CEF750F001761B3 /* autogen.sh */,
                                FA322D5E0CEF750F001761B3 /* config.guess */,
                                FA322D5F0CEF750F001761B3 /* config.sub */,
                        isa = PBXGroup;
                        children = (
                                FA18A64A16CEE18100132F66 /* Makefile.ng */,
-                               FA322D250CEF74B1001761B3 /* README */,
                                FA322D1D0CEF74B1001761B3 /* channel-test.e */,
                                FA322D1E0CEF74B1001761B3 /* check-idle.e */,
                                FA322D1F0CEF74B1001761B3 /* connect-test.e */,
+                               FA322D200CEF74B1001761B3 /* functions.inc */,
+                               FA322D210CEF74B1001761B3 /* getpid.sh */,
                                FAA3D2700F139CB300B2447E /* invite-test.e */,
                                FAA3D2710F139CB300B2447E /* join-test.e */,
                                FAA3D2720F139CB300B2447E /* kick-test.e */,
                                FAA3D2730F139CB300B2447E /* message-test.e */,
                                FA18A64E16CEE24B00132F66 /* misc-test.e */,
                                FA18A64C16CEE1AC00132F66 /* mode-test.e */,
-                               FAA3D2760F139CB300B2447E /* opless-channel-test.e */,
-                               FAA3D2770F139CB300B2447E /* server-link-test.e */,
-                               FA322D280CEF74B1001761B3 /* stress-A.e */,
-                               FA322D290CEF74B1001761B3 /* stress-B.e */,
-                               FA1A6BBD0D6857D900AA8F71 /* who-test.e */,
-                               FA18A64D16CEE1D900132F66 /* whois-test.e */,
-                               FA322D200CEF74B1001761B3 /* functions.inc */,
                                FAA3D2740F139CB300B2447E /* ngircd-test1.conf */,
                                FAA3D2750F139CB300B2447E /* ngircd-test2.conf */,
-                               FA322D210CEF74B1001761B3 /* getpid.sh */,
+                               FAA3D2760F139CB300B2447E /* opless-channel-test.e */,
+                               FA322D250CEF74B1001761B3 /* README */,
+                               FAA3D2770F139CB300B2447E /* server-link-test.e */,
                                FA322D260CEF74B1001761B3 /* start-server.sh */,
                                FA322D270CEF74B1001761B3 /* stop-server.sh */,
+                               FA322D280CEF74B1001761B3 /* stress-A.e */,
+                               FA322D290CEF74B1001761B3 /* stress-B.e */,
+                               FA7E9FEE242FFC4500A04296 /* server-link-test.e */,
+                               FA7E9FF0242FFC6C00A04296 /* server-login-test.e */,
                                FA322D2A0CEF74B1001761B3 /* stress-server.sh */,
                                FA322D2B0CEF74B1001761B3 /* test-loop.sh */,
                                FA322D2C0CEF74B1001761B3 /* tests.sh */,
                                FA322D2D0CEF74B1001761B3 /* wait-tests.sh */,
+                               FA1A6BBD0D6857D900AA8F71 /* who-test.e */,
+                               FA18A64D16CEE1D900132F66 /* whois-test.e */,
                        );
                        path = testsuite;
                        sourceTree = "<group>";
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        attributes = {
-                               LastUpgradeCheck = 1130;
+                               LastUpgradeCheck = 1140;
                                ORGANIZATIONNAME = "ngIRCd Development Team";
                        };
                        buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */;
                1DEB928708733DD80010E9CD /* Default */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               CLANG_ENABLE_OBJC_WEAK = YES;
                        };
                        name = Default;
                };
                        buildSettings = {
                                ALWAYS_SEARCH_USER_PATHS = NO;
                                CLANG_WARN_ASSIGN_ENUM = YES;
+                               CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
                                CLANG_WARN_COMMA = YES;
+                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
                                CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
                                CLANG_WARN_EMPTY_BODY = YES;
                                CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+                               CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
                                CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
                                CLANG_WARN_STRICT_PROTOTYPES = YES;
                                CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
                                CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
                                GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_PEDANTIC = YES;
                                GCC_WARN_SHADOW = YES;
                                GCC_WARN_SIGN_COMPARE = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
                                GCC_WARN_UNUSED_FUNCTION = YES;
                                GCC_WARN_UNUSED_LABEL = YES;
                        buildSettings = {
                                ALWAYS_SEARCH_USER_PATHS = NO;
                                CLANG_WARN_ASSIGN_ENUM = YES;
+                               CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
                                CLANG_WARN_COMMA = YES;
+                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
                                CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
                                CLANG_WARN_EMPTY_BODY = YES;
                                CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+                               CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
                                CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
                                CLANG_WARN_STRICT_PROTOTYPES = YES;
                                CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
                                CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               ENABLE_TESTABILITY = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
                                GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_PEDANTIC = YES;
                                GCC_WARN_SHADOW = YES;
                                GCC_WARN_SIGN_COMPARE = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
                                GCC_WARN_UNUSED_FUNCTION = YES;
                                GCC_WARN_UNUSED_LABEL = YES;
                FAB0570D105D917F006AF9E2 /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               CLANG_ENABLE_OBJC_WEAK = YES;
                        };
                        name = Debug;
                };
index be766783f79a66fa328e6431ef1bfdd43a5c3376..053cd419e277de677eb7ba00ada5ef75cd645da7 100644 (file)
@@ -1,5 +1,5 @@
 %define name    ngircd
-%define version 25
+%define version 26~rc1
 %define release 1
 %define prefix  %{_prefix}
 
@@ -15,19 +15,15 @@ BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  zlib-devel, openssl-devel
 
 %description
-This package provides ngIRCd, a portable and lightweight Internet Relay
-Chat server for small or private networks, developed under the GNU
-General Public License (GPL). It is simple to configure, can cope with
-dynamic IP addresses, and supports IPv6 as well as SSL. It is written
-from scratch and not based on the original IRCd.
-
-Advantages:
- - well arranged (lean) configuration file
- - simple to build/install, configure and maintain
- - supports IPv6 and SSL
- - no problems with servers that have dynamic IP addresses
- - freely available, modern, portable and tidy C-source
- - ngIRCd is being actively developed since 2001
+ngIRCd is a free, portable and lightweight Internet Relay Chat server for small
+or private networks, developed under the GNU General Public License (GPL).
+
+The server is quite easy to configure, can handle dynamic IP addresses, and
+optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+user authentication as well as character set conversion for legacy clients. The
+server has been written from scratch and is not based on the forefather, the
+daemon of IRCNet.
+
 
 %prep
 %setup -q
@@ -54,7 +50,7 @@ make %{?_smp_mflags}
 
 %files
 %defattr(755,root,root)
-%doc AUTHORS  COPYING  ChangeLog  INSTALL NEWS  README doc/*
+%doc AUTHORS COPYING ChangeLog INSTALL.md NEWS README.md doc/*
 %config(noreplace) /etc
 %{_prefix}/sbin
 %{_mandir}/man5/ngircd.conf*
index c96f993a805a83c12a4ba6a41efb75dc0bb29d8b..852ee93c1e40498314d19f4d7a2986d31166a208 100755 (executable)
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/bash
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2019 Alexander Barton (alex@barton.de) and Contributors
+# Copyright (c)2001-2020 Alexander Barton (alex@barton.de) and Contributors
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
 # ./src/ngircd/ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
 #
 
-awk '
+gawk '
   /^\[[[:digit:]]+:0 / {print "\033[1;95m" $0 "\033[0m"}
   /^\[[[:digit:]]+:1 / {print "\033[1;35m" $0 "\033[0m"}
   /^\[[[:digit:]]+:2 / {print "\033[1;91m" $0 "\033[0m"}
@@ -23,4 +23,6 @@ awk '
   /^\[[[:digit:]]+:5 / {print "\033[1m" $0 "\033[0m"}
   /^\[[[:digit:]]+:6 / {print $0}
   /^\[[[:digit:]]+:7 / {print "\033[90m" $0 "\033[0m"}
-'
+' </dev/stdin &
+
+wait
index 81eae40d9a763d1e82b9456de1b969648c516c84..5c365f9431157bdd8701aa6e5755bc09ebecb873 100644 (file)
@@ -35,13 +35,20 @@ up-to-date (e.g. using ./autogen.sh) before generating the archives!
 II. How to prepare a new ngIRCd release?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-a) Make sure the source tree is in a releasable state ;-)
-    - is the AUTHORS file up to date?
-
-b) Make sure you have working versions of GNU autoconf and GNU automake
+a) Make sure you have working versions of GNU autoconf and GNU automake
    installed on the system you use for generating the release:
-   as of October 2010 we are using GNU autoconf 2.67 and GNU automake 1.11.1
+   as of May 2020 we are using GNU autoconf 2.69 and GNU automake 1.11.6
    which seem to work just fine.
+   NOTE: new releases of GNU automake DO NOT work, as they lack support for
+   the "ansi2knr" wrapper and "de-ANSI-fication" support!
+
+b) Make sure the source tree is in a releasable state ;-)
+    - Are all branches & patches merged? Check GitHub issues, pull requests
+      and milestones!
+    - Run as many tests as you can!
+    - Is the AUTHORS file up to date? This command may be helpful:
+      "( grep '>$' AUTHORS; git shortlog -se | cut -c8- ) | grep -Ev \
+       '(alex@barton.de|fw@strlen.de)' | LC_ALL=de_DE.UTF-8 sort -u"
 
 c) Update the files describing the new release:
     - ChangeLog
index 5913c94ee1fdd05fbd34808c80d3e11646e79cb3..4ce26f06bfb09353da98b28467f0b8f875a74227 100644 (file)
@@ -1,6 +1,6 @@
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors
+# Copyright (c)2001-2020 Alexander Barton (alex@barton.de) and Contributors
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@ doc_templates = sample-ngircd.conf.tmpl
 
 generated_docs = sample-ngircd.conf
 
-toplevel_docs = ../AUTHORS ../COPYING ../ChangeLog ../INSTALL ../NEWS ../README
+toplevel_docs = ../AUTHORS ../COPYING ../ChangeLog ../INSTALL.md ../NEWS ../README.md
 
 SUBDIRS = src
 
@@ -55,7 +55,7 @@ all: $(generated_docs)
 install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
        $(MKDIR_P) -m 755 $(DESTDIR)$(sysconfdir)
        @if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
-         make install-config; \
+         ${MAKE} install-config; \
         fi
        $(MKDIR_P) -m 755 $(DESTDIR)$(docdir)
        for f in $(static_docs) $(toplevel_docs); do \
@@ -75,7 +75,7 @@ install-config:
 uninstall-hook:
        rm -rf $(DESTDIR)$(docdir)
        @if cmp --silent sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; then \
-         make uninstall-config; \
+         ${MAKE} uninstall-config; \
         else \
          echo; \
          echo " ** NOTE: Not uninstalling changed configuration file:"; \
@@ -87,7 +87,7 @@ uninstall-config:
        rm -f $(DESTDIR)$(sysconfdir)/ngircd.conf
 
 srcdoc:
-       make -C src srcdoc
+       ${MAKE} -C src srcdoc
 
 .PHONY: install-config uninstall-config srcdoc
 
index 75c0e085471e89b73feefe0fafe55d23811bdf28..e2a79ae8916b3ba75075c419f5d6a455cfccc600 100644 (file)
@@ -78,12 +78,14 @@ m68k/apple/aux3.1.1         gcc 2.7.2    19         12-02-26 alex     Y Y N Y
 m68k/apple/aux3.1.1         Orig. A/UX   19         12-02-26 alex     Y Y N Y 2
 m68k/hp/hp-ux9.10           Orig. HPUX   0.7.x-CVS  03-04-30 goetz    Y Y Y Y
 m88k/dg/dgux5.4R3.10        gcc 2.5.8    CVSHEAD    04-03-15 alex     Y Y ? ?
+mips/sgi/irix6.5            SGI          25         19-12-29 goetz    Y Y ? ?
 mipsel/openwrt/linux-uclibc gcc 4.8      24~9-g619a 18-01-28 goetz    - - - Y 6
 mipsel/unknown/linux-gnu    gcc 4.1.2    18         11-07-05 goetz    Y Y N Y 1
 mipsel/unknown/linux-gnu    gcc 4.4.5    21         13-11-24 goetz    Y Y Y Y 1
+mipsel/unknown/netbsd8.0    gcc 5.5.0    25         19-08-09 root     Y Y y Y 3
 powerpc/apple/darwin6.8     gcc 3.1      21         14-01-03 goetz    Y Y Y Y
 powerpc/apple/darwin7.9.0   gcc 3.3      22         15-03-22 goetz    Y Y Y Y 3
-powerpc/apple/darwin8.11.0  gcc 4.0.1    18         11-07-02 goetz    Y Y Y Y 3
+powerpc/apple/darwin8.11.0  gcc 4.0.1    25         19-11-24 goetz    Y Y Y Y 3
 powerpc/apple/darwin9.8.0   gcc 4.0.1    21         14-01-04 goetz    Y Y Y Y 3
 powerpc/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex     Y Y Y Y
 powerpc/unknown/openbsd3.6  gcc 2.95.3   0.10.0     06-10-08 alex     Y Y N Y
@@ -99,6 +101,7 @@ x86_64/apple/darwin15.6.0   A-clang 8.0  23~38-g455 16-11-04 alex     Y Y Y Y 3
 x86_64/apple/darwin16.5.0   A-clang 8.1  25~rc1-7-g 18-11-04 alex     Y Y Y Y 3
 x86_64/apple/darwin17.7.0   A-clang 10.0 25~rc1     18-11-04 alex     Y Y Y Y 3
 x86_64/apple/darwin18.2.0   A-clang 10.0 25~rc1-11  19-01-23 alex     Y Y Y Y 3
+x86_64/apple/darwin19.0.0   A-clang 11.0 25~19-g928 19-12-07 alex     Y Y Y Y 3
 x86_64/unknown/dragonfly3.4 gcc 4.7.2    21         13-11-12 goetz    Y Y N Y 3
 x86_64/unkn./freebsd8.1-gnu gcc 4.4.5    19         12-02-26 alex     Y Y Y Y 3
 x86_64/unknown/freebsd8.4   gcc 4.2.1    24~rc1-7   17-01-20 alex     Y Y Y Y 3
index cccc7e923b954f76a0c5704b4366412a5fc003d6..5892557920f669985b413218e2f90de793ad66ad 100644 (file)
        # Topic for this channel
        ;Topic = a great topic
 
-       # Initial channel modes
-       ;Modes = tnk
-
-       # initial channel password (mode k)
-       ;Key = Secret
+       # Initial channel modes, as used in "MODE" commands. Modifying lists
+       # (ban list, invite list, exception list) is supported.
+       # This option can be specified multiple times, evaluated top to bottom.
+       ;Modes = +tnk mykey +l 5
+       ;Modes = +b nick!~user@bad.host.example.com
 
        # Key file, syntax for each line: "<user>:<nick>:<key>".
        # Default: none.
        ;KeyFile = :ETCDIR:/#chan.key
 
-       # maximum users per channel (mode l)
-       ;MaxUsers = 23
-
 [Channel]
        # More [Channel] sections, if you like ...
 
index 0ee2a12f21307edc313fa53741bbae6d72a470a9..b27421a31d5d12e3f1399eddae12ec26056ddee6 100644 (file)
@@ -1,7 +1,7 @@
 .\"
 .\" ngircd(8) manual page template
 .\"
-.TH ngircd 8 "Jan 2020" ngIRCd "ngIRCd Manual"
+.TH ngircd 8 "May 2020" ngIRCd "ngIRCd Manual"
 .SH NAME
 ngIRCd \- the "next generation" IRC daemon
 .SH SYNOPSIS
@@ -13,12 +13,15 @@ ngIRCd \- the "next generation" IRC daemon
 .BR ngIRCd
 is a free, portable and lightweight Internet Relay Chat server for small
 or private networks, developed under the GNU General Public License (GPL).
-It is easy to configure, can cope with dynamic IP addresses, and supports
-IPv6, SSL-protected connections as well as PAM for authentication.
-It is written from scratch and not based on the original IRCd.
+.PP
+The server is quite easy to configure, can handle dynamic IP addresses, and
+optionally supports IDENT, IPv6 connections, SSL-protected links, and PAM for
+user authentication as well as character set conversion for legacy clients. The
+server has been written from scratch and is not based on the "forefather", the
+daemon of the IRCNet.
 .PP
 The name ngIRCd means
-.IR "next generation IRC daemon",
+.IR "next-generation IRC daemon",
 which is a little bit exaggerated:
 .IR "lightweight Internet Relay Chat server"
 most probably would have been a better name :-)
index 0971f37646874b9859cf2f3d428fd47b103fb4aa..e4446f96c6ae26e0f53933a9e097f7a23c5daac3 100644 (file)
@@ -1,7 +1,7 @@
 .\"
 .\" ngircd.conf(5) manual page template
 .\"
-.TH ngircd.conf 5 "Jan 2020" ngIRCd "ngIRCd Manual"
+.TH ngircd.conf 5 "May 2020" ngIRCd "ngIRCd Manual"
 .SH NAME
 ngircd.conf \- configuration file of ngIRCd
 .SH SYNOPSIS
@@ -510,10 +510,12 @@ Name of the channel, including channel prefix ("#" or "&").
 Topic for this channel.
 .TP
 \fBModes\fR (string)
-Initial channel modes.
-.TP
-\fBKey\fR (string)
-Sets initial channel key (only relevant if channel mode "k" is set).
+Initial channel modes, as used in "MODE" commands. Modifying lists (ban list,
+invite list, exception list) is supported.
+.PP
+.RS
+This option can be specified multiple times, evaluated top to bottom.
+.RE
 .TP
 \fBKeyFile\fR (string)
 Path and file name of a "key file" containing individual channel keys for
@@ -557,10 +559,6 @@ The file is not reopened on each access, so you can modify and overwrite it
 without problems, but moving or deleting the file will have not effect until
 the daemon re-reads its configuration!
 .RE
-.TP
-\fBMaxUsers\fR (number)
-Set maximum user limit for this channel (only relevant if channel mode "l"
-is set).
 .SH HINTS
 It's wise to use "ngircd \-\-configtest" to validate the configuration file
 after changing it. See
index 53c385c2c158f602265f81f02d086817b2de7f30..3282a8d0460533301ca0c4f58675548fa35db833 100644 (file)
@@ -36,6 +36,8 @@
 #include "log.h"
 #include "messages.h"
 #include "match.h"
+#include "parse.h"
+#include "irc-mode.h"
 
 #define REMOVE_PART 0
 #define REMOVE_QUIT 1
@@ -93,9 +95,11 @@ GLOBAL void
 Channel_InitPredefined( void )
 {
        CHANNEL *new_chan;
+       REQUEST Req;
        const struct Conf_Channel *conf_chan;
-       const char *c;
-       size_t i, channel_count = array_length(&Conf_Channels, sizeof(*conf_chan));
+       char *c;
+       char modes[COMMAND_LEN], name[CHANNEL_NAME_LEN];
+       size_t i, n, channel_count = array_length(&Conf_Channels, sizeof(*conf_chan));
 
        conf_chan = array_start(&Conf_Channels);
 
@@ -126,21 +130,61 @@ Channel_InitPredefined( void )
                                                        conf_chan->name);
                        continue;
                }
-               Log(LOG_INFO, "Created pre-defined channel \"%s\".",
-                                               conf_chan->name);
-
                Channel_ModeAdd(new_chan, 'P');
 
                if (conf_chan->topic[0])
                        Channel_SetTopic(new_chan, NULL, conf_chan->topic);
 
-               c = conf_chan->modes;
-               while (*c)
-                       Channel_ModeAdd(new_chan, *c++);
+               /* Evaluate modes strings with fake requests */
+               if (conf_chan->modes_num) {
+                       /* Prepare fake request structure */
+                       strlcpy(name, conf_chan->name, sizeof(name));
+                       Log(LOG_INFO, "Evaluating predefined channel modes for \"%s\".", name);
+                       Req.argv[0] = name;
+                       Req.prefix = Client_ID(Client_ThisServer());
+                       Req.command = "MODE";
+
+                       /* Iterate over channel modes strings */
+                       for (n = 0; n < conf_chan->modes_num; n++) {
+                               Req.argc = 1;
+                               strlcpy(modes, conf_chan->modes[n], sizeof(modes));
+                               Log(LOG_DEBUG, "Evaluate \"MODE %s %s\".", name, modes);
+                               c = strtok(modes, " ");
+                               while (c && Req.argc < 15) {
+                                       Req.argv[Req.argc++] = c;
+                                       c = strtok(0, " ");
+                               }
+
+                               if (Req.argc > 1) {
+                                       /* Handling of legacy "Key" and "MaxUsers" settings:
+                                        * Enforce setting the respective mode(s), to support
+                                        * the legacy "Mode = kl" notation, which was valid but
+                                        * is an invalid MODE string: key and limit are missing!
+                                        * So set them manually when "k" or "l" are detected in
+                                        * the first MODE parameter ... */
+                                       if (Req.argc > 1 && strchr(Req.argv[1], 'k')) {
+                                               Channel_SetKey(new_chan, conf_chan->key);
+                                               Channel_ModeAdd(new_chan, 'k');
+                                       }
+                                       if (strchr(Req.argv[1], 'l')) {
+                                               Channel_SetMaxUsers(new_chan, conf_chan->maxusers);
+                                               Channel_ModeAdd(new_chan, 'l');
+                                       }
+
+                                       IRC_MODE(Client_ThisServer(), &Req);
+                               }
+
+                               /* Original channel modes srings are no longer needed */
+                               free(conf_chan->modes[n]);
+                       }
+               }
 
-               Channel_SetKey(new_chan, conf_chan->key);
-               Channel_SetMaxUsers(new_chan, conf_chan->maxusers);
                Set_KeyFile(new_chan, conf_chan->keyfile);
+
+               Log(LOG_INFO,
+                   "Created pre-defined channel \"%s\", mode \"%s\" (key \"%s\", limit %d).",
+                   new_chan->name, new_chan->modes, new_chan->key,
+                   new_chan->maxusers);
        }
        if (channel_count)
                array_free(&Conf_Channels);
index a453312c3e93473a8a0ee7c2c8cf1c4a5b652660..67c0260423ac8a3e2ca9a099397691eeae40711a 100644 (file)
@@ -337,9 +337,11 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
        assert(Client != NULL);
        assert(Hostname != NULL);
 
-       /* Only cloak the hostmask if it has not yet been cloaked (the period
-        * indicates it's still an IP address). */
-       if (Conf_CloakHost[0] && strchr(Client->host, '.')) {
+       /* Only cloak the hostmask if it has not yet been cloaked.
+        * The period or colon indicates it's still an IP address.
+        * An empty string means a rDNS lookup did not happen (yet). */
+       if (Conf_CloakHost[0] && (!Client->host[0] || strchr(Client->host, '.')
+                                 || strchr(Client->host, ':'))) {
                char cloak[GETID_LEN];
 
                strlcpy(cloak, Hostname, GETID_LEN);
index af715af8c7c1b773680b63f14890663962467623..a8896a1f634db1fd511a9129442e2d50b3b05420 100644 (file)
@@ -40,6 +40,7 @@ struct ConnSSL_State {
        gnutls_session_t gnutls_session;
        void *cookie;           /* pointer to server configuration structure
                                   (for outgoing connections), or NULL. */
+       size_t x509_cred_idx;   /* index of active x509 credential record */
 #endif
        char *fingerprint;
 };
index ef36a2fe5d1c1842c851624c5322c91979554084..1c5ba624d5dd93e732b511d204dca4e8f6196244 100644 (file)
@@ -328,7 +328,7 @@ Conf_Test( void )
 {
        struct passwd *pwd;
        struct group *grp;
-       unsigned int i;
+       unsigned int i, j;
        bool config_valid;
        size_t predef_channel_count;
        struct Conf_Channel *predef_chan;
@@ -483,7 +483,8 @@ Conf_Test( void )
                /* Valid "Channel" section */
                puts( "[CHANNEL]" );
                printf("  Name = %s\n", predef_chan->name);
-               printf("  Modes = %s\n", predef_chan->modes);
+               for(j = 0; j < predef_chan->modes_num; j++)
+                       printf("  Modes = %s\n", predef_chan->modes[j]);
                printf("  Key = %s\n", predef_chan->key);
                printf("  MaxUsers = %lu\n", predef_chan->maxusers);
                printf("  Topic = %s\n", predef_chan->topic);
@@ -852,7 +853,7 @@ no_listenports(void)
 static bool
 Read_TextFile(const char *Filename, const char *Name, array *Destination)
 {
-       char line[127];
+       char line[COMMAND_LEN];
        FILE *fp;
        int line_no = 1;
 
@@ -902,7 +903,7 @@ Read_Config(bool TestOnly, bool IsStarting)
        FILE *fd;
        DIR *dh;
 
-       Log(LOG_INFO, "Using configuration file \"%s\" ...", NGIRCd_ConfFile);
+       Config_Error(LOG_INFO, "Using configuration file \"%s\" ...", NGIRCd_ConfFile);
 
        /* Open configuration file */
        fd = fopen( NGIRCd_ConfFile, "r" );
@@ -1289,116 +1290,6 @@ WarnPAM(const char UNUSED *File, int UNUSED Line)
 #endif
 }
 
-/**
- * Handle legacy "NoXXX" options in [GLOBAL] section.
- *
- * TODO: This function and support for "NoXXX" could be removed starting
- * with ngIRCd release 19 (one release after marking it "deprecated").
- *
- * @param Var  Variable name.
- * @param Arg  Argument string.
- * @returns    true if a NoXXX option has been processed; false otherwise.
- */
-static bool
-CheckLegacyNoOption(const char *Var, const char *Arg)
-{
-       if(strcasecmp(Var, "NoDNS") == 0) {
-               Conf_DNS = !Check_ArgIsTrue( Arg );
-               return true;
-       }
-       if (strcasecmp(Var, "NoIdent") == 0) {
-               Conf_Ident = !Check_ArgIsTrue(Arg);
-               return true;
-       }
-       if(strcasecmp(Var, "NoPAM") == 0) {
-               Conf_PAM = !Check_ArgIsTrue(Arg);
-               return true;
-       }
-       return false;
-}
-
-/**
- * Handle deprecated legacy options in [GLOBAL] section.
- *
- * TODO: This function and support for these options in the [Global] section
- * could be removed starting with ngIRCd release 19 (one release after
- * marking it "deprecated").
- *
- * @param Var  Variable name.
- * @param Arg  Argument string.
- * @returns    true if a legacy option has been processed; false otherwise.
- */
-static const char*
-CheckLegacyGlobalOption(const char *File, int Line, char *Var, char *Arg)
-{
-       if (strcasecmp(Var, "AllowRemoteOper") == 0
-           || strcasecmp(Var, "ChrootDir") == 0
-           || strcasecmp(Var, "ConnectIPv4") == 0
-           || strcasecmp(Var, "ConnectIPv6") == 0
-           || strcasecmp(Var, "OperCanUseMode") == 0
-           || strcasecmp(Var, "OperChanPAutoOp") == 0
-           || strcasecmp(Var, "OperServerMode") == 0
-           || strcasecmp(Var, "PredefChannelsOnly") == 0
-           || strcasecmp(Var, "SyslogFacility") == 0
-           || strcasecmp(Var, "WebircPassword") == 0) {
-               Handle_OPTIONS(File, Line, Var, Arg);
-               return "[Options]";
-       }
-       if (strcasecmp(Var, "ConnectRetry") == 0
-           || strcasecmp(Var, "IdleTimeout") == 0
-           || strcasecmp(Var, "MaxConnections") == 0
-           || strcasecmp(Var, "MaxConnectionsIP") == 0
-           || strcasecmp(Var, "MaxJoins") == 0
-           || strcasecmp(Var, "MaxNickLength") == 0
-           || strcasecmp(Var, "PingTimeout") == 0
-           || strcasecmp(Var, "PongTimeout") == 0) {
-               Handle_LIMITS(File, Line, Var, Arg);
-               return "[Limits]";
-       }
-#ifdef SSL_SUPPORT
-       if (strcasecmp(Var, "SSLCertFile") == 0
-           || strcasecmp(Var, "SSLDHFile") == 0
-           || strcasecmp(Var, "SSLKeyFile") == 0
-           || strcasecmp(Var, "SSLKeyFilePassword") == 0
-           || strcasecmp(Var, "SSLPorts") == 0) {
-               Handle_SSL(File, Line, Var + 3, Arg);
-               return "[SSL]";
-       }
-#endif
-
-       return NULL;
-}
-
-/**
- * Strip "no" prefix of a string.
- *
- * TODO: This function and support for "NoXXX" should be removed starting
- * with ngIRCd release 19! (One release after marking it "deprecated").
- *
- * @param str  Pointer to input string starting with "no".
- * @returns    New pointer to string without "no" prefix.
- */
-static const char *
-NoNo(const char *str)
-{
-       assert(strncasecmp("no", str, 2) == 0 && str[2]);
-       return str + 2;
-}
-
-/**
- * Invert "boolean" string.
- *
- * TODO: This function and support for "NoXXX" should be removed starting
- * with ngIRCd release 19! (One release after marking it "deprecated").
- *
- * @param arg  "Boolean" input string.
- * @returns    Pointer to inverted "boolean string".
- */
-static const char *
-InvertArg(const char *arg)
-{
-       return yesno_to_str(!Check_ArgIsTrue(arg));
-}
 
 /**
  * Handle variable in [Global] configuration section.
@@ -1413,7 +1304,6 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
        struct passwd *pwd;
        struct group *grp;
        size_t len;
-       const char *section;
        char *ptr;
 
        assert(File != NULL);
@@ -1553,36 +1443,6 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
                return;
        }
 
-       if (CheckLegacyNoOption(Var, Arg)) {
-               /* TODO: This function and support for "NoXXX" could be
-                * be removed starting with ngIRCd release 19 (one release
-                * after marking it "deprecated"). */
-               Config_Error(LOG_WARNING,
-                            "%s, line %d (section \"Global\"): \"No\"-Prefix is deprecated, use \"%s = %s\" in [Options] section!",
-                            File, Line, NoNo(Var), InvertArg(Arg));
-               if (strcasecmp(Var, "NoIdent") == 0)
-                       WarnIdent(File, Line);
-               else if (strcasecmp(Var, "NoPam") == 0)
-                       WarnPAM(File, Line);
-               return;
-       }
-       if ((section = CheckLegacyGlobalOption(File, Line, Var, Arg))) {
-               /** TODO: This function and support for these options in the
-                * [Global] section could be removed starting with ngIRCd
-                * release 19 (one release after marking it "deprecated"). */
-               if (strncasecmp(Var, "SSL", 3) == 0) {
-                       Config_Error(LOG_WARNING,
-                                    "%s, line %d (section \"Global\"): \"%s\" is deprecated here, move it to %s and rename to \"%s\"!",
-                                    File, Line, Var, section,
-                                    Var + 3);
-               } else {
-                       Config_Error(LOG_WARNING,
-                                    "%s, line %d (section \"Global\"): \"%s\" is deprecated here, move it to %s!",
-                                    File, Line, Var, section);
-               }
-               return;
-       }
-
        Config_Error_Section(File, Line, Var, "Global");
 }
 
@@ -1807,18 +1667,6 @@ Handle_OPTIONS(const char *File, int Line, char *Var, char *Arg)
                Conf_MorePrivacy = Check_ArgIsTrue(Arg);
                return;
        }
-       if (strcasecmp(Var, "NoticeAuth") == 0) {
-               /*
-                * TODO: This section and support for "NoticeAuth" variable
-                * could be removed starting with ngIRCd release 24 (one
-                * release after marking it "deprecated") ...
-                */
-               Config_Error(LOG_WARNING,
-                            "%s, line %d (section \"Options\"): \"%s\" is deprecated, please use \"NoticeBeforeRegistration\"!",
-                            File, Line, Var);
-               Conf_NoticeBeforeRegistration = Check_ArgIsTrue(Arg);
-               return;
-       }
        if (strcasecmp(Var, "NoticeBeforeRegistration") == 0) {
                Conf_NoticeBeforeRegistration = Check_ArgIsTrue(Arg);
                return;
@@ -1850,22 +1698,6 @@ Handle_OPTIONS(const char *File, int Line, char *Var, char *Arg)
                        Config_Error_TooLong(File, Line, Var);
                return;
        }
-       if (strcasecmp(Var, "PredefChannelsOnly") == 0) {
-               /*
-                * TODO: This section and support for "PredefChannelsOnly"
-                * could be removed starting with ngIRCd release 22 (one
-                * release after marking it "deprecated") ...
-                */
-               Config_Error(LOG_WARNING,
-                            "%s, line %d (section \"Options\"): \"%s\" is deprecated, please use \"AllowedChannelTypes\"!",
-                            File, Line, Var);
-               if (Check_ArgIsTrue(Arg))
-                       Conf_AllowedChannelTypes[0] = '\0';
-               else
-                       strlcpy(Conf_AllowedChannelTypes, CHANTYPES,
-                               sizeof(Conf_AllowedChannelTypes));
-               return;
-       }
 #ifndef STRICT_RFC
        if (strcasecmp(Var, "RequireAuthPing") == 0) {
                Conf_AuthPing = Check_ArgIsTrue(Arg);
@@ -2155,8 +1987,12 @@ Handle_CHANNEL(const char *File, int Line, char *Var, char *Arg)
        }
        if (strcasecmp(Var, "Modes") == 0) {
                /* Initial modes */
-               len = strlcpy(chan->modes, Arg, sizeof(chan->modes));
-               if (len >= sizeof(chan->modes))
+               if(chan->modes_num >= sizeof(chan->modes)) {
+                       Config_Error(LOG_ERR, "Too many Modes, option ignored.");
+                       return;
+               }
+               chan->modes[chan->modes_num++] = strndup(Arg, COMMAND_LEN);
+               if(strlen(Arg) >= COMMAND_LEN)
                        Config_Error_TooLong(File, Line, Var);
                return;
        }
@@ -2172,6 +2008,9 @@ Handle_CHANNEL(const char *File, int Line, char *Var, char *Arg)
                len = strlcpy(chan->key, Arg, sizeof(chan->key));
                if (len >= sizeof(chan->key))
                        Config_Error_TooLong(File, Line, Var);
+               Config_Error(LOG_WARNING,
+                            "%s, line %d (section \"Channel\"): \"%s\" is deprecated here, use \"Modes = +k <key>\"!",
+                            File, Line, Var);
                return;
        }
        if( strcasecmp( Var, "MaxUsers" ) == 0 ) {
@@ -2179,6 +2018,9 @@ Handle_CHANNEL(const char *File, int Line, char *Var, char *Arg)
                chan->maxusers = (unsigned long) atol(Arg);
                if (!chan->maxusers && strcmp(Arg, "0"))
                        Config_Error_NaN(File, Line, Var);
+               Config_Error(LOG_WARNING,
+                            "%s, line %d (section \"Channel\"): \"%s\" is deprecated here, use \"Modes = +l <limit>\"!",
+                            File, Line, Var);
                return;
        }
        if (strcasecmp(Var, "KeyFile") == 0) {
index 8029c0f77b3086d17512d8466ef04821402d1b15..0d2965c1f2059fa508ce3b5cb4c5fe3a0bb6acb7 100644 (file)
@@ -83,11 +83,12 @@ struct SSLOptions {
 /** Pre-defined channels */
 struct Conf_Channel {
        char name[CHANNEL_NAME_LEN];    /**< Name of the channel */
-       char modes[CHANNEL_MODE_LEN];   /**< Initial channel modes */
+       char *modes[512];               /**< Initial channel modes to evaluate */
        char key[CLIENT_PASS_LEN];      /**< Channel key ("password", mode "k" ) */
        char topic[COMMAND_LEN];        /**< Initial topic */
        char keyfile[512];              /**< Path and name of channel key file */
        unsigned long maxusers;         /**< User limit for this channel, mode "l" */
+       unsigned int modes_num;         /**< Number of channel modes to evaluate */
 };
 
 
index 72d38b8621ff559c9c93903989e7c091b018be79..3cf8a3a62b27d43ce32fcc1101f765dac3775fb7 100644 (file)
@@ -45,13 +45,17 @@ Conn_UpdateIdle(CONN_ID Idx)
 /**
  * Update "ping timestamp", the time of the last outgoing PING request.
  *
+ * the value 0 signals a newly connected client including servers during the
+ * initial "server burst"; and 1 means that no PONG is pending for a PING.
+ *
  * @param Idx Connection index.
+ * @param TimeStamp 0, 1, or time stamp.
  */
 GLOBAL void
-Conn_UpdatePing(CONN_ID Idx)
+Conn_UpdatePing(CONN_ID Idx, time_t TimeStamp)
 {
        assert(Idx > NONE);
-       My_Connections[Idx].lastping = time(NULL);
+       My_Connections[Idx].lastping = TimeStamp;
 }
 
 /*
index 1d05acc88d5623979a371e80aedc3f4a61e480c8..37f70363a8b24c1221798442be74c35ef2acf672 100644 (file)
@@ -30,7 +30,7 @@
 
 
 GLOBAL void Conn_UpdateIdle PARAMS((CONN_ID Idx));
-GLOBAL void Conn_UpdatePing PARAMS((CONN_ID Idx));
+GLOBAL void Conn_UpdatePing PARAMS((CONN_ID Idx, time_t TimeStamp));
 
 GLOBAL time_t Conn_GetSignon PARAMS((CONN_ID Idx));
 GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx ));
index 3f482dc7ff60263ce40822d41d20c4a7b345e409..4dd335ea9209f6a01fa11f459fb3e0d976e44a21 100644 (file)
@@ -62,9 +62,17 @@ static bool ConnSSL_LoadServerKey_openssl PARAMS(( SSL_CTX *c ));
 
 #define MAX_HASH_SIZE  64      /* from gnutls-int.h */
 
-static gnutls_certificate_credentials_t x509_cred;
+typedef struct {
+       int refcnt;
+       gnutls_certificate_credentials_t x509_cred;
+       gnutls_dh_params_t dh_params;
+} x509_cred_slot;
+
+static array x509_creds = INIT_ARRAY;
+static size_t x509_cred_idx;
+
 static gnutls_dh_params_t dh_params;
-static gnutls_priority_t priorities_cache;
+static gnutls_priority_t priorities_cache = NULL;
 static bool ConnSSL_LoadServerKey_gnutls PARAMS(( void ));
 #endif
 
@@ -266,6 +274,21 @@ void ConnSSL_Free(CONNECTION *c)
                gnutls_bye(sess, GNUTLS_SHUT_RDWR);
                gnutls_deinit(sess);
        }
+       x509_cred_slot *slot = array_get(&x509_creds, sizeof(x509_cred_slot), c->ssl_state.x509_cred_idx);
+       assert(slot != NULL);
+       assert(slot->refcnt > 0);
+       assert(slot->x509_cred != NULL);
+       slot->refcnt--;
+       if ((c->ssl_state.x509_cred_idx != x509_cred_idx) && (slot->refcnt <= 0)) {
+               Log(LOG_INFO, "Discarding X509 certificate credentials from slot %zd.",
+                   c->ssl_state.x509_cred_idx);
+               gnutls_certificate_free_keys(slot->x509_cred);
+               gnutls_certificate_free_credentials(slot->x509_cred);
+               slot->x509_cred = NULL;
+               gnutls_dh_params_deinit(slot->dh_params);
+               slot->dh_params = NULL;
+               slot->refcnt = 0;
+       }
 #endif
        assert(Conn_OPTION_ISSET(c, CONN_SSL));
        /* can't just set bitmask to 0 -- there are other, non-ssl related flags, e.g. CONN_ZIP. */
@@ -348,22 +371,21 @@ out:
        int err;
        static bool initialized;
 
-       if (initialized) {
-               /* TODO: cannot reload gnutls keys: can't simply free x509
-                * context -- it may still be in use */
-               return false;
-       }
-
-       err = gnutls_global_init();
-       if (err) {
-               Log(LOG_ERR, "Failed to initialize GnuTLS: %s",
-                   gnutls_strerror(err));
-               goto out;
+       if (!initialized) {
+               err = gnutls_global_init();
+               if (err) {
+                       Log(LOG_ERR, "Failed to initialize GnuTLS: %s",
+                           gnutls_strerror(err));
+                       goto out;
+               }
        }
 
        if (!ConnSSL_LoadServerKey_gnutls())
                goto out;
 
+       if (priorities_cache != NULL) {
+               gnutls_priority_deinit(priorities_cache);
+       }
        if (gnutls_priority_init(&priorities_cache, Conf_SSLOptions.CipherList,
                                 NULL) != GNUTLS_E_SUCCESS) {
                Log(LOG_ERR,
@@ -389,6 +411,9 @@ ConnSSL_LoadServerKey_gnutls(void)
        int err;
        const char *cert_file;
 
+       x509_cred_slot *slot = NULL;
+       gnutls_certificate_credentials_t x509_cred;
+
        err = gnutls_certificate_allocate_credentials(&x509_cred);
        if (err < 0) {
                Log(LOG_ERR, "Failed to allocate certificate credentials: %s",
@@ -419,6 +444,43 @@ ConnSSL_LoadServerKey_gnutls(void)
                    gnutls_strerror(err));
                return false;
        }
+
+       /* Free currently active x509 context (if any) unless it is still in use */
+       slot = array_get(&x509_creds, sizeof(x509_cred_slot), x509_cred_idx);
+       if ((slot != NULL) && (slot->refcnt <= 0) && (slot->x509_cred != NULL)) {
+               Log(LOG_INFO, "Discarding X509 certificate credentials from slot %zd.", x509_cred_idx);
+               gnutls_certificate_free_keys(slot->x509_cred);
+               gnutls_certificate_free_credentials(slot->x509_cred);
+               slot->x509_cred = NULL;
+               gnutls_dh_params_deinit(slot->dh_params);
+               slot->dh_params = NULL;
+               slot->refcnt = 0;
+       }
+
+       /* Find free slot */
+       x509_cred_idx = (size_t) -1;
+       size_t i;
+       for (slot = array_start(&x509_creds), i = 0;
+            i < array_length(&x509_creds, sizeof(x509_cred_slot));
+            slot++, i++) {
+               if (slot->refcnt <= 0) {
+                       x509_cred_idx = i;
+                       break;
+               }
+       }
+       /* ... allocate new slot otherwise. */
+       if (x509_cred_idx == (size_t) -1) {
+               x509_cred_idx = array_length(&x509_creds, sizeof(x509_cred_slot));
+               slot = array_alloc(&x509_creds, sizeof(x509_cred_slot), x509_cred_idx);
+               if (slot == NULL) {
+                       Log(LOG_ERR, "Failed to allocate new slot for certificate credentials");
+                       return false;
+               }
+       }
+       Log(LOG_INFO, "Storing new X509 certificate credentials in slot %zd.", x509_cred_idx);
+       slot->x509_cred = x509_cred;
+       slot->refcnt = 0;
+
        return true;
 }
 #endif
@@ -520,8 +582,13 @@ ConnSSL_Init_SSL(CONNECTION *c)
                                 (gnutls_transport_ptr_t) (long) c->sock);
        gnutls_certificate_server_set_request(c->ssl_state.gnutls_session,
                                              GNUTLS_CERT_REQUEST);
+
+       Log(LOG_INFO, "Using X509 credentials from slot %zd", x509_cred_idx);
+       c->ssl_state.x509_cred_idx = x509_cred_idx;
+       x509_cred_slot *slot = array_get(&x509_creds, sizeof(x509_cred_slot), x509_cred_idx);
+       slot->refcnt++;
        ret = gnutls_credentials_set(c->ssl_state.gnutls_session,
-                                    GNUTLS_CRD_CERTIFICATE, x509_cred);
+                                    GNUTLS_CRD_CERTIFICATE, slot->x509_cred);
        if (ret != 0) {
                Log(LOG_ERR, "Failed to set SSL credentials: %s",
                    gnutls_strerror(ret));
index f62e96754fa9ef610ef556f246f7b6f3711648cd..94c6c4a8b1683fa75ca3fd4f6daaf98884d29dfd 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #define CONN_MODULE
+#define CONN_MODULE_GLOBAL_INIT
 
 #include "portab.h"
 
@@ -659,12 +660,14 @@ Conn_Handler(void)
        size_t wdatalen;
        struct timeval tv;
        time_t t;
+       bool command_available;
 
        Log(LOG_NOTICE, "Server \"%s\" (on \"%s\") ready.",
            Client_ID(Client_ThisServer()), Client_Hostname(Client_ThisServer()));
 
        while (!NGIRCd_SignalQuit && !NGIRCd_SignalRestart) {
                t = time(NULL);
+               command_available = false;
 
                /* Check configured servers and established links */
                Check_Servers();
@@ -733,16 +736,31 @@ Conn_Handler(void)
                                continue;
                        }
 
+                       if (array_bytes(&My_Connections[i].rbuf) >= COMMAND_LEN) {
+                               /* There is still more data in the read buffer
+                                * than a single valid command can get long:
+                                * so either there is a complete command, or
+                                * invalid data. Therefore don't try to read in
+                                * even more data from the network but wait for
+                                * this command(s) to be handled first! */
+                               io_event_del(My_Connections[i].sock,
+                                            IO_WANTREAD);
+                               command_available = true;
+                               continue;
+                       }
+
                        io_event_add(My_Connections[i].sock, IO_WANTREAD);
                }
 
-               /* Set the timeout for reading from the network to 1 second,
-                * which is the granularity with witch we handle "penalty
-                * times" for example.
+               /* Don't wait for data when there is still at least one command
+                * available in a read buffer which can be handled immediately;
+                * set the timeout for reading from the network to 1 second
+                * otherwise, which is the granularity with witch we handle
+                * "penalty times" for example.
                 * Note: tv_sec/usec are undefined(!) after io_dispatch()
                 * returns, so we have to set it before each call to it! */
                tv.tv_usec = 0;
-               tv.tv_sec = 1;
+               tv.tv_sec = command_available ? 0 : 1;
 
                /* Wait for activity ... */
                i = io_dispatch(&tv);
@@ -1271,6 +1289,9 @@ Handle_Write( CONN_ID Idx )
                if (errno == EAGAIN || errno == EINTR)
                        return true;
 
+               /* Log write errors but do not close the connection yet.
+                * Calling Conn_Close() now could result in too many recursive calls.
+                */
                if (!Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ISCLOSING))
                        Log(LOG_ERR,
                            "Write error on connection %d (socket %d): %s!",
@@ -1278,7 +1299,7 @@ Handle_Write( CONN_ID Idx )
                else
                        LogDebug("Recursive write error on connection %d (socket %d): %s!",
                                 Idx, My_Connections[Idx].sock, strerror(errno));
-               Conn_Close(Idx, "Write error", NULL, false);
+
                return false;
        }
 
@@ -1539,16 +1560,21 @@ Socket2Index( int Sock )
  * @param Idx  Connection index.
  */
 static void
-Read_Request( CONN_ID Idx )
+Read_Request(CONN_ID Idx)
 {
        ssize_t len;
        static const unsigned int maxbps = COMMAND_LEN / 2;
        char readbuf[READBUFFER_LEN];
        time_t t;
        CLIENT *c;
-       assert( Idx > NONE );
-       assert( My_Connections[Idx].sock > NONE );
 
+       assert(Idx > NONE);
+       assert(My_Connections[Idx].sock > NONE);
+
+       /* Check if the read buffer is "full". Basically this shouldn't happen
+        * here, because as long as there possibly are commands in the read
+        * buffer (buffer usage > COMMAND_LEN), the socket shouldn't be
+        * scheduled for reading in Conn_Handler() at all ... */
 #ifdef ZLIB
        if ((array_bytes(&My_Connections[Idx].rbuf) >= READBUFFER_LEN) ||
                (array_bytes(&My_Connections[Idx].zip.rbuf) >= READBUFFER_LEN))
@@ -1556,7 +1582,6 @@ Read_Request( CONN_ID Idx )
        if (array_bytes(&My_Connections[Idx].rbuf) >= READBUFFER_LEN)
 #endif
        {
-               /* Read buffer is full */
                Log(LOG_ERR,
                    "Receive buffer space exhausted (connection %d): %d/%d bytes",
                    Idx, array_bytes(&My_Connections[Idx].rbuf), READBUFFER_LEN);
@@ -1564,12 +1589,14 @@ Read_Request( CONN_ID Idx )
                return;
        }
 
+       /* Now read new data from the network, up to READBUFFER_LEN bytes ... */
 #ifdef SSL_SUPPORT
        if (Conn_OPTION_ISSET(&My_Connections[Idx], CONN_SSL))
-               len = ConnSSL_Read( &My_Connections[Idx], readbuf, sizeof(readbuf));
+               len = ConnSSL_Read(&My_Connections[Idx], readbuf, sizeof(readbuf));
        else
 #endif
-       len = read(My_Connections[Idx].sock, readbuf, sizeof(readbuf));
+               len = read(My_Connections[Idx].sock, readbuf, sizeof(readbuf));
+
        if (len == 0) {
                LogDebug("Client \"%s:%u\" is closing connection %d ...",
                         My_Connections[Idx].host,
@@ -1579,13 +1606,20 @@ Read_Request( CONN_ID Idx )
        }
 
        if (len < 0) {
-               if( errno == EAGAIN ) return;
+               if (errno == EAGAIN)
+                       return;
+
                Log(LOG_ERR, "Read error on connection %d (socket %d): %s!",
                    Idx, My_Connections[Idx].sock, strerror(errno));
                Conn_Close(Idx, "Read error", "Client closed connection",
                           false);
                return;
        }
+
+       /* Now append the newly received data to the connection buffer.
+        * NOTE: This can lead to connection read buffers being bigger(!) than
+        * READBUFFER_LEN bytes, as we add up to READBUFFER_LEN new bytes to a
+        * buffer possibly being "almost" READBUFFER_LEN bytes already! */
 #ifdef ZLIB
        if (Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ZIP)) {
                if (!array_catb(&My_Connections[Idx].zip.rbuf, readbuf,
@@ -1832,6 +1866,9 @@ Check_Connections(void)
        CLIENT *c;
        CONN_ID i;
        char msg[64];
+       time_t time_now;
+
+       time_now = time(NULL);
 
        for (i = 0; i < Pool_Size; i++) {
                if (My_Connections[i].sock < 0)
@@ -1846,7 +1883,7 @@ Check_Connections(void)
                            My_Connections[i].lastdata) {
                                /* We already sent a ping */
                                if (My_Connections[i].lastping <
-                                   time(NULL) - Conf_PongTimeout) {
+                                   time_now - Conf_PongTimeout) {
                                        /* Timeout */
                                        snprintf(msg, sizeof(msg),
                                                 "Ping timeout: %d seconds",
@@ -1855,10 +1892,10 @@ Check_Connections(void)
                                        Conn_Close(i, NULL, msg, true);
                                }
                        } else if (My_Connections[i].lastdata <
-                                  time(NULL) - Conf_PingTimeout) {
+                                  time_now - Conf_PingTimeout) {
                                /* We need to send a PING ... */
                                LogDebug("Connection %d: sending PING ...", i);
-                               Conn_UpdatePing(i);
+                               Conn_UpdatePing(i, time_now);
                                Conn_WriteStr(i, "PING :%s",
                                              Client_ID(Client_ThisServer()));
                        }
@@ -1869,7 +1906,7 @@ Check_Connections(void)
                         * still not registered. */
 
                        if (My_Connections[i].lastdata <
-                           time(NULL) - Conf_PongTimeout) {
+                           time_now - Conf_PongTimeout) {
                                LogDebug
                                    ("Unregistered connection %d timed out ...",
                                     i);
index c642541f07ce486b712f5a3b0e719a438d9ea8da..869477f091f69f2f9ed2d7f6b40dbb8c7109a85b 100644 (file)
@@ -105,9 +105,17 @@ typedef struct _Connection
 #endif
 } CONNECTION;
 
-GLOBAL CONNECTION *My_Connections;
-GLOBAL CONN_ID Pool_Size;
-GLOBAL long WCounter;
+
+#ifdef CONN_MODULE_GLOBAL_INIT
+CONNECTION *My_Connections;
+CONN_ID Pool_Size;
+long WCounter;
+#else
+extern CONNECTION *My_Connections;
+extern CONN_ID Pool_Size;
+extern long WCounter;
+#endif
+
 
 #define CONNECTION2ID(x) (long)(x - My_Connections)
 
index 82bd55182d774a54343c4634ae5271032a3aba8c..e38d5bb6f3338629f35cc2e22b7ef46bb08f6e15 100644 (file)
@@ -1565,7 +1565,8 @@ IRC_Send_ISUPPORT(CLIENT * Client)
                                                   Conf_Network))
                return DISCONNECTED;
        if (!IRC_WriteStrClient(Client, RPL_ISUPPORT1_MSG, Client_ID(Client),
-                               CHANTYPES, CHANTYPES, Conf_MaxJoins))
+                               Conf_AllowedChannelTypes, Conf_AllowedChannelTypes,
+                               Conf_MaxJoins))
                return DISCONNECTED;
        return IRC_WriteStrClient(Client, RPL_ISUPPORT2_MSG, Client_ID(Client),
                                  CHANNEL_NAME_LEN - 1, Conf_MaxNickLength - 1,
index 846b10d6e8aa2f08951c393f545aba0deb8ae331..368a03d46bef6ff775ecc029051b427d21cbef32 100644 (file)
@@ -877,11 +877,20 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
                    (long)(time(NULL) - Conn_GetSignon(conn)),
                    time(NULL) - Conn_GetSignon(conn) == 1 ? "" : "s",
                    Client_UserCount(), Channel_CountVisible(NULL));
-               Conn_UpdatePing(conn);
-       } else
-               LogDebug("Connection %d: received PONG. Lag: %ld seconds.",
-                        conn, (long)(time(NULL) - Conn_LastPing(conn)));
+       }
+#ifdef DEBUG
+       else {
+               if (Conn_LastPing(conn) > 1)
+                       LogDebug("Connection %d: received PONG. Lag: %ld seconds.",
+                                conn, (long)(time(NULL) - Conn_LastPing(conn)));
+               else
+                       LogDebug("Got unexpected PONG on connection %d. Ignored.",
+                                conn);
+       }
+#endif
 
+       /* We got a PONG, so signal that none is pending on this connection. */
+       Conn_UpdatePing(conn, 1);
        return CONNECTED;
 } /* IRC_PONG */
 
index e877213ef7629f14c0a10593e6c389d5b0bcd76d..ae333b1018d1156f74414ee6c41ae7971ec32b10 100644 (file)
@@ -447,10 +447,11 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req)
                if (Class_AddMask(class, Req->argv[0],
                                  timeout,
                                  Req->argv[2])) {
-                       Log(LOG_NOTICE|LOG_snotice,
-                           "\"%s\" added \"%s\" to %c-Line list: \"%s\" (%ld seconds).",
-                           Client_Mask(from), Req->argv[0], class_c,
-                           Req->argv[2], atol(Req->argv[1]));
+                       if (Client_Type(from) != CLIENT_SERVER)
+                               Log(LOG_NOTICE|LOG_snotice,
+                                   "\"%s\" added \"%s\" to %c-Line list: \"%s\" (%ld seconds).",
+                                   Client_Mask(from), Req->argv[0], class_c,
+                                   Req->argv[2], atol(Req->argv[1]));
                        if (class == CLASS_GLINE) {
                                /* Inform other servers */
                                IRC_WriteStrServersPrefix(Client, from,
index 317a3e1a1bf99c8379cb20e83419684024c262af..3f9753b9670d93205d5d6504e34e9f87e5984cdf 100644 (file)
@@ -186,6 +186,15 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                if (!Client_CheckID(Client, Req->argv[0]))
                        return DISCONNECTED;
 
+               if (!Req->prefix) {
+                       /* We definitely need a prefix here! */
+                       Log(LOG_ALERT, "Got SERVER command without prefix! (on connection %d)",
+                           Client_Conn(Client));
+                       Conn_Close(Client_Conn(Client), NULL,
+                                  "SERVER command without prefix", true);
+                       return DISCONNECTED;
+               }
+
                from = Client_Search( Req->prefix );
                if (! from) {
                        /* Uh, Server, that introduced the new server is unknown?! */
@@ -358,7 +367,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
 {
        char msg[COMMAND_LEN], logmsg[COMMAND_LEN];
        CLIENT *from, *target;
-       CONN_ID con;
+       CONN_ID con, client_con;
        int loglevel;
 
        assert(Client != NULL);
@@ -398,6 +407,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
                return CONNECTED;
        }
 
+       client_con = Client_Conn(Client);
        con = Client_Conn(target);
 
        if (Req->argv[1][0])
@@ -419,7 +429,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
                                Req->argv[0], Client_ID(from),
                                Req->argv[1][0] ? Req->argv[1] : "-");
                Conn_Close(con, NULL, msg, true);
-               if (con == Client_Conn(Client))
+               if (con == client_con)
                        return DISCONNECTED;
        } else {
                /* This server is not directly connected, so the SQUIT must
index 7166640ba054288c08030f331ddf9c9724e0a073..41255ca0d97eab650f96ef147fd7ceedb9bc34e3 100644 (file)
@@ -9,6 +9,7 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
+#define GLOBAL_INIT
 #include "portab.h"
 
 /**
index 70d5ed3ed26327fb14722df062b2a6b834bb6d93..43f2f9070c20caa28cdeee403d80b177dfa95b91 100644 (file)
@@ -102,7 +102,11 @@ typedef unsigned char bool;
 #endif
 
 #undef GLOBAL
+#ifdef GLOBAL_INIT
 #define GLOBAL
+#else
+#define GLOBAL extern
+#endif
 
 /* SPLint */
 
index 96d37f19a526885f20e1a29922a37c1a4f83b50b..f866e6080af46c8b33f648b7944af6bd01563a49 100644 (file)
@@ -23,13 +23,19 @@ EXTRA_DIST = \
        stress-A.e stress-B.e \
        server-login-test.e \
        start-server1 stop-server1 ngircd-test1.conf \
-       start-server2 stop-server2 ngircd-test2.conf
+       start-server2 stop-server2 ngircd-test2.conf \
+       start-server3 stop-server3 ngircd-test3.conf \
+       reload-server3 reload-server.sh prep-server3 cleanup-server3 switch-server3 \
+       connect-ssl-cert1-test.e connect-ssl-cert2-test.e \
+       ssl/cert-my-first-domain-tld.pem ssl/cert-my-second-domain-tld.pem \
+       ssl/dhparams-my-first-domain-tld.pem ssl/dhparams-my-second-domain-tld.pem \
+       ssl/key-my-first-domain-tld.pem ssl/key-my-second-domain-tld.pem
 
 all:
 
 clean-local:
        rm -rf logs tests *-test ngircd-test*.log procs.tmp tests-skipped.lst \
-        T-ngircd1 ngircd-test1.motd T-ngircd2 ngircd-test2.motd
+        T-ngircd1 ngircd-test1.motd T-ngircd2 ngircd-test2.motd T-ngircd3 ngircd-test3.motd
 
 maintainer-clean-local:
        rm -f Makefile Makefile.in Makefile.am
@@ -39,6 +45,7 @@ check_SCRIPTS = ngircd-TEST-Binary tests.sh
 ngircd-TEST-Binary:
        cp ../ngircd/ngircd T-ngircd1
        cp ../ngircd/ngircd T-ngircd2
+       cp ../ngircd/ngircd T-ngircd3
        [ -f getpid.sh ] || ln -s $(srcdir)/getpid.sh .
        rm -f tests-skipped.lst
 
@@ -46,6 +53,14 @@ connect-test: tests.sh
        rm -f connect-test
        ln -s $(srcdir)/tests.sh connect-test
 
+connect-ssl-cert1-test: tests.sh
+       rm -f connect-ssl-cert1-test
+       ln -s $(srcdir)/tests.sh connect-ssl-cert1-test
+
+connect-ssl-cert2-test: tests.sh
+       rm -f connect-ssl-cert2-test
+       ln -s $(srcdir)/tests.sh connect-ssl-cert2-test
+
 channel-test: tests.sh
        rm -f channel-test
        ln -s $(srcdir)/tests.sh channel-test
@@ -113,4 +128,16 @@ TESTS = start-server1 \
        stress-server.sh \
        stop-server1
 
+if HAVE_SSL
+TESTS += \
+       prep-server3 \
+       start-server3 \
+       connect-ssl-cert1-test \
+       switch-server3 \
+       reload-server3 \
+       connect-ssl-cert2-test \
+       cleanup-server3 \
+       stop-server3
+endif
+
 # -eof-
diff --git a/src/testsuite/cleanup-server3 b/src/testsuite/cleanup-server3
new file mode 100755 (executable)
index 0000000..a80fe73
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+rm ssl/cert.pem ssl/key.pem ssl/dhparams.pem
diff --git a/src/testsuite/connect-ssl-cert1-test.e b/src/testsuite/connect-ssl-cert1-test.e
new file mode 100644 (file)
index 0000000..e692110
--- /dev/null
@@ -0,0 +1,21 @@
+# ngIRCd test suite
+# Server connect test
+
+spawn openssl s_client -quiet -connect 127.0.0.1:6790
+expect {
+        timeout { exit 1 }
+        "*CN = my.first.domain.tld"
+}
+
+sleep 2
+send "oper\r"
+expect {
+       timeout { exit 1 }
+       "451"
+}
+
+send "quit\r"
+expect {
+       timeout { exit 1 }
+       "Connection closed"
+}
diff --git a/src/testsuite/connect-ssl-cert2-test.e b/src/testsuite/connect-ssl-cert2-test.e
new file mode 100644 (file)
index 0000000..eea4245
--- /dev/null
@@ -0,0 +1,22 @@
+# ngIRCd test suite
+# Server connect test
+
+spawn openssl s_client -quiet -connect 127.0.0.1:6790
+expect {
+        timeout { exit 1 }
+        "*CN = my.second.domain.tld"
+}
+
+sleep 2
+send "oper\r"
+expect {
+       timeout { exit 1 }
+       "451"
+}
+
+send "quit\r"
+expect {
+       timeout { exit 1 }
+       "Connection closed"
+}
+
index c088f5cc2ea13bbbdecf42b45096f3a6df77c1c9..643dde42eec5490feba9acf923b818a85d478fe8 100644 (file)
@@ -61,6 +61,49 @@ expect {
        timeout { exit 1 }
        "405"
 }
+send "JOIN 0\r"
+
+send "JoIn #MultiMode\r"
+expect {
+       timeout { exit 1 }
+       "474 nick #MultiMode"
+}
+
+send "OPer TestOp 123\r"
+expect {
+       timeout { exit 1 }
+       "381"
+}
+
+send "Mode #MultiMode -b nick!~user\r"
+expect {
+       timeout { exit 1 }
+       "MODE #MultiMode -b nick!~user@*"
+}
+
+send "jOiN #MULTIMODE\r"
+expect {
+       timeout { exit 1 }
+       "@* JOIN :#MULTIMODE"
+}
+expect {
+       timeout { exit 1 }
+       "366"
+}
+send "ModE #MULTImode\r"
+expect {
+       timeout { exit 1 }
+       "324 nick #MultiMode +Pnt"
+}
+send "mODe #multimode +b\r"
+expect {
+       timeout { exit 1 }
+       "367 nick #MultiMode banned!~ghost@example.com ngircd.test.server"
+}
+expect {
+       timeout { exit 1 }
+       "368 nick #MultiMode"
+}
 
 send "quit\r"
 expect {
index ab240a7c4aa285fb68c55923fb49458031207504..233238aa1013f01092c49a211d10633d2dffa937 100644 (file)
        Name = +ModelessChannel
        Topic = A modeless Channel
 
+[Channel]
+       Name = MultiMode
+       Modes = +n +b nick!~user
+       Modes = +t
+       Modes = +b banned!~ghost@example.com
+
 # -eof-
diff --git a/src/testsuite/ngircd-test3.conf b/src/testsuite/ngircd-test3.conf
new file mode 100644 (file)
index 0000000..1117e37
--- /dev/null
@@ -0,0 +1,31 @@
+# ngIRCd test suite
+# configuration file for test server #1
+
+[Global]
+       Name = ngircd.test.server
+       Info = ngIRCd Test-Server 3
+       Listen = 127.0.0.1
+       Ports = 6789
+       MotdFile = ngircd-test3.motd
+       AdminEMail = admin@irc.server
+
+[SSL]
+        CertFile = ssl/cert.pem
+        KeyFile = ssl/key.pem
+        DHFile = ssl/dhparams.pem
+        Ports = 6790
+
+
+[Limits]
+       MaxConnectionsIP = 0
+       MaxJoins = 4
+       MaxPenaltyTime = 1
+
+[Options]
+       OperCanUseMode = yes
+       Ident = no
+       IncludeDir = /var/empty
+       DNS = no
+       PAM = no
+
+# -eof-
diff --git a/src/testsuite/prep-server3 b/src/testsuite/prep-server3
new file mode 100755 (executable)
index 0000000..054c670
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+cp ssl/cert-my-first-domain-tld.pem ssl/cert.pem
+cp ssl/key-my-first-domain-tld.pem ssl/key.pem
+cp ssl/dhparams-my-first-domain-tld.pem ssl/dhparams.pem
diff --git a/src/testsuite/reload-server.sh b/src/testsuite/reload-server.sh
new file mode 100755 (executable)
index 0000000..b17d672
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+# ngIRCd Test Suite
+
+[ -z "$srcdir" ] && srcdir=`dirname $0`
+
+# read in functions
+. ${srcdir}/functions.inc
+
+if [ -n "$1" ]; then
+       id="$1"; shift
+else
+       id="1"
+fi
+
+echo_n "reloading server ${id} ..."
+
+# reload (sighup) test-server ...
+pid=`./getpid.sh T-ngircd${id}`
+if [ -z "$pid" ]; then
+  echo " failure: no running server found!?"
+  exit 1
+fi
+kill -HUP $pid > /dev/null 2>&1; r=$?
+if [ $r -eq 0 ]; then
+  echo " ok".
+  exit 0
+fi
+echo " failure: server ${id} could not be restarted"
+exit 1
+
+# -eof-
diff --git a/src/testsuite/reload-server3 b/src/testsuite/reload-server3
new file mode 100755 (executable)
index 0000000..da7b37e
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+# ngIRCd Test Suite
+
+[ -z "$srcdir" ] && srcdir=`dirname $0`
+${srcdir}/reload-server.sh 3
+
+# -eof-
index b5226a7d530ad272aceb8efc7943f2b5e95d9fc3..bdf95e0935b28ed90a1322d9f75d1f0dd0d4148b 100644 (file)
@@ -45,7 +45,7 @@ expect {
 }
 expect {
        timeout { exit 1 }
-       ":ngircd.test.server CHANINFO #FullKeyed +Plk Secret 0 :"
+       ":ngircd.test.server CHANINFO #FullKeyed +Pkl Secret 0 :"
 }
 expect {
        timeout { exit 1 }
diff --git a/src/testsuite/ssl/cert-my-first-domain-tld.pem b/src/testsuite/ssl/cert-my-first-domain-tld.pem
new file mode 100644 (file)
index 0000000..1b3961d
--- /dev/null
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEDDCCAnSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAeMRwwGgYDVQQDExNteS5m
+aXJzdC5kb21haW4udGxkMB4XDTIwMDQyNDA4MjQyNVoXDTQ3MDkxMDA4MjQyNVow
+HjEcMBoGA1UEAxMTbXkuZmlyc3QuZG9tYWluLnRsZDCCAaIwDQYJKoZIhvcNAQEB
+BQADggGPADCCAYoCggGBAJ3HvAIDQxL/o7yoemMH5OZEXyFTQ/Q838UY0lXbWBb0
+Lsz9ft0UFtu/SSabHLLJHQME99IyleYiMwi0Y3oqDCVZp6eqeKS7MTRIot2D1m4T
+QsK13dAvZOaEYPsltdsFDCP75s07tDp9aYYsHDsNhHu8LxUachmb3747/v1E1TGZ
+T5BSnzGxEsQo1vzKKMpMbjct1d3zdQRB1o/r6BlaPykTAaB1DkM7GOOdtprhO/Sh
+PbfXL+BHgldPbxboul7NTt1r2CfqFmz4Pi4PbCruv0HVG8N8egN6Jb80UuwOiCcM
+BxY9uhCh6ZPoZ9ufmGALhkgD0rlt/sQfKQ0EImzx8cC/6zvSfJQ0WazLp/wCImkP
+QZwKm/U6RMHWtthHg4pJRsYF5rL2+YMqebTcG655+fgQm9EI+ZcAqWIbnogGA046
+oS1X7805ogBo7OPMlJ19NjxOc3yS9dXlk6hEe0AKSCCusy4lI4gcGd2gwmAtXp3i
+ZVkFBsUsmBe3x5sEAEVVyQIDAQABo1UwUzAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM
+MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHoAAwHQYDVR0OBBYEFFst+QAEUdCP
+V80/hmOEBKtjOMRLMA0GCSqGSIb3DQEBCwUAA4IBgQCOEIJgi0H1lc33dU8Na4//
+CI3rOOYwFnSiiUe8A5n38LsU2ZrwwJmn60JgNdAmrNkXTI8qNTuTU6XIOAqq32FY
+wdNqPt7wE7UDRMQeMDlLNo+lnuI1XrBxk9mEpfmyGeGqeIDIr5vlEWs4Snr73RC0
+iQBUD6qGdhZa/ABm342psSA4OxtjCn6mBBT/gSi8yCO0Po8yFvndGMe3kNQFwir4
+supxptzqFDCDOQOYSgUy2QT7wlFAqPdZWMSepdeoaBYrqBsvf9shWC0iChKJxnCp
+SVZpoPysxuVyQMKjjzTJcNDwydMyIny4Z9rt+kkvgn/JDxIQe1+jJ8dJR+VWQeNe
+we604uEsN0hWq1FkkMO8NQdbM4xipDciEanHunWvwFkXuIuc0aEpqIchU32O2wav
+ck8ytssLLQDGaJLHx6iOB2MCi8HbS8U9xfrg8JJIFnxmnkKdI6x2akzYm+nqDxqQ
+dGeoVJgegiamYlydkGskw04oGkD16H0LQwlzsDwgvP8=
+-----END CERTIFICATE-----
diff --git a/src/testsuite/ssl/cert-my-second-domain-tld.pem b/src/testsuite/ssl/cert-my-second-domain-tld.pem
new file mode 100644 (file)
index 0000000..f8d8985
--- /dev/null
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEDjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDExRteS5z
+ZWNvbmQuZG9tYWluLnRsZDAeFw0yMDA0MjQwODIzNDBaFw00NzA5MTAwODIzNDBa
+MB8xHTAbBgNVBAMTFG15LnNlY29uZC5kb21haW4udGxkMIIBojANBgkqhkiG9w0B
+AQEFAAOCAY8AMIIBigKCAYEA4+442scsdqSf6O4UO/RskMzOX8BhDcSwrhGe97jd
+CuQKUqS6OT1UoHK0DdMkxHlOMhifPzKxoBQlI/02l14tV//xNArKj4a+BZzNS1mp
+3adjgTc3uRDQHmHVZUzH4VXhL2zZ1EXVaJULZVWJYAqMW8GOObs+Kwijo+zxBGRs
+96Re9sg3XMkCUN+ZMoCpqoU4R/QiJ5z7B4AXS9CVcvczQKiULn1otP+UQQ4ABHlN
+t8pZzR6P/WGy91PvGt5wWfpReGveP/Zl2tksVXXs0CQgteneblYVzj01MaobVW59
+/LGUpe0oQy2rtzQVX3DZkDoGwGh4lof2Af+xMjCbVL6oDbPPooXG8TJnDP3AVhMG
+KIb+EhBUIEJnd/z6ZXTWbv0KQOt4wiVBzuXVBf7xxn/aH4+3kyrnj7CsUHXM4++x
+KRZq7gaP7nRbN22rw+WCHnqvMfAGnS7/6AjKFUWxmNWxRXMX+ehsSbT/XQnQm88e
+oUBLzQc4JrNSPklVJ82Qp19tAgMBAAGjVTBTMAwGA1UdEwEB/wQCMAAwEwYDVR0l
+BAwwCgYIKwYBBQUHAwEwDwYDVR0PAQH/BAUDAwegADAdBgNVHQ4EFgQUdnjZogYk
+7JK21Fj2NfYwrtJzK1EwDQYJKoZIhvcNAQELBQADggGBABDreWdgeyLMvqv1fO1f
+zbkSxUp57XoQsX3G/1nUfjT2Zujxwvu8D9N74R3I/BsxVTiI4RL2LZj33q+eq0KX
+LG/zBH2DEBheMmQtbMS6Ah+MTSlvG8SDlRRYPEVdYYtXOwskGNyIwcqNTr0j2Mrn
+Zlre0VJQc5r94seoVCjCseio26I9qf0LW2QsGfk4vSMJlhTRkcbBjKABG8xGXv61
++Hd4OFA0e/gOzFZFwDxWEsks5d8w6kzyipdGcCezBhlDi/qNCAex1GVTdUsCbGNS
+9N2i1Cty01AJbrkfWwKCc/Xg/YV/9PVncoiwJSIILllmFvLPu0vRof8AX/4DxEkS
+YFnN2x+qyukW+DfSnC3YSqyKdKtvB0U0Xf4tcHQfX2kHS/PqOIR6F9trY45ZlXoA
+nQKf1vcsIJzHW1mi9SvyVgyp3HftPw5xIU15mHRHBfBEzkVNwZJxyCl6nd++4vMS
+DmzpJPCT/a8rl1Jj5yyQ5zJp06Z7FbPpkT9kiAB5+U/vKw==
+-----END CERTIFICATE-----
diff --git a/src/testsuite/ssl/dhparams-my-first-domain-tld.pem b/src/testsuite/ssl/dhparams-my-first-domain-tld.pem
new file mode 100644 (file)
index 0000000..011750b
--- /dev/null
@@ -0,0 +1,77 @@
+
+Recommended key length: 256 bits
+
+generator:
+       39:76:54:fb:49:4c:58:2c:f6:62:3a:81:d1:1e:ef:55
+       97:da:5a:9c:f8:11:e4:23:26:91:e2:d4:14:94:14:e1
+       d2:82:69:b6:f0:2e:af:08:cc:bc:21:0d:e5:a7:40:f9
+       8d:18:a2:52:6a:41:de:57:c7:17:0d:23:b9:36:3c:33
+       ef:ff:0b:85:b1:a9:59:65:49:46:36:3b:57:e4:b7:91
+       4b:6c:56:1a:47:44:d8:5b:8a:bd:93:93:41:81:01:9d
+       31:8d:3d:b8:a6:6c:7e:48:aa:86:b6:68:eb:66:0b:f3
+       42:58:c5:ef:65:75:9d:8d:0f:18:21:25:86:40:a6:fd
+       23:15:58:82:57:df:b6:0d:e5:c9:f1:85:ef:ec:ae:4a
+       b4:1b:70:ac:f5:c8:75:57:d6:4b:17:ca:f1:a1:45:13
+       c0:e7:2b:b9:26:92:c0:a1:c4:ba:87:4e:b7:37:2f:6c
+       02:51:86:95:2d:f3:c1:7e:c1:f7:00:52:00:0d:43:f2
+       aa:8d:af:f6:5a:4f:a8:65:a5:26:af:58:fa:5d:fb:77
+       42:e2:1e:19:f5:0f:8a:f2:9b:6b:9a:c0:2c:60:4f:45
+       da:9c:54:97:67:6a:e3:62:b9:c1:a0:3d:bf:cb:aa:22
+       23:3b:08:bc:29:6a:a5:91:5e:76:1b:60:1d:c2:02:85
+       2e:c6:85:20:5a:6e:0b:84:e3:e3:88:4e:c5:48:f3:c8
+       c1:71:b0:22:22:70:00:27:99:c6:dc:50:62:2d:be:55
+       65:af:60:d7:43:44:2f:97:72:a2:66:48:fa:ee:af:7a
+       81:cc:77:97:95:61:74:37:44:f2:b9:8e:9a:90:e4:45
+       89:69:66:fe:52:fe:82:d2:de:4c:11:64:a2:c3:6e:00
+       e4:a7:58:4f:e9:61:0d:d2:72:a1:fb:72:89:84:73:64
+       de:1a:2c:0f:7e:46:5f:73:f6:67:3f:14:86:1c:90:bf
+       49:d6:d1:3c:6a:6a:8b:42:29:22:02:47:c4:b9:bb:64
+       
+
+prime:
+       90:cb:d2:ec:9f:0c:6c:69:f5:c0:46:e1:9c:fc:4d:3b
+       ff:65:40:32:66:d5:fa:e0:ee:88:7d:35:ad:5e:1a:37
+       07:db:c0:ed:a4:b2:94:ed:41:b4:be:be:35:e3:36:ff
+       04:c2:48:4d:f0:e9:d2:54:54:de:10:4b:1c:6b:0e:e6
+       8f:c1:8a:9f:9d:e2:f0:9e:35:52:b7:2a:29:5e:e1:95
+       c0:e0:6e:2b:a9:eb:00:fb:fe:90:d9:aa:02:2d:52:e5
+       09:fe:5a:e9:5e:73:e1:94:d1:a5:a1:f5:3b:97:e8:53
+       67:ea:86:a7:f2:70:5c:31:7f:ed:23:f1:ce:01:62:e5
+       0c:7b:7c:18:67:ec:42:35:e8:d1:3d:e1:74:f9:77:02
+       fb:8d:24:a7:bf:3a:38:36:cf:82:9e:90:b2:7c:c3:f3
+       d3:e4:f1:55:ca:4b:1e:5e:50:b9:3b:d8:6a:6c:c2:51
+       a9:a7:e2:86:02:ef:7b:c2:d1:80:e2:dd:e0:7c:e2:03
+       e5:b1:e9:5b:45:c7:56:bb:37:56:9a:4a:0e:7e:b6:f6
+       a5:95:ef:93:5f:f9:38:16:e3:73:b5:68:a7:98:15:a2
+       6c:ff:6b:2e:89:f7:9f:f8:a9:d7:ce:a4:9a:de:cb:42
+       90:40:7b:fe:6c:3a:e0:4c:42:fe:0c:af:4e:7f:37:be
+       fd:3b:31:17:f6:30:0d:52:a5:ca:19:c3:c6:a4:dc:48
+       ec:59:02:6e:5a:80:b8:09:7d:3d:9a:00:32:7a:d7:fe
+       84:38:12:22:7f:c6:97:88:91:05:7f:ba:74:2b:8c:36
+       a0:e4:d7:1c:22:2f:0b:6a:cb:a8:71:40:d2:b1:ed:9f
+       43:79:2f:a6:34:7d:c0:65:c4:04:fa:d4:5c:14:7c:4b
+       6f:cb:b2:f8:f0:91:05:33:b7:23:58:e8:4d:ff:3f:ef
+       a4:f3:17:78:9b:5b:f6:f1:49:82:12:de:5d:f7:1d:47
+       1e:08:7f:ee:2d:10:68:f8:a5:97:03:9d:32:d2:9c:b7
+       
+
+
+-----BEGIN DH PARAMETERS-----
+MIIDDQKCAYEAkMvS7J8MbGn1wEbhnPxNO/9lQDJm1frg7oh9Na1eGjcH28DtpLKU
+7UG0vr414zb/BMJITfDp0lRU3hBLHGsO5o/Bip+d4vCeNVK3Kile4ZXA4G4rqesA
++/6Q2aoCLVLlCf5a6V5z4ZTRpaH1O5foU2fqhqfycFwxf+0j8c4BYuUMe3wYZ+xC
+NejRPeF0+XcC+40kp786ODbPgp6QsnzD89Pk8VXKSx5eULk72GpswlGpp+KGAu97
+wtGA4t3gfOID5bHpW0XHVrs3VppKDn629qWV75Nf+TgW43O1aKeYFaJs/2suifef
++KnXzqSa3stCkEB7/mw64ExC/gyvTn83vv07MRf2MA1SpcoZw8ak3EjsWQJuWoC4
+CX09mgAyetf+hDgSIn/Gl4iRBX+6dCuMNqDk1xwiLwtqy6hxQNKx7Z9DeS+mNH3A
+ZcQE+tRcFHxLb8uy+PCRBTO3I1joTf8/76TzF3ibW/bxSYIS3l33HUceCH/uLRBo
++KWXA50y0py3AoIBgDl2VPtJTFgs9mI6gdEe71WX2lqc+BHkIyaR4tQUlBTh0oJp
+tvAurwjMvCEN5adA+Y0YolJqQd5XxxcNI7k2PDPv/wuFsalZZUlGNjtX5LeRS2xW
+GkdE2FuKvZOTQYEBnTGNPbimbH5Iqoa2aOtmC/NCWMXvZXWdjQ8YISWGQKb9IxVY
+glfftg3lyfGF7+yuSrQbcKz1yHVX1ksXyvGhRRPA5yu5JpLAocS6h063Ny9sAlGG
+lS3zwX7B9wBSAA1D8qqNr/ZaT6hlpSavWPpd+3dC4h4Z9Q+K8ptrmsAsYE9F2pxU
+l2dq42K5waA9v8uqIiM7CLwpaqWRXnYbYB3CAoUuxoUgWm4LhOPjiE7FSPPIwXGw
+IiJwACeZxtxQYi2+VWWvYNdDRC+XcqJmSPrur3qBzHeXlWF0N0TyuY6akORFiWlm
+/lL+gtLeTBFkosNuAOSnWE/pYQ3ScqH7comEc2TeGiwPfkZfc/ZnPxSGHJC/SdbR
+PGpqi0IpIgJHxLm7ZAICAQA=
+-----END DH PARAMETERS-----
diff --git a/src/testsuite/ssl/dhparams-my-second-domain-tld.pem b/src/testsuite/ssl/dhparams-my-second-domain-tld.pem
new file mode 100644 (file)
index 0000000..a158861
--- /dev/null
@@ -0,0 +1,77 @@
+
+Recommended key length: 256 bits
+
+generator:
+       da:16:f5:61:0c:09:de:cd:9b:be:b8:2b:c9:96:97:1b
+       fc:29:b2:a5:1b:ee:d3:36:bd:6c:73:7e:1c:2a:35:71
+       26:c6:54:b6:28:24:db:87:9d:fc:9e:26:28:e9:01:b8
+       85:f2:02:9b:6a:c3:f5:3a:85:ae:1d:8c:e9:e8:c4:41
+       3a:78:2f:9e:f0:2a:77:18:99:a6:91:2b:2b:8c:10:98
+       89:04:d9:03:5f:4f:77:d6:27:1d:5e:ee:a2:d0:b1:c8
+       a7:64:b4:7a:67:5f:aa:3f:02:b0:d2:f7:cd:4c:7a:9d
+       63:57:99:8c:89:17:3f:2d:2d:1d:f5:58:61:49:62:54
+       55:17:be:ea:43:03:44:d7:02:39:67:26:b3:7a:4f:00
+       a3:a1:3b:d9:f3:aa:7a:c5:00:46:86:92:e2:2e:d8:09
+       ee:ca:97:06:c5:33:e5:99:f3:4c:46:81:50:59:6b:60
+       fb:a3:24:2a:f8:8f:e0:fb:a5:c3:9a:7d:f7:f2:d7:30
+       e5:1b:fa:15:a0:ca:6d:f5:64:4f:20:a3:fb:f4:31:55
+       b5:58:c4:6f:06:7d:5d:36:16:03:31:73:57:6b:39:c6
+       10:21:d9:f0:eb:74:43:2e:b0:da:ee:96:86:6e:0c:b5
+       08:78:af:3d:9b:66:71:bc:05:63:9d:aa:a6:2e:bc:c9
+       c0:e4:a4:c6:60:e8:5d:d2:96:55:a3:72:4e:7a:ec:b2
+       a8:23:b9:3f:7c:33:5d:f0:5f:29:57:cd:8e:9a:fd:7b
+       b6:83:7f:56:ba:64:bd:a8:1c:83:7f:ee:04:f1:bb:1f
+       70:6d:08:46:a2:95:e6:6e:2a:54:44:d9:af:9d:22:a4
+       50:6d:88:65:de:05:89:99:75:7e:0c:12:d9:25:43:f7
+       da:b6:41:f8:60:68:f7:6a:f6:a4:8d:8b:93:82:87:56
+       c1:80:4d:e6:66:37:1e:22:5c:86:90:d1:8e:02:3a:18
+       34:84:6a:da:e5:4f:a5:4f:29:78:46:97:71:24:80:92
+       
+
+prime:
+       f8:98:84:b9:b2:75:39:d5:da:14:fa:4a:03:96:57:78
+       95:4e:8c:ba:c3:89:de:36:2c:4a:2b:0a:31:08:09:89
+       bb:f6:00:a1:0b:64:02:52:1e:3f:23:67:df:2c:97:7a
+       7a:81:e0:b0:ae:00:bf:a6:8f:02:e1:62:d4:dc:9e:62
+       9a:27:f2:cf:4f:88:73:96:de:8a:61:1c:ac:3f:bb:f3
+       0d:be:5e:07:3b:6f:da:0c:10:03:b5:b2:5a:60:3e:c8
+       6f:aa:2c:3e:92:b9:ec:ee:08:29:90:c3:5e:8e:c1:a4
+       a7:1a:ab:87:f8:70:13:e8:b1:2f:b5:79:c1:bb:8f:21
+       76:b4:1f:ba:91:62:f9:d3:3a:d7:c8:23:00:3e:fe:a5
+       49:51:f8:eb:9f:46:e3:7d:1a:d3:54:a1:3a:d1:4b:05
+       ec:77:6e:80:dc:1b:22:e1:36:2a:a1:75:20:8c:48:bd
+       53:a6:24:c0:b2:47:36:51:0d:69:b3:cc:e6:fe:8c:34
+       0e:1f:16:03:af:81:b7:62:11:a8:82:06:c2:70:00:23
+       fe:0e:e0:fa:a1:e7:3d:cc:81:ae:76:f4:3e:66:84:df
+       3f:63:ba:4e:aa:21:1d:5c:a2:a2:55:0e:53:31:40:7d
+       7a:99:20:77:23:82:0c:a7:b3:1b:dd:13:fc:23:5f:6d
+       58:6