Bug 87174 - vsftpd gots caught in an endless loop while parsing erroneous config AND stdin is e.g. /dev/null
Summary: vsftpd gots caught in an endless loop while parsing erroneous config AND stdi...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-09 19:50 UTC by Pavel Gubin
Modified: 2005-10-13 06:10 UTC (History)
0 users

See Also:


Attachments
file.diff (1.00 KB, patch)
2005-10-09 19:50 UTC, Pavel Gubin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Gubin 2005-10-09 19:50:16 UTC
When vsftpd tries to report config error, and stdin is detached from controlling terminal, it gots  caught in an endless loop because it uses die() (utility.c) to report an error condition, which in turn calls bug() (DIE_DEBUG defined by default), bug() calls vsf_sysutil_activate_noblock() which fails to set nonblocking mode when /dev/null is opened as fd=0, calls again die() etc., until the program eats up ann vertual memory and gots killes by the system.

Fix: Put a file named patch-utility into files/ subdir of vsftpd port, rebuild and reinstall:

patch-utility
How-To-Repeat: Make a vsftpd.conf with syntax error, then feed it to vsftpd:
/usr/local/libexec/vsftpd vsftpd.conf </dev/null
Comment 1 Andrej Zverev freebsd_committer freebsd_triage 2005-10-10 12:43:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

Over to maintainer
Comment 2 Dirk Meyer freebsd_committer freebsd_triage 2005-10-13 06:08:47 UTC
State Changed
From-To: open->closed

committed, thanks. 
(pach did not apply, it had additional spaces in each line)