]> arthur.barton.de Git - ngircd.git/commitdiff
Merge branch 'katp32/master'
authorAlexander Barton <alex@barton.de>
Sun, 17 Sep 2023 19:37:45 +0000 (21:37 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 17 Sep 2023 19:37:45 +0000 (21:37 +0200)
Thanks Katherine Peeters for the patch and pull request!

Closes #294.

* katp32/master:
  Improve documentation for --syslog
  Added command line flag to enable syslog
  Split NoSyslog from behaviour of NoDaemon

58 files changed:
.github/workflows/ci.yml [new file with mode: 0644]
.travis.yml [deleted file]
AUTHORS
ChangeLog
NEWS
README.md
configure.ng
contrib/MacOSX/Makefile.am
contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml [deleted file]
contrib/MacOSX/ngIRCd.pmdoc/01ngircd.xml [deleted file]
contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml [deleted file]
contrib/MacOSX/ngIRCd.pmdoc/02de.xml [deleted file]
contrib/MacOSX/ngIRCd.pmdoc/Makefile.am [deleted file]
contrib/MacOSX/ngIRCd.pmdoc/index.xml [deleted file]
contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
contrib/README
contrib/nglog.sh
doc/HowToRelease.txt
doc/sample-ngircd.conf.tmpl
man/ngircd.conf.5.tmpl
src/ngircd/array.c
src/ngircd/channel.c
src/ngircd/client.c
src/ngircd/client.h
src/ngircd/conf.c
src/ngircd/conf.h
src/ngircd/conn-func.c
src/ngircd/conn-zip.c
src/ngircd/conn.c
src/ngircd/conn.h
src/ngircd/defines.h
src/ngircd/io.c
src/ngircd/irc-channel.c
src/ngircd/irc-channel.h
src/ngircd/irc-info.c
src/ngircd/irc-login.c
src/ngircd/irc-mode.c
src/ngircd/irc-op.c
src/ngircd/irc-oper.c
src/ngircd/irc-server.c
src/ngircd/irc.c
src/ngircd/lists.c
src/ngircd/log.c
src/ngircd/log.h
src/ngircd/login.c
src/ngircd/login.h
src/ngircd/messages.h
src/ngircd/ngircd.c
src/ngircd/ngircd.h
src/ngircd/numeric.c
src/ngircd/parse.c
src/ngircd/parse.h
src/ngircd/proc.c
src/ngircd/resolve.c
src/ngircd/sighandlers.c
src/portab/portab.h
src/portab/vsnprintf.c
src/testsuite/README

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644 (file)
index 0000000..a8e3260
--- /dev/null
@@ -0,0 +1,48 @@
+name: ngIRCd CI
+
+on:
+  push:
+    branches:
+      - master
+    paths-ignore:
+      - 'AUTHORS'
+      - 'COPYING'
+      - 'ChangeLog'
+      - 'NEWS'
+      - 'contrib/**'
+      - 'doc/**'
+      - 'man/**'
+      - '**.md'
+      - '**.txt'
+  pull_request:
+    branches:
+      - master
+    paths-ignore:
+      - 'AUTHORS'
+      - 'COPYING'
+      - 'ChangeLog'
+      - 'NEWS'
+      - 'contrib/**'
+      - 'doc/**'
+      - 'man/**'
+      - '**.md'
+      - '**.txt'
+
+jobs:
+  build_and_distcheck:
+
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Install packages
+      run: sudo apt-get install autoconf automake build-essential expect libident-dev libpam-dev libssl-dev libwrap0-dev libz-dev pkg-config telnet
+    - name: Generate build system files
+      run: ./autogen.sh
+    - name: Configure the build system
+      run: ./configure --enable-ipv6 --with-iconv --with-ident --with-openssl --with-pam --with-tcp-wrappers --with-zlib
+    - name: Build everything
+      run: make all
+    - name: Create distribution archive and run tests
+      run: make distcheck
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 3131cbb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-language: c
-addons:
-  apt:
-    packages:
-    - libident-dev
-    - libpam0g-dev
-    - libssl-dev
-    - libwrap0-dev
-    - zlib1g-dev
-    - expect
-    - telnet
-compiler:
-  - gcc
-  - clang
-script: ./autogen.sh && ./configure --enable-ipv6 --with-iconv --with-ident --with-openssl --with-pam --with-tcp-wrappers --with-zlib && make check
diff --git a/AUTHORS b/AUTHORS
index 9df73de795033f04d249907521f0e28beaa2393c..0e18a3bab628e26901f67ecfa511f42b9b5c5148 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,7 +2,7 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2022 Alexander Barton and Contributors.
+               (c)2001-2023 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
index dcbac6ec174cef4ab98015d53b8c81232452b70e..5301eb53c553d46b6cb9cd570e5e8e1481ce3cc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2022 Alexander Barton and Contributors.
+               (c)2001-2023 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
diff --git a/NEWS b/NEWS
index 0e539695cc7e9b39b2549d7f773709eda9e7f173..782e6f64b0a761a8be1a9a1d48398995c180fe40 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2022 Alexander Barton and Contributors.
+               (c)2001-2023 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
index f576481f178b86d2438e1ca5287e50e6937bb1e5..615931861505cf899224a33393f67c0767c7d65c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -22,8 +22,9 @@ 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.
+The development of ngIRCd started back in 2001 and in the meantime it 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
@@ -41,7 +42,6 @@ specified by the RFCs that are used by existing clients.
 - 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
 
index 59d9d9fe8fd5e469650799e6b4cb0b0b3afad2eb..b8bcd24d13bad32c47ecb97ce54450e4f49d1e83 100644 (file)
@@ -101,6 +101,7 @@ AC_DEFUN([WORKING_GETADDRINFO],[
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#include <string.h>
 int
 main(int argc, char **argv)
 {
@@ -709,7 +710,6 @@ AC_CONFIG_FILES([ \
        Makefile \
        contrib/Debian/Makefile \
        contrib/MacOSX/Makefile \
-       contrib/MacOSX/ngIRCd.pmdoc/Makefile \
        contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
        contrib/Makefile \
        doc/Makefile \
index abd799c58c00a36b6d1f1488287fdb23d1a6ec5a..009001c87ce3a736a706121c0a718e6858d42e2b 100644 (file)
@@ -1,6 +1,6 @@
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2008 Alexander Barton <alex@barton.de>
+# Copyright (c)2001-2022 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
@@ -9,7 +9,7 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 
-SUBDIRS = ngIRCd.xcodeproj ngIRCd.pmdoc
+SUBDIRS = ngIRCd.xcodeproj
 
 EXTRA_DIST = de.barton.ngircd.plist.tmpl config.h preinstall.sh postinstall.sh
 
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml b/contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml
deleted file mode 100644 (file)
index a179c99..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<pkg-contents spec="1.12"><f n="ngircd.dest" o="root" g="admin" p="16877" pt="../../ngircd.dest" m="false" t="file"><f n="opt" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="etc" o="root" g="admin" p="16877"><f n="ngircd.motd" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="sbin" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="33261"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="share" o="root" g="admin" p="16877"><f n="doc" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="AUTHORS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Bopm.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="ChangeLog" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="COPYING" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="FAQ.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="GIT.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="HowToRelease.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="INSTALL" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="NEWS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="PAM.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Platforms.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Protocol.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-AUX.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-BeOS.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-Interix.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="RFC.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="sample-ngircd.conf" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Services.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="SSL.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man" o="root" g="admin" p="16877"><f n="man5" o="root" g="admin" p="16877"><f n="ngircd.conf.5" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man8" o="root" g="admin" p="16877"><f n="ngircd.8" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f></pkg-contents>
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/01ngircd.xml b/contrib/MacOSX/ngIRCd.pmdoc/01ngircd.xml
deleted file mode 100644 (file)
index 7823ca6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<pkgref spec="1.12" uuid="46208410-4A1B-48C6-97BD-DE284F13F864"><config><identifier>de.barton.ngircd.daemon.pkg</identifier><version>17.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom>../../ngircd.dest</installFrom><installTo mod="true">/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>extraFiles</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>scripts.preinstall.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>scripts.preupgrade.path</mod><mod>requireAuthorization</mod></config><contents><file-list>02ngircd-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml b/contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml
deleted file mode 100644 (file)
index 1c854e6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<pkg-contents spec="1.12"><f n="de.barton.ngircd.plist" o="root" g="wheel" p="33188" pt="/Users/alex/Develop/ngircd/alex.git/contrib/MacOSX/de.barton.ngircd.plist" m="false" t="file"><mod>group</mod><mod>owner</mod></f></pkg-contents>
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/02de.xml b/contrib/MacOSX/ngIRCd.pmdoc/02de.xml
deleted file mode 100644 (file)
index 600e53f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<pkgref spec="1.12" uuid="F0954DA7-0607-4277-AE10-D882AC7C38CA"><config><identifier>de.barton.ngircd.launchscript.pkg</identifier><version>17.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">de.barton.ngircd.plist</installFrom><installTo mod="true">/Library/LaunchDaemons</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>scripts.preinstall.path</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod><mod>installTo.isAbsoluteType</mod><mod>version</mod><mod>parent</mod><mod>scripts.preupgrade.path</mod><mod>identifier</mod><mod>scripts.postupgrade.path</mod><mod>requireAuthorization</mod><mod>extraFiles</mod><mod>scripts.postupgrade.isRelativeType</mod><mod>installTo.path</mod></config><scripts><preinstall relative="true" mod="true">preinstall.sh</preinstall><postinstall relative="true" mod="true">postinstall.sh</postinstall><preupgrade relative="true" mod="true">preinstall.sh</preupgrade><postupgrade relative="true" mod="true">postinstall.sh</postupgrade></scripts><contents><file-list>01de-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/Makefile.am b/contrib/MacOSX/ngIRCd.pmdoc/Makefile.am
deleted file mode 100644 (file)
index e11eeb1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2008 Alexander Barton <alex@barton.de>
-#
-# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-# Please read the file COPYING, README and AUTHORS for more information.
-#
-
-EXTRA_DIST = index.xml \
- 01ngircd-contents.xml 01ngircd.xml 02de-contents.xml 02de.xml
-
-maintainer-clean-local:
-       rm -f Makefile Makefile.in
-
-# -eof-
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/index.xml b/contrib/MacOSX/ngIRCd.pmdoc/index.xml
deleted file mode 100644 (file)
index 0c8cc55..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-<pkmkdoc spec="1.12"><properties><title>ngIRCd</title><build>../../ngIRCd.mpkg</build><organization>de.barton.ngircd</organization><userSees ui="both"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>ngIRCd â€“ next generation Internet Relay Chat (IRC) server
-  daemon</description><contents><choice title="ngIRCd daemon" id="choicengircd" tooltip="ngIRCd daemon, documentation and manual pages" description="Binaries, documentation and manual pages of the ngIRCd, the next generation IRC (Internet Relay Chat) daemon. This package will be installed into /opt/ngircd." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.daemon.pkg"/></choice><choice title="Start and stop script" id="choicelaunchscript" tooltip="LaunchDaemon start and stop script" description="Installs the ngIRCd start and stop script for the &quot;launch daemon&quot;. If this is an update/upgrade, and ngIRCd is already running, it will be automatically restarted." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.launchscript.pkg"/></choice></contents><resources bg-scale="none" bg-align="bottomleft"><locale lang="en"><resource type="background">../ngIRCd-Logo.gif</resource><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
-
-\f0\i\fs24 \cf0 ngIRCd -- The Next Generation IRC Daemon\
-Copyright (c)2001-2014 Alexander Barton and Contributors.\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-
-\i0 \cf0 \
-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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \
-\
-Please see below and read the file COPYING, README and AUTHORS for more information.\
-\
-\
-\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
-
-\b \cf0 GNU GENERAL PUBLIC LICENSE\
-Version 2, June 1991\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-
-\b0 \cf0 \
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
-\cf0 Copyright (C) 1989, 1991 Free Software Foundation, Inc.\
-59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\
-Everyone is permitted to copy and distribute verbatim copies\
-of this license document, but changing it is not allowed.\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-\cf0 \
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
-
-\b \cf0 Preamble\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-
-\b0 \cf0 \
-The licenses for most software are designed to take away your freedom to share and change it.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.  This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it.  (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.)  You can apply it to your programs, too.\
-\
-When we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.\
-\
-To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.\
-\
-For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their rights.\
-\
-We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.\
-\
-Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software.  If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.\
-\
-Finally, any free program is threatened constantly by software patents.  We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary.  To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.\
-\
-The precise terms and conditions for copying, distribution and modification follow.\
-\page \
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
-
-\b \cf0 GNU GENERAL PUBLIC LICENSE\
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION\
-AND MODIFICATION\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-
-\b0 \cf0 \
-0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License.  The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law:\
-that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.  (Hereinafter, translation is included without limitation in the term "modification".)  Each licensee is addressed as "you".\
-\
-Activities other than copying, distribution and modification are not covered by this License; they are outside its scope.  The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the\
-Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.\
-\
-1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.\
-\
-You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\
-\
-  2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1above, provided that you also meet all of these conditions:\
-\
-    a) You must cause the modified files to carry prominent notices\
-    stating that you changed the files and the date of any change.\
-\
-    b) You must cause any work that you distribute or publish, that in\
-    whole or in part contains or is derived from the Program or any\
-    part thereof, to be licensed as a whole at no charge to all third\
-    parties under the terms of this License.\
-\
-    c) If the modified program normally reads commands interactively\
-    when run, you must cause it, when started running for such\
-    interactive use in the most ordinary way, to print or display an\
-    announcement including an appropriate copyright notice and a\
-    notice that there is no warranty (or else, saying that you provide\
-    a warranty) and that users may redistribute the program under\
-    these conditions, and telling the user how to view a copy of this\
-    License.  (Exception: if the Program itself is interactive but\
-    does not normally print such an announcement, your work based on\
-    the Program is not required to print an announcement.)\
-\page \
-These requirements apply to the modified work as a whole.  If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works.  But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\
-\
-Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.\
-\
-In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\
-\
-3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:\
-\
-    a) Accompany it with the complete corresponding machine-readable\
-    source code, which must be distributed under the terms of Sections\
-    1 and 2 above on a medium customarily used for software\
-    interchange; or,\
-\
-    b) Accompany it with a written offer, valid for at least three\
-    years, to give any third party, for a charge no more than your\
-    cost of physically performing source distribution, a complete\
-    machine-readable copy of the corresponding source code, to be\
-    distributed under the terms of Sections 1 and 2 above on a medium\
-    customarily used for software interchange; or,\
-\
-    c) Accompany it with the information you received as to the offer\
-    to distribute corresponding source code.  (This alternative is\
-    allowed only for noncommercial distribution and only if you\
-    received the program in object code or executable form with such\
-    an offer, in accord with Subsection b above.)\
-\
-The source code for a work means the preferred form of the work for making modifications to it.  For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable.  However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\
-\
-If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not\
-compelled to copy the source along with the object code.\
-\
-4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License.  Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\
-\
-5. You are not required to accept this License, since you have not signed it.  However, nothing else grants you permission to modify or distribute the Program or its derivative works.  These actions are prohibited by law if you do not accept this License.  Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\
-\
-6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions.  You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\
-\
-7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all.  For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.\
-\
-If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\
-\
-It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices.  Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\
-\
-This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\
-\page \
-8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded.  In such case, this License incorporates the limitation as if written in the body of this License.\
-\
-9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\
-\
-Each version is given a distinguishing version number.  If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation.  If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.\
-\
-10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission.  For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this.  Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\
-\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
-
-\b \cf0 NO WARRANTY
-\b0 \
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-\cf0 \
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\
-\
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="readme"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fmodern\fcharset0 Courier;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\f0\fs26 \cf0 Please note:\
-\
-\pard\tx260\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li260\fi-260\ql\qnatural\pardirnatural
-\cf0 \'95      You 
-\b have to adjust the configuration file
-\b0  of ngIRCd, at least if you are installing ngIRCd for the first time on this system (it is preserved while updating, of course).\
-\
-\'95   The daemon is automatically restarted when updating, so your 
-\b users will be disconnected
-\b0 .\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-\cf0 \
-ngIRCd becomes installed in the (newly created) /opt/ngircd directory on your system volume. Interesting files and directories are:\
-\
-\pard\tx260\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li260\fi-260\ql\qnatural\pardirnatural
-\cf0 \'95      
-\f1 /opt/ngircd/sbin/ngircd
-\f0  \'96 executable daemon\
-\'95   
-\f1 /opt/ngircd/etc/ngircd.conf
-\f0  \'96 configuration file\
-\'95   
-\f1 /opt/ngircd/share/doc/ngircd/\'85
-\f0  \'96 documentation\
-\'95   
-\f1 /opt/ngircd/share/mac/\'85
-\f0  \'96 manual pages}]]></resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\f0\fs26 \cf0 ngIRCd is a free and open source daemon for the Internet Relay Chat (IRC) protocol, developed under the GNU General Public License (GPL). It is written from scratch, is quite portable and is not based upon the original IRCd like many others.\
-\
-       ngIRCd Homepage: {\field{\*\fldinst{HYPERLINK "http://ngircd.barton.de"}}{\fldrslt http://ngircd.barton.de}}\
-\
-Please see the documentation for details! You can find it online here on the Homepage:\
-\
-       Documentation: {\field{\*\fldinst{HYPERLINK "http://ngircd.barton.de/documentation"}}{\fldrslt http://ngircd.barton.de/documentation}}\
-\
-You will be guided through all steps necessary to install this software on Mac OS X.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fmodern\fcharset0 Courier;}
-{\colortbl;\red255\green255\blue255;}
-{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid1\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
-{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid101\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
-{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\f0\fs26 \cf0 The daemon has been restarted if it was already running before this installation and you have installed the LaunchDaemon start and stop script (which is the default).\
-\
-If you installed ngIRCd for the first time (or had the LaunchDaemon script disabled before), you can start ngIRCd using the following terminal command:\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\fs20 \cf0 \
-\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
-\ls1\ilvl0
-\f1\fs26 \cf0  sudo launchctl load -w \\\
-        /Library/LaunchDaemons/de.barton.ngircd.plist\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\f0 \cf0 \
-To disable automatic starting of ngIRCd, use this command:\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\fs18 \cf0 \
-\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
-\ls2\ilvl0
-\f1\fs26 \cf0  sudo launchctl unload -w \\\
-        /Library/LaunchDaemons/de.barton.ngircd.plist\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\f0 \cf0 \
-But don\'92t forget to 
-\b adjust the configuration!
-\b0  By default, it is stored in the following file:\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-
-\fs18 \cf0 \
-\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
-
-\f1\fs26 \cf0  /opt/ngircd/etc/ngircd.conf}]]></resource></locale></resources><flags/><extra-files/><item type="file">02de.xml</item><item type="file">01ngircd.xml</item><mod>extraFiles</mod><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
index 989a002bd5dbca033a32490c0ef5b8fbdd580f52..4b2065a51b61c6edb78f0d4a6b1a15f6fb18f901 100644 (file)
                FAA3D27C0F139CF800B2447E /* strtok_r.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = strtok_r.c; sourceTree = "<group>"; };
                FAA3D27D0F139CF800B2447E /* waitpid.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = waitpid.c; sourceTree = "<group>"; };
                FAA3D2800F139D1500B2447E /* Services.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Services.txt; sourceTree = "<group>"; };
-               FAA3D2820F139D2E00B2447E /* 01ngircd-contents.xml */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; path = "01ngircd-contents.xml"; sourceTree = "<group>"; };
-               FAA3D2830F139D2E00B2447E /* 01ngircd.xml */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; path = 01ngircd.xml; sourceTree = "<group>"; };
-               FAA3D2840F139D2E00B2447E /* 02de-contents.xml */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; path = "02de-contents.xml"; sourceTree = "<group>"; };
-               FAA3D2850F139D2E00B2447E /* 02de.xml */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; path = 02de.xml; sourceTree = "<group>"; };
-               FAA3D2860F139D2E00B2447E /* index.xml */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.xml; path = index.xml; sourceTree = "<group>"; };
-               FAA3D2880F139D2E00B2447E /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
                FAA3D28A0F139D2E00B2447E /* postinstall.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = postinstall.sh; sourceTree = "<group>"; };
                FAA3D28B0F139D2E00B2447E /* preinstall.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = preinstall.sh; sourceTree = "<group>"; };
                FAA97C55124A271400D5BBA9 /* sighandlers.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = sighandlers.c; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                FA18A64316CEDE8100132F66 /* Makefile.am */,
