View Issue Details

IDProjectCategoryView StatusLast Update
0006666unrealircdpublic2026-11-15 01:50
Reportergh0st Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version6.2.7.1 
Summary0006666: UNIX socket path over 108 bytes: unlink() uses full path, bind() uses truncated one, so restart fails
DescriptionIn src/socket.c, the UNIX domain socket listener (around line 1586) does:

    unlink(ip); /* full path */
    strlcpy(server.sun_path, ip, sizeof(server.sun_path)); /* truncated to 108 */

When the socket path is longer than sun_path (108 bytes on Linux), e.g. with a deep install directory, unlink() removes the full (non-existent) path while bind() creates the socket at the truncated path. The stale socket from the previous run is therefore never cleaned up, and the next start fails with:

    Could not listen on UNIX domain socket ... Address already in use
Steps To Reproduce1. Install UnrealIRCd under a deep directory so the control socket path (data/unrealircd.ctl or a listen { file ...; } path) is longer than 108 bytes.
2. Start the server, then stop it uncleanly (e.g. kill -9) so the socket file is left behind.
3. Start it again: listening on the UNIX socket fails with 'Address already in use'.
Additional InformationSuggested fix: reject socket paths that don't fit in sun_path with a clear config error (preferred, since a silently truncated path also isn't where the user expects it), or at least unlink() the truncated path that is actually bound.

Reported by gh0st ([email protected]).
3rd party modules

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-11-15 01:50 gh0st New Issue