Bug 714554

Summary: starting dovecot service from ssh command line does not return
Product: Red Hat Enterprise Linux 6 Reporter: Fang Wenqi <anton.fang>
Component: opensshAssignee: Jan F. Chadima <jchadima>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: mvadkert, pvrabec
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openssh-5.3p1-62.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 09:56:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Fang Wenqi 2011-06-20 04:29:27 UTC
Description of problem:


Version-Release number of selected component (if applicable):
  # rpm -qa | grep dovecot
  dovecot-2.0.9-2.el6.x86_64


How reproducible:
  *Always*

Steps to Reproduce:
1. In a RHEL6.1 x86_64 system, install dovecot-2.0.9-2.el6.x86_64.rpm from RHEL6.1 DVD.
2. # ssh localhost " /etc/init.d/dovecot restart "
Stopping Dovecot Imap: [  OK  ]
Starting Dovecot Imap: [  OK  ]


Actual results:
  ssh does not return and keep waiting.

Expected results:
  ssh return to the "#" prompt.

Additional info:
 1. did not meet this issue on RHEL6.0.
 2. tried the community dovecot-2.0.11, did not meet this issue.

Comment 2 Michal Hlavinka 2011-06-21 10:34:42 UTC
Thanks for reporting this, I can reproduce this

Comment 3 Michal Hlavinka 2011-06-21 13:41:17 UTC
This happens not because of dovecot update, but because of openssh update in rhel 6.1

If you downgrade dovecot to rhel6.0 version behaviour is still the same, but if you downgrade openssh to 5.3p1-20.el6_0.3 it works even with new dovecot version. 

It works with newer openssh version 5.5p1-25.el6.2 from Fedora 14 (after rebuild). Also when I add "set -x" in dovecot init script, it calls exit:
...
+ RETVAL=0
+ exit 0

Comment 4 Peter Vrabec 2011-06-23 10:04:24 UTC
This has solved the issue for me. It's a patch for openssh-5.3p1-sftp-chroot.patch

--- a/openssh-5.3p1-sftp-chroot.patch
+++ b/openssh-5.3p1-sftp-chroot.patch.NEW
@@ -22,7 +22,7 @@ diff -up openssh-5.3p1/channels.c.sftp-chroot openssh-5.3p1/channels.c
 +              } else if (c->efd != -1 &&
 +                  (c->extended_usage == CHAN_EXTENDED_READ ||
 +                  c->extended_usage == CHAN_EXTENDED_IGNORE) &&
-+                  FD_ISSET(c->efd, readset)) {
++                  (c->detach_close || FD_ISSET(c->efd, readset))) {
                        len = read(c->efd, buf, sizeof(buf));
                        debug2("channel %d: read %d from efd %d",
                            c->self, len, c->efd);

I have no clue what I have done. Just back-ported snip of code from openssh-5.8p1

Comment 5 Miroslav Vadkerti 2011-06-23 13:10:02 UTC
Tested openssh-5.3p1-52.el6 from RHEL6.1 patched with the above and I didn't find any regressions. The fix seems to be ready to be included in RHEL6.2 updated package.

Comment 7 Fang Wenqi 2011-06-30 14:56:21 UTC
Thanks for fixing the issue.

Will there be an errata for the RHEL6.1 users ?

Comment 8 Miroslav Vadkerti 2011-06-30 16:49:36 UTC
The fix for this issue will be addressed in RHEL6.2

Comment 10 errata-xmlrpc 2011-12-06 09:56:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1551.html