Browse Source

Import upstream version 17.1

Alexander Barton 10 years ago
parent
commit
c01f25a3cd
100 changed files with 3711 additions and 1503 deletions
  1. BIN
      ._INSTALL
  2. BIN
      ._README
  3. 138 1
      ChangeLog
  4. 24 2
      INSTALL
  5. 2 2
      Makefile.am
  6. 28 22
      Makefile.in
  7. 65 1
      NEWS
  8. 7 7
      README
  9. 22 16
      aclocal.m4
  10. 1021 240
      configure
  11. 63 10
      configure.in
  12. BIN
      contrib/._ngindent
  13. BIN
      contrib/._ngircd-bsd.sh
  14. BIN
      contrib/._ngircd-redhat.init
  15. 2 2
      contrib/Debian/Makefile.am
  16. 4 4
      contrib/Debian/Makefile.in
  17. 55 0
      contrib/Debian/changelog
  18. 2 2
      contrib/Debian/control
  19. 2 2
      contrib/Debian/ngircd.init
  20. 4 0
      contrib/Debian/ngircd.pam
  21. 6 2
      contrib/Debian/rules
  22. BIN
      contrib/MacOSX/._Makefile.am
  23. 8 9
      contrib/MacOSX/Makefile.in
  24. 17 1
      contrib/MacOSX/config.h
  25. 2 2
      contrib/MacOSX/ngIRCd.pmdoc/Makefile.in
  26. 2 2
      contrib/MacOSX/ngIRCd.pmdoc/index.xml
  27. 2 2
      contrib/MacOSX/ngIRCd.xcodeproj/Makefile.in
  28. 34 7
      contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
  29. 14 0
      contrib/MacOSX/postinstall.sh
  30. 8 9
      contrib/Makefile.in
  31. 1 1
      contrib/ngircd-redhat.init
  32. 1 1
      contrib/ngircd.spec
  33. 30 17
      contrib/platformtest.sh
  34. 19 14
      depcomp
  35. 53 0
      doc/Bopm.txt
  36. 17 10
      doc/FAQ.txt
  37. 77 0
      doc/HowToRelease.txt
  38. 28 11
      doc/Makefile.am
  39. 35 21
      doc/Makefile.in
  40. 36 0
      doc/PAM.txt
  41. 18 16
      doc/Platforms.txt
  42. 37 0
      doc/README-Interix.txt
  43. 2 4
      doc/SSL.txt
  44. 28 9
      doc/sample-ngircd.conf
  45. 2 2
      doc/src/Makefile.in
  46. 120 108
      install-sh
  47. 2 2
      man/Makefile.in
  48. 15 8
      man/ngircd.8.tmpl
  49. 35 10
      man/ngircd.conf.5.tmpl
  50. BIN
      src/._Makefile.am
  51. 8 9
      src/Makefile.in
  52. 23 2
      src/config.h.in
  53. 9 10
      src/ipaddr/Makefile.in
  54. 6 2
      src/ipaddr/ng_ipaddr.h
  55. BIN
      src/ngircd/._client.h
  56. BIN
      src/ngircd/._conn-func.c
  57. BIN
      src/ngircd/._irc-channel.c
  58. BIN
      src/ngircd/._irc-op.c
  59. BIN
      src/ngircd/._irc-op.h
  60. BIN
      src/ngircd/._irc.c
  61. BIN
      src/ngircd/._irc.h
  62. BIN
      src/ngircd/._log.h
  63. BIN
      src/ngircd/._parse.h
  64. 4 6
      src/ngircd/Makefile.am
  65. 28 19
      src/ngircd/Makefile.in
  66. 11 2
      src/ngircd/channel.c
  67. 2 0
      src/ngircd/channel.h
  68. 162 29
      src/ngircd/client.c
  69. 16 1
      src/ngircd/client.h
  70. 2 1
      src/ngircd/conf-ssl.h
  71. 202 61
      src/ngircd/conf.c
  72. 29 14
      src/ngircd/conf.h
  73. 10 0
      src/ngircd/conn-func.c
  74. 1 0
      src/ngircd/conn-func.h
  75. 3 2
      src/ngircd/conn-ssl.c
  76. 386 180
      src/ngircd/conn.c
  77. 21 6
      src/ngircd/conn.h
  78. 3 8
      src/ngircd/defines.h
  79. 50 15
      src/ngircd/io.c
  80. 3 0
      src/ngircd/io.h
  81. 57 29
      src/ngircd/irc-channel.c
  82. 150 120
      src/ngircd/irc-info.c
  83. 151 11
      src/ngircd/irc-login.c
  84. 2 1
      src/ngircd/irc-login.h
  85. 55 17
      src/ngircd/irc-mode.c
  86. 0 1
      src/ngircd/irc-op.c
  87. 14 14
      src/ngircd/irc-oper.c
  88. 0 2
      src/ngircd/irc-server.c
  89. 68 60
      src/ngircd/irc-write.c
  90. 9 8
      src/ngircd/irc-write.h
  91. 17 11
      src/ngircd/irc.c
  92. 0 1
      src/ngircd/lists.c
  93. 56 91
      src/ngircd/log.c
  94. 6 7
      src/ngircd/log.h
  95. 6 2
      src/ngircd/messages.h
  96. 51 175
      src/ngircd/ngircd.c
  97. 2 4
      src/ngircd/ngircd.h
  98. 0 2
      src/ngircd/numeric.c
  99. 0 1
      src/ngircd/op.c
  100. 0 0
      src/ngircd/pam.c

BIN
._INSTALL


BIN
._README


+ 138 - 1
ChangeLog

@@ -1,7 +1,7 @@
 
                      ngIRCd - Next Generation IRC Server
 
-                        (c)2001-2009 Alexander Barton,
+                        (c)2001-2010 Alexander Barton,
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
@@ -10,6 +10,143 @@
                                -- ChangeLog --
 
 