-                               FAA3D2810F139D2E00B2447E /* ngIRCd.pmdoc */,
                                FA322DB10CEF7565001761B3 /* config.h */,
                                FA18A64216CEDE5700132F66 /* de.barton.ngircd.plist.tmpl */,
                                FA322D8E0CEF7523001761B3 /* ngIRCd.xcodeproj */,
                        name = ipaddr;
                        sourceTree = "<group>";
                };
-               FAA3D2810F139D2E00B2447E /* ngIRCd.pmdoc */ = {
-                       isa = PBXGroup;
-                       children = (
-                               FAA3D2880F139D2E00B2447E /* Makefile.am */,
-                               FAA3D2860F139D2E00B2447E /* index.xml */,
-                               FAA3D2830F139D2E00B2447E /* 01ngircd.xml */,
-                               FAA3D2820F139D2E00B2447E /* 01ngircd-contents.xml */,
-                               FAA3D2850F139D2E00B2447E /* 02de.xml */,
-                               FAA3D2840F139D2E00B2447E /* 02de-contents.xml */,
-                       );
-                       path = ngIRCd.pmdoc;
-                       sourceTree = "<group>";
-               };
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        attributes = {
-                               LastUpgradeCheck = 1140;
+                               LastUpgradeCheck = 1420;
                                ORGANIZATIONNAME = "ngIRCd Development Team";
                        };
                        buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */;
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                CLANG_ENABLE_OBJC_WEAK = YES;
+                               CODE_SIGN_IDENTITY = "-";
+                               DEAD_CODE_STRIPPING = YES;
+                               MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
                        };
                        name = Default;
                };
                                CLANG_WARN_EMPTY_BODY = YES;
                                CLANG_WARN_INFINITE_RECURSION = YES;
                                CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+                               CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
                                CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
                                CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
                                CLANG_WARN_STRICT_PROTOTYPES = YES;
                                CLANG_WARN_SUSPICIOUS_MOVE = YES;
                                CLANG_WARN_UNREACHABLE_CODE = YES;
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               DEAD_CODE_STRIPPING = YES;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                                GCC_NO_COMMON_BLOCKS = YES;
                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
                                GCC_WARN_UNUSED_LABEL = YES;
                                GCC_WARN_UNUSED_PARAMETER = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
