vsftpd started even if not in standalone mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vsftpd (Ubuntu) |
Fix Released
|
Wishlist
|
Unassigned | ||
Lucid |
Fix Released
|
Medium
|
Unassigned | ||
Maverick |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: vsftpd
(lucid vsftpd 2.2.2-3ubuntu6)
because of a syntax error in /etc/init/
/etc/init/
if [ -e "${CONFFILE}" ] && !egrep -iq "^ *listen(_ipv6)? *= *yes" "${CONFFILE}"
without space between ! and egrep. As a result !egrep returns with an error ("!egrep" command not found) and as a result, the script assumes the "listen = yes" line is in the file.
Moreover, if the /etc/vsftpd.conf file is not there, vsftpd is also started which I suspect was not intended.
Moreover egrep is not a POSIX command.
Would be better written as:
if ! grep -qEis -- '^[[:blank:
=======
SRU Justification
IMPACT: See above description to see the its impact.
REPRODUCE:
1. First edit the configure (/etc/vsftpd.conf) and comment the line "listen=yes".
2. Then start vsftpd: sudo service vsftpd start
3. Upstart will report that the service has been started (start/running), when it should have failed to start because the upstart job does the configuration check (stop/pre-start).
HOW FIXED: Add a blank space between ! and egrep as specified above. Also, instead of using 'exit 0' use stop within the upstart job.
PATCH: Attached. Uploaded to lucid-proposed for review there.
REGRESSION POTENTIAL: Minimal. I've tested this throughly and works as expected. (See C-de Avillez comment #2 on how this is supposed to work.
=======
Related branches
- Martin Pitt: Approve
-
Diff: 60 lines (+15/-4)3 files modifieddebian/changelog (+11/-0)
debian/vsftpd.postinst (+2/-2)
debian/vsftpd.upstart (+2/-2)
- Dave Walker (community): Approve
-
Diff: 72 lines (+24/-8)3 files modifieddebian/changelog (+13/-0)
debian/vsftpd.postinst (+8/-5)
debian/vsftpd.upstart (+3/-3)
Changed in vsftpd (Ubuntu): | |
assignee: | nobody → Andres Rodriguez (andreserl) |
status: | Confirmed → Triaged |
status: | Triaged → In Progress |
Changed in vsftpd (Ubuntu Lucid): | |
status: | Confirmed → In Progress |
Changed in vsftpd (Ubuntu Maverick): | |
status: | Confirmed → In Progress |
Changed in vsftpd (Ubuntu Lucid): | |
status: | In Progress → Confirmed |
Changed in vsftpd (Ubuntu Maverick): | |
status: | In Progress → Confirmed |
Changed in vsftpd (Ubuntu Lucid): | |
assignee: | nobody → Andres Rodriguez (andreserl) |
status: | Confirmed → In Progress |
description: | updated |
Changed in vsftpd (Ubuntu Lucid): | |
status: | In Progress → Confirmed |
importance: | Undecided → Low |
importance: | Low → Medium |
Changed in vsftpd (Ubuntu Maverick): | |
importance: | Low → Medium |
Changed in vsftpd (Ubuntu Lucid): | |
assignee: | Andres Rodriguez (andreserl) → nobody |
tags: | removed: verification-needed |
Also, I suspect the last line of the pre-start script should be:
check_standalon e_mode || stop
instead of:
check_standalon e_mode || exit 0
which is a no-op except for the message that check_standalon e_mode might display.