+ngIRCd Release 17.1 (2010-12-19)
+
+  - --configtest: remember if MOTD is configured by file or phrase
+  - Enhance log messages when establishing server links a little bit
+  - Reset ID of outgoing server link on DNS error correctly
+  - Don't log critical (or worse) messages to stderr
+  - Manual page ngircd(8): add SIGNALS section
+  - Manual pages: update and simplyfy AUTHORS section
+  - Remove "error file" when compiled with debug code enabled
+  - README: Updated list of implemented commands
+  - add doc/README-Interix.txt and doc/Bopm.txt to distribution tarball
+  - Merge branch 'numeric-329'
+  - add doc/PAM.txt to distribution tarball
+  - New numeric 329: get channel creation time on "MODE #chan" commands
+  - Save channel creation time; new function Channel_CreationTime()
+
+ngIRCd Release 17 (2010-11-07)
+
+  - doc: change path names in sample-ngircd.conf depending on sysconfdir
+  - Fix up generation and distribution of sample-ngircd.conf
+  - contrib/ngircd-redhat.init: updated email address of Naoya Nakazawa
+  - contrib/platformtest.sh: make command name quoting consistent
+
+  ngIRCd 17~rc3 (2010-10-27)
+  - Xcode builds: detect version number correctly, updateed project file
+    to use the Mac OS X 10.5.x SDK, disable pam_fail_delay() because it
+    is only available starting with Mac OS X 10.6, and generate a default
+    PAM configuration for the Mac OS X Installer.app package of ngIRCd.
+  - Debian: updated standards version to 3.9.1, added libpam0g-dev to the
+    dependencies, and install a default /etc/pam.d/ngircd allowing all logins.
+  - Make contrib/platformtest.sh more portable.
+  - Fix connect attempts to further IP addresses of outgoing server links.
+
+  ngIRCd 17~rc2 (2010-10-25)
+  - ZeroConf: include header files missing since commit a988bbc86a.
+  - Generate ngIRCd version number from GIT tag.
+  - Make sourcecode compatible with ansi2knr again. This allows to compile
+    ngIRCd using a pre-ANSI K&R C compiler again.
+  - ./configure: check if C compiler can compile ISO Standard C.
+  - ./configure: check support for C prototypes again.
+  - Don't use PARAMS() macro for function implementations.
+  - Added m68k/apple/aux3.0.1 (gcc 2.7.2) to doc/Platforms.txt.
+  - Only try to set FD_CLOEXEC if this flag is defined.
+  - Only use "__attribute__ ((unused))" if GCC >=2.8 is used.
+  - doc/Makefile.am: don't set docdir, automake handles it already.
+
+  ngIRCd 17~rc1 (2010-10-11)
+  - New configuration option "NoZeroConf" to disable service registration at
+    runtime even if ngIRCd is compiled with support for ZeroConf (e.g. using
+    Howl, Avahi or on Mac OS X).
+  - New configuration option "SyslogFacility" to define the syslog "facility"
+    (the "target"), to which ngIRCd should send its log messages.
+    Possible values are system dependant, but most probably "auth", "daemon",
+    "user" and "local1" through "local7" are possible values; see syslog(3).
+    Default is "local5" for historical reasons.
+  - Dump the "internal server state" (configured servers, established
+    connections and known clients) to the console or syslog when receiving
+    the SIGUSR2 signal and debug mode is enabled.
+  - Enable the daemon to disable and enable "debug mode" on runtime using
+    signal SIGUSR1, when debug code is compiled in, not only on startup
+    using the command line parameters.
+  - Signal handler: added new 'delayed' signal handlers, including fallback
+    to deprecated sysv API. And removed global NGIRCd_SignalRehash variable.
+  - IO: add io_cloexec() to set close-on-exec flag.
+  - ng_ipaddr.h: include required assert.h header.
+  - Conn_SyncServerStruct(): test all connections; and work case insensitive
+  - configure script: correctly indent IPv6 yes/no summary output.
+  - Don't reset My_Connections[Idx].lastping when reading data, so the
+    client lag debug-output is working again.
+  - Implement user mode "x": hostname cloaking (closes: #102).
+  - Make configure switch "--docdir" work (closes: #108).
+  - Reformat and update FAQ.txt a little bit.
+  - INSTALL: mention SSL, IPv6, and changed handling of MotdFile.
+  - Change MOTD file handling: ngIRCd now caches the contens of the MOTD
+    file, so the daemon now requires a HUP signal or REHASH command to
+    re-read the MOTD file when its content changed.
+  - Startup: open /dev/null before chroot'ing the daemon.
+  - Allow IRC ops to change channel modes even without OperServerMode set.
+  - Allow IRC operators to use MODE command on any channel (closes: #100).
+  - Added mailmap file for git-[short]log and git-blame.
+  - Authenticated users should be registered without the "~" mark.
+  - Set NoPAM=yes in configuration files used for the testsuite.
+  - New configuration option "NoPAM" to disable PAM.
+  - Implement asynchronous user authentication using PAM, please see the
+    file doc/PAM.txt for details.
+  - Resolver: Implement signal handler and catch TERM signals.
+  - Don't set a penalty time when doing DNS lookups.
+  - Add some documentation for using BOPM with ngIRCd, see doc/Bopm.txt.
+  - Implement user mode "c": receive connect/disconnect NOTICEs. Note that
+    this new mode requires the user to be an IRC operator.
+  - ngircd.init: require "$network" and "$remote_fs" when stopping ngircd.
+  - Show SSL status in WHOIS output, numeric 275.
+  - Include correct header files when testing for arpa/inet.h (Closes: #105).
+  - Don't access already freed memory in IRC_KILL().
+  - Fix "beeing" typo ...
+  - SSL/TLS: fix bogus "socket closed" error message.
+
+ngIRCd Release 16 (2010-05-02)
+
+  - doc/SSL: remove line continuation marker
+
+  ngIRCd 16~rc2 (2010-04-25)
+  - Updated some more copyright notices, it's 2010 already :-)
+  - Only compile in Get_Error() if really needed
+  - Fix gcc warning "ignoring return value of ..."
+  - Include netinet/in_systm.h alongside netinet/ip.h
+  - Include netinet/{in.h, in_systm.h} when checking for netinet/ip.h
+  - Only include <netinet/in_systm.h> if it exists
+  - Updated doc/Platforms.txt
+  - Enhace connection statistics counters: display total number of served
+    connections on daemon shutdown and when a new client connects using
+    the new numeric RPL_STATSCONN (250).
+
+  ngIRCd 16~rc1 (2010-03-25)
+  - Various fixes to the build system and code cleanups.
+  - contrib/platformtest.sh: Only show latest commit.
+  - Updatet doc/Platforms.txt, added new README-Interix.txt documenting
+    how to tun ngIRCd on Microsoft Services for UNIX (MS SFU, MS SUA).
+  - Updated links to the ngIRCd homepage (bug tracker, mailing list).
+  - Added missing modes to USERMODES #define
+  - Show our name (IRCD=ngIRCd) in ISUPPORT (005) numeric
+  - Quote received messages of ERROR commands in log output.
+  - ngircd.conf manual page: document missing "Password" variable.
+  - Implement WEBIRC command used by some Web-IRC frontends. The password
+    required to secure this command must be configured using the new
+    "WebircPassword" variable in the ngircd.conf file.
+  - Don't use port 6668 as example for both "Ports" and "SSLPorts".
+  - Remove limit on max number of configured irc operators.
+  - Only link "nsl" library when really needed.
+  - A new channel mode "secure connections only" (+z) has been implemented:
+    Only clients using a SSL encrypted connection to the server are allowed
+    to join such a channel.
+    But please note three things: a) already joined clients are not checked
+    when setting this mode, b) IRC operators are always allowed to join
+    every channel, and c) remote clients using a server not supporting this
+    mode are not checked either and therefore always allowed to join.
+
 ngIRCd Release 15 (2009-11-07)
 
   - "ngircd --configtest": print SSL configuration options even when unset.

+ 24 - 2
INSTALL

@@ -1,7 +1,7 @@
 
                      ngIRCd - Next Generation IRC Server
 
-                        (c)2001-2007 Alexander Barton,
+                        (c)2001-2010 Alexander Barton,
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
@@ -9,11 +9,15 @@
 
                                 -- INSTALL --
 
-                         
 
 I. Upgrade Information
 ~~~~~~~~~~~~~~~~~~~~~~
 
+Differences to version 16
+
+- Changes to the "MotdFile" specified in ngircd.conf now require a ngircd
+  configuration reload to take effect (HUP signal, REHASH command).
+
 Differences to version 0.9.x
 
 - The option of the configure script to enable support for Zeroconf/Bonjour/
@@ -184,6 +188,24 @@ standard locations.
   to the daemon, for example by using "/etc/hosts.{allow|deny}".
   The "libwrap" is required for this option.
 
+* PAM:
+  --with-pam[=<path>]
+
+  Enable support for PAM, the Pluggable Authentication Modules library.
+  See doc/PAM.txt for details.
+
+* SSL:
+  --with-openssl[=<path>]
+  --with-gnutls[=<path>]
+
+  Enable support for SSL/TLS using OpenSSL or gnutls libraries.
+  See doc/SSL.txt for details.
+
+* IPv6:
+  --enable-ipv6
+
+  Adds support for version 6 of the Internet Protocol.
+
 
 IV. Useful make-targets
 ~~~~~~~~~~~~~~~~~~~~~~~

+ 2 - 2
Makefile.am

@@ -1,6 +1,6 @@
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2010 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
@@ -38,7 +38,7 @@ have-xcodebuild:
 	 || ( echo; echo "Error: \"xcodebuild\" not found!"; echo; exit 1 )
 
 xcode: have-xcodebuild
-	rel=`grep AC_INIT configure.in | cut -d' ' -f2 | cut -d')' -f1`; \
+	rel=`git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'`; \
 	 def="GCC_PREPROCESSOR_DEFINITIONS=\"VERSION=\\\"$$rel\\\"\""; \
 	 xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
 	 -configuration Default $$def build

+ 28 - 22
Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,7 @@
 
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2010 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
@@ -295,8 +295,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
@@ -321,8 +321,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -332,13 +332,12 @@ ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
 	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	test -z "$(CTAGS_ARGS)$$tags$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$tags $$unique
@@ -409,6 +408,10 @@ dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
 	$(am__remove_distdir)
 
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__remove_distdir)
@@ -435,6 +438,8 @@ distcheck: dist
 	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
@@ -586,17 +591,18 @@ uninstall-am:
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am am--refresh check check-am clean clean-generic \
 	clean-local ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
-	distclean-generic distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	maintainer-clean-local mostlyclean mostlyclean-generic pdf \
-	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+	dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
+	distclean distclean-generic distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-local mostlyclean \
+	mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am
 
 
 clean-local:
@@ -624,7 +630,7 @@ have-xcodebuild:
 	 || ( echo; echo "Error: \"xcodebuild\" not found!"; echo; exit 1 )
 
 xcode: have-xcodebuild
-	rel=`grep AC_INIT configure.in | cut -d' ' -f2 | cut -d')' -f1`; \
+	rel=`git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'`; \
 	 def="GCC_PREPROCESSOR_DEFINITIONS=\"VERSION=\\\"$$rel\\\"\""; \
 	 xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
 	 -configuration Default $$def build

+ 65 - 1
NEWS

@@ -1,7 +1,7 @@
 
                      ngIRCd - Next Generation IRC Server
 
-                        (c)2001-2009 Alexander Barton,
+                        (c)2001-2010 Alexander Barton,
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
@@ -10,6 +10,70 @@
                                   -- NEWS --
 
 
+ngIRCd Release 17.1 (2010-12-19)
+
+  - Don't log critical (or worse) messages to stderr
+  - Remove "error file" when compiled with debug code enabled
+  - New numeric 329: get channel creation time on "MODE #chan" commands
+
+ngIRCd Release 17 (2010-11-07)
+
+  - doc: change path names in sample-ngircd.conf depending on sysconfdir
+
+  ngIRCd 17~rc2 (2010-10-25)
+  - Generate ngIRCd version number from GIT tag.
+  - Make sourcecode compatible with ansi2knr again. This allows to compile
+    ngIRCd using a pre-ANSI K&R C compiler again.
+
+  ngIRCd 17~rc1 (2010-10-11)
+  - New configuration option "NoZeroConf" to disable service registration at
+    runtime even if ngIRCd is compiled with support for ZeroConf (e.g. using
+    Howl, Avahi or on Mac OS X).
+  - New configuration option "SyslogFacility" to define the syslog "facility"
+    (the "target"), to which ngIRCd should send its log messages.
+    Possible values are system dependant, but most probably "auth", "daemon",
+    "user" and "local1" through "local7" are possible values; see syslog(3).
+    Default is "local5" for historical reasons.
+  - Dump the "internal server state" (configured servers, established
+    connections and known clients) to the console or syslog when receiving
+    the SIGUSR2 signal and debug mode is enabled.
+  - Enable the daemon to disable and enable "debug mode" on runtime using
+    signal SIGUSR1, when debug code is compiled in, not only on startup
+    using the command line parameters.
+  - Implement user mode "x": hostname cloaking (closes: #102).
+  - Change MOTD file handling: ngIRCd now caches the contens of the MOTD
+    file, so the daemon now requires a HUP signal or REHASH command to
+    re-read the MOTD file when its content changed.
+  - Allow IRC ops to change channel modes even without OperServerMode set.
+  - Allow IRC operators to use MODE command on any channel (closes: #100).
+  - New configuration option "NoPAM" to disable PAM.
+  - Implement asynchronous user authentication using PAM, please see the
+    file doc/PAM.txt for details.
+  - Add some documentation for using BOPM with ngIRCd, see doc/Bopm.txt.
+  - Implement user mode "c": receive connect/disconnect NOTICEs. Note that
+    this new mode requires the user to be an IRC operator.
+  - Show SSL status in WHOIS output, numeric 275.
+
+ngIRCd Release 16 (2010-05-02)
+
+  ngIRCd 16~rc2 (2010-04-25)
+  - Enhace connection statistics counters: display total number of served
+    connections on daemon shutdown and when a new client connects using
+    the new numeric RPL_STATSCONN (250).
+
+  ngIRCd 16~rc1 (2010-03-25)
+  - Implement WEBIRC command used by some Web-IRC frontends. The password
+    required to secure this command must be configured using the new
+    "WebircPassword" variable in the ngircd.conf file.
+  - Remove limit on max number of configured irc operators.
+  - A new channel mode "secure connections only" (+z) has been implemented:
+    Only clients using a SSL encrypted connection to the server are allowed
+    to join such a channel.
+    But please note three things: a) already joined clients are not checked
+    when setting this mode, b) IRC operators are always allowed to join
+    every channel, and c) remote clients using a server not supporting this
+    mode are not checked either and therefore always allowed to join.
+
 ngIRCd Release 15 (2009-11-07)
 
   ngIRCd 15~rc1 (2009-10-15)

+ 7 - 7
README

@@ -34,11 +34,11 @@ used in real IRC networks.
 
 Implemented IRC-commands are:
 