-                               MACOSX_DEPLOYMENT_TARGET = 10.6;
+                               MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
                                PRODUCT_NAME = ngircd;
                        };
                        name = Default;
                                CLANG_WARN_EMPTY_BODY = YES;
                                CLANG_WARN_INFINITE_RECURSION = YES;
                                CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+                               CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
                                CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
                                CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
                                CLANG_WARN_STRICT_PROTOTYPES = YES;
                                CLANG_WARN_SUSPICIOUS_MOVE = YES;
                                CLANG_WARN_UNREACHABLE_CODE = YES;
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               DEAD_CODE_STRIPPING = YES;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                                ENABLE_TESTABILITY = YES;
                                GCC_NO_COMMON_BLOCKS = YES;
                                GCC_WARN_UNUSED_LABEL = YES;
                                GCC_WARN_UNUSED_PARAMETER = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
-                               MACOSX_DEPLOYMENT_TARGET = 10.6;
+                               MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
                                ONLY_ACTIVE_ARCH = YES;
                                PRODUCT_NAME = ngircd;
                                SDKROOT = "";
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                CLANG_ENABLE_OBJC_WEAK = YES;
+                               CODE_SIGN_IDENTITY = "-";
+                               DEAD_CODE_STRIPPING = YES;
+                               MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
                        };
                        name = Debug;
                };
index 4a6229a13068e32267a270dd0c369d03e06b6d1d..b956d0eb7b79ee4c978b7acb5b1bc1b4e86dda1e 100644 (file)
@@ -43,7 +43,7 @@ ngircd.spec
  - RPM "spec" file.
 
 nglog.sh
- - Colorizes the log messages of ngircd(8) accoring to their log level.
+ - Colorizes the log messages of ngircd(8) according to their log level.
 
 platformtest.sh
  - Build ngIRCd and output a "result line" suitable for doc/Platforms.txt.
index 852ee93c1e40498314d19f4d7a2986d31166a208..cb4eb3e9c9bfb145ef5510759357f48c68ffa6f8 100755 (executable)
@@ -10,7 +10,7 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 # This script parses the log output of ngircd(8), and colorizes the messages
-# accoring to their log level. Example usage:
+# according to their log level. Example usage:
 # ./src/ngircd/ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
 #
 
index 2bd98486375e94526439379fae34d6c68a890ccc..de9cfb06aef9f9400695b1ecdbd5dcbc2027fe42 100644 (file)
@@ -2,7 +2,7 @@
                      ngIRCd - Next Generation IRC Server
                            http://ngircd.barton.de/
 
-               (c)2001-2022 Alexander Barton and Contributors.
+               (c)2001-2023 Alexander Barton and Contributors.
                ngIRCd is free software and published under the
                    terms of the GNU General Public License.
 
index 5892557920f669985b413218e2f90de793ad66ad..cea23a2bd39508a60582478b256dc8dd700aa241 100644 (file)
        ;Modes = +tnk mykey +l 5
        ;Modes = +b nick!~user@bad.host.example.com
 
+       # Should ngIRCd automatically join ("autojoin") all users to this
+       # channel on connect? Note: The users must have permissions to access
+       # the channel, otherwise joining them will fail!
+       ;Autojoin = yes
+
        # Key file, syntax for each line: "<user>:<nick>:<key>".
        # Default: none.
        ;KeyFile = :ETCDIR:/#chan.key
index 5878c02dc0a3af4fba1a3bd9ef3d84501e027a23..80c00714c36e7f5360048a549de50eea5d1285e9 100644 (file)
@@ -517,6 +517,11 @@ invite list, exception list) is supported.
 This option can be specified multiple times, evaluated top to bottom.
 .RE
 .TP
+\fBAutojoin\fR (boolean)
+Should ngIRCd automatically join ("autojoin") all users to this channel on
+connect? Note: The users must have permissions to access the channel, otherwise
+joining them will fail!
+.TP
 \fBKeyFile\fR (string)
 Path and file name of a "key file" containing individual channel keys for
 different users. The file consists of plain text lines with the following
index 4cc793f18c02b3f4bea6dd1f46ed2914441740a5..6d1ab338495d05308011138a2a1afc7052c2c1ca 100644 (file)
@@ -68,7 +68,7 @@ array_alloc(array * a, size_t size, size_t pos)
 
        if (a->allocated < alloc) {
 #if DEBUG_ARRAY
-               Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.",
+               LogDebug("array_alloc(): changing size from %u to %u bytes.",
                    a->allocated, alloc);
 #endif
                tmp = realloc(a->mem, alloc);
@@ -169,7 +169,7 @@ array_catb(array * dest, const char *src, size_t len)
        assert(ptr != NULL);
 
 #if DEBUG_ARRAY
-       Log(LOG_DEBUG,
+       LogDebug(
            "array_catb(): appending %u bytes to array (now %u bytes in array).",
            len, tmp);
 #endif
@@ -249,7 +249,7 @@ array_free(array * a)
 {
        assert(a != NULL);
 #if DEBUG_ARRAY
-       Log(LOG_DEBUG,
+       LogDebug(
            "array_free(): %u bytes free'd (%u bytes still used at time of free()).",
            a->allocated, a->used);
 #endif
@@ -315,7 +315,7 @@ array_moveleft(array * a, size_t membersize, size_t pos)
                return; /* nothing to do */
 
 #if DEBUG_ARRAY
-       Log(LOG_DEBUG,
+       LogDebug(
            "array_moveleft(): %u bytes used in array, starting at position %u.",
            a->used, bytepos);
 #endif
index 3282a8d0460533301ca0c4f58675548fa35db833..03af496baf6631374aaa51fc7e6d664a86334709 100644 (file)
@@ -148,7 +148,7 @@ Channel_InitPredefined( void )
                        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);
+                               LogDebug("Evaluate \"MODE %s %s\".", name, modes);
                                c = strtok(modes, " ");
                                while (c && Req.argc < 15) {
                                        Req.argv[Req.argc++] = c;
@@ -186,8 +186,6 @@ Channel_InitPredefined( void )
                    new_chan->name, new_chan->modes, new_chan->key,
                    new_chan->maxusers);
        }
-       if (channel_count)
-               array_free(&Conf_Channels);
 
        /* Make sure the local &SERVER channel exists */
        if (!Channel_Search("&SERVER")) {
index 634cecdced292005599caa32995c0c7b1221be0a..48768514f950e4f1ad41db94d73375206defd739 100644 (file)
@@ -213,7 +213,7 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
                Generate_MyToken(client);
 
        if (Client_HasMode(client, 'a'))
-               client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1);
+               client->away = strdup(DEFAULT_AWAY_MSG);
 
        client->next = (POINTER *)My_Clients;
        My_Clients = client;
@@ -698,10 +698,8 @@ Client_ID( CLIENT *Client )
 {
        assert( Client != NULL );
 
-#ifdef DEBUG
        if(Client->type == CLIENT_USER)
                assert(strlen(Client->id) < Conf_MaxNickLength);
-#endif
 
        if( Client->id[0] ) return Client->id;
        else return "*";
@@ -1499,9 +1497,7 @@ Client_RegisterWhowas( CLIENT *Client )
        slot = Last_Whowas + 1;
        if( slot >= MAX_WHOWAS || slot < 0 ) slot = 0;
 
-#ifdef DEBUG
-       Log( LOG_DEBUG, "Saving WHOWAS information to slot %d ...", slot );
-#endif
+       LogDebug( "Saving WHOWAS information to slot %d ...", slot );
 
        My_Whowas[slot].time = now;
        strlcpy( My_Whowas[slot].id, Client_ID( Client ),
@@ -1696,17 +1692,16 @@ Client_Announce(CLIENT * Client, CLIENT * Prefix, CLIENT * User)
 } /* Client_Announce */
 
 
-#ifdef DEBUG
 
 GLOBAL void
 Client_DebugDump(void)
 {
        CLIENT *c;
 
-       Log(LOG_DEBUG, "Client status:");
+       LogDebug("Client status:");
        c = My_Clients;
        while (c) {
-               Log(LOG_DEBUG,
+               LogDebug(
                    " - %s: type=%d, host=%s, user=%s, conn=%d, start=%ld, flags=%s",
                    Client_ID(c), Client_Type(c), Client_Hostname(c),
                    Client_User(c), Client_Conn(c), Client_StartTime(c),
@@ -1715,7 +1710,6 @@ Client_DebugDump(void)
        }
 } /* Client_DumpClients */
 
-#endif
 
 
 /* -eof- */
index 4185d2176ebd2e4ba7a65391f254c03cfe76a808..f6f9525b9c40beaaa9924dd43c684167192581ce 100644 (file)
@@ -182,9 +182,7 @@ GLOBAL void Client_UpdateCloakedHostname PARAMS((CLIENT *Client,
                                                 const char *hostname));
 
 
-#ifdef DEBUG
 GLOBAL void Client_DebugDump PARAMS((void));
-#endif
 
 #endif
 
index 140d0b9f63b9b22acb2fabb7a4065ba1ab74bae9..4fd7d44d255046470bec670cf22078c9b838280c 100644 (file)
@@ -464,13 +464,13 @@ Conf_Test( void )
                printf( "  Host = %s\n", Conf_Server[i].host );
                printf( "  Port = %u\n", (unsigned int)Conf_Server[i].port );
 #ifdef SSL_SUPPORT
-               printf( "  SSLConnect = %s\n", Conf_Server[i].SSLConnect?"yes":"no");
+               printf( "  SSLConnect = %s\n", yesno_to_str(Conf_Server[i].SSLConnect));
 #endif
                printf( "  MyPassword = %s\n", Conf_Server[i].pwd_in );
                printf( "  PeerPassword = %s\n", Conf_Server[i].pwd_out );
                printf( "  ServiceMask = %s\n", Conf_Server[i].svs_mask);
                printf( "  Group = %d\n", Conf_Server[i].group );
-               printf( "  Passive = %s\n\n", Conf_Server[i].flags & CONF_SFLAG_DISABLED ? "yes" : "no");
+               printf( "  Passive = %s\n\n", yesno_to_str(Conf_Server[i].flags & CONF_SFLAG_DISABLED));
        }
 
        predef_channel_count = array_length(&Conf_Channels, sizeof(*predef_chan));
@@ -488,6 +488,7 @@ Conf_Test( void )
                printf("  Key = %s\n", predef_chan->key);
                printf("  MaxUsers = %lu\n", predef_chan->maxusers);
                printf("  Topic = %s\n", predef_chan->topic);
+               printf("  Autojoin = %s\n", yesno_to_str(predef_chan->autojoin));
                printf("  KeyFile = %s\n\n", predef_chan->keyfile);
        }
 
@@ -942,16 +943,13 @@ Read_Config(bool TestOnly, bool IsStarting)
 
                                        if( Conf_Server[i].conn_id == Conf_Server[n].conn_id ) {
                                                Init_Server_Struct( &Conf_Server[n] );
-#ifdef DEBUG
-                                               Log(LOG_DEBUG,"Deleted unused duplicate server %d (kept %d).",
-                                                                                               n, i );
-#endif
+                                               LogDebug("Deleted unused duplicate server %d (kept %d).", n, i);
                                        }
                                }
                        } else {
                                /* Mark server as "once" */
                                Conf_Server[i].flags |= CONF_SFLAG_ONCE;
-                               Log( LOG_DEBUG, "Marked server %d as \"once\"", i );
+                               LogDebug("Marked server %d as \"once\"", i);
                        }
                }
        }
