mirror of
https://github.com/osmarks/ngircd.git
synced 2025-04-16 07:43:19 +00:00
Compare commits
12 Commits
rel-27-rc1
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
acf8409c60 | ||
![]() |
02a572d829 | ||
![]() |
4ad7de02d6 | ||
![]() |
6cb09e4c98 | ||
![]() |
e348ac04e7 | ||
![]() |
7ccf98edfa | ||
![]() |
3e3f6cbece | ||
![]() |
75ef4e14e0 | ||
![]() |
d4fb21f354 | ||
![]() |
90fb3cf0a2 | ||
![]() |
b77b9432c4 | ||
![]() |
a33d15751b |
63
.github/workflows/ci.yml
vendored
63
.github/workflows/ci.yml
vendored
@ -28,32 +28,53 @@ on:
|
||||
|
||||
jobs:
|
||||
build_and_distcheck:
|
||||
|
||||
name: Configure ngIRCd sources and run make targets "all" and "distcheck"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
name: build+test
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu
|
||||
- macos
|
||||
toolchain:
|
||||
- gcc
|
||||
- llvm
|
||||
include:
|
||||
- os: ubuntu
|
||||
toolchain: gcc
|
||||
install_cmd: |
|
||||
sudo apt update
|
||||
sudo apt install build-essential expect libident-dev libpam0g-dev libssl-dev libwrap0-dev pkg-config telnet zlib1g-dev gcc
|
||||
configure_cmd: |
|
||||
./configure CC=gcc --enable-ipv6 --with-iconv --with-ident --with-openssl --with-pam --with-tcp-wrappers --with-zlib
|
||||
- os: ubuntu
|
||||
toolchain: llvm
|
||||
install_cmd: |
|
||||
sudo apt update
|
||||
sudo apt install build-essential expect libident-dev libpam0g-dev libssl-dev libwrap0-dev pkg-config telnet zlib1g-dev clang
|
||||
configure_cmd: |
|
||||
./configure CC=clang --enable-ipv6 --with-iconv --with-ident --with-openssl --with-pam --with-tcp-wrappers --with-zlib
|
||||
- os: macos
|
||||
toolchain: gcc
|
||||
install_cmd: |
|
||||
brew update
|
||||
brew install autoconf automake expect openssl@3 pkg-config telnet zlib gcc
|
||||
configure_cmd: |
|
||||
./configure CC=gcc --enable-ipv6 --with-iconv --with-openssl --with-zlib
|
||||
- os: macos
|
||||
toolchain: llvm
|
||||
install_cmd: |
|
||||
brew update
|
||||
brew install autoconf automake expect openssl@3 pkg-config telnet zlib llvm
|
||||
configure_cmd: |
|
||||
./configure CC=clang --enable-ipv6 --with-iconv --with-openssl --with-zlib
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: awalsh128/cache-apt-pkgs-action@v1
|
||||
with:
|
||||
packages: >
|
||||
autoconf
|
||||
automake
|
||||
build-essential
|
||||
expect
|
||||
libident-dev
|
||||
libpam0g-dev
|
||||
libssl-dev
|
||||
libwrap0-dev
|
||||
pkg-config
|
||||
telnet
|
||||
zlib1g-dev
|
||||
version: 1.0
|
||||
- name: Install dependencies
|
||||
run: ${{ matrix.install_cmd }}
|
||||
- name: Generate build system files
|
||||
run: ./autogen.sh
|
||||
- name: Configure the build system
|
||||
run: ./configure --enable-ipv6 --with-iconv --with-ident --with-openssl --with-pam --with-tcp-wrappers --with-zlib
|
||||
run: ${{ matrix.configure_cmd }}
|
||||
- name: Build everything
|
||||
run: make all
|
||||
- name: Create distribution archive and run tests
|
||||
|
@ -68,6 +68,7 @@ Or join the "#ngircd" channel in IRC on irc.barton.de:
|
||||
- Tom Ryder <tom@sanctum.geek.nz>
|
||||
- Unit 193 <unit193@ubuntu.com>
|
||||
- Valentin Lorentz <progval+git@progval.net>
|
||||
- Val Lorentz <progval+git@progval.net>
|
||||
- William Pitcock <nenolod@dereferenced.org>
|
||||
- Windree <57554809+Windree@users.noreply.github.com>
|
||||
- xnaas <8271327+xnaas@users.noreply.github.com>
|
||||
|
20
ChangeLog
20
ChangeLog
@ -8,7 +8,25 @@
|
||||
|
||||
-- ChangeLog --
|
||||
|
||||
ngIRCd 27
|
||||
ngIRCd 27 (2024-04-26)
|
||||
|
||||
- Update ChangeLog, NEWS, AUTHORS.md & doc/Platforms.txt for ngIRCd 27.
|
||||
- Clarify in the sample configuration file and the ngircd.conf(5) manual
|
||||
page that the "CAFile" option is unset by default.
|
||||
- Fix channel symbol returned in the RPL_NAMREPLY(353) numeric of NAMES
|
||||
commands for secret (mode +s) channels: this should be "@", not "=".
|
||||
Thanks Val Lorentz <progval+git@progval.net> for the patch!
|
||||
Closes #313.
|
||||
- Add an example filter file for "Fail2Ban": contrib/ngircd-fail2ban.conf.
|
||||
- Don't abort startup when setgid/setuid() fails with EINVAL: Both setgid(2)
|
||||
as well as setuid(2) can fail with EINVAL in addition to EPERM, their
|
||||
manual pages state "EINVAL: The user/group ID specified in uid/gid is not
|
||||
valid in this user namespace ". So not only treat EPERM as an "acceptable
|
||||
error" and continue with logging the error, but do the same for EINVAL.
|
||||
This was triggered by the Void Linux xbps-uunshare(1) tool used for
|
||||
building "XBPS source packages" and reported by luca in #ngircd. Thanks!
|
||||
- Test suite: Don't use "pgrep -u" when LOGNAME and USER are not set
|
||||
Thanks for reporting this on IRC, luca!
|
||||
|
||||
ngIRCd 27~rc1 (2024-04-13)
|
||||
- Validate certificates on server links. Up to now, ngIRCd optionally used
|
||||
|
4
NEWS
4
NEWS
@ -8,7 +8,9 @@
|
||||
|
||||
-- NEWS --
|
||||
|
||||
ngIRCd 27
|
||||
ngIRCd 27 (2024-04-26)
|
||||
|
||||
- Add an example filter file for "Fail2Ban": contrib/ngircd-fail2ban.conf.
|
||||
|
||||
ngIRCd 27~rc1 (2024-04-13)
|
||||
- Validate certificates on server links. Up to now, ngIRCd optionally used
|
||||
|
@ -1,3 +1,9 @@
|
||||
ngircd (27-0ab1) unstable; urgency=medium
|
||||
|
||||
* New "upstream" release: ngIRCd 27.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Fri, 26 Apr 2024 16:52:14 +0200
|
||||
|
||||
ngircd (27~rc1-0ab1) unstable; urgency=medium
|
||||
|
||||
* New "upstream" release candidate 1 for ngIRCd Release 27.
|
||||
|
@ -53,6 +53,11 @@ execute_after_dh_auto_install:
|
||||
$(CURDIR)/contrib/ngircd.logcheck \
|
||||
$(CURDIR)/debian/ngircd/etc/logcheck/ignore.d.paranoid/ngircd
|
||||
|
||||
# Install the fail2ban configuration.
|
||||
install -o root -g root -m 0644 -D \
|
||||
$(CURDIR)/contrib/ngircd-fail2ban.conf \
|
||||
$(CURDIR)/debian/ngircd/etc/fail2ban/filter.d/ngircd.conf
|
||||
|
||||
# Make lintian happy :-)
|
||||
rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING
|
||||
mv $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/ChangeLog \
|
||||
|
@ -17,6 +17,7 @@ EXTRA_DIST = README.md \
|
||||
Dockerfile \
|
||||
ngindent.sh \
|
||||
ngircd-bsd.sh \
|
||||
ngircd-fail2ban.conf \
|
||||
ngIRCd-Logo.gif \
|
||||
ngircd-redhat.init \
|
||||
ngircd.logcheck \
|
||||
|
@ -16,6 +16,8 @@ This `contrib/` directory contains the following sub-folders and files:
|
||||
|
||||
- `ngircd-bsd.sh`: Start/stop script for FreeBSD.
|
||||
|
||||
- `ngircd-fail2ban.conf`: fail2ban(1) filter configuration for ngIRCd.
|
||||
|
||||
- `ngircd-redhat.init`: Start/stop script for old(er) RedHat-based
|
||||
distributions (like CentOS and Fedora), which did _not_ use systemd(8).
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
</provides>
|
||||
<launchable type="service">ngircd</launchable>
|
||||
<releases>
|
||||
<release version="27" date="2024-04-26" />
|
||||
<release version="27~rc1" date="2024-04-13" />
|
||||
<release version="26.1" date="2021-01-02" />
|
||||
<release version="26" date="2020-06-20" />
|
||||
|
25
contrib/ngircd-fail2ban.conf
Normal file
25
contrib/ngircd-fail2ban.conf
Normal file
@ -0,0 +1,25 @@
|
||||
# Fail2ban filter for ngIRCd
|
||||
#
|
||||
# Put into /etc/fail2ban/filter.d/ngircd.conf and enable in your jail.local
|
||||
# configuration like this:
|
||||
#
|
||||
# [ngircd]
|
||||
# enabled = true
|
||||
# backend = systemd
|
||||
#
|
||||
|
||||
[INCLUDES]
|
||||
|
||||
before = common.conf
|
||||
|
||||
[DEFAULT]
|
||||
|
||||
_daemon = ngircd
|
||||
|
||||
[Definition]
|
||||
|
||||
failregex = ^%(__prefix_line)sRefused connection from <ADDR> on socket \d+:
|
||||
|
||||
[Init]
|
||||
|
||||
journalmatch = _SYSTEMD_UNIT=ngircd.service + _COMM=ngircd
|
@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version 27~rc1
|
||||
%define version 27
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2020 Alexander Barton and Contributors.
|
||||
(c)2001-2024 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
@ -27,7 +27,8 @@ for inclusion here. Thanks for your help!
|
||||
Platform Compiler ngIRCd Date Tester C M T R *
|
||||
--------------------------- ------------ ---------- -------- -------- - - - - -
|
||||
aarch64/apple/darwin A-clang 12.0 26 20-12-10 goetz N Y Y Y 3
|
||||
aarch64/apple/darwin23.4.0 A-clang 15.0 26.1~131 24-04-01 alex Y Y Y Y 3
|
||||
aarch64/apple/darwin23.4.0 A-clang 15.0 27~rc1 24-04-13 alex Y Y Y Y 3
|
||||
aarch64/unknown/linux-gnu gcc 12.2.0 27~rc1 24-04-21 alex Y Y Y Y 1
|
||||
alpha/unknown/netbsd3.0 gcc 3.3.3 CVSHEAD 06-05-07 fw Y Y Y Y 3
|
||||
armv6l/unk./linux-gnueabi gcc 4.7.2 20.2 13-03-08 goetz Y Y Y Y 5
|
||||
armv6l/unk./linux-gnueabihf gcc 4.6.3 21~rc2 13-10-26 pi Y Y Y Y 5
|
||||
@ -73,7 +74,7 @@ i686/pc/linux-gnu gcc 4.3.2 14.1 09-08-04 alex Y Y Y Y 1
|
||||
i686/pc/minix gcc 4.4.6 21~rc2 13-10-27 alex Y Y N N
|
||||
i686/unknown/gnu0.3 gcc 4.4.5 19 12-02-29 alex Y Y Y Y
|
||||
i686/unknown/gnu0.5 gcc 4.9.1 22~rc1-3 14-10-11 alex Y Y Y Y
|
||||
i686/unknown/gnu0.9 gcc 12.2.0 26.1~131-g 24-04-01 alex Y Y Y Y
|
||||
i686/unknown/gnu0.9 gcc 12.2.0 27~rc1 24-04-21 alex Y Y Y Y
|
||||
i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y 3
|
||||
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
|
||||
@ -107,7 +108,7 @@ x86_64/apple/darwin18.2.0 A-clang 10.0 25~rc1-11 19-01-23 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin19.4.0 A-clang 11.0 26~rc1 20-05-10 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin19.6.0 A-clang 12.0 26 20-10-20 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin20.1.0 A-clang 12.0 26 21-01-01 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin23.4.0 A-clang 15.0 26.1~133-g 24-04-03 alex Y Y Y Y 3
|
||||
x86_64/apple/darwin23.4.0 A-clang 15.0 27~rc1 24-04-21 alex Y Y Y Y 3
|
||||
x86_64/unknown/dragonfly3.4 gcc 4.7.2 21 13-11-12 goetz Y Y N Y 3
|
||||
x86_64/unkn./freebsd8.1-gnu gcc 4.4.5 19 12-02-26 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd8.4 gcc 4.2.1 24~rc1-7 17-01-20 alex Y Y Y Y 3
|
||||
@ -115,11 +116,12 @@ x86_64/unknown/freebsd9.2 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd10.3 F-clang 3.4 24 17-01-20 goetz Y Y Y Y 3
|
||||
x86_64/unknown/freebsd11.0 F-clang 3.8 24 17-01-21 goetz Y Y Y Y 3
|
||||
x86_64/unknown/freebsd12.1 F-clang 8.0 26 20-08-28 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd14.0 F-clang 16.0 26.1~131 24-04-01 alex Y Y Y Y 3
|
||||
x86_64/unknown/freebsd14.0 F-clang 16.0 27~rc1 24-04-21 alex Y Y Y Y 3
|
||||
x86_64/unknown/haiku gcc 7.3.0 25~rc1-11 19-01-06 alex Y Y N Y
|
||||
x86_64/unknown/haiku gcc 13.2.0 26.1~132-g 24-04-02 alex Y Y Y Y
|
||||
x86_64/unknown/haiku gcc 13.2.0 27~rc1 24-04-21 user Y Y Y Y
|
||||
x86_64/unknown/linux-gnu clang 3.3 21 14-01-07 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu clang 3.4 22~rc1-3 14-10-11 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu D-clang 14.0 27~rc1 24-04-21 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 4.4.5 24~rc1-7 17-01-20 alex Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu gcc 4.7.2 23~rc1-3 15-11-15 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 4.8.4 24~rc1-7 17-01-20 alex Y Y Y Y 1
|
||||
@ -129,14 +131,16 @@ x86_64/pc/linux-gnu [WSL] gcc 5.4.0 24 18-03-07 goetz Y Y y Y 7
|
||||
x86_64/pc/linux-gnu gcc 6.2.1 24~rc1-7 17-01-20 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 6.3.0 25~rc1-11 19-01-23 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 8.3.0 26 20-08-28 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 11.4.0 26.1~133-g 24-04-03 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 12.2.0 26.1~132-g 24-04-02 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 11.4.0 27~rc1 24-04-21 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 12.2.0 27~rc1 24-04-21 alex Y Y Y Y 1
|
||||
x86_64/pc/linux-gnu gcc 13.2.1 27~rc1 24-04-21 alex Y Y Y Y 1
|
||||
x86_64/pc/solaris2.11 gcc 10.3.0 27~rc1 24-04-26 alex Y Y y Y 5
|
||||
x86_64/unknown/linux-gnu icc 16 23 16-01-13 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu nwcc 0.8.2 21 13-12-01 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu Open64 21.1 14-03-27 goetz Y Y Y Y 1
|
||||
x86_64/unknown/linux-gnu Sun C 5.12 21.1 14-03-27 goetz Y Y Y Y 1
|
||||
x86_64/unknown/netbsd9.0 gcc 7.4.0 26 20-08-28 alex Y Y y Y 3
|
||||
x86_64/unknown/netbsd10.0 gcc 10.5.0 26.1~131-g 24-04-01 alex Y Y Y Y 3
|
||||
x86_64/unknown/netbsd10.0 gcc 10.5.0 27~rc1 24-04-21 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd4.7 gcc 3.3.5 20~rc1 12-02-26 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd4.8 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y y Y 3
|
||||
x86_64/unknown/openbsd5.1 gcc 4.2.1 21 13-12-28 alex Y Y Y Y 3
|
||||
@ -144,7 +148,7 @@ x86_64/unknown/openbsd5.5 gcc 4.2.1 22~rc1-3 14-10-10 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd6.6 gcc 4.2.1 26 20-08-28 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd6.6 O-clang 8.0 26 20-08-28 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd6.7 gcc 4.2.1 26 20-09-26 goetz Y Y y Y 3
|
||||
x86_64/unknown/openbsd7.4 O-clang 13.0 26.1~131-g 24-04-01 alex Y Y Y Y 3
|
||||
x86_64/unknown/openbsd7.4 O-clang 13.0 27~rc1 24-04-21 alex Y Y Y Y 3
|
||||
|
||||
|
||||
* Notes
|
||||
|
@ -273,7 +273,8 @@
|
||||
# is only available when ngIRCd is compiled with support for SSL!
|
||||
# So don't forget to remove the ";" above if this is the case ...
|
||||
|
||||
# SSL Trusted CA Certificates File (for verifying peer certificates)
|
||||
# SSL Trusted CA Certificates File for verifying peer certificates.
|
||||
# (Default: not set; so no certificates are trusted)
|
||||
;CAFile = /etc/ssl/CA/cacert.pem
|
||||
|
||||
# Certificate Revocation File (for marking otherwise valid
|
||||
|
@ -399,7 +399,7 @@ when it is compiled with support for SSL using OpenSSL or GnuTLS!
|
||||
.TP
|
||||
\fBCAFile\fR (string)
|
||||
Filename pointing to the Trusted CA Certificates. This is required for
|
||||
verifying peer certificates.
|
||||
verifying peer certificates. Default: not set, so no certificates are trusted.
|
||||
.TP
|
||||
\fBCertFile\fR (string)
|
||||
SSL Certificate file of the private server key.
|
||||
|
@ -796,10 +796,10 @@ Conn_Handler(void)
|
||||
/* Send the current status to the service manager. */
|
||||
snprintf(status, sizeof(status),
|
||||
"WATCHDOG=1\nSTATUS=%ld connection%s established (%ld user%s, %ld server%s), %ld maximum. %ld accepted in total.\n",
|
||||
NumConnections, NumConnections == 1 ? "" : "s",
|
||||
(long)NumConnections, NumConnections == 1 ? "" : "s",
|
||||
Client_MyUserCount(), Client_MyUserCount() == 1 ? "" : "s",
|
||||
Client_MyServerCount(), Client_MyServerCount() == 1 ? "" : "s",
|
||||
NumConnectionsMax, NumConnectionsAccepted);
|
||||
(long)NumConnectionsMax, (long)NumConnectionsAccepted);
|
||||
Signal_NotifySvcMgr(status);
|
||||
notify_t = t;
|
||||
}
|
||||
|
@ -818,7 +818,7 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
|
||||
|
||||
/* Now print all clients which are not in any channel */
|
||||
c = Client_First();
|
||||
snprintf(rpl, sizeof(rpl), RPL_NAMREPLY_MSG, Client_ID(from), "*", "*");
|
||||
snprintf(rpl, sizeof(rpl), RPL_NAMREPLY_MSG, Client_ID(from), '*', "*");
|
||||
while (c) {
|
||||
if (Client_Type(c) == CLIENT_USER
|
||||
&& Channel_FirstChannelOf(c) == NULL
|
||||
@ -830,11 +830,11 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
|
||||
strlcat(rpl, Client_ID(c), sizeof(rpl));
|
||||
|
||||
if (strlen(rpl) > COMMAND_LEN - CLIENT_NICK_LEN - 4) {
|
||||
/* Line is gwoing too long, send now */
|
||||
/* Line is going too long, send now */
|
||||
if (!IRC_WriteStrClient(from, "%s", rpl))
|
||||
return DISCONNECTED;
|
||||
snprintf(rpl, sizeof(rpl), RPL_NAMREPLY_MSG,
|
||||
Client_ID(from), "*", "*");
|
||||
Client_ID(from), '*', "*");
|
||||
}
|
||||
}
|
||||
c = Client_Next(c);
|
||||
@ -1500,6 +1500,8 @@ IRC_Send_NAMES(CLIENT * Client, CHANNEL * Chan)
|
||||
char str[COMMAND_LEN];
|
||||
CL2CHAN *cl2chan;
|
||||
CLIENT *cl;
|
||||
bool secret_channel;
|
||||
char chan_symbol;
|
||||
|
||||
assert(Client != NULL);
|
||||
assert(Chan != NULL);
|
||||
@ -1514,10 +1516,13 @@ IRC_Send_NAMES(CLIENT * Client, CHANNEL * Chan)
|
||||
return CONNECTED;
|
||||
|
||||
/* Secret channel? */
|
||||
if (!is_member && Channel_HasMode(Chan, 's'))
|
||||
secret_channel = Channel_HasMode(Chan, 's');
|
||||
if (!is_member && secret_channel)
|
||||
return CONNECTED;
|
||||
|
||||
snprintf(str, sizeof(str), RPL_NAMREPLY_MSG, Client_ID(Client), "=",
|
||||
chan_symbol = secret_channel ? '@' : '=';
|
||||
|
||||
snprintf(str, sizeof(str), RPL_NAMREPLY_MSG, Client_ID(Client), chan_symbol,
|
||||
Channel_Name(Chan));
|
||||
cl2chan = Channel_FirstMember(Chan);
|
||||
while (cl2chan) {
|
||||
@ -1540,7 +1545,7 @@ IRC_Send_NAMES(CLIENT * Client, CHANNEL * Chan)
|
||||
if (!IRC_WriteStrClient(Client, "%s", str))
|
||||
return DISCONNECTED;
|
||||
snprintf(str, sizeof(str), RPL_NAMREPLY_MSG,
|
||||
Client_ID(Client), "=",
|
||||
Client_ID(Client), chan_symbol,
|
||||
Channel_Name(Chan));
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
||||
{
|
||||
CLIENT *cl, *origin;
|
||||
CHANNEL *chan;
|
||||
bool is_valid_nick, is_valid_chan;
|
||||
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
@ -76,10 +77,12 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
||||
Client = Client_Search(Req->prefix);
|
||||
|
||||
/* Channel or user mode? */
|
||||
is_valid_nick = Client_IsValidNick(Req->argv[0]);
|
||||
is_valid_chan = Channel_IsValidName(Req->argv[0]);
|
||||
cl = NULL; chan = NULL;
|
||||
if (Client_IsValidNick(Req->argv[0]))
|
||||
if (is_valid_nick)
|
||||
cl = Client_Search(Req->argv[0]);
|
||||
if (Channel_IsValidName(Req->argv[0]))
|
||||
if (is_valid_chan)
|
||||
chan = Channel_Search(Req->argv[0]);
|
||||
|
||||
if (cl)
|
||||
@ -88,8 +91,12 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
||||
return Channel_Mode(Client, Req, origin, chan);
|
||||
|
||||
/* No target found! */
|
||||
if (is_valid_nick)
|
||||
return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
|
||||
Client_ID(Client), Req->argv[0]);
|
||||
else
|
||||
return IRC_WriteErrClient(Client, ERR_NOSUCHCHANNEL_MSG,
|
||||
Client_ID(Client), Req->argv[0]);
|
||||
} /* IRC_MODE */
|
||||
|
||||
/**
|
||||
|
@ -84,7 +84,7 @@
|
||||
#define RPL_ENDOFEXCEPTLIST_MSG "349 %s %s :End of channel exception list"
|
||||
#define RPL_VERSION_MSG "351 %s %s-%s.%s %s :%s"
|
||||
#define RPL_WHOREPLY_MSG "352 %s %s %s %s %s %s %s :%d %s"
|
||||
#define RPL_NAMREPLY_MSG "353 %s %s %s :"
|
||||
#define RPL_NAMREPLY_MSG "353 %s %c %s :"
|
||||
#define RPL_LINKS_MSG "364 %s %s %s :%d %s"
|
||||
#define RPL_ENDOFLINKS_MSG "365 %s %s :End of LINKS list"
|
||||
#define RPL_ENDOFNAMES_MSG "366 %s %s :End of NAMES list"
|
||||
|
@ -722,7 +722,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
|
||||
Log(LOG_ERR, "Can't change group ID to %s(%u): %s!",
|
||||
grp ? grp->gr_name : "?", Conf_GID,
|
||||
strerror(real_errno));
|
||||
if (real_errno != EPERM)
|
||||
if (real_errno != EPERM && real_errno != EINVAL)
|
||||
goto out;
|
||||
}
|
||||
#ifdef HAVE_SETGROUPS
|
||||
@ -748,7 +748,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
|
||||
Log(LOG_ERR, "Can't change user ID to %s(%u): %s!",
|
||||
pwd ? pwd->pw_name : "?", Conf_UID,
|
||||
strerror(real_errno));
|
||||
if (real_errno != EPERM)
|
||||
if (real_errno != EPERM && real_errno != EINVAL)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,13 @@ if [ -x /usr/bin/pgrep ]; then
|
||||
*)
|
||||
PGREP_FLAGS=""
|
||||
esac
|
||||
if [ -n "${LOGNAME:-}" ] || [ -n "${USER:-}" ]; then
|
||||
# Try to narrow the search down to the current user ...
|
||||
exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1"
|
||||
else
|
||||
# ... but neither LOGNAME nor USER were set!
|
||||
exec /usr/bin/pgrep $PGREP_FLAGS -n "$1"
|
||||
fi
|
||||
fi
|
||||
|
||||
# pidof(1) could be a good alternative on elder Linux systems
|
||||
|
Loading…
x
Reference in New Issue
Block a user