--- /dev/null
+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
+++ /dev/null
-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
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.
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.
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.
## 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
- 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
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
+#include <string.h>
int
main(int argc, char **argv)
{
Makefile \
contrib/Debian/Makefile \
contrib/MacOSX/Makefile \
- contrib/MacOSX/ngIRCd.pmdoc/Makefile \
contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
contrib/Makefile \
doc/Makefile \
#
# 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
# 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
+++ /dev/null
-<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
+++ /dev/null
-<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
+++ /dev/null
-<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
+++ /dev/null
-<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
+++ /dev/null
-#
-# 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-
+++ /dev/null
-<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 "launch daemon". 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>
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;
};
- 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.
# 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
#
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.
;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
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
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);
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
{
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
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
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;
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")) {
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;
{
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 "*";
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 ),
} /* 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),
}
} /* Client_DumpClients */
-#endif
/* -eof- */
const char *hostname));
-#ifdef DEBUG
GLOBAL void Client_DebugDump PARAMS((void));
-#endif
#endif
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));
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);
}
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);
}
}
}
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));
{
/* Validate configuration settings. */
-#ifdef DEBUG
int i, servers, servers_once;
-#endif
bool config_valid = true;
char *ptr;
"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]) {
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;
}
Log(Level, "%s", msg);
}
-#ifdef DEBUG
/**
* Dump internal state of the "configuration module".
{
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,
}
}
-#endif
/**
* Initialize server configuration structure to default values.
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 */
};
/** 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 */
/* Password required by WEBIRC command */
GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN];
-#ifdef DEBUG
GLOBAL void Conf_DebugDump PARAMS((void));
-#endif
#endif
#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"
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
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 );
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)) {
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 );
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);
/**
* 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.
*/
#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 ));
}
#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");
}
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;
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;
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);
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);
Class_HandleServerBans(c);
}
-#ifdef DEBUG
else
LogDebug("Resolver: discarding result for already registered connection %d.", i);
-#endif
} /* cb_Read_Resolver_Result */
/**
#endif /* SSL_SUPPORT */
-#ifdef DEBUG
/**
* Dump internal state of the "connection module".
{
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,
}
} /* Conn_DumpClients */
-#endif /* DEBUG */
/* -eof- */
GLOBAL void Conn_SetAuthPing PARAMS((CONN_ID Idx, long ID));
#endif
-#ifdef DEBUG
GLOBAL void Conn_DebugDump PARAMS((void));
-#endif
#endif
/** 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). */
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
* 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.
*/
* 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
} /* 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.
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? */
/*
* 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
GLOBAL bool IRC_CHANINFO PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL bool IRC_Send_Channel_Info PARAMS((CLIENT *Client, CHANNEL *Chan));
+
#endif
/* -eof- */
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;
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));
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'))
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))
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
(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)));
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);
/*
* 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
break;
default:
if (Client_Type(Client) != CLIENT_SERVER) {
- Log(LOG_DEBUG,
+ LogDebug(
"Unknown mode \"%c%c\" from \"%s\"!?",
set ? '+' : '-', *mode_ptr,
Client_ID(Origin));
*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));
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++))
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) {
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));
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));
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;
}
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') &&
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
/*
* 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
#include "numeric.h"
#include "ngircd.h"
#include "irc.h"
+#include "irc-channel.h"
#include "irc-info.h"
#include "irc-write.h"
#include "op.h"
"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;
}
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])
/**
* 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.
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) {
* @param Format Format string like printf().
* @param ... Further arguments.
*/
-#ifdef DEBUG
# ifdef PROTOTYPES
GLOBAL void
LogDebug( const char *Format, ... )
va_end( ap );
Log(LOG_DEBUG, "%s", msg);
}
-#endif /* DEBUG */
/**
}
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 );
#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
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);
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
#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"
} 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
/**
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, '@');
GLOBAL bool Login_User PARAMS((CLIENT * Client));
GLOBAL bool Login_User_PostAuth PARAMS((CLIENT *Client));
+GLOBAL void Login_Autojoin PARAMS((CLIENT *Client));
#endif
/*
* 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
/*
* 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
NGIRCd_SignalQuit = NGIRCd_SignalRestart = false;
NGIRCd_Passive = false;
-#ifdef DEBUG
NGIRCd_Debug = false;
-#endif
#ifdef SNIFFER
NGIRCd_Sniffer = false;
#endif
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( "" );
/* 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 */
/* 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;
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." );
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" );
/* 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 ));
/* 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 ) {
if (pwd) {
if (chdir(pwd->pw_dir) == 0)
- Log(LOG_DEBUG,
+ LogDebug(
"Changed working directory to \"%s\" ...",
pwd->pw_dir);
else
/** 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) */
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);
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 );
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 */
{
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);
}
}
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 */
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))
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;
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';
* 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);
close(w_fd);
return;
}
-#ifdef DEBUG
len = array_length(&IpAddrs, sizeof(*addr));
assert(len > 0);
addr = array_start(&IpAddrs);
Log_Subprocess(LOG_DEBUG, "translated \"%s\" to %s.",
Host, ng_ipaddr_tostr(addr));
}
-#endif
/* Write result into pipe to parent */
ArrayWrite(w_fd, &IpAddrs);
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)
while (waitpid( -1, NULL, WNOHANG) > 0)
;
return;
-#ifdef DEBUG
case SIGUSR1:
if (! NGIRCd_Debug) {
Log(LOG_INFO|LOG_snotice,
#endif /* SNIFFER */
}
return;
-#endif
}
/*
/* re-read configuration */
Rehash();
break;
-#ifdef DEBUG
case SIGUSR2:
if (NGIRCd_Debug) {
Log(LOG_INFO|LOG_snotice,
}
break;
default:
- Log(LOG_DEBUG, "Got signal %d! Ignored.", Signal);
-#endif
+ LogDebug("Got signal %d! Ignored.", Signal);
}
Signal_Unblock(Signal);
}
#include "config.h"
+/* remove assert() macro at compile time if DEBUG is not set. */
+
#ifndef DEBUG
# define NDEBUG
#endif
* 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
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>]