@@ -2003,6 +2001,11 @@ Handle_CHANNEL(const char *File, int Line, char *Var, char *Arg)
                        Config_Error_TooLong(File, Line, Var);
                return;
        }
+       if( strcasecmp( Var, "Autojoin" ) == 0 ) {
+               /* Check autojoin */
+               chan->autojoin = Check_ArgIsTrue(Arg);
+               return;
+       }
        if( strcasecmp( Var, "Key" ) == 0 ) {
                /* Initial Channel Key (mode k) */
                len = strlcpy(chan->key, Arg, sizeof(chan->key));
@@ -2049,9 +2052,7 @@ Validate_Config(bool Configtest, bool Rehash)
 {
        /* Validate configuration settings. */
 
-#ifdef DEBUG
        int i, servers, servers_once;
-#endif
        bool config_valid = true;
        char *ptr;
 
@@ -2125,7 +2126,6 @@ Validate_Config(bool Configtest, bool Rehash)
                             "Maximum penalty increase ('MaxPenaltyTime') is set to %ld, this is not recommended!",
                             Conf_MaxPenaltyTime);
 
-#ifdef DEBUG
        servers = servers_once = 0;
        for (i = 0; i < MAX_SERVERS; i++) {
                if (Conf_Server[i].name[0]) {
@@ -2134,12 +2134,10 @@ Validate_Config(bool Configtest, bool Rehash)
                                servers_once++;
                }
        }
-       Log(LOG_DEBUG,
-           "Configuration: Operators=%ld, Servers=%d[%d], Channels=%ld",
+       LogDebug("Configuration: Operators=%ld, Servers=%d[%d], Channels=%ld",
            array_length(&Conf_Opers, sizeof(struct Conf_Oper)),
            servers, servers_once,
            array_length(&Conf_Channels, sizeof(struct Conf_Channel)));
-#endif
 
        return config_valid;
 }
@@ -2226,7 +2224,6 @@ va_dcl
                Log(Level, "%s", msg);
 }
 
-#ifdef DEBUG
 
 /**
  * Dump internal state of the "configuration module".
@@ -2236,11 +2233,11 @@ Conf_DebugDump(void)
 {
        int i;
 
-       Log(LOG_DEBUG, "Configured servers:");
+       LogDebug("Configured servers:");
        for (i = 0; i < MAX_SERVERS; i++) {
                if (! Conf_Server[i].name[0])
                        continue;
-               Log(LOG_DEBUG,
+               LogDebug(
                    " - %s: %s:%d, last=%ld, group=%d, flags=%d, conn=%d",
                    Conf_Server[i].name, Conf_Server[i].host,
                    Conf_Server[i].port, Conf_Server[i].lasttry,
@@ -2249,7 +2246,6 @@ Conf_DebugDump(void)
        }
 }
 
-#endif
 
 /**
  * Initialize server configuration structure to default values.
index b964c4070282027a0a53bb3506c66a1b6accfc4a..f3e2c5a573936a8df5588cba342d8b5f63566f71 100644 (file)
@@ -87,6 +87,7 @@ struct Conf_Channel {
        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 */
+       bool autojoin;                  /**< 1 to make all users autojoin this channel */
        unsigned long maxusers;         /**< User limit for this channel, mode "l" */
        unsigned int modes_num;         /**< Number of channel modes to evaluate */
 };
@@ -222,7 +223,7 @@ GLOBAL bool Conf_ConnectIPv6;
 /** Try to connect to remote systems using the IPv4 protocol (true) */
 GLOBAL bool Conf_ConnectIPv4;
 
-/** Idle timout (seconds), after which the daemon should exit */
+/** Idle timeout (seconds), after which the daemon should exit */
 GLOBAL int Conf_IdleTimeout;
 
 /** Maximum number of simultaneous connections to this server */
@@ -280,9 +281,7 @@ GLOBAL bool Conf_SSLInUse PARAMS((void));
 /* Password required by WEBIRC command */
 GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN];
 
-#ifdef DEBUG
 GLOBAL void Conf_DebugDump PARAMS((void));
-#endif
 
 
 #endif
index 3cf8a3a62b27d43ce32fcc1101f765dac3775fb7..25ae1b26dff830e0b457e5ffe1461d2ca70c9776 100644 (file)
 #include <assert.h>
 #include <time.h>
 
-#ifdef DEBUG
-# include "log.h"
-#endif
+#include "log.h"
 #include "conn.h"
-
 #include "conf.h"
 #include "conn-func.h"
 
@@ -116,13 +113,10 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds)
 
        My_Connections[Idx].delaytime += Seconds;
 
-#ifdef DEBUG
-       Log(LOG_DEBUG,
-           "Add penalty time on connection %d: %ld second%s, total %ld second%s.",
+       LogDebug("Add penalty time on connection %d: %ld second%s, total %ld second%s.",
            Idx, (long)Seconds, Seconds != 1 ? "s" : "",
            My_Connections[Idx].delaytime - t,
            My_Connections[Idx].delaytime - t != 1 ? "s" : "");
-#endif
 } /* Conn_SetPenalty */
 
 GLOBAL void
index fe7f2fb0e06ffc169aa1956065eaf30e2021c00c..36816bddecd16d341c0a241e7da67ec61e0471ff 100644 (file)
@@ -142,7 +142,7 @@ Zip_Flush( CONN_ID Idx )
        out->avail_out = (uInt)sizeof zipbuf;
 
 #if DEBUG_ZIP