-ADMIN, AWAY, CHANINFO, CONNECT, DIE, DISCONNECT, ERROR, HELP, INVITE, ISON,
-JOIN, KICK, KILL, LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN, NOTICE,
-OPER, PART, PASS, PING, PONG, PRIVMSG, QUIT, REHASH, RESTART, SERVER, SQUIT,
-STATS, TIME, TOPIC, TRACE, USER, USERHOST, VERSION, WALLOPS, WHO, WHOIS,
-WHOWAS.
+ADMIN, AWAY, CHANINFO, CONNECT, DIE, DISCONNECT, ERROR, HELP, INFO, INVITE,
+ISON, JOIN, KICK, KILL, LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN,
+NOTICE, OPER, PART, PASS, PING, PONG, PRIVMSG, QUIT, REHASH, RESTART, SERVER,
+SERVICE, SERVLIST, SQUERY, SQUIT,  STATS, SUMMON, TIME, TOPIC, TRACE, USER,
+USERHOST, USERS, VERSION, WALLOPS, WEBIRC, WHO, WHOIS, WHOWAS.
 
 
 III. Features (or: why use ngIRCd?)
@@ -78,10 +78,10 @@ VI. Bugs
 If you find bugs in the ngIRCd (which might be there :-), please report
 them at the following URL:
 
-<http://ngircd.barton.de/#bugs>
+<http://ngircd.barton.de/bugtracker.php>
 
 There you can read about known bugs and limitations, too.
 
 If you have critics, patches or something else, please feel free to post a
 mail to the ngIRCd mailing list: <ngircd-ml@arthur.ath.cx> (please see
-<http://ngircd.barton.de/#ml> for details).
+<http://ngircd.barton.de/support.php#ml> for details).

+ 22 - 16
aclocal.m4

@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,12 +11,15 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf.  If you want to use that,
-you should regenerate the build system entirely.], [63])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.61],,
+[m4_warning([this file was generated for autoconf 2.61.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -31,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.10'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10], [],
+m4_if([$1], [1.10.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -47,8 +50,10 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -320,7 +325,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # each Makefile.in and add a new line on top of each file to say so.
   # Grep'ing the whole file is not good either: AIX grep has a line
   # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
     dirpart=`AS_DIRNAME("$mf")`
   else
     continue
@@ -380,13 +385,13 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2008 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
+# serial 13
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -491,16 +496,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
 # our stamp files there.
 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
 [# Compute $1's index in $config_headers.
+_am_arg=$1
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
-    $1 | $1:* )
+    $_am_arg | $_am_arg:* )
       break ;;
     * )
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 #
@@ -798,7 +804,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 

File diff suppressed because it is too large
+ 1021 - 240
configure


+ 63 - 10
configure.in

@@ -1,6 +1,6 @@
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2009 Alexander Barton <alex@barton.de>
+# Copyright (c)2001-2010 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
@@ -9,10 +9,12 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 
+define(VERSION_ID,esyscmd(git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'|tr -d \\n))
+
 # -- Initialisation --
 
 AC_PREREQ(2.50)
-AC_INIT(ngircd, 15)
+AC_INIT(ngircd, VERSION_ID)
 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE(1.6)
@@ -33,6 +35,7 @@ AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
 AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled])
 AH_TEMPLATE([ZEROCONF], [Define if support for Zeroconf should be included])
 AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
+AH_TEMPLATE([PAM], [Define if PAM should be used])
 AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
 
 AH_TEMPLATE([TARGET_OS], [Target operating system name])
@@ -42,6 +45,8 @@ AH_TEMPLATE([TARGET_CPU], [Target CPU name])
 # -- C Compiler --
 
 AC_PROG_CC
+AC_PROG_CC_STDC
+AC_C_PROTOTYPES
 
 # -- Helper programs --
 
@@ -101,11 +106,24 @@ AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
 
 AC_CHECK_HEADERS([ \
-	ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
-	strings.h sys/socket.h sys/time.h unistd.h \
+	ctype.h errno.h fcntl.h netdb.h netinet/in.h netinet/in_systm.h \
+	stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h \
 	],,AC_MSG_ERROR([required C header missing!]))
 
-AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdbool.h stddef.h varargs.h])
+AC_CHECK_HEADERS([ \
+	arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h \
+	],[],[],[[
+	#ifdef HAVE_SYS_TYPES_H
+		#include <sys/types.h>
+	#endif
+	#ifdef HAVE_SYS_SOCKET_H
+		#include <sys/socket.h>
+	#endif
+	#ifdef HAVE_NETINET_IN_H
+		#include <netinet/in.h>
+	#endif
+	]]
+)
 
 # -- Datatypes --
 
@@ -130,9 +148,11 @@ AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
 
 # -- Libraries --
 
+# A/UX needs this.
 AC_CHECK_LIB(UTIL,memmove)
+# needed on solaris. GNU libc also has a libnsl, but we do not need it.
+AC_SEARCH_LIBS(gethostbyname,nsl)
 AC_CHECK_LIB(socket,bind)
-AC_CHECK_LIB(nsl,gethostent)
 
 # -- Functions --
 
@@ -143,7 +163,7 @@ AC_CHECK_FUNCS([ \
 	bind gethostbyaddr gethostbyname gethostname inet_ntoa \
 	setsid setsockopt socket strcasecmp waitpid],,AC_MSG_ERROR([required function missing!]))
 
-AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton isdigit sigaction snprintf \
+AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton isdigit sigaction sigprocmask snprintf \
  vsnprintf strdup strlcpy strlcat strtok_r)
 
 # -- Configuration options --
@@ -464,6 +484,33 @@ if test "$x_identauth_on" = "yes"; then
 	AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
 fi
 
