View Issue Details

IDProjectCategoryView StatusLast Update
0005087unrealircdpublic2018-04-21 20:29
ReportermbwAssigned Tosyzop 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSOS Version
Product Version 
Target VersionFixed in Version4.0.18 
Summary0005087: doesn't daemonize correctly (fork, close fds)
DescriptionWhen unrealircd starts, it doesn't close stdin, stdout, and sterr.
Steps To Reproducessh hostname /path/to/unrealircd

My ssh session hangs, rather than exiting after unrealircd has finished starting and forked.
Additional InformationIt also look like it handles fork returning -1 correctly. In this case, ircd should return non-zero rather than zero.
TagsNo tags attached.
3rd party modules

Activities

syzop

2018-04-17 07:18

administrator   ~0020093

Confirmed, I can reproduce the issue. Thanks for the report. Will take a look at the end of the week.

syzop

2018-04-21 20:16

administrator   ~0020097

https://github.com/unrealircd/unrealircd/commit/74009b88ba02c91306b851ed51969fdb02393785

commit 74009b88ba02c91306b851ed51969fdb02393785
Author: Bram Matthys <syzop@vulnscan.org>
Date: Sat Apr 21 20:12:23 2018 +0200

    Cleanup of init_sys(): remove old stuff for ancient OS's.
    On *NIX now always redirect stdin, stdout and stderr to /dev/null for
    safety and to prevent any ssh hanging as reported by mbw (0005087).
    This code needs some testing on non-Linux though it should be all
    POSIX, unless I missed something... :)

syzop

2018-04-21 20:29

administrator   ~0020098

And I see I missed a part of your report, so fixed that as well. Thanks again!

https://github.com/unrealircd/unrealircd/commit/f0092fef4eaf31fee44693a01678313d8a2f4f61

commit f0092fef4eaf31fee44693a01678313d8a2f4f61
Author: Bram Matthys <syzop@vulnscan.org>
Date: Sat Apr 21 20:27:53 2018 +0200

    Properly report failure of fork(). Reported by mbw (0005087).

Issue History

Date Modified Username Field Change
2018-04-17 00:08 mbw New Issue
2018-04-17 07:18 syzop Assigned To => syzop
2018-04-17 07:18 syzop Status new => confirmed
2018-04-17 07:18 syzop Note Added: 0020093
2018-04-21 20:16 syzop Status confirmed => resolved
2018-04-21 20:16 syzop Resolution open => fixed
2018-04-21 20:16 syzop Fixed in Version => 4.0.18
2018-04-21 20:16 syzop Note Added: 0020097
2018-04-21 20:29 syzop Note Added: 0020098