[Bug 1536] New: SSH modifies line endings when using command in authorized_keys

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Mon Nov 10 18:19:32 EST 2008


https://bugzilla.mindrot.org/show_bug.cgi?id=1536

           Summary: SSH modifies line endings when using command in
                    authorized_keys
           Product: Portable OpenSSH
           Version: 5.1p1
          Platform: ix86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sshd
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: codewarrior at binaryvibrance.net


Overview:
SSH modifies line endings when using command in authorized_keys.
I'm using keys to ensure that an unattended copy occurs while using the
command="aScript.php" that outputs an uncompressed tarball. Because of
the line endings changing, my tarball becomes invalid.

What happens:
When using public/private keys to force a particular command to run,
under tested circumstances, LF is converted to CRLF.
Running the same command without using a forced command returns the
correct text.

Steps to reproduce:

cd ~
echo this is a test > bugcheck.txt
echo It needs to have multiple lines >> bugcheck.txt
echo so that I can check if there is a bug >> bugcheck.txt
echo in OpenSSH >> bugcheck.txt
ssh-keygen -t rsa -f bugcheck -N ""
echo -n
"no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command=\"cat
bugcheck.txt\" " >> ~/.ssh/authorized_keys
cat bugcheck.pub >> ~/.ssh/authorized_keys
ssh localhost 'cat bugcheck.txt' > bugcheck-response-1.txt
ssh -i bugcheck localhost > bugcheck-response-2.txt
ls -l bugcheck-response-*.txt

Actual Results:
-rw-r--r-- 1 codewarrior codewarrior  96 Nov 10 11:12
bugcheck-response-1.txt
-rw-r--r-- 1 codewarrior codewarrior 100 Nov 10 11:12
bugcheck-response-2.txt
(bugcheck-response-2.txt contains CRLF line endings)

Expected Results:
-rw-r--r-- 1 codewarrior codewarrior  96 Nov 10 11:12
bugcheck-response-1.txt
-rw-r--r-- 1 codewarrior codewarrior  96 Nov 10 11:12
bugcheck-response-2.txt
(bugcheck-response-2.txt should have original LF line endings)

Build Date and Platform:
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006 on RedHat Enterprise Linux 5

Additional Builds and Platforms
OpenSSH_5.1p1, OpenSSL 0.9.8h 28 May 2008 on Gentoo Linux

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list