+# compile in PAM support?
+
+x_pam_on=no
+AC_ARG_WITH(pam,
+	[  --with-pam              enable user authentication using PAM],
+	[	if test "$withval" != "no"; then
+			if test "$withval" != "yes"; then
+				CFLAGS="-I$withval/include $CFLAGS"
+				CPPFLAGS="-I$withval/include $CPPFLAGS"
+				LDFLAGS="-L$withval/lib $LDFLAGS"
+			fi
+			AC_CHECK_LIB(pam, pam_authenticate)
+			AC_CHECK_FUNCS(pam_authenticate, x_pam_on=yes,
+				AC_MSG_ERROR([Can't enable PAM support!])
+			)
+		fi
+	]
+)
+if test "$x_pam_on" = "yes"; then
+	AC_DEFINE(PAM, 1)
+	AC_CHECK_HEADERS(security/pam_appl.h,pam_ok=yes)
+	if test "$pam_ok" != "yes"; then
+		AC_CHECK_HEADERS(pam/pam_appl.h,pam_ok=yes,
+			AC_MSG_ERROR([required C header missing!]))
+	fi
+fi
+
 # compile in IRC+ protocol support?
 
 x_ircplus_on=yes
@@ -573,7 +620,7 @@ B=`eval echo ${bindir}` ; B=`eval echo ${B}`
 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
-D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
+D=`eval echo ${docdir}` ; D=`eval echo ${D}`
 
 echo "             Target: ${target}"
 test "$target" != "$host" && echo "               Host: ${host}"
@@ -641,11 +688,17 @@ echo $ECHO_N "        I/O backend: $ECHO_C"
 	echo "\"$x_io_backend\""
 
 echo $ECHO_N "      IPv6 protocol: $ECHO_C"
-echo $ECHO_N "$x_ipv6_on    $ECHO_C"
-
+test "$x_ipv6_on" = "yes" \
+	&& echo $ECHO_N "yes   $ECHO_C" \
+	|| echo $ECHO_N "no    $ECHO_C"
 echo $ECHO_N "        SSL support: $ECHO_C"
 echo "$x_ssl_lib"
 
+echo $ECHO_N "        PAM support: $ECHO_C"
+test "$x_pam_on" = "yes" \
+	&& echo "yes" \
+	|| echo "no"
+
 echo
 
 # -eof-

BIN
contrib/._ngindent


BIN
contrib/._ngircd-bsd.sh


BIN
contrib/._ngircd-redhat.init


+ 2 - 2
contrib/Debian/Makefile.am

@@ -1,6 +1,6 @@
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2010 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
@@ -10,7 +10,7 @@
 #
 
 EXTRA_DIST = rules changelog compat control copyright \
-	ngircd.init ngircd.default ngircd.postinst
+	ngircd.init ngircd.default ngircd.pam ngircd.postinst
 
 maintainer-clean-local:
 	rm -f Makefile Makefile.in

+ 4 - 4
contrib/Debian/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,7 @@
 
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2010 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
@@ -155,7 +155,7 @@ target_vendor = @target_vendor@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = rules changelog compat control copyright \
-	ngircd.init ngircd.default ngircd.postinst
+	ngircd.init ngircd.default ngircd.pam ngircd.postinst
 
 all: all-am
 

+ 55 - 0
contrib/Debian/changelog

@@ -1,3 +1,58 @@
+ngircd (17.1-0ab1) unstable; urgency=low
+
+  * New "upstream" release: ngIRCd 17.1.
+
+ -- Alexander Barton <alex@barton.de>  Sun, 19 Dec 2010 15:56:42 +0100
+
+ngircd (17-0ab1) unstable; urgency=low
+
+  * New "upstream" release: ngIRCd 17.
+
+ -- Alexander Barton <alex@barton.de>  Sun, 07 Nov 2010 17:23:07 +0100
+
+ngircd (17~rc3-0ab1) unstable; urgency=low
+
+  * New "upstream" release candidate 3 for ngIRCd Release 17.
+
+ -- Alexander Barton <alex@barton.de>  Wed, 27 Oct 2010 22:30:08 +0200
+
+ngircd (17~rc2-0ab2) unstable; urgency=low
+
+  * Install /etc/pam.d/ngircd including "auth required pam_permit.so" when
+    installing -full or -full-dbg variant to keep backwards compatibility.
+
+ -- Alexander Barton <alex@barton.de>  Tue, 26 Oct 2010 23:34:56 +0200
+
+ngircd (17~rc2-0ab1) unstable; urgency=low
+
+  * New "upstream" release candidate 2 for ngIRCd Release 17.
+
+ -- Alexander Barton <alex@barton.de>  Mon, 25 Oct 2010 18:51:15 +0200
+
+ngircd (17~rc1-0ab1) unstable; urgency=low
+
+  * New "upstream" release candidate 1 for ngIRCd Release 17.
+
+ -- Alexander Barton <alex@barton.de>  Mon, 11 Oct 2010 16:57:47 +0200
+
+ngircd (16-0ab1) unstable; urgency=low
+
+  * New "upstream" release: ngIRCd 16.
+
+ -- Alexander Barton <alex@barton.de>  Sun, 02 May 2010 13:32:41 +0200
+
+ngircd (16~rc2-0ab1) unstable; urgency=low
+
+  * New "upstream" release candidate 2 for ngIRCd Release 16.
+
+ -- Alexander Barton <alex@barton.de>  Sun, 25 Apr 2010 13:12:42 +0200
+
+ngircd (16~rc1-0ab1) unstable; urgency=low
+
+  * New "upstream" release candidate 1 for ngIRCd Release 16.
+
+ -- Alexander Barton <alex@barton.de>  Thu, 25 Mar 2010 15:56:03 +0200
+
 ngircd (15-0ab1) unstable; urgency=low
 
   * New "upstream" release: ngIRCd 15.

+ 2 - 2
contrib/Debian/control

@@ -2,8 +2,8 @@ Source: ngircd
 Section: net
 Priority: optional
 Maintainer: Alexander Barton <alex@barton.de>
-Build-Depends: debhelper (>> 4.0.0), libz-dev, libwrap0-dev, libident-dev, libgnutls-dev
-Standards-Version: 3.8.0
+Build-Depends: debhelper (>> 4.0.0), libz-dev, libwrap0-dev, libident-dev, libgnutls-dev, libpam0g-dev
+Standards-Version: 3.9.1
 
 Package: ngircd
 Architecture: any

+ 2 - 2
contrib/Debian/ngircd.init

@@ -1,13 +1,13 @@
 #!/bin/sh
 #
 # ngIRCd start and stop script for Debian-based systems
-# Copyright 2008,2009 Alexander Barton <alex@barton.de>
+# Copyright 2008-2010 Alexander Barton <alex@barton.de>
 #
 
 ### BEGIN INIT INFO
 # Provides:		ngircd
 # Required-Start:	$network $remote_fs
-# Required-Stop:
+# Required-Stop:	$network $remote_fs
 # Should-Start:		$syslog $named
 # Should-Stop:		$syslog
 # Default-Start:	2 3 4 5

+ 4 - 0
contrib/Debian/ngircd.pam

@@ -0,0 +1,4 @@
+# /etc/pam.d/ngircd
+
+# allow all connections to ngIRCd
+auth required pam_permit.so

+ 6 - 2
contrib/Debian/rules

@@ -53,7 +53,7 @@ configure-ngircd-full: configure
 	  --sysconfdir=/etc/ngircd \
 	  --mandir=\$${prefix}/share/man \
 	  --with-syslog --with-zlib \
-	  --with-gnutls --with-ident --with-tcp-wrappers \
+	  --with-gnutls --with-ident --with-tcp-wrappers --with-pam \
 	  --enable-ipv6
 
 configure-ngircd-full-dbg: configure
@@ -66,7 +66,7 @@ configure-ngircd-full-dbg: configure
 	  --mandir=\$${prefix}/share/man \
 	  --enable-debug --enable-sniffer \
 	  --with-syslog --with-zlib \
-	  --with-gnutls --with-ident --with-tcp-wrappers \
+	  --with-gnutls --with-ident --with-tcp-wrappers --with-pam \
 	  --enable-ipv6
 
 build:
@@ -163,6 +163,8 @@ install-ngircd-full: build-ngircd-full
 	 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
 	 >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
 	touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
+	mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d
+	cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full/etc/pam.d/ngircd
 
 install-ngircd-full-dbg: build-ngircd-full-dbg
 	dh_testdir
@@ -183,6 +185,8 @@ install-ngircd-full-dbg: build-ngircd-full-dbg
 	 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
 	 >$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
 	touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd
+	mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d
+	cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d/ngircd
 
 # Build architecture-independent files here.
 binary-indep:

BIN
contrib/MacOSX/._Makefile.am


+ 8 - 9
contrib/MacOSX/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -278,8 +278,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
@@ -304,8 +304,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -315,13 +315,12 @@ ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
 	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	test -z "$(CTAGS_ARGS)$$tags$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$tags $$unique

+ 17 - 1
contrib/MacOSX/config.h

@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2009 Alexander Barton (alex@barton.de).
+ * Copyright (c)2001-2010 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
@@ -51,6 +51,9 @@
 /* Define if IPV6 protocol should be enabled */
 #define WANT_IPV6 1
 
+/* Define if PAM should be used */
+#define PAM 1
+
 /* -- Supported features -- */
 
 /* Define if SSP C support is enabled. */
@@ -71,6 +74,8 @@
 #define HAVE_STDBOOL_H 1
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #define HAVE_ARPA_INET_H 1
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#define HAVE_NETINET_IP_H 1
 
 /* Define to 1 if you have the `kqueue' function. */
 #define HAVE_KQUEUE 1
@@ -92,6 +97,8 @@
 #define HAVE_GETADDRINFO 1
 /* Define to 1 if you have the `getnameinfo' function. */
 #define HAVE_GETNAMEINFO 1
+/* Define to 1 if you have the `sigaction' function. */
+#define HAVE_SIGACTION 1
 
 /* Define if socklen_t exists */
 #define HAVE_socklen_t 1
@@ -103,4 +110,13 @@
 #define HAVE_DNSSERVICEREGISTRATIONCREATE 1
 #endif
 
+#ifdef PAM
+/* Define to 1 if you have the `pam_authenticate' function. */
+#define HAVE_PAM_AUTHENTICATE 1
+/* Define to 1 if you have the <pam/pam_appl.h> header file. */
+#define HAVE_PAM_PAM_APPL_H 1
+/* Mac OS X <10.6 doesn't have pam_fail_delay() */
+#define NO_PAM_FAIL_DELAY 1
+#endif
+
 /* -eof- */

+ 2 - 2
contrib/MacOSX/ngIRCd.pmdoc/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.

+ 2 - 2
contrib/MacOSX/ngIRCd.pmdoc/index.xml

@@ -4,7 +4,7 @@
 \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-2009 Alexander Barton and Contributors.\
+Copyright (c)2001-2010 Alexander Barton and Contributors.\
 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
 
 \i0 \cf0 \
@@ -187,4 +187,4 @@ To disable automatic starting of ngIRCd, use this command:\
 \ls2\ilvl0
 \f1\fs24 \cf0 	sudo launchctl unload -w \\\
 		/Library/LaunchDaemons/de.barton.ngircd.plist\
-}]]></resource></locale></resources><flags/><item type="file">01ngircd.xml</item><item type="file">02de.xml</item><mod>properties.customizeOption</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
+}]]></resource></locale></resources><flags/><item type="file">01ngircd.xml</item><item type="file">02de.xml</item><mod>properties.customizeOption</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>

+ 2 - 2
contrib/MacOSX/ngIRCd.xcodeproj/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.

+ 34 - 7
contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj

@@ -7,6 +7,8 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		FA2D564A11EA158B00D37A35 /* pam.c in Sources */ = {isa = PBXBuildFile; fileRef = FA2D564911EA158B00D37A35 /* pam.c */; };
+		FA2D567B11EA1AB300D37A35 /* libpam.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FA2D567A11EA1AB300D37A35 /* libpam.dylib */; };
 		FA322D350CEF74B1001761B3 /* array.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322CD90CEF74B1001761B3 /* array.c */; };
 		FA322D360CEF74B1001761B3 /* channel.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322CDB0CEF74B1001761B3 /* channel.c */; };
 		FA322D370CEF74B1001761B3 /* client.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322CDD0CEF74B1001761B3 /* client.c */; };
@@ -36,7 +38,9 @@
 		FA322DC10CEF77CB001761B3 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FA322DC00CEF77CB001761B3 /* libz.dylib */; };
 		FA407F2E0DB159F400271AF1 /* ng_ipaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */; };
 		FA85178C0FA061EC006A1F5A /* op.c in Sources */ = {isa = PBXBuildFile; fileRef = FA85178B0FA061EC006A1F5A /* op.c */; };
+		FA99428C10E82A27007F27ED /* proc.c in Sources */ = {isa = PBXBuildFile; fileRef = FA99428B10E82A27007F27ED /* proc.c */; };
 		FAA3D27B0F139CDC00B2447E /* conn-ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = FAA3D2790F139CDC00B2447E /* conn-ssl.c */; };
+		FAA97C57124A271400D5BBA9 /* sighandlers.c in Sources */ = {isa = PBXBuildFile; fileRef = FAA97C55124A271400D5BBA9 /* sighandlers.c */; };
 		FAE5CC2E0CF2308A007D69B6 /* numeric.c in Sources */ = {isa = PBXBuildFile; fileRef = FAE5CC2D0CF2308A007D69B6 /* numeric.c */; };
 /* End PBXBuildFile section */
 
@@ -55,6 +59,9 @@
 /* Begin PBXFileReference section */
 		FA1A6BBC0D6857BB00AA8F71 /* misc-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "misc-test.e"; sourceTree = "<group>"; };
 		FA1A6BBD0D6857D900AA8F71 /* who-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "who-test.e"; sourceTree = "<group>"; };
+		FA2D564811EA158B00D37A35 /* pam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pam.h; sourceTree = "<group>"; };
+		FA2D564911EA158B00D37A35 /* pam.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pam.c; sourceTree = "<group>"; };
+		FA2D567A11EA1AB300D37A35 /* libpam.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpam.dylib; path = usr/lib/libpam.dylib; sourceTree = SDKROOT; };
 		FA322BBA0CEF72E4001761B3 /* ngIRCd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ngIRCd; sourceTree = BUILT_PRODUCTS_DIR; };
 		FA322CD60CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
 		FA322CD90CEF74B1001761B3 /* array.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = array.c; sourceTree = "<group>"; };
@@ -196,6 +203,8 @@
 		FA407F380DB15AC700271AF1 /* GIT.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = GIT.txt; sourceTree = "<group>"; };
 		FA85178A0FA061EC006A1F5A /* op.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = op.h; sourceTree = "<group>"; };
 		FA85178B0FA061EC006A1F5A /* op.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = op.c; sourceTree = "<group>"; };
+		FA99428A10E82A27007F27ED /* proc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proc.h; sourceTree = "<group>"; };
+		FA99428B10E82A27007F27ED /* proc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = proc.c; sourceTree = "<group>"; };
 		FAA3D2700F139CB300B2447E /* invite-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "invite-test.e"; sourceTree = "<group>"; };
 		FAA3D2710F139CB300B2447E /* join-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "join-test.e"; sourceTree = "<group>"; };
 		FAA3D2720F139CB300B2447E /* kick-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "kick-test.e"; sourceTree = "<group>"; };
@@ -218,6 +227,8 @@
 		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>"; };
+		FAA97C56124A271400D5BBA9 /* sighandlers.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = sighandlers.h; sourceTree = "<group>"; };
 		FAE5CC2C0CF2308A007D69B6 /* numeric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = numeric.h; sourceTree = "<group>"; };
 		FAE5CC2D0CF2308A007D69B6 /* numeric.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = numeric.c; sourceTree = "<group>"; };
 /* End PBXFileReference section */
