Patches

Only in ircnowd: build.sh diff -ur ircnowd/doc/Makefile.in ngircd-27/doc/Makefile.in --- ircnowd/doc/Makefile.in Wed Apr 23 09:58:25 2025 +++ ngircd-27/doc/Makefile.in Fri Apr 26 07:54:22 2024 -618,13 +618,16

 all: $(generated_docs)

 install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)

+ $(MKDIR_P) -m 755 $(DESTDIR)$(sysconfdir) + @if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then + ${MAKE} install-config; + fi

 	$(MKDIR_P) -m 755 $(DESTDIR)$(docdir)
 	for f in $(static_docs) $(toplevel_docs); do  	  $(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/;  	 done

- $(MKDIR_P) -m 755 $(DESTDIR)$(datarootdir)/examples/${PACKAGE_TARNAME}

 	for f in $(generated_docs); do -	  $(INSTALL) -m 644 -c $$f $(DESTDIR)$(datarootdir)/examples/${PACKAGE_TARNAME}; +	  $(INSTALL) -m 644 -c $$f $(DESTDIR)$(docdir)/;  	 done

 install-config:

diff -ur ircnowd/doc/sample-ngircd.conf.tmpl ngircd-27/doc/sample-ngircd.conf.tmpl --- ircnowd/doc/sample-ngircd.conf.tmpl Wed Apr 23 10:00:03 2025 +++ ngircd-27/doc/sample-ngircd.conf.tmpl Fri Apr 19 14:50:23 2024 -81,14 +81,14

 	# Group ID under which the ngIRCd should run; you can use the name
 	# of the group or the numerical ID. ATTENTION: For this to work the
 	# server must have been started with root privileges!

- ;ServerGID = _ngircd + ;ServerGID = 65534

 	# User ID under which the server should run; you can use the name
 	# of the user or the numerical ID. ATTENTION: For this to work the
 	# server must have been started with root privileges! In addition,
 	# the configuration and MOTD files must be readable by this user,
 	# otherwise RESTART and REHASH won't work!

- ;ServerUID = _ngircd + ;ServerUID = 65534

 [Limits]
 	# Define some limits and timeouts for this ngIRCd instance. Default

-159,7 +159,7

 	# binary. By default ngIRCd won't use the chroot() feature.
 	# ATTENTION: For this to work the server must have been started
 	# with root privileges!

- ;ChrootDir = /var/ngircd + ;ChrootDir = /var/empty

 	# Set this hostname for every client instead of the real one.
 	# Use %x to add the hashed value of the original hostname.

-282,7 +282,7

 	;CRLFile = /etc/ssl/CA/crl.pem

 	# SSL Server Key Certificate

- ;CertFile = :ETCDIR:/server-cert.pem + ;CertFile = :ETCDIR:/ssl/server-cert.pem

 	# Select cipher suites allowed for SSL/TLS connections. This defaults
 	# to HIGH:!aNULL:@STRENGTH (OpenSSL) or SECURE128 (GnuTLS).

-294,10 +294,10

 	;CipherList = SECURE128:-VERS-SSL3.0

 	# Diffie-Hellman parameters

- ;DHFile = :ETCDIR:/dhparams.pem + ;DHFile = :ETCDIR:/ssl/dhparams.pem

 	# SSL Server Key

- ;KeyFile = :ETCDIR:/server-key.pem + ;KeyFile = :ETCDIR:/ssl/server-key.pem

 	# password to decrypt SSLKeyFile (OpenSSL only)
 	;KeyFilePassword = secret

diff -ur ircnowd/src/ngircd/conf.c ngircd-27/src/ngircd/conf.c --- ircnowd/src/ngircd/conf.c Wed Apr 23 10:01:57 2025 +++ ngircd-27/src/ngircd/conf.c Sat Apr 13 02:33:33 2024 -399,7 +399,7

 	printf("  MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
 	printf("  MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
 	printf("  MaxNickLength = %u\n", Conf_MaxNickLength - 1);

- printf(" MaxPenaltyTime = %lld\n", (long long)Conf_MaxPenaltyTime); + printf(" MaxPenaltyTime = %ld\n", (long)Conf_MaxPenaltyTime);

 	printf("  MaxListSize = %d\n", Conf_MaxListSize);
 	printf("  PingTimeout = %d\n", Conf_PingTimeout);
 	printf("  PongTimeout = %d\n", Conf_PongTimeout);

-777,7 +777,7

 	strlcat(Conf_HelpFile, HELP_FILE, sizeof(Conf_HelpFile));
 	strcpy(Conf_ServerPwd, "");
 	strlcpy(Conf_PidFile, PID_FILE, sizeof(Conf_PidFile));

- Conf_UID = Conf_GID = 703; /* _ngircd */ + Conf_UID = Conf_GID = 0;

 	/* Limits */
 	Conf_ConnectRetry = 60;

-1546,7 +1546,7

 		return;
 	}
 	if (strcasecmp(Var, "MaxPenaltyTime") == 0) {

- Conf_MaxPenaltyTime = atoll(Arg); + Conf_MaxPenaltyTime = atol(Arg);

 		if (Conf_MaxPenaltyTime < -1)
 			Conf_MaxPenaltyTime = -1;	/* "unlimited" */
 		return;

-2202,8 +2202,8

 	if (Conf_MaxPenaltyTime != -1)
 		Config_Error(LOG_WARNING,

- "Maximum penalty increase ('MaxPenaltyTime') is set to %lld, this is not recommended!", - (long long)Conf_MaxPenaltyTime); + "Maximum penalty increase ('MaxPenaltyTime') is set to %ld, this is not recommended!", + Conf_MaxPenaltyTime);

 #ifdef HAVE_SETRLIMIT
 	if(getrlimit(RLIMIT_NOFILE, &rlim) == 0) {

diff -ur ircnowd/src/ngircd/defines.h ngircd-27/src/ngircd/defines.h --- ircnowd/src/ngircd/defines.h Wed Apr 23 10:05:15 2025 +++ ngircd-27/src/ngircd/defines.h Sat Apr 13 02:33:33 2024 -160,10 +160,10

 #define WRITEBUFFER_FLUSH_LEN 4096

 /** Maximum size of the write buffer of a connection in bytes. */

-#define WRITEBUFFER_MAX_LEN 1048576 +#define WRITEBUFFER_MAX_LEN 32768

 /** Maximum size of the write buffer of a server link connection in bytes. */

-#define WRITEBUFFER_SLINK_LEN 1048576 +#define WRITEBUFFER_SLINK_LEN 65536

 /* IRC/IRC+ protocol */

diff -ur ircnowd/src/ngircd/ngircd.c ngircd-27/src/ngircd/ngircd.c --- ircnowd/src/ngircd/ngircd.c Wed Apr 23 10:03:47 2025 +++ ngircd-27/src/ngircd/ngircd.c Sat Apr 20 08:18:01 2024 -30,7 +30,6

 #include <fcntl.h>
 #include <pwd.h>
 #include <grp.h>

-#include <err.h>

 #if defined(DEBUG) && defined(HAVE_MTRACE)
 #include <mcheck.h>

-266,16 +265,6

 			exit(1);
 		}

- /* XXX using a PID file needs cpath to unlink() later */ - if(Conf_PidFile[0]) { - if ( pledge("stdio inet dns rpath proc getpw cpath", NULL) == -1) - err(1, "pledge"); - } - else { - if ( pledge("stdio inet dns rpath proc getpw", NULL) == -1) - err(1, "pledge"); - } -

 		if (!io_library_init(CONNECTION_POOL)) {
 			Log(LOG_ALERT,
 			    "Fatal: Could not initialize IO routines: %s",

-575,7 +564,7

 #if !defined(SINGLE_USER_OS)

 /**

- * Get user and group ID of unprivileged "_ngircd" user. + * Get user and group ID of unprivileged "nobody" user.

  *
  * @param uid	User ID
  * @param gid	Group ID

-599,7 +588,7

 	}
 #endif

- pwd = getpwnam("_ngircd"); + pwd = getpwnam("nobody");

 	if (!pwd)
 		return false;

-715,11 +704,11

 	if (Conf_UID == 0) {
 		pwd = getpwuid(0);
 		Log(LOG_INFO,

- "ServerUID must not be %s(0), using \"_ngircd\" instead.", + "ServerUID must not be %s(0), using \"nobody\" instead.",

 		    pwd ? pwd->pw_name : "?");
 		if (!NGIRCd_getNobodyID(&Conf_UID, &Conf_GID)) {
 			Log(LOG_WARNING,

- "Could not get user/group ID of user \"_ngircd\": %s", + "Could not get user/group ID of user \"nobody\": %s",

 			    errno ? strerror(errno) : "not found" );
 			goto out;
 		}

diff -ur ircnowd/src/ngircd/proc.c ngircd-27/src/ngircd/proc.c --- ircnowd/src/ngircd/proc.c Wed Apr 23 10:04:21 2025 +++ ngircd-27/src/ngircd/proc.c Sun Mar 31 02:51:10 2024 -24,7 +24,6

 #include <sys/types.h>
 #include <unistd.h>
 #include <time.h>

-#include <err.h>

 #include "log.h"
 #include "io.h"

-77,9 +76,6

 		return -1;
 	case 0:
 		/* New child process: */

- /* XXX no PAM, fork only for DNS and IDENT */ - if (pledge("stdio dns inet", NULL) == -1) - err(1, "pledge");

 #ifdef HAVE_ARC4RANDOM_STIR
 		arc4random_stir();
 #endif

7215 bytes received in 0.00 seconds (1.40 MB/s)