-       Log(LOG_DEBUG, "out->avail_in %d, out->avail_out %d",
+       LogDebug("out->avail_in %d, out->avail_out %d",
                out->avail_in, out->avail_out);
 #endif
        result = deflate( out, Z_SYNC_FLUSH );
@@ -165,7 +165,7 @@ Zip_Flush( CONN_ID Idx )
 
        zipbuf_used = WRITEBUFFER_SLINK_LEN - out->avail_out;
 #if DEBUG_ZIP
-       Log(LOG_DEBUG, "zipbuf_used: %d", zipbuf_used);
+       LogDebug("zipbuf_used: %d", zipbuf_used);
 #endif
        if (!array_catb(&My_Connections[Idx].wbuf,
                        (char *)zipbuf, (size_t) zipbuf_used)) {
@@ -217,7 +217,7 @@ Unzip_Buffer( CONN_ID Idx )
        in->avail_out = (uInt)sizeof unzipbuf;
 
 #if DEBUG_ZIP
-       Log(LOG_DEBUG, "in->avail_in %d, in->avail_out %d",
+       LogDebug("in->avail_in %d, in->avail_out %d",
                in->avail_in, in->avail_out);
 #endif
        result = inflate( in, Z_SYNC_FLUSH );
@@ -232,7 +232,7 @@ Unzip_Buffer( CONN_ID Idx )
        in_len = z_rdatalen - in->avail_in;
        unzipbuf_used = READBUFFER_LEN - in->avail_out;
 #if DEBUG_ZIP
-       Log(LOG_DEBUG, "unzipbuf_used: %d - %d = %d", READBUFFER_LEN,
+       LogDebug("unzipbuf_used: %d - %d = %d", READBUFFER_LEN,
                in->avail_out, unzipbuf_used);
 #endif
        assert(unzipbuf_used <= READBUFFER_LEN);
index 94c6c4a8b1683fa75ca3fd4f6daaf98884d29dfd..e8ef68f36c7ec32642b806c78e5f70d4dc01feea 100644 (file)
@@ -591,7 +591,7 @@ set_v6_only(int af, int sock)
 /**
  * Initialize new listening port.
  *
- * @param listen_addr  Local address to bind the socet to (can be 0.0.0.0).
+ * @param listen_addr  Local address to bind the socket to (can be 0.0.0.0).
  * @param Port         Port number on which the new socket should be listening.
  * @returns            file descriptor of the socket or -1 on failure.
  */
@@ -875,7 +875,7 @@ va_dcl
 
 #ifdef SNIFFER
        if (NGIRCd_Sniffer)
-               Log(LOG_DEBUG, " -> connection %d: '%s'.", Idx, buffer);
+               LogDebug("-> connection %d: '%s'.", Idx, buffer);
 #endif
 
        len = strlcat( buffer, "\r\n", sizeof( buffer ));
@@ -1055,8 +1055,10 @@ Conn_Close(CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClien
                }
 #endif
                /* Send ERROR to client (see RFC 2812, section 3.1.7) */
-               if (FwdMsg)
-                       Conn_WriteStr(Idx, "ERROR :%s", FwdMsg);
+               if (c)
+                       Conn_WriteStr(Idx, "ERROR :Closing connection: %s[%s@%s] (%s)",
+                                     Client_ID(c), Client_User(c), Client_Hostname(c),
+                                     FwdMsg ? FwdMsg : "\"\"");
                else
                        Conn_WriteStr(Idx, "ERROR :Closing connection");
        }
@@ -1356,13 +1358,14 @@ New_Connection(int Sock, UNUSED bool IsSSL)
        new_sock = accept(Sock, (struct sockaddr *)&new_addr,
                          (socklen_t *)&new_sock_len);
        if (new_sock < 0) {
-               Log(LOG_CRIT, "Can't accept connection: %s!", strerror(errno));
+               Log(LOG_CRIT, "Can't accept connection on socket %d: %s!",
+                   Sock, strerror(errno));
                return -1;
        }
        NumConnectionsAccepted++;
 
        if (!ng_ipaddr_tostr_r(&new_addr, ip_str)) {
-               Log(LOG_CRIT, "fd %d: Can't convert IP address!", new_sock);
+               Log(LOG_CRIT, "Can't convert peer IP address of socket %d!", new_sock);
                Simple_Message(new_sock, "ERROR :Internal Server Error");
                close(new_sock);
                return -1;
@@ -1375,7 +1378,8 @@ New_Connection(int Sock, UNUSED bool IsSSL)
        fromhost(&req);
        if (!hosts_access(&req)) {
                Log(deny_severity,
-                   "Refused connection from %s (by TCP Wrappers)!", ip_str);
+                   "Refused connection from %s on socket %d (by TCP Wrappers)!",
+                   ip_str, Sock);
                Simple_Message(new_sock, "ERROR :Connection refused");
                close(new_sock);
                return -1;
@@ -1400,8 +1404,8 @@ New_Connection(int Sock, UNUSED bool IsSSL)
        if ((Conf_MaxConnectionsIP > 0) && (cnt >= Conf_MaxConnectionsIP)) {
                /* Access denied, too many connections from this IP address! */
                Log(LOG_ERR,
-                   "Refused connection from %s: too may connections (%ld) from this IP address!",
-                   ip_str, cnt);
+                   "Refused connection from %s on socket %d: too may connections (%ld) from this IP address!",
+                   ip_str, Sock, cnt);
                Simple_Message(new_sock,
                               "ERROR :Connection refused, too many connections from your IP address");
                close(new_sock);
@@ -1454,7 +1458,7 @@ New_Connection(int Sock, UNUSED bool IsSSL)
        Account_Connection();
 
 #ifdef SSL_SUPPORT
-       /* Delay connection initalization until SSL handshake is finished */
+       /* Delay connection initialization until SSL handshake is finished */
        if (!IsSSL)
 #endif
                Conn_StartLogin(new_sock);
@@ -2341,10 +2345,8 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
 
                Class_HandleServerBans(c);
        }
-#ifdef DEBUG
        else
                LogDebug("Resolver: discarding result for already registered connection %d.", i);
-#endif
 } /* cb_Read_Resolver_Result */
 
 /**
@@ -2688,7 +2690,6 @@ Conn_SetCertFp(UNUSED CONN_ID Idx, UNUSED const char *fingerprint)
 
 #endif /* SSL_SUPPORT */
 
-#ifdef DEBUG
 
 /**
  * Dump internal state of the "connection module".
@@ -2698,11 +2699,11 @@ Conn_DebugDump(void)
 {
        int i;
 
-       Log(LOG_DEBUG, "Connection status:");
+       LogDebug("Connection status:");
        for (i = 0; i < Pool_Size; i++) {
                if (My_Connections[i].sock == NONE)
                        continue;
-               Log(LOG_DEBUG,
+               LogDebug(
                    " - %d: host=%s, lastdata=%ld, lastping=%ld, delaytime=%ld, flag=%d, options=%d, bps=%d, client=%s",
                    My_Connections[i].sock, My_Connections[i].host,
                    My_Connections[i].lastdata, My_Connections[i].lastping,
@@ -2712,6 +2713,5 @@ Conn_DebugDump(void)
        }
 } /* Conn_DumpClients */
 
-#endif /* DEBUG */
 
 /* -eof- */
index 869477f091f69f2f9ed2d7f6b40dbb8c7109a85b..ca64ad205e6f3595d4f5a7c1b0b0cca2e3e3706b 100644 (file)
@@ -166,9 +166,7 @@ GLOBAL long Conn_GetAuthPing PARAMS((CONN_ID Idx));
 GLOBAL void Conn_SetAuthPing PARAMS((CONN_ID Idx, long ID));
 #endif
 
-#ifdef DEBUG
 GLOBAL void Conn_DebugDump PARAMS((void));
-#endif
 
 #endif
 
index ff8cd226d641b0dced4b398438b74c14f2df983a..c5371e87371708a9f4d71978e0e8dfddce402795 100644 (file)
 /** Max. host name length (including NULL). */
 #define CLIENT_HOST_LEN 64
 
-/** Max. mask lenght (including NULL). */
+/** Max. mask length (including NULL). */
 #define MASK_LEN (2 * CLIENT_HOST_LEN)
 
 /** Max. length of all client modes (including NULL). */
index 037c4afca2af7c0cf9662058ee2a18d3a92b12eb..2a1e941e8e91b89347f4c80b86b38497a708fcd3 100644 (file)
@@ -148,7 +148,7 @@ static void io_docallback PARAMS((int fd, short what));
 static void
 io_debug(const char *s, int fd, int what)
 {
-       Log(LOG_DEBUG, "%s: %d, %d\n", s, fd, what);
+       LogDebug("%s: %d, %d\n", s, fd, what);
 }
 #else
 static inline void
index 812429bbf33eadc2a0dbd5174522bb673572f121..a1bb4ef597f930387ede37c4a3d8d007b8fe19e1 100644 (file)
@@ -176,7 +176,7 @@ join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags)
  * and MODE commands.
  *
  * @param To           Forward JOIN (and MODE) command to this peer server
- * @param Prefix       Client used to prefix the genrated commands
+ * @param Prefix       Client used to prefix the generated commands
  * @param Data         Parameters of JOIN command to forward, probably
  *                     containing channel modes separated by ASCII 7.
  */
@@ -209,7 +209,7 @@ cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data)
  * This function calls cb_join_forward(), which differentiates between
  * protocol implementations (e.g. RFC 2812, RFC 1459).
  *
- * @param Client       Client used to prefix the genrated commands
+ * @param Client       Client used to prefix the generated commands
  * @param target       Forward JOIN (and MODE) command to this peer server
  * @param chan         Channel structure
  * @param channame     Channel name
@@ -248,46 +248,38 @@ join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan,
 } /* join_forward */
 
 /**
- * Acknowledge user JOIN request and send "channel info" numerics.
+ * Send channel TOPIC and NAMES list to a newly (N)JOIN'ed client.
  *
- * @param Client       Client used to prefix the genrated commands
- * @param target       Forward commands/numerics to this user
- * @param chan         Channel structure
- * @param channame     Channel name
+ * @param Client       Client used to prefix the generated commands
+ * @param Chan         Channel structure
  */
-static bool
-join_send_topic(CLIENT *Client, CLIENT *target, CHANNEL *chan,
-                                       const char *channame)
+GLOBAL bool
+IRC_Send_Channel_Info(CLIENT *Client, CHANNEL *Chan)
 {
        const char *topic;
 
-       if (Client_Type(Client) != CLIENT_USER)
-               return true;
-       /* acknowledge join */
-       if (!IRC_WriteStrClientPrefix(Client, target, "JOIN :%s", channame))
-               return false;
-
-       /* Send topic to client, if any */
-       topic = Channel_Topic(chan);
+       /* Send the topic (if any) to the new client: */
+       topic = Channel_Topic(Chan);
        assert(topic != NULL);
        if (*topic) {
                if (!IRC_WriteStrClient(Client, RPL_TOPIC_MSG,
-                       Client_ID(Client), channame, topic))
+                       Client_ID(Client), Channel_Name(Chan), topic))
                                return false;
 #ifndef STRICT_RFC
                if (!IRC_WriteStrClient(Client, RPL_TOPICSETBY_MSG,
-                       Client_ID(Client), channame,
-                       Channel_TopicWho(chan),
-                       Channel_TopicTime(chan)))
+                       Client_ID(Client), Channel_Name(Chan),
+                       Channel_TopicWho(Chan),
+                       Channel_TopicTime(Chan)))
                                return false;
 #endif
        }
-       /* send list of channel members to client */
-       if (!IRC_Send_NAMES(Client, chan))
+
+       /* Send list of channel members to the new client: */
+       if (!IRC_Send_NAMES(Client, Chan))
                return false;
-       return IRC_WriteStrClient(Client, RPL_ENDOFNAMES_MSG, Client_ID(Client),
-                                 Channel_Name(chan));
-} /* join_send_topic */
+       return IRC_WriteStrClient(Client, RPL_ENDOFNAMES_MSG,
+                                 Client_ID(Client), Channel_Name(Chan));
+}
 
 /**
  * Handler for the IRC "JOIN" command.
@@ -408,8 +400,15 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
 
                join_forward(Client, target, chan, channame);
 
-               if (!join_send_topic(Client, target, chan, channame))
-                       break; /* write error */
+               if (Client_Type(Client) == CLIENT_USER) {
+                       /* Acknowledge join ... */
+                       if (!IRC_WriteStrClientPrefix(Client, target,
+                                                     "JOIN :%s", channame))
+                               break; /* write error */
+                       /* ... and greet new user: */
+                       if (!IRC_Send_Channel_Info(Client, chan))
+                               break; /* write error */
+               }
 
        join_next:
                /* next channel? */
index 685ec0c3044eccd711ea0c9e085fca5acbd5bdfb..77f00f86e66c0f90255c0c1f543e84e64946f188 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2022 by Alexander Barton (alex@barton.de)
  *
  * 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
@@ -25,6 +25,8 @@ GLOBAL bool IRC_LIST PARAMS((CLIENT *Client, REQUEST *Req ));
 
 GLOBAL bool IRC_CHANINFO PARAMS((CLIENT *Client, REQUEST *Req ));
 
+GLOBAL bool IRC_Send_Channel_Info PARAMS((CLIENT *Client, CHANNEL *Chan));
+
 #endif
 
 /* -eof- */