@@ -228,6 +239,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				FA322DC10CEF77CB001761B3 /* libz.dylib in Frameworks */,
+				FA2D567B11EA1AB300D37A35 /* libpam.dylib in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -254,6 +266,7 @@
 				FA322D630CEF750F001761B3 /* Makefile.am */,
 				1AB674ADFE9D54B511CA2CBB /* Products */,
 				FA322DC00CEF77CB001761B3 /* libz.dylib */,
+				FA2D567A11EA1AB300D37A35 /* libpam.dylib */,
 			);
 			name = ngIRCd;
 			sourceTree = "<group>";
@@ -339,10 +352,16 @@
 				FA85178B0FA061EC006A1F5A /* op.c */,
 				FA322D080CEF74B1001761B3 /* parse.c */,
 				FA322D090CEF74B1001761B3 /* parse.h */,
+				FA99428B10E82A27007F27ED /* proc.c */,
+				FA99428A10E82A27007F27ED /* proc.h */,
 				FA322D0A0CEF74B1001761B3 /* rendezvous.c */,
 				FA322D0B0CEF74B1001761B3 /* rendezvous.h */,
 				FA322D0C0CEF74B1001761B3 /* resolve.c */,
 				FA322D0D0CEF74B1001761B3 /* resolve.h */,
+				FAA97C55124A271400D5BBA9 /* sighandlers.c */,
+				FAA97C56124A271400D5BBA9 /* sighandlers.h */,
+				FA2D564811EA158B00D37A35 /* pam.h */,
+				FA2D564911EA158B00D37A35 /* pam.c */,
 			);
 			path = ngircd;
 			sourceTree = "<group>";
@@ -631,7 +650,14 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */;
 			compatibilityVersion = "Xcode 3.0";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
+			knownRegions = (
+				English,
+				Japanese,
+				French,
+				German,
+			);
 			mainGroup = 08FB7794FE84155DC02AAC07 /* ngIRCd */;
 			projectDirPath = "";
 			projectReferences = (
@@ -682,6 +708,9 @@
 				FA407F2E0DB159F400271AF1 /* ng_ipaddr.c in Sources */,
 				FAA3D27B0F139CDC00B2447E /* conn-ssl.c in Sources */,
 				FA85178C0FA061EC006A1F5A /* op.c in Sources */,
+				FA99428C10E82A27007F27ED /* proc.c in Sources */,
+				FA2D564A11EA158B00D37A35 /* pam.c in Sources */,
+				FAA97C57124A271400D5BBA9 /* sighandlers.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -711,7 +740,6 @@
 				GCC_WARN_UNUSED_VALUE = YES;
 				INSTALL_PATH = /usr/local/bin;
 				PRODUCT_NAME = ngIRCd;
-				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
 			};
 			name = Default;
 		};
@@ -724,22 +752,22 @@
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				PREBINDING = NO;
-				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
 			};
 			name = Default;
 		};
 		FAB0570C105D917F006AF9E2 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
-				ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
+				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
 				GCC_DEBUGGING_SYMBOLS = full;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_VERSION = 4.0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				ONLY_ACTIVE_ARCH = YES;
 				PREBINDING = NO;
-				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+				SDKROOT = "";
 			};
 			name = Debug;
 		};
@@ -758,7 +786,7 @@
 				GCC_WARN_SHADOW = YES;
 				GCC_WARN_SIGN_COMPARE = YES;
 				GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = NO;
 				GCC_WARN_UNKNOWN_PRAGMAS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_LABEL = YES;
@@ -766,7 +794,6 @@
 				GCC_WARN_UNUSED_VALUE = YES;
 				INSTALL_PATH = /usr/local/bin;
 				PRODUCT_NAME = ngIRCd;
-				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
 			};
 			name = Debug;
 		};

+ 14 - 0
contrib/MacOSX/postinstall.sh

@@ -19,6 +19,20 @@ else
 fi
 chmod o-rwx /opt/ngircd/etc/ngircd.conf
 
+if [ ! -e /opt/ngircd/etc/ngircd.pam ]; then
+	echo "Creating default PAM configuration: /opt/ngircd/etc/ngircd.pam"
+	echo "# PAM configuration for ngIRCd" >/opt/ngircd/etc/ngircd.pam
+	echo "" >>/opt/ngircd/etc/ngircd.pam
+	echo "auth required pam_permit.so" >>/opt/ngircd/etc/ngircd.pam
+	echo "#auth required pam_opendirectory.so" >>/opt/ngircd/etc/ngircd.pam
+fi
+chmod 644 /opt/ngircd/etc/ngircd.pam
+
+if [ ! -e /etc/pam.d/ngircd ]; then
+	echo "Linkint /opt/ngircd/etc/ngircd.pam to /etc/pam.d/ngircd"
+	ln -s /opt/ngircd/etc/ngircd.pam /etc/pam.d/ngircd || exit 1
+fi
+
 if [ -f "$LDPLIST" ]; then
 	echo "Fixing ownership and permissions of LaunchDaemon script ..."
 	chown root:wheel "$LDPLIST" || exit 1

+ 8 - 9
contrib/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -278,8 +278,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
@@ -304,8 +304,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -315,13 +315,12 @@ ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
 	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	test -z "$(CTAGS_ARGS)$$tags$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$tags $$unique

+ 1 - 1
contrib/ngircd-redhat.init

@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # ngIRCd start and stop script for RedHat based distributions.
-# Written by Naoya Nakazawa <naoya@sanow.net> for CentOS 5.2, 2009.
+# Written by Naoya Nakazawa <naoya.n@gmail.com> for CentOS 5.2, 2009.
 #
 # chkconfig: 2345 01
 # description: ngIRCd is an Open Source server for \

+ 1 - 1
contrib/ngircd.spec

@@ -1,5 +1,5 @@
 %define name    ngircd
-%define version 15
+%define version 17.1
 %define release 1
 %define prefix  %{_prefix}
 

+ 30 - 17
contrib/platformtest.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2009 Alexander Barton <alex@barton.de>
+# Copyright (c)2001-2010 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
@@ -51,16 +51,16 @@ if [ $? -ne 0 ]; then
 	cd ..
 fi
 
-echo "$NAME: Checking for ./configure script ..."
-if [ ! -e ./configure ]; then
-	echo "$NAME: Not found. Running ./autogen.sh ..."
+echo "$NAME: Checking for \"./autogen.sh\" script ..."
+if [ -r ./autogen.sh ]; then
+	echo "$NAME: Running \"./autogen.sh\" ..."
 	[ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null
 fi
 
-if [ -e ./configure ]; then
+if [ -r ./configure ]; then
 	echo "$NAME: Running \"./configure\" script ..."
 	[ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null
-	if [ $? -eq 0 -a -e ./Makefile ]; then
+	if [ $? -eq 0 -a -r ./Makefile ]; then
 		CONFIGURE=1
 		echo "$NAME: Running \"make\" ..."
 		[ -n "$VERBOSE" ] && make || make >/dev/null
@@ -93,22 +93,29 @@ fi
 
 # Get compiler information
 if [ -r "Makefile" ]; then
-	eval $(grep "^CC = " Makefile | sed -e 's/ //g')
+	CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
 	$CC --version 2>&1 | grep -i "GCC" >/dev/null
 	if [ $? -eq 0 ]; then
-		COMPILER=$($CC --version | head -n 1 | awk "{ print \$3 }" \
+		COMPILER=$($CC --version | head -1 | awk "{ print \$3 }" \
 		 | cut -d'-' -f1)
 		COMPILER="gcc $COMPILER"
+	else
+		case "$CC" in
+		  gcc*)
+			v="`$CC --version 2>/dev/null | head -1`"
+			[ -n "$v" ] && COMPILER="gcc $v"
+			;;
+		esac
 	fi
 fi
 
 # Get ngIRCd version information
-if [ -d ".git" ]; then
-	VERSION=`git log --abbrev-commit --pretty=oneline HEAD~1.. \
-	 | cut -d' ' -f1 | tr -d '.'`
-elif [ -r "Makefile" ]; then
-	eval $(grep "^VERSION = " Makefile | sed -e 's/ //g')
-fi
+eval $(grep "^VERSION = " Makefile | sed -e 's/ //g')
+case "$VERSION" in
+	*-*-*)
+		VERSION=`echo "$VERSION" | cut -d'-' -f3 | cut -b2-`
+		;;
+esac
 [ -n "$VERSION" ] || VERSION="unknown"
 
 # Get IO interface information
@@ -137,7 +144,13 @@ echo "                                                ./configure works --+ | |
 echo "                                                                    | | | |"
 echo "Platform                    Compiler     ngIRCd     Date     Tester C M T R See"
 echo "--------------------------- ------------ ---------- -------- ------ - - - - ---"
-printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \
- "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \
- "$C" "$M" "$T" "$R" "$COMMENT"
+type printf >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+	printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \
+	 "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \
+	 "$C" "$M" "$T" "$R" "$COMMENT"
+else
+	echo "$PLATFORM $COMPILER $VERSION $DATE $USER" \
+	 "$C" "$M" "$T" "$R" "$COMMENT"
+fi
 echo; echo

+ 19 - 14
depcomp

@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2006-10-15.18
+scriptversion=2007-03-29.01
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -215,34 +215,39 @@ aix)
   # current directory.  Also, the AIX compiler puts `$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
-  tmpdepfile="$stripped.u"
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
-  if test -f "$tmpdepfile"; then :
-  else
-    stripped=`echo "$stripped" | sed 's,^.*/,,'`
-    tmpdepfile="$stripped.u"
-  fi
-
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile"
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
 
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
   if test -f "$tmpdepfile"; then
-    outname="$stripped.o"
     # Each line is of the form `foo.o: dependent.h'.
     # Do two passes, one to just change these to
     # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
-    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile

+ 53 - 0
doc/Bopm.txt

@@ -0,0 +1,53 @@
+
+                     ngIRCd - Next Generation IRC Server
+
+                        (c)2001-2010 Alexander Barton,
+                    alex@barton.de, http://www.barton.de/
+
+               ngIRCd is free software and published under the
+                   terms of the GNU General Public License.
+
+                                -- BOPM.txt --
+
+
+I. Introduction
+~~~~~~~~~~~~~~~~
+
+Citing <http://wiki.blitzed.org/BOPM>: "BOPM is an open source open proxy
+monitor, designed for use with hybrid-based ircds, although it can be used
+with slight modification on any server which has the ability to show connects
+to opers and that supports KLINEs."
+
+And starting with Release 17, ngIRCd supports all required log messages that
+BOPM requires to be useful.
+
+II. Installation
+~~~~~~~~~~~~~~~~~
+
+Install BOPM as usual, please see the BOPM documentation for details.
+Afterwards adjust the following configuration parameters that are important
+for ngIRCd:
+
+a) BOPM "IRC" section:
+
+  1) Set "server" and "port" accordingly,
+
+  2) adjust the "oper" line to match an [Operator] block in ngircd.conf,
+
+  3) change "mode" to "+ci" or "+c".
+
+  4) Set "connregex" to the following string, everything in one line(!):
+     "\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*";
+     and comment all the other "connregex" examples (prepend a "#" character).
+
+  5) Set "kline" to "KILL %n :Open proxy found on your host!"; for example,
+     and comment all the other "kline" examples.
+
+b) BOPM "scanner" section:
+
+  Make sure you configure a valid "target_ip" and "target_port" for the
+  configured scanners to test. And please note that you CAN'T USE the port
+  of ngIRCd, because ngIRCd doesn't send any banner message by default!
+
+  So you need a service what sends a banner, so for example POP3, SMTP,
+  IMAP, or SSH daemons should work ...

