Bug 961 - CVS annotate problems
Summary: CVS annotate problems
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 3.8.1p1
Hardware: All Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-10 18:50 AEDT by Steinar Bang
Modified: 2006-10-07 11:38 AEST (History)
0 users

See Also:


Attachments
Return stdio to blocking before executing shell/command (616 bytes, patch)
2004-12-10 20:46 AEDT, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steinar Bang 2004-12-10 18:50:53 AEDT
I had a problem that CVS annotate from emacs didn't work.  Lines were missing 
from the output.  I was told on gnu.emacs.help, that this was an SSH/CVS/libc 
interaction problem that also affected other tools such as rsync, and was told 
to make the CVS_RSH enviroment variable point to the following bourne shell 
script:

#!/bin/sh
(ssh "$@" 2>&1 1>&3 | cat) 3>&1 1>&2

Using the script fixed the problem for me, but it would be nice not to need it.
Comment 1 Mark D Baushke 2004-12-10 20:09:35 AEDT
Both cvs-1.11.18 (the stable branch release) and cvs-1.12.10 (the
feature branch release) have a workaround for your problem.

The difficulty is that SSH puts stdout into non-blocking mode via
a redirection of stderr. In turn, this may lead to fwrite() and/or
fflush() failing with EAGAIN which was not expected by previous
versions of CVS (rsh does not exhibit this misbehavior).
Comment 2 Damien Miller 2004-12-10 20:46:07 AEDT
Created attachment 751 [details]
Return stdio to blocking before executing shell/command

I don't recall any of the CVS developers reporting this, but anyway - this
patch resets std{in,out,err} to blocking mode before the command or shell is
executed.
Comment 3 Damien Miller 2004-12-13 12:58:04 AEDT
hm, this may be a bug in Linux's socket or tty code - sshd never touches the
child's fds. This patch therefore just prints:

debug3: fd 0 is not O_NONBLOCK
debug3: fd 1 is not O_NONBLOCK
debug3: fd 2 is not O_NONBLOCK

(tested: Linux, OpenBSD, Solaris 10)
Comment 4 Damien Miller 2005-02-09 16:28:37 AEDT
I don't think there is any more that we can do, and CVS has fixed their problems
at their end.
Comment 5 Darren Tucker 2006-10-07 11:38:10 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.