index 82bd55182d774a54343c4634ae5271032a3aba8c..718aa9905835ac0482cc0e74ad4643090517d558 100644 (file)
@@ -138,7 +138,7 @@ who_flags_qualifier(CLIENT *Client, const char *chan_user_modes,
 static bool
 IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
 {
-       bool is_visible, is_member, is_ircop;
+       bool is_visible, is_member, is_ircop, is_oper;
        CL2CHAN *cl2chan;
        char flags[10];
        CLIENT *c;
@@ -148,9 +148,10 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
        assert( Chan != NULL );
 
        is_member = Channel_IsMemberOf(Chan, Client);
+       is_oper = Client_HasMode(Client, 'o');
 
        /* Secret channel? */
-       if (!is_member && Channel_HasMode(Chan, 's'))
+       if (!is_member && !is_oper && Channel_HasMode(Chan, 's'))
                return IRC_WriteStrClient(Client, RPL_ENDOFWHO_MSG,
                                          Client_ID(Client), Channel_Name(Chan));
 
@@ -163,7 +164,7 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
                        continue;
 
                is_visible = !Client_HasMode(c, 'i');
-               if (is_member || is_visible) {
+               if (is_member || is_visible || is_oper) {
                        memset(flags, 0, sizeof(flags));
 
                        if (Client_HasMode(c, 'a'))
@@ -1264,6 +1265,8 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
 
                        if (Client_Type(c) != CLIENT_USER)
                                continue;
+                       if (Client_HasMode(c, 'i'))
+                               continue;
                        if (!MatchCaseInsensitive(query, Client_ID(c)))
                                continue;
                        if (!IRC_WHOIS_SendReply(Client, from, c))
index 368a03d46bef6ff775ecc029051b427d21cbef32..fb2219226d8c3654c3ebdb8029e96dd2a3ab1160 100644 (file)
@@ -774,7 +774,7 @@ IRC_PING(CLIENT *Client, REQUEST *Req)
                return IRC_WriteErrClient(Client, ERR_NOSUCHSERVER_MSG,
                                        Client_ID(Client), Req->prefix);
 
-       Log(LOG_DEBUG, "Connection %d: got PING, sending PONG ...",
+       LogDebug("Connection %d: got PING, sending PONG ...",
            Client_Conn(Client));
 
 #ifdef STRICT_RFC
@@ -877,9 +877,7 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
                    (long)(time(NULL) - Conn_GetSignon(conn)),
                    time(NULL) - Conn_GetSignon(conn) == 1 ? "" : "s",
                    Client_UserCount(), Channel_CountVisible(NULL));
-       }
-#ifdef DEBUG
-       else {
+       } else {
                if (Conn_LastPing(conn) > 1)
                        LogDebug("Connection %d: received PONG. Lag: %ld seconds.",
                                 conn, (long)(time(NULL) - Conn_LastPing(conn)));
@@ -887,7 +885,6 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
                        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);
index 99255df14a5433f60b3ad56e35f7e8f802175916..0ea046e561c9196f646006602f0a14362149f42f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2023 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
@@ -281,7 +281,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
                        break;
                default:
                        if (Client_Type(Client) != CLIENT_SERVER) {
-                               Log(LOG_DEBUG,
+                               LogDebug(
                                    "Unknown mode \"%c%c\" from \"%s\"!?",
                                    set ? '+' : '-', *mode_ptr,
                                    Client_ID(Origin));
@@ -292,7 +292,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
                                                        *mode_ptr);
                                x[0] = '\0';
                        } else {
-                               Log(LOG_DEBUG,
+                               LogDebug(
                                    "Handling unknown mode \"%c%c\" from \"%s\" for \"%s\" ...",
                                    set ? '+' : '-', *mode_ptr,
                                    Client_ID(Origin), Client_ID(Target));
@@ -609,33 +609,43 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                                                Channel_Name(Channel));
                                break;
                        }
-                       if (arg_arg > mode_arg) {
-                               if (is_oper || is_machine || is_owner ||
-                                   is_admin || is_op || is_halfop) {
-                                       Channel_ModeDel(Channel, 'k');
-                                       Channel_SetKey(Channel,
-                                                      Req->argv[arg_arg]);
-                                       strlcpy(argadd, Channel_Key(Channel),
-                                               sizeof(argadd));
-                                       x[0] = *mode_ptr;
-                               } else {
+                       if (arg_arg <= mode_arg) {
+                               if (is_machine)
+                                       Log(LOG_ERR,
+                                           "Got MODE +k without key for \"%s\" from \"%s\"! Ignored.",
+                                           Channel_Name(Channel), Client_ID(Origin));
+                               else
                                        connected = IRC_WriteErrClient(Origin,
-                                               ERR_CHANOPRIVSNEEDED_MSG,
+                                               ERR_NEEDMOREPARAMS_MSG,
+                                               Client_ID(Origin), Req->command);
+                               goto chan_exit;
+                       }
+                       if (!Req->argv[arg_arg][0] || strchr(Req->argv[arg_arg], ' ')) {
+                               if (is_machine)
+                                       Log(LOG_ERR,
+                                           "Got invalid key on MODE +k for \"%s\" from \"%s\"! Ignored.",
+                                           Channel_Name(Channel), Client_ID(Origin));
+                               else
+                                       connected = IRC_WriteErrClient(Origin,
+                                              ERR_INVALIDMODEPARAM_MSG,
                                                Client_ID(Origin),
-                                               Channel_Name(Channel));
-                               }
-                               Req->argv[arg_arg][0] = '\0';
-                               arg_arg++;
+                                               Channel_Name(Channel), 'k');
+                               goto chan_exit;
+                       }
+                       if (is_oper || is_machine || is_owner ||
+                           is_admin || is_op || is_halfop) {
+                               Channel_ModeDel(Channel, 'k');
+                               Channel_SetKey(Channel, Req->argv[arg_arg]);
+                               strlcpy(argadd, Channel_Key(Channel), sizeof(argadd));
+                               x[0] = *mode_ptr;
                        } else {
-#ifdef STRICT_RFC
-                               /* Only send error message in "strict" mode,
-                                * this is how ircd2.11 and others behave ... */
                                connected = IRC_WriteErrClient(Origin,
-                                       ERR_NEEDMOREPARAMS_MSG,
-                                       Client_ID(Origin), Req->command);
-#endif
-                               goto chan_exit;
+                                       ERR_CHANOPRIVSNEEDED_MSG,
+                                       Client_ID(Origin),
+                                       Channel_Name(Channel));
                        }
+                       Req->argv[arg_arg][0] = '\0';
+                       arg_arg++;
                        break;
                case 'l': /* Member limit */
                        if (Mode_Limit_Reached(Client, mode_arg_count++))
@@ -651,35 +661,44 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                                                Channel_Name(Channel));
                                break;
                        }
-                       if (arg_arg > mode_arg) {
-                               if (is_oper || is_machine || is_owner ||
-                                   is_admin || is_op || is_halfop) {
-                                       l = atol(Req->argv[arg_arg]);
-                                       if (l > 0 && l < 0xFFFF) {
-                                               Channel_ModeDel(Channel, 'l');
-                                               Channel_SetMaxUsers(Channel, l);
-                                               snprintf(argadd, sizeof(argadd),
-                                                        "%ld", l);
-                                               x[0] = *mode_ptr;
-                                       }
-                               } else {
+                       if (arg_arg <= mode_arg) {
+                               if (is_machine)
+                                       Log(LOG_ERR,
+                                           "Got MODE +l without limit for \"%s\" from \"%s\"! Ignored.",
+                                           Channel_Name(Channel), Client_ID(Origin));
+                               else
                                        connected = IRC_WriteErrClient(Origin,
-                                               ERR_CHANOPRIVSNEEDED_MSG,
+                                               ERR_NEEDMOREPARAMS_MSG,
+                                               Client_ID(Origin), Req->command);
+                               goto chan_exit;
+                       }
+                       l = atol(Req->argv[arg_arg]);
+                       if (l <= 0 || l >= 0xFFFF) {
+                               if (is_machine)
+                                       Log(LOG_ERR,
+                                           "Got MODE +l with invalid limit for \"%s\" from \"%s\"! Ignored.",
+                                           Channel_Name(Channel), Client_ID(Origin));
+                               else
+                                       connected = IRC_WriteErrClient(Origin,
+                                               ERR_INVALIDMODEPARAM_MSG,
                                                Client_ID(Origin),
-                                               Channel_Name(Channel));
-                               }
-                               Req->argv[arg_arg][0] = '\0';
-                               arg_arg++;
+                                               Channel_Name(Channel), 'l');
+                               goto chan_exit;
+                       }
+                       if (is_oper || is_machine || is_owner ||
+                           is_admin || is_op || is_halfop) {
+                               Channel_ModeDel(Channel, 'l');
+                               Channel_SetMaxUsers(Channel, l);
+                               snprintf(argadd, sizeof(argadd), "%ld", l);
+                               x[0] = *mode_ptr;
                        } else {
-#ifdef STRICT_RFC
-                               /* Only send error message in "strict" mode,
-                                * this is how ircd2.11 and others behave ... */
                                connected = IRC_WriteErrClient(Origin,
-                                       ERR_NEEDMOREPARAMS_MSG,
-                                       Client_ID(Origin), Req->command);
-#endif
-                               goto chan_exit;
+                                       ERR_CHANOPRIVSNEEDED_MSG,
+                                       Client_ID(Origin),
+                                       Channel_Name(Channel));
                        }