+ 17 - 10
doc/FAQ.txt

@@ -1,7 +1,7 @@
 
                      ngIRCd - Next Generation IRC Server
 
-                      (c)2001-2003 by Alexander Barton,
+                      (c)2001-2010 by Alexander Barton,
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
@@ -12,9 +12,11 @@
 
 I. General
 ~~~~~~~~~~
+
 Q: Is it possible to link the ngIRCd with non-ngIRCd servers?
 A: Yes. ngIRCd is compatible to the original ircd used by IRCNet. Actually
-   this is being tested with version 2.10.3p3.
+   this is being tested with version 2.10.3p3. Please note that newer
+   versions (2.11.x) aren't compatible any more!
 
 Q: Is there a homepage with further information and downloads?
 A: Yes. Please visit <http://ngircd.barton.de/>.
@@ -26,6 +28,7 @@ A: ngIRCd offers several benefits: no problems with dynamic IPs, easy to
 
 II. Compilation
 ~~~~~~~~~~~~~~~
+
 Q: I did a "CVS checkout" but can't execute ./configure because the script
    is missing in the generated directory!?
 A: When using development versions via CVS, the configure script as well as
@@ -55,27 +58,33 @@ III. Runtime
 ~~~~~~~~~~~~
 
 Q: Where is the log file located?
-A: ngIRCd does not write its own log file. Instead, ngIRCd uses
-   syslog(3). Check the files in /var/log/ and/or consult the
-   documentation for your system logger daemon.
+A: ngIRCd does not write its own log file. Instead, ngIRCd uses syslog(3).
+   Check the files in /var/log/ and/or consult the documentation for your
+   system logger daemon.
+
 Q: I cannot connect to remote peers when I use the chroot option, the
    following is logged: "Can't resolve example.com: unknown error!".
 A: On Linux/glibc with chroot enabled you need to put some libraries inside
    the chroot as well, notably libnss_dns; maybe others. Unfortunately, even
-   linking ngircd statically does not help this. The only known workaround
+   linking ngIRCd statically does not help this. The only known workaround
    is to either disable chroot support or to link against dietlibc instead
    of glibc. (tnx to Sebastian Siewior)
+
 Q: I have added an [Oper] section, how do i log on as IRC operator?
 A: You can use the /OPER command in your IRC client to become an IRC operator.
    ngIRCd will also log all OPER requests (using syslog), if OPER fails you
    can look there to determine why it did not work (bad password, unauthorized
    host mask, etc.)
+
 Q: I am an IRC operator, but MODE doesn't work!
-A: You need to set 'OperCanUseMode = yes' in ngircd.conf to enable MODE for IRC
-   operators.
+A: You need to set 'OperCanUseMode = yes' in ngircd.conf, then IRC operators
+   can use the MODE command for changing modes even when they are not joined
+   to the specific channel.
+
 
 IV. Bugs!?
 ~~~~~~~~~~
+
 Q: Is there a list of known bugs and desired feature enhancements?
 A: Yes. Have a look at the bug tracking system (Bugzilla) for ngIRCd located
    at <http://ngircd.barton.de/bugzilla/index.cgi>. There you can file bug
@@ -85,6 +94,3 @@ Q: What should I do if I found a bug?
 A: Please file a bug report at <http://ngircd.barton.de/bugzilla/index.cgi>!
    The author of the particular component will be notified automagically :-)
 
-
-$Id: FAQ.txt,v 1.12 2008/01/02 22:47:58 alex Exp $

+ 77 - 0
doc/HowToRelease.txt

@@ -0,0 +1,77 @@
+
+                     ngIRCd - Next Generation IRC Server
+
+                        (c)2001-2010 Alexander Barton,
+                    alex@barton.de, http://www.barton.de/
+
+               ngIRCd is free software and published under the
+                   terms of the GNU General Public License.
+
+                            -- HowToRelease.txt --
+
+
+I. Introduction
+~~~~~~~~~~~~~~~
+
+Creating a new ngIRCd release requires a few steps to follow: the source
+tree must be in a releasable state (be up to date, include all required
+patches, be tested on as many platforms as possible), a name for the new
+release must be chosen, and all the files describing the release must be
+updated accordingly.
+
+Since ngIRCd release 13 (2009-12-25) we use "simple" release numbers for
+major releases (e.g. "13", "17", "42", ...) introducing new features and
+sub-releases for bug fixes only (e.g. "14.1", "22.3", ...).
+
+When creating pre-releases or release candidates, please use the tilde ("~")
+character to separate the "postfix" in the release number (e.g. "17~rc2"
+or "123.4~rc6").
+
+The release/version number of a build is automatically generated using the
+GIT "describe" command, see git-describe(1). Therefore it is required that
+a new release is tagged in the GIT tree and that the configure script is
+up-to-date (e.g. using ./autogen.sh) before generating the archives!
+
+
+II. How to prepare a new ngIRCd release?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+a) Make sure the source tree is in a releasable state ;-)
+
+b) Make sure you have working versions of GNU autoconf and GNU automake
+   installed on the system you use for generating the release:
+   as of October 2010 we are using GNU autoconf 2.61 and GNU automake 1.10.1
+   which seem to work just fine.
+
+c) Update the files describing the new release:
+    - ChangeLog
+    - NEWS
+
+d) Update the version numbers in the following files:
+    - contrib/ngircd.spec
+
+e) Generate a new Debian change log entry in the following file, e.g. using
+   the Debian "dch" tool of the "devscripts" package:
+    - contrib/Debian/changelog
+
+f) Commit the above changes to GIT: "git add", "git commit"
+
+g) Create a new signed GIT tag for the new release: "git tag -s".
+   Please note that we don't use the tilde ("~") here, instead use a simple
+   hyphen ("-") as delimiter: e.g. "rel-16" "rel-17-rc1", "rel-18-pre2", ...
+
+h) Run "./autogen.sh" to update the ./configure script with the correct
+   release number (autogenerated using "git describe", see above).
+
+i) Run "./configure" to rebuild all generated Makefiles.
+
+j) Run "make distcheck" to generate the distribution archives.
+
+k) Sign the distribution archive(s) using GnuPG: "gpg -b <archivefile>"
+
+l) Upload and distribute the newly generated ngIRCd release archive(s)
+   and GnuPG signatures.
+
+m) Write an announcement to the mailing list, freshmeat, Twitter, ...
+
+n) Relax :-)

+ 28 - 11
doc/Makefile.am

@@ -1,6 +1,6 @@
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
 #
 # Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
 # der GNU General Public License (GPL), wie von der Free Software Foundation
@@ -10,29 +10,46 @@
 # der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
 #
 
+.tmpl:
+	sed \
+	    -e s@:ETCDIR:@${sysconfdir}@ \
+	    <$< >$@
+
+SUFFIXES = .tmpl
+
+static_docs = Bopm.txt FAQ.txt GIT.txt HowToRelease.txt PAM.txt Platforms.txt \
+	Protocol.txt README-AUX.txt README-BeOS.txt README-Interix.txt RFC.txt \
+	SSL.txt Services.txt Zeroconf.txt
+
+doc_templates = sample-ngircd.conf.tmpl
+
+generated_docs = sample-ngircd.conf
+
+toplevel_docs = ../AUTHORS ../COPYING ../ChangeLog ../INSTALL ../NEWS ../README
+
 SUBDIRS = src
 
-EXTRA_DIST = FAQ.txt GIT.txt Protocol.txt Platforms.txt README-AUX.txt \
-	README-BeOS.txt RFC.txt Services.txt SSL.txt Zeroconf.txt \
-	sample-ngircd.conf
+EXTRA_DIST = $(static_docs) $(doc_templates)
+
+CLEANFILES = $(generated_docs)
 
 maintainer-clean-local:
 	rm -f Makefile Makefile.in
 
-docdir = $(datadir)/doc/$(PACKAGE)
+all: $(generated_docs)
 
-documents = $(EXTRA_DIST) ../AUTHORS ../COPYING ../ChangeLog ../INSTALL \
-	../NEWS ../README
-
-install-data-hook:
+install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
 	if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
-	  $(INSTALL) -m 600 -c $(srcdir)/sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
+	  $(INSTALL) -m 600 -c sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
 	 fi
 	$(mkinstalldirs) $(DESTDIR)$(docdir)
