[Bug 1784] New: ssh-keygen fails when filename of key file contains multiple slashes

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sun Jun 20 05:23:10 EST 2010


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

           Summary: ssh-keygen fails when filename of key file contains
                    multiple slashes
           Product: Portable OpenSSH
           Version: 5.2p1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ssh-keygen
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: srinidhi.bs at gmail.com


In Linux, multiple slashes in the file path have the same effect as a
single slash character. For example, "/home//foo/" is the same as
"/home/foo/". ssh-keygen doesn't work with filenames containing
multiple slashes.

Behavior of ssh-keygen With double slashes:

# su - foo -c "ssh-keygen -t rsa -f /home/foo//.ssh/id_rsa -N ''"
Generating public/private rsa key pair.
open /home/foo//.ssh/id_rsa failed: No such file or directory.
Saving the key failed: /home/foo//.ssh/id_rsa.

# su - foo -c "ssh-keygen -t rsa -f /home/foo/.ssh/id_rsa -N ''"
Generating public/private rsa key pair.
Created directory '/home/foo/.ssh'.
Your identification has been saved in /home/foo/.ssh/id_rsa.
Your public key has been saved in /home/foo/.ssh/id_rsa.pub.
The key fingerprint is:
3a:1b:5a:af:3a:0a:f4:32:da:87:a9:e6:98:b0:d4:87 foo at toruk
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
| .      S        |
|. o .  .         |
|o+ E .=          |
|=*= +o =         |
|Ooooooo..        |
+-----------------+

# getent passwd foo
foo:x:1004:100::/home/foo:/bin/bash

# ssh -V
OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009

I have also seen the same behavior with OpenSSH_4.2p1.

-- 
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