+                       Req->argv[arg_arg][0] = '\0';
+                       arg_arg++;
                        break;
                case 'O': /* IRC operators only */
                        if (set) {
@@ -823,7 +842,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                        break;
                default:
                        if (Client_Type(Client) != CLIENT_SERVER) {
-                               Log(LOG_DEBUG,
+                               LogDebug(
                                    "Unknown mode \"%c%c\" from \"%s\" on %s!?",
                                    set ? '+' : '-', *mode_ptr,
                                    Client_ID(Origin), Channel_Name(Channel));
@@ -833,7 +852,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                                        Channel_Name(Channel));
                                x[0] = '\0';
                        } else {
-                               Log(LOG_DEBUG,
+                               LogDebug(
                                    "Handling unknown mode \"%c%c\" from \"%s\" on %s ...",
                                    set ? '+' : '-', *mode_ptr,
                                    Client_ID(Origin), Channel_Name(Channel));
@@ -904,7 +923,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                if (Client_Type(Client) == CLIENT_SERVER) {
                        /* MODE requests for local channels from other servers
                         * are definitely invalid! */
-                       if (Channel_IsLocal(Channel)) {
+                       if (Channel_IsLocal(Channel) && Client != Client_ThisServer()) {
                                Log(LOG_ALERT, "Got remote MODE command for local channel!? Ignored.");
                                return CONNECTED;
                        }
index a309ee9f068fcba162c9f393a8b1d46633c3604c..2bf9e349b36245dced9ee4485acb43a8b2f1fef7 100644 (file)
@@ -222,9 +222,9 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req)
 
        if (Client_Conn(target) > NONE) {
                /* The target user is local, so we have to send the status code */
-               if (!IRC_WriteStrClientPrefix(from, target, RPL_INVITING_MSG,
-                                              Client_ID(from), Req->argv[0],
-                                              colon_if_necessary, Req->argv[1]))
+               if (!IRC_WriteStrClient(from, RPL_INVITING_MSG,
+                                       Client_ID(from), Req->argv[0],
+                                       colon_if_necessary, Req->argv[1]))
                        return DISCONNECTED;
 
                if (Client_HasMode(target, 'a') &&
index ae333b1018d1156f74414ee6c41ae7971ec32b10..df8e22699bf1ee06d95f370e8e7c39a8206830c0 100644 (file)
@@ -399,7 +399,7 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req)
                                          Client_ID(Client), Req->command);
 
        if (!Conf_AllowRemoteOper && Client_Type(Client) == CLIENT_SERVER) {
-               /* Explicitely forbid remote servers to modify "x-lines" when
+               /* Explicitly forbid remote servers to modify "x-lines" when
                 * the "AllowRemoteOper" configuration option isn't set, even
                 * when the command seems to originate from the remote server
                 * itself: this prevents GLINE's to become set during server
index 3f9753b9670d93205d5d6504e34e9f87e5984cdf..b78d05022dae5a29a70c7036c1e5664c194868ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2022 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
@@ -32,6 +32,7 @@
 #include "numeric.h"
 #include "ngircd.h"
 #include "irc.h"
+#include "irc-channel.h"
 #include "irc-info.h"
 #include "irc-write.h"
 #include "op.h"
@@ -298,7 +299,7 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
                            "Failed to join client \"%s\" to channel \"%s\" (NJOIN): killing it!",
                            ptr, channame);
                        IRC_KillClient(NULL, NULL, ptr, "Internal NJOIN error!");
-                       Log(LOG_DEBUG, "... done.");
+                       LogDebug("... done.");
                        goto skip_njoin;
                }
 
@@ -320,6 +321,12 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
                IRC_WriteStrChannelPrefix(Client, chan, c, false,
                                          "JOIN :%s", channame);
 
+               /* If the client is connected to this server, it was remotely
+                * joined to the channel by another server/service: So send
+                * TOPIC and NAMES messages like on a regular JOIN command! */
+               if(Client_Conn(c) != NONE)
+                       IRC_Send_Channel_Info(c, chan);
+
                /* Announce "channel user modes" to the channel, if any */
                strlcpy(modes, Channel_UserModes(chan, c), sizeof(modes));
                if (modes[0])
index 3113a4ba8fe22f3933f339b46b12a60f1d9736cf..ba33e5ae334d03786281e4599f31529330f2c295 100644 (file)
@@ -514,7 +514,7 @@ Option_String(UNUSED CONN_ID Idx)
 /**
  * Send a message to target(s).
  *
- * This function is used by IRC_{PRIVMSG|NOTICE|SQUERY} to actualy
+ * This function is used by IRC_{PRIVMSG|NOTICE|SQUERY} to actually
  * send the message(s).
  *
  * @param Client The client from which this command has been received.
index 38b3b0e8031fc9f52480748dbf8b2de84e079d11..69ea79a4063396bcfd7aa07e663b48ea76e1b6fe 100644 (file)
@@ -341,7 +341,7 @@ Lists_CheckReason(struct list_head *h, CLIENT *Client, char *reason, size_t len)
 
        while (e) {
                next = e->next;
-               if (MatchCaseInsensitive(e->mask, Client_MaskCloaked(Client))) {
+               if (MatchCaseInsensitive(e->mask, Client_MaskCloaked(Client)) || MatchCaseInsensitive(e->mask, Client_Mask(Client))) {
                        if (len && e->reason)
                                strlcpy(reason, e->reason, len);
                        if (e->onlyonce) {
index f2582bce78381ec6174974c854aa47629dc03747..dae53f9f5b45481b56be1295eb451eb2f162a986 100644 (file)
@@ -121,7 +121,6 @@ Log_Exit( void )
  * @param Format Format string like printf().
  * @param ... Further arguments.
  */
-#ifdef DEBUG
 # ifdef PROTOTYPES
 GLOBAL void
 LogDebug( const char *Format, ... )
@@ -145,7 +144,6 @@ va_dcl
        va_end( ap );
        Log(LOG_DEBUG, "%s", msg);
 }
-#endif /* DEBUG */
 
 
 /**
@@ -184,11 +182,7 @@ va_dcl
        }
        else snotice = false;
 
-#ifdef DEBUG
        if(( Level == LOG_DEBUG ) && ( ! NGIRCd_Debug )) return;
-#else
-       if( Level == LOG_DEBUG ) return;
-#endif
 
 #ifdef PROTOTYPES
        va_start( ap, Format );
@@ -215,20 +209,16 @@ Log_Init_Subprocess(char UNUSED *Name)
 #ifdef SYSLOG
        openlog(PACKAGE, LOG_CONS|LOG_PID, Conf_SyslogFacility);
 #endif
-#ifdef DEBUG
        Log_Subprocess(LOG_DEBUG, "%s sub-process starting, PID %ld.",
                     Name, (long)getpid());
-#endif
 }
 
 
 GLOBAL void
 Log_Exit_Subprocess(char UNUSED *Name)
 {
-#ifdef DEBUG
        Log_Subprocess(LOG_DEBUG, "%s sub-process %ld done.",
                     Name, (long)getpid());
-#endif
 #ifdef SYSLOG
        closelog( );
 #endif
@@ -251,13 +241,8 @@ va_dcl
 
        assert(Format != NULL);
 
-#ifdef DEBUG
        if ((Level == LOG_DEBUG) && (!NGIRCd_Debug))
                return;
-#else
-       if (Level == LOG_DEBUG)
-               return;
-#endif
 
 #ifdef PROTOTYPES
        va_start(ap, Format);
index b48193f5023b9feb415c1c8cd5d37f4c117a01f4..0ac4c4d9a4e85ad648abef9e9e20e16f3aab0247 100644 (file)
@@ -40,20 +40,14 @@ GLOBAL void Log_ReInit PARAMS((void));
 
 GLOBAL void Log_ServerNotice PARAMS((char UserMode, const char *Format, ...));
 
-#ifdef DEBUG
 GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
-#else
-static inline void LogDebug PARAMS(( UNUSED const char *Format, ... )){/* Do nothing. The compiler should optimize this out, please ;-) */}
-#endif
 
 GLOBAL void Log_Init_Subprocess PARAMS((char *Name));
 GLOBAL void Log_Exit_Subprocess PARAMS((char *Name));
 
 GLOBAL void Log_Subprocess PARAMS((const int Level, const char *Format, ...));
 
-#ifdef DEBUG
 GLOBAL void Log_InitErrorfile PARAMS(( void ));
-#endif
 
 #endif
 
index ba9378f824e333b1576bb7837094acf221d6b26e..3412e337a75e6e63a1ef03afd098c1e173878814 100644 (file)
@@ -31,6 +31,7 @@
 #include "log.h"
 #include "messages.h"
 #include "ngircd.h"
+#include "irc-channel.h"
 #include "irc-info.h"
 #include "irc-mode.h"
 #include "irc-write.h"
@@ -201,9 +202,41 @@ Login_User_PostAuth(CLIENT *Client)
        } else
                IRC_SetPenalty(Client, 1);
 
+       /* Autojoin clients to the channels */
+       Login_Autojoin(Client);
+
        return CONNECTED;
 }
 
+/**
+ * Autojoin clients to the channels set by administrator
+ *
+ * Do nothing if autojoin is not set in the configuration or the channel is not
+ * available (any more).
+ **/
+GLOBAL void
+Login_Autojoin(CLIENT *Client)
+{
+       REQUEST Req;
+       const struct Conf_Channel *conf_chan;
+       size_t i, channel_count = array_length(&Conf_Channels, sizeof(*conf_chan));
+
+       conf_chan = array_start(&Conf_Channels);
+       assert(channel_count == 0 || conf_chan != NULL);
+
+       for (i = 0; i < channel_count; i++, conf_chan++) {
+               if(!conf_chan->autojoin)
+                       continue;
+               if (!Channel_Search(conf_chan->name))
+                       continue;
+               Req.prefix = Client_ID(Client_ThisServer());
+               Req.command = "JOIN";
+               Req.argc = 1;
+               Req.argv[0] = (char *)conf_chan->name;
+               IRC_JOIN(Client, &Req);
+       }
+}
+
 #ifdef PAM
 
 /**
@@ -248,7 +281,7 @@ cb_Read_Auth_Result(int r_fd, UNUSED short events)
 
        if (result == true) {
                /* Authentication succeeded, now set the correct user name
-                * supplied by the client (without prepended '~' for exmaple),
+                * supplied by the client (without prepended '~' for example),
                 * but cut it at the first '@' character: */
                strlcpy(user, Client_OrigUser(client), sizeof(user));
                ptr = strchr(user, '@');
index 6e3a21d6befa1d0afe380c91fc56d79fdbd045c8..b5d7be1e3b705739b4f050fe2fd13edc9813192e 100644 (file)
@@ -19,6 +19,7 @@
 
 GLOBAL bool Login_User PARAMS((CLIENT * Client));
 GLOBAL bool Login_User_PostAuth PARAMS((CLIENT *Client));
+GLOBAL void Login_Autojoin PARAMS((CLIENT *Client));
 
 #endif
 
index 76a04ff98d4d11a373bd0cfb0695dd65a87280e6..1bbfa69971de4d30f569c08c13900387c93d96b7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2020 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2023 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
 #define ERR_USERNOTONSERV_MSG          "504 %s %s :User is not on this server"
 #define ERR_NOINVITE_MSG               "518 %s :Cannot invite to %s (+V)"
 
+#define ERR_INVALIDMODEPARAM_MSG       "696 %s %s %c * :Invalid mode parameter"
+
 #ifdef ZLIB
 # define RPL_STATSLINKINFOZIP_MSG      "211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld"
 #endif
index a124e2e75f57a00cceac0be88b53a3f7adc6504a..fd919e34becff5f6c7a33963e9b5d4e591fd991d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2022 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2023 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
@@ -88,9 +88,7 @@ main(int argc, const char *argv[])
 
        NGIRCd_SignalQuit = NGIRCd_SignalRestart = false;
        NGIRCd_Passive = false;
-#ifdef DEBUG
        NGIRCd_Debug = false;
-#endif
 #ifdef SNIFFER
        NGIRCd_Sniffer = false;
 #endif
@@ -117,12 +115,10 @@ main(int argc, const char *argv[])
                                configtest = true;
                                ok = true;
                        }
-#ifdef DEBUG
                        if (strcmp(argv[i], "--debug") == 0) {
                                NGIRCd_Debug = true;
                                ok = true;
                        }
-#endif
                        if (strcmp(argv[i], "--help") == 0) {
                                Show_Version();
                                puts(""); Show_Help( ); puts( "" );
@@ -158,12 +154,10 @@ main(int argc, const char *argv[])
                        /* short option */
                        for (n = 1; n < strlen(argv[i]); n++) {
                                ok = false;
-#ifdef DEBUG
                                if (argv[i][n] == 'd') {
                                        NGIRCd_Debug = true;
                                        ok = true;
                                }
-#endif
                                if (argv[i][n] == 'f') {
                                        if (!argv[i][n+1] && i+1 < argc) {
                                                /* Ok, next character is a blank */
@@ -237,10 +231,8 @@ main(int argc, const char *argv[])
 
        /* Debug level for "VERSION" command */
        NGIRCd_DebugLevel[0] = '\0';
-#ifdef DEBUG
        if (NGIRCd_Debug)
                strcpy(NGIRCd_DebugLevel, "1");
-#endif
 #ifdef SNIFFER
        if (NGIRCd_Sniffer) {
                NGIRCd_Debug = true;
@@ -465,7 +457,7 @@ static void
 Show_Version( void )
 {
        puts( NGIRCd_Version );
-       puts( "Copyright (c)2001-2022 Alexander Barton (<alex@barton.de>) and Contributors." );
+       puts( "Copyright (c)2001-2023 Alexander Barton (<alex@barton.de>) and Contributors." );
        puts( "Homepage: <http://ngircd.barton.de/>\n" );
        puts( "This is free software; see the source for copying conditions. There is NO" );
        puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );
@@ -480,9 +472,7 @@ Show_Version( void )
 static void
 Show_Help( void )
 {
-#ifdef DEBUG
        puts( "  -d, --debug        log extra debug messages" );
-#endif
        puts( "  -f, --config <f>   use file <f> as configuration file" );
        puts( "  -n, --nodaemon     don't fork and don't detach from controlling terminal" );
        puts( "  -p, --passive      disable automatic connections to other servers" );
@@ -507,9 +497,7 @@ Pidfile_Delete( void )
        /* Pidfile configured? */
        if( ! Conf_PidFile[0] ) return;
 
-#ifdef DEBUG
-       Log( LOG_DEBUG, "Removing PID file (%s) ...", Conf_PidFile );
-#endif
+       LogDebug( "Removing PID file (%s) ...", Conf_PidFile );
 
        if( unlink( Conf_PidFile ))
                Log( LOG_ERR, "Error unlinking PID file (%s): %s", Conf_PidFile, strerror( errno ));
@@ -531,9 +519,7 @@ Pidfile_Create(pid_t pid)
        /* Pidfile configured? */
        if( ! Conf_PidFile[0] ) return;
 
-#ifdef DEBUG
-       Log( LOG_DEBUG, "Creating PID file (%s) ...", Conf_PidFile );
-#endif
+       LogDebug( "Creating PID file (%s) ...", Conf_PidFile );
 
        pidfd = open( Conf_PidFile, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
        if ( pidfd < 0 ) {
@@ -834,7 +820,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 
        if (pwd) {
                if (chdir(pwd->pw_dir) == 0)
-                       Log(LOG_DEBUG,
+                       LogDebug(
                            "Changed working directory to \"%s\" ...",
                            pwd->pw_dir);
                else
index 2efb8a943fb921e52f6574ff8851b424e43bdbdc..c3ae0feed731b6afc38e9af45b04c97243ede2a6 100644 (file)
@@ -35,10 +35,8 @@ GLOBAL char NGIRCd_Version[126];
 /** String specifying the compile-time options and target platform */
 GLOBAL char NGIRCd_VersionAddition[126];
 
-#ifdef DEBUG
 /** Flag indicating if debug mode is active (true) or not (false) */
 GLOBAL bool NGIRCd_Debug;
-#endif
 
 #ifdef SNIFFER
 /** Flag indication if sniffer is active (true) or not (false) */
index 8edb76e2169150951fbcdf9cb5611102b346d16f..997410683cc9e97a918b0e244c03a129b99c0906 100644 (file)
@@ -217,10 +217,8 @@ Send_CHANINFO(CLIENT * Client, CHANNEL * Chan)
        char *modes, *topic, *key;
        bool has_k, has_l;
 
-#ifdef DEBUG
        Log(LOG_DEBUG, "Sending CHANINFO commands for \"%s\" ...",
            Channel_Name(Chan));
-#endif
 
        modes = Channel_Modes(Chan);
        topic = Channel_Topic(Chan);
index 51834133bff35e8ca86cb6d2e755bc9863d8cf16..7b5d28c2dc8f87335dfd92bf18b2a06886905fe3 100644 (file)
@@ -183,7 +183,7 @@ Parse_Request( CONN_ID Idx, char *Request )
        assert( Request != NULL );
 
 #ifdef SNIFFER
-       if( NGIRCd_Sniffer ) Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request );
+       if( NGIRCd_Sniffer ) LogDebug( " <- connection %d: '%s'.", Idx, Request );
 #endif
 
        Init_Request( &req );
index 859c7ce575692ee4b69ff032face09f96269ba3e..48260c67017388cc499032f863dcc626e43104be 100644 (file)
@@ -25,7 +25,7 @@ typedef struct _REQUEST
        char *prefix;                   /**< Prefix */
        char *command;                  /**< IRC command */
        char *argv[15];                 /**< Parameters, at most 15 (0..14) */
-       int argc;                       /**< Number of given paramaters */
+       int argc;                       /**< Number of given parameters */
 } REQUEST;
 
 /** IRC command handling structure */
index d68d714da44d77eb9b158f128e0f52775b408315..af00dd3d3e9c81ca1345a10513ce8a4250292f15 100644 (file)
@@ -114,14 +114,10 @@ Proc_GenericSignalHandler(int Signal)
 {
        switch(Signal) {
        case SIGTERM:
-#ifdef DEBUG
                Log_Subprocess(LOG_DEBUG, "Child got TERM signal, exiting.");
-#endif
                exit(1);
        case SIGALRM:
-#ifdef DEBUG
                Log_Subprocess(LOG_DEBUG, "Child got ALARM signal, exiting.");
-#endif
                exit(1);
        }
 }
index afbef5b375122711763fe91bb80f56c1a929c8db..1931bc712e3be470672b92d484c7c9a9c9846f41 100644 (file)
@@ -93,9 +93,7 @@ Resolve_Name( PROC_STAT *s, const char *Host, void (*cbfunc)(int, short))
        pid = Proc_Fork(s, pipefd, cbfunc, RESOLVER_TIMEOUT);
        if (pid > 0) {
                /* Main process */
-#ifdef DEBUG
                Log( LOG_DEBUG, "Resolver for \"%s\" created (PID %d).", Host, pid );
-#endif
                return true;
        } else if( pid == 0 ) {
                /* Sub process */
@@ -140,15 +138,11 @@ Do_IdentQuery(int identsock, array *resolved_addr)
        if (identsock < 0)
                return;
 
-#ifdef DEBUG
        Log_Subprocess(LOG_DEBUG, "Doing IDENT lookup on socket %d ...",
                       identsock);
-#endif
        res = ident_id( identsock, 10 );
-#ifdef DEBUG
        Log_Subprocess(LOG_DEBUG, "Ok, IDENT lookup on socket %d done: \"%s\"",
                       identsock, res ? res : "(NULL)");
-#endif
        if (!res) /* no result */
                return;
        if (!array_cats(resolved_addr, res))
@@ -373,9 +367,7 @@ Do_ResolveAddr(const ng_ipaddr_t *Addr, int identsock, int w_fd)
 
        array_init(&resolved_addr);
        ng_ipaddr_tostr_r(Addr, tmp_ip_str);
-#ifdef DEBUG
        Log_Subprocess(LOG_DEBUG, "Now resolving %s ...", tmp_ip_str);
-#endif
        if (!ReverseLookup(Addr, hostname, sizeof(hostname)))
                goto dns_done;
 
@@ -388,9 +380,7 @@ Do_ResolveAddr(const ng_ipaddr_t *Addr, int identsock, int w_fd)
                Log_Forgery_NoIP(tmp_ip_str, hostname);
                strlcpy(hostname, tmp_ip_str, sizeof(hostname));
        }
-#ifdef DEBUG
        Log_Subprocess(LOG_DEBUG, "Ok, translated %s to \"%s\".", tmp_ip_str, hostname);
-#endif
  dns_done:
        len = strlen(hostname);
        hostname[len] = '\n';
@@ -417,10 +407,8 @@ Do_ResolveName( const char *Host, int w_fd )
         * to parent. */
        array IpAddrs;
        int af;
-#ifdef DEBUG
        ng_ipaddr_t *addr;
        size_t len;
-#endif
        Log_Subprocess(LOG_DEBUG, "Now resolving \"%s\" ...", Host);
 
        array_init(&IpAddrs);
@@ -440,7 +428,6 @@ Do_ResolveName( const char *Host, int w_fd )
                close(w_fd);
                return;
        }
-#ifdef DEBUG
        len = array_length(&IpAddrs, sizeof(*addr));
        assert(len > 0);
        addr = array_start(&IpAddrs);
@@ -449,7 +436,6 @@ Do_ResolveName( const char *Host, int w_fd )
                Log_Subprocess(LOG_DEBUG, "translated \"%s\" to %s.",
                                        Host, ng_ipaddr_tostr(addr));
        }
-#endif
        /* Write result into pipe to parent */
        ArrayWrite(w_fd, &IpAddrs);
 
index 8275123e6acd433a555f4e130a11faa10205ab47..4ed1a1255f4498b3820856dd8736d2a86cf0d33c 100644 (file)
@@ -41,25 +41,23 @@ static const int signals_catch[] = {
        SIGINT, SIGQUIT, SIGTERM, SIGHUP, SIGCHLD, SIGUSR1, SIGUSR2
 };
 
-#ifdef DEBUG
 
 static void
 Dump_State(void)
 {
-       Log(LOG_DEBUG, "--- Internal server state: %s ---",
+       LogDebug("--- Internal server state: %s ---",
            Client_ID(Client_ThisServer()));
 #ifdef HAVE_LONG_LONG
-       Log(LOG_DEBUG, "time()=%llu", (unsigned long long)time(NULL));
+       LogDebug("time()=%llu", (unsigned long long)time(NULL));
 #else
-       Log(LOG_DEBUG, "time()=%lu", (unsigned long)time(NULL));
+       LogDebug("time()=%lu", (unsigned long)time(NULL));
 #endif
        Conf_DebugDump();
        Conn_DebugDump();
        Client_DebugDump();
-       Log(LOG_DEBUG, "--- End of state dump ---");
+       LogDebug("--- End of state dump ---");
 } /* Dump_State */
 
-#endif
 
 static void
 Signal_Block(int sig)
@@ -174,7 +172,6 @@ Signal_Handler(int Signal)
                while (waitpid( -1, NULL, WNOHANG) > 0)
                        ;
                return;
-#ifdef DEBUG
        case SIGUSR1:
                if (! NGIRCd_Debug) {
                        Log(LOG_INFO|LOG_snotice,
@@ -197,7 +194,6 @@ Signal_Handler(int Signal)
 #endif /* SNIFFER */
                }
                return;
-#endif
        }
 
        /*
@@ -226,7 +222,6 @@ Signal_Handler_BH(int Signal)
                /* re-read configuration */
                Rehash();
                break;
-#ifdef DEBUG
        case SIGUSR2:
                if (NGIRCd_Debug) {
                        Log(LOG_INFO|LOG_snotice,
@@ -235,8 +230,7 @@ Signal_Handler_BH(int Signal)
                }
                break;
        default:
-               Log(LOG_DEBUG, "Got signal %d! Ignored.", Signal);
-#endif
+               LogDebug("Got signal %d! Ignored.", Signal);
        }
        Signal_Unblock(Signal);
 }
index 43f2f9070c20caa28cdeee403d80b177dfa95b91..ebe81b49ff9ca511dbfe410539351952ea6794d5 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "config.h"
 
+/* remove assert() macro at compile time if DEBUG is not set. */
+
 #ifndef DEBUG
 # define NDEBUG
 #endif
index 4c65db1febd5c30008f421a0a6d1e45b28f8e11c..d3b2a888fc9d185734ea2180f8455cb98e5bb07a 100644 (file)
@@ -45,7 +45,7 @@
  *  probably requires libm on most operating systems. Don't yet
  *  support the exponent (e,E) and sigfig (g,G). Also, fmtint()
  *  was pretty badly broken, it just wasn't being exercised in ways
- *  which showed it, so that's been fixed. Also, formated the code
+ *  which showed it, so that's been fixed. Also, formatted the code
  *  to mutt conventions, and removed dead code left over from the
  *  original. Also, there is now a builtin-test, just compile with:
  *    gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
index 4ff5ea9f937cf2d5df049e5c1cb1e994580f7c2a..33855fb094afa4cfdeef7e3081e29cda8cf4afff 100644 (file)
@@ -71,7 +71,7 @@ tests.sh
 test-loop.sh [<loops> [<wait>]]
 
        This script runs all the tests <loops> times (default: 5) and pauses
-       <wait> seconds (default: 5) betweed runs.
+       <wait> seconds (default: 5) between runs.
        It isn't used by "make check" or "make testsuite".
 
 wait-tests.sh [<max>]