-	for f in $(documents); do \
+	for f in $(static_docs) $(toplevel_docs); do \
 	  $(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \
 	 done
+	for f in $(generated_docs); do \
+	  $(INSTALL) -m 644 -c $$f $(DESTDIR)$(docdir)/; \
+	 done
 
 uninstall-hook:
 	rm -rf $(DESTDIR)$(docdir)

+ 35 - 21
doc/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,7 @@
 
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
 #
 # Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
 # der GNU General Public License (GPL), wie von der Free Software Foundation
@@ -133,7 +133,7 @@ build_vendor = @build_vendor@
 builddir = @builddir@
 datadir = @datadir@
 datarootdir = @datarootdir@
-docdir = $(datadir)/doc/$(PACKAGE)
+docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
@@ -167,17 +167,21 @@ target_os = @target_os@
 target_vendor = @target_vendor@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+SUFFIXES = .tmpl
+static_docs = Bopm.txt FAQ.txt GIT.txt HowToRelease.txt PAM.txt Platforms.txt \
+	Protocol.txt README-AUX.txt README-BeOS.txt README-Interix.txt RFC.txt \
+	SSL.txt Services.txt Zeroconf.txt
+
+doc_templates = sample-ngircd.conf.tmpl
+generated_docs = sample-ngircd.conf
+toplevel_docs = ../AUTHORS ../COPYING ../ChangeLog ../INSTALL ../NEWS ../README
 SUBDIRS = src
-EXTRA_DIST = FAQ.txt GIT.txt Protocol.txt Platforms.txt README-AUX.txt \
-	README-BeOS.txt RFC.txt Services.txt SSL.txt Zeroconf.txt \
-	sample-ngircd.conf
-
-documents = $(EXTRA_DIST) ../AUTHORS ../COPYING ../ChangeLog ../INSTALL \
-	../NEWS ../README
-
+EXTRA_DIST = $(static_docs) $(doc_templates)
+CLEANFILES = $(generated_docs)
 all: all-recursive
 
 .SUFFIXES:
+.SUFFIXES: .tmpl
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -283,8 +287,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
@@ -309,8 +313,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -320,13 +324,12 @@ ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
 	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	test -z "$(CTAGS_ARGS)$$tags$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$tags $$unique
@@ -404,6 +407,7 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -488,18 +492,28 @@ uninstall-am:
 	uninstall uninstall-am uninstall-hook
 
 
+.tmpl:
+	sed \
+	    -e s@:ETCDIR:@${sysconfdir}@ \
+	    <$< >$@
+
 maintainer-clean-local:
 	rm -f Makefile Makefile.in
 
-install-data-hook:
+all: $(generated_docs)
+
+install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
 	if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
-	  $(INSTALL) -m 600 -c $(srcdir)/sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
+	  $(INSTALL) -m 600 -c sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
 	 fi
 	$(mkinstalldirs) $(DESTDIR)$(docdir)
-	for f in $(documents); do \
+	for f in $(static_docs) $(toplevel_docs); do \
 	  $(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \
 	 done
+	for f in $(generated_docs); do \
+	  $(INSTALL) -m 644 -c $$f $(DESTDIR)$(docdir)/; \
+	 done
 
 uninstall-hook:
 	rm -rf $(DESTDIR)$(docdir)

+ 36 - 0
doc/PAM.txt

@@ -0,0 +1,36 @@
+
+                     ngIRCd - Next Generation IRC Server
+
+                        (c)2001-2010 Alexander Barton,
+                    alex@barton.de, http://www.barton.de/
+
+               ngIRCd is free software and published under the
+                   terms of the GNU General Public License.
+
+                                 -- PAM.txt --
+
+
+ngIRCd can optionally be compiled to use PAM, the Pluggable Authentication
+Modules library, for user authentication. When compiled with PAM support,
+ngIRCd will authenticate all users connecting to the daemon using the
+configured PAM modules in an asynchronous child process.
+
+To enable PAM, you have to pass the command line parameter "--with-pam" to
+the "configure" script. Please see the PAM documentation ("man 7 pam") for
+details and information about configuring PAM and its individual modules.
+
+A very simple -- and quite useless ;-) -- example would be:
+
+	/etc/pam.d/ngircd:
+	  auth  required  pam_debug.so
+
+Here the "pam_debug" module will be called each time a client connects to
+the ngIRCd and has sent its PASS, NICK, and USER commands.
+
+Please note ONE VERY IMPORTANT THING:
+
+All the PAM modules are executed with the privileges of the user ngIRCd
+is running as. Therefore a lot of PAM modules aren't working as expected,
+because they need root privileges ("pam_unix", for example)!
+Only PAM modules not(!) requiring root privileges (such as "pam_pgsql",
+"pam_mysql", "pam_opendirectory" ...) can be used in conjunction with ngIRCd.

+ 18 - 16
doc/Platforms.txt

@@ -1,7 +1,7 @@
 
                      ngIRCd - Next Generation IRC Server
 
-                        (c)2001-2009 Alexander Barton
+                        (c)2001-2010 Alexander Barton
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
@@ -32,40 +32,42 @@ hppa1.1/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex   Y Y Y Y
 hppa2.0/unknown/linux-gnu   gcc 3.3.5    13~rc1     08-12-02 alex   Y Y Y Y
 hppa2.0w-hp-hpux11.11       gcc 4.2.3    14.1       09-07-22 goetz  Y Y Y Y
 i386/apple/darwin9.7.0      gcc 4.0.1    14.1       09-08-04 alex   Y Y Y Y (3)
-i386/apple/darwin10.0.0b2   gcc 4.2.1    14.1       09-07-27 alex   Y Y Y Y (3)
+i386/apple/darwin10.4.0     gcc 4.2.1    17         10-11-07 alex   Y Y Y Y (3)
 i386/pc/solaris2.9          gcc 3.2.2    CVSHEAD    04-02-24 alex   Y Y Y Y
-i386/pc/solaris2.11         gcc 3.4.3    14.1       09-08-03 alex   Y Y Y Y (4)
+i386/pc/solaris2.11         gcc 3.4.3    17         10-11-07 alex   Y Y N Y (4)
 i386/unknown/freebsd5.2.1   gcc 3.3.3    0.8.0      04-05-30 alex   Y Y Y Y
-i386/unknown/freebsd6.0     gcc 3.4.4    0.10.0-p1  06-08-04 alex   Y Y Y Y (3)
-i386/unknown/freebsd6.1     gcc 3.4.4    CVSHEAD    06-05-07 fw     Y Y Y Y (3)
-i386/unknown/freebsd6.2     gcc 3.4.6    14.1       09-07-27 alex   Y Y Y Y (3)
-i386/unknown/freebsd7.0     gcc 4.2.1    14.1       09-07-28 alex   Y Y Y Y (3)
-i386/unknown/freebsd7.2     gcc 4.2.1    14.1       09-08-03 alex   Y Y Y Y (3)
-i386/unknown/gnu0.3         gcc 3.3.3    0.8.0      04-05-30 alex   Y Y n Y
-i686/unknown/gnu0.3         gcc 4.3.1    14.1       09-07-28 alex   Y Y Y Y
+i386/unknown/freebsd6.2     gcc 3.4.6    17         10-11-07 alex   Y Y Y Y (3)
+i386/unknown/freebsd7.3     gcc 4.2.1    17         10-11-07 alex   Y Y Y Y (3)
+i686/unknown/gnu0.3         gcc 4.4.5    17         10-11-07 alex   Y Y Y Y
+i686/unkn./kfreebsd7.2-gnu  gcc 4.3.4    15         09-12-02 alex   Y Y Y Y (3)
 i386/unknown/netbsdelf1.6.1 gcc 2.95.3   CVSHEAD    04-02-24 alex   Y Y Y Y
 i386/unknown/netbsdelf3.0.1 gcc 3.3.3    0.10.0-p1  06-08-30 alex   Y Y Y Y (3)
-i386/unknown/netbsdelf4.0   gcc 4.1.2    14.1       09-07-28 alex   Y Y Y Y (3)
+i386/unknown/netbsdelf4.0   gcc 4.1.2    17         10-11-07 alex   Y Y Y Y (3)
+i386/unknown/netbsdelf5.0.2 gcc 4.1.3    17         10-11-07 alex   Y Y Y Y (3)
 i386/unknown/openbsd3.9     gcc 3.3.5    0.10.0-p1  06-08-30 alex   Y Y Y Y (3)
-i386/unknown/openbsd4.1     gcc 3.3.5    14.1       09-07-28 alex   Y Y Y Y (3)
-i686/pc/cygwin              gcc 3.3.1    0.8.0      04-05-30 alex   Y Y n Y
+i386/unknown/openbsd4.1     gcc 3.3.5    16         10-04-11 alex   Y Y Y Y (3)
+i586/pc/interix3.5          gcc 3.3      15         10-01-22 alex   Y Y N Y
+i686/pc/cygwin              gcc 3.3.1    0.8.0      04-05-30 alex   Y Y N Y
 i686/pc/linux-gnu           gcc 2.95.4   0.8.0      04-05-30 alex   Y Y Y Y (1)
 i686/pc/linux-gnu           gcc 3.3.5    14.1       09-08-04 alex   Y Y Y Y (1)
 i386/pc/linux-gnu           gcc 4.1.2    13~rc1     08-12-05 alex   Y Y Y Y (1)
 i686/pc/linux-gnu           gcc 4.3.2    14.1       09-08-04 alex   Y Y Y Y (1)
+m68k/apple/aux3.0.1         gcc 2.7.2    17         10-11-07 alex   Y Y N Y
+m68k/apple/aux3.0.1         Orig. A/UX   17         10-11-07 alex   Y Y N Y (2)
 m68k/apple/aux3.1.1         Orig. A/UX   0.7.x-CVS  03-04-22 alex   Y Y Y Y (2)
 m68k/hp/hp-ux9.10           Orig. HPUX   0.7.x-CVS  03-04-30 goetz  Y Y Y Y
 m88k/dg/dgux5.4R3.10        gcc 2.5.8    CVSHEAD    04-03-15 alex   Y Y ? ?
 powerpc/apple/darwin6.5     gcc 3.1      0.7.x-CVS  03-04-23 alex   Y Y Y Y
-powerpc/apple/darwin7.4.0   gcc 3.3      0.8.0      04-05-30 alex   Y Y Y Y
 powerpc/apple/darwin7.9.0   gcc 3.3      CVSHEAD    06-05-07 fw     Y Y Y Y (3)
 powerpc/apple/darwin8.1.0   gcc 4.0      0.9.x-CVS  05-06-27 alex   Y Y Y Y
 powerpc/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex   Y Y Y Y
-powerpc/unknown/openbsd3.6  gcc 2.95.3   0.10.0     06-10-08 alex   Y Y n Y
+powerpc/unknown/openbsd3.6  gcc 2.95.3   0.10.0     06-10-08 alex   Y Y N Y
 sparc/sun/solaris2.6        gcc 2.95.3   0.7.x-CVS  03-04-22 alex   Y Y Y Y
 sparc/sun/solaris2.7        gcc 3.3      0.8.0      04-05-30 alex   Y Y Y Y
 sparc/unkn./netbsdelf1.6.1  gcc 2.95.3   0.8.0      04-05-30 alex   Y Y Y Y
-x86_64/unknown/linux-gnu    gcc 4.3.2    14.1       09-08-04 alex   Y Y Y Y (1)
+x86_64/unknown/freebsd8.1   gcc 4.2.1    17         10-11-07 alex   Y Y Y Y (3)
+x86_64/unknown/linux-gnu    gcc 4.3.2    17         10-11-07 alex   Y Y Y Y (1)
+x86_64/unknown/openbsd4.7   gcc 3.3.5    17         10-11-07 alex   Y Y Y Y (3)
 
 
 Notes

+ 37 - 0
doc/README-Interix.txt

@@ -0,0 +1,37 @@
+
+                    ngIRCd - Next Generation IRC Server
+
+                      (c)2001-2010 Alexander Barton,
+                   alex@barton.de, http://www.barton.de/
+
+               ngIRCd is free software and published under the
+                  terms of the GNU General Public License.
+
+
+                         -- README-Interix.txt --
+
+
+ngIRCd release 15 has successfully been tested on Microsoft Windows XP
+Professional using the Services for UNIX (SFU) version 3.5 and Microsoft
+Windows 7 with the bundled Subsystem for UNIX Applications (SUA).
+
+SFU are supported on Windows 2000, Windows 2000 Server, Windows XP, and
+Windows Server 2003. SUA is supported on Windows Server 2003 R2, Windows
+Server 2008 & 2008 R2, Windows Vista, and Windows 7 -- so ngIRCd should be
+able to run on all of these platforms.
+
+But please note that the poll() API function is not fully implemented by
+SFU/SUA and therefore can't be used by ngIRCd -- which normally would be
+the default. Please see <http://www.suacommunity.com/faqs.aspx> section
+4.25 for details:
+
+  "If you do try to use the poll() API your program will block on the
+  API call forever. You must direct your program to build using the
+  select() API."
+
+So when running the ./configure script, you HAVE TO DISABLE poll() support:
+
+  ./configure --without-poll
+
+ngIRCd then defaults to using the select() API function which works fine.
+

+ 2 - 4
doc/SSL.txt

@@ -49,8 +49,7 @@ Creating a self-signed certificate
 OpenSSL:
 
 Creating a self-signed certificate and key:
- $ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem \
-	-out server-cert.pem -days 1461
+ $ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem -out server-cert.pem -days 1461
 Create DH parameters (optional):
  $ openssl dhparam -2 -out dhparams.pem 2048
 
@@ -58,8 +57,7 @@ GnuTLS:
 
 Creating a self-signed certificate and key:
  $ certtool --generate-privkey --bits 2048 --outfile server-key.pem
- $ certtool --generate-self-signed --load-privkey server-key.pem \
-	 --outfile server-cert.pem
+ $ certtool --generate-self-signed --load-privkey server-key.pem --outfile server-cert.pem
 Create DH parameters (optional):
  $ certtool  --generate-dh-params --bits 2048 --outfile dhparams.pem
 

+ 28 - 9
doc/sample-ngircd.conf

@@ -28,33 +28,39 @@
 	# LINKS requests for example.
 	Info = Server Info Text
 
-	# Global password for all users needed to connect to the server
+	# Global password for all users needed to connect to the server.
+	# (Default: not set)
 	;Password = abc
 
+	# Password required for using the WEBIRC command used by some
+	# Web-to-IRC gateways. If not set/empty, the WEBIRC command can't
+	# be used. (Default: not set)
+	;WebircPassword = xyz
+
 	# Information about the server and the administrator, used by the
 	# ADMIN command. Not required by server but by RFC!
 	;AdminInfo1 = Description
 	;AdminInfo2 = Location
 	;AdminEMail = admin@irc.server
- 
+
 	# Ports on which the server should listen. There may be more than
 	# one port, separated with ",". (Default: 6667)
 	;Ports = 6667, 6668, 6669
 
 	# Additional Listen Ports that expect SSL/TLS encrypted connections
-	;SSLPorts = 9999,6668
+	;SSLPorts = 6697, 9999
 
 	# SSL Server Key
-        ;SSLKeyFile = /usr/local/etc/ngircd/ssl/server-key.pem
+	;SSLKeyFile = :ETCDIR:/ssl/server-key.pem
 
 	# password to decrypt SSLKeyFile (OpenSSL only)
 	;SSLKeyFilePassword = secret
 
 	# SSL Server Key Certificate
-	;SSLCertFile = /usr/local/etc/ngircd/ssl/server-cert.pem
+	;SSLCertFile = :ETCDIR:/ssl/server-cert.pem
 
 	# Diffie-Hellman parameters
-	;SSLDHFile = /usr/local/etc/ngircd/ssl/dhparams.pem
+	;SSLDHFile = :ETCDIR:/ssl/dhparams.pem
 
 	# comma separated list of IP addresses on which the server should
 	# listen. Default values are:
@@ -62,12 +68,18 @@
 	# so the server listens on all IP addresses of the system by default.
 	;Listen = 127.0.0.1,192.168.0.1
 
+	# Syslog "facility" to which ngIRCd should send log messages.
+	# Possible values are system dependant, but most probably auth, daemon,
+	# user and local1 through local7 are possible values; see syslog(3).
+	# Default is "local5" for historical reasons, you probably want to
+	# change this to "daemon", for example.
+	SyslogFacility = local1
+
 	# Text file with the "message of the day" (MOTD). This message will
 	# be shown to all users connecting to the server:
-	;MotdFile = /usr/local/etc/ngircd.motd
+	;MotdFile = :ETCDIR:/ngircd.motd
 
 	# A simple Phrase (<256 chars) if you don't want to use a motd file.
-	# If it is set no MotdFile will be read at all.
 	;MotdPhrase = "Hello world!"
 
 	# User ID under which the server should run; you can use the name
@@ -129,6 +141,13 @@
 	# with support for it.
 	;NoIdent = no
 
+	# Don't use PAM, even if ngIRCd has been compiled with support for it.
+	;NoPAM = no
+
+	# Don't use ZeroConf service registration, even if ngIRCd has been
+	# compiled with support for it (e.g. Howl, Avahi, Mac OS X).
+	;NoZeroConf = no
+
 	# try to connect to other irc servers using ipv4 and ipv6, if possible
 	;ConnectIPv6 = yes
 	;ConnectIPv4 = yes
@@ -251,7 +270,7 @@
 
 	# Key file, syntax for each line: "<user>:<nick>:<key>".
 	# Default: none.
-	;KeyFile = /etc/ngircd/#chan.key
+	;KeyFile = :ETCDIR:/#chan.key
 
 	# maximum users per channel (mode l)
 	;MaxUsers = 23

+ 2 - 2
doc/src/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.

+ 120 - 108
install-sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2006-10-14.15
+scriptversion=2006-12-25.00
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -48,7 +48,7 @@ IFS=" ""	$nl"
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
 if test -z "$doit"; then
   doit_exec=exec
 else
@@ -58,34 +58,49 @@ fi
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-posix_glob=
 posix_mkdir=
 
 # Desired mode of installed file.
 mode=0755
 
+chgrpcmd=
 chmodcmd=$chmodprog
 chowncmd=
-chgrpcmd=
-stripcmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
 no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -95,65 +110,55 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
 while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
+
+    -C) copy_on_change=true;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-        shift
-        shift
 	case $mode in
 	  *' '* | *'	'* | *'
 '*	  | *'*'* | *'?'* | *'['*)
 	    echo "$0: invalid mode: $mode" >&2
 	    exit 1;;
 	esac
-        continue;;
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
+    -s) stripcmd=$stripprog;;
 
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
+    -t) dst_arg=$2
+	shift;;
 
-    -T) no_target_directory=true
-	shift
-	continue;;
+    -T) no_target_directory=true;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
@@ -165,21 +170,22 @@ while test $# -ne 0; do
 
     *)  break;;
   esac
+  shift
 done
 
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
   # Otherwise, the last argument is the destination.  Remove it from $@.
   for arg
   do
-    if test -n "$dstarg"; then
+    if test -n "$dst_arg"; then
       # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dstarg"
+      set fnord "$@" "$dst_arg"
       shift # fnord
     fi
     shift # arg
-    dstarg=$arg
+    dst_arg=$arg
   done
 fi
 
@@ -224,7 +230,7 @@ for src
 do
   # Protect names starting with `-'.
   case $src in
-    -*) src=./$src ;;
+    -*) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -242,22 +248,22 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
 
-    dst=$dstarg
+    dst=$dst_arg
     # Protect names starting with `-'.
     case $dst in
-      -*) dst=./$dst ;;
+      -*) dst=./$dst;;
     esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
+	echo "$0: $dst_arg: Is a directory" >&2
 	exit 1
       fi
       dstdir=$dst
@@ -378,26 +384,19 @@ do
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-	/*) prefix=/ ;;
-	-*) prefix=./ ;;
-	*)  prefix= ;;
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
       esac
 
-      case $posix_glob in
-        '')
-	  if (set -f) 2>/dev/null; then
-	    posix_glob=true
-	  else
-	    posix_glob=false
-	  fi ;;
-      esac
+      eval "$initialize_posix_glob"
 
       oIFS=$IFS
       IFS=/
-      $posix_glob && set -f
+      $posix_glob set -f
       set fnord $dstdir
       shift
-      $posix_glob && set +f
+      $posix_glob set +f
       IFS=$oIFS
 
       prefixes=
@@ -459,41 +458,54 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dst"; then
-	       $doit $rmcmd -f "$dst" 2>/dev/null \
-	       || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
-		     && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
-	       || {
-		 echo "$0: cannot unlink or rename $dst" >&2
-		 (exit 1); exit 1
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dst"
-	 }
-    } || exit 1
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
 
     trap '' 0
   fi

+ 2 - 2
man/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.

+ 15 - 8
man/ngircd.8.tmpl

@@ -1,7 +1,7 @@
 .\"
 .\" ngircd(8) manual page template
 .\"
-.TH ngircd 8 "Dec 2008" ngircd "ngIRCd Manual"
+.TH ngircd 8 "Dec 2010" ngircd "ngIRCd Manual"
 .SH NAME
 ngIRCd \- the next generation IRC daemon
 .SH SYNOPSIS
@@ -64,17 +64,24 @@ The system wide default configuration file.
 .RS
 Default "message of the day" (MOTD).
 .RE
+.SH SIGNALS
+The daemon understands the following signals:
+.TP
+\fBTERM\fR
+Shut down all conections and terminate the daemon.
+.TP
+\fBHUP\fR
+Shut down all listening sockets, re-read the configuration file and
+re-initialize the daemon.
 .SH HINTS
 It's wise to use "ngircd \-\-configtest" to validate the configuration file
 after changing it.
-.SH AUTHOR
-Alexander Barton,
-.UR mailto:alex@barton.de
-.UE
+.SH AUTHORS
+Alexander Barton, <alex@barton.de>
 .br
-Homepage:
-.UR http://ngircd.barton.de/
-.UE