SSH NONBLOCK Issue

From: Aaron Smith (asmith_at_nexcerpt.com)
Date: 03/11/04

  • Next message: Aaron Smith: "SSH NONBLOCKING Issue Part II"
    To: secureshell@securityfocus.com
    Date: Thu, 11 Mar 2004 12:30:58 -0500
    
    
    

            We recently upgraded a number of servers here from Redhat 7.3 to
    Whitebox Linux 3.0 (a clone of Redhat Enterprise Linux 3.0). All three
    are running OpenSSH version 3.6.1-p2. After the upgrade, a particular
    perl script that utilizes SSH stopped working properly. Basically, all
    this script did was open a "file" which was a pipe to an ssh command
    (i.e. open(FILE,$cmd)). The ssh command was a simple ssh to another
    machine to cat a particular file.
            If the SSH command is run from the command line, it works fine. When
    run from the script, it hangs. It seems that the actual SSH connection
    is set up and authenticated just fine, but then it hangs waiting for the
    actual output from the cat command. After putting in -vv to the
    commands and comparing the output, the only difference I could find was
    the following debug statements from the scripts version:
    debug2: fd 3 is O_NONBLOCK
    debug1: fd 4 setting O_NONBLOCK

            After doing some googling around, and reading this:
    http://bugzilla.mindrot.org/show_bug.cgi?id=26

            My current theory is that STDOUT is being set to NONBLOCK, preventing
    the output of the cat command from being read. The question, then, is
    what causes that to happen and why is it different in the script vs. in
    the command line. We also created a test script that runs the same
    command in the same way as the main script and that one works just fine
    (and does not have the fd 3 NONBLOCK statement in the debug output..)

    -- 
    -----------------------------------------------------------------
    Aaron Smith             		vox: 269.226.9550 ext.26
    Network Director        		fax: 269.349.9076	
    Nexcerpt, Inc.          		http://www.nexcerpt.com
    	
    	...Nexcerpt... Extend Your Expertise
    
    



  • Next message: Aaron Smith: "SSH NONBLOCKING Issue Part II"