[Bug 2481] Tilde expansion in -i option inconsistent

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Oct 22 09:37:33 AEDT 2015


Darren Tucker <dtucker at zip.com.au> changed:

           What    |Removed                     |Added
                 CC|                            |dtucker at zip.com.au

--- Comment #1 from Darren Tucker <dtucker at zip.com.au> ---
The reason for the discrepancy is that in this case, -i doesn't do
tilde expansion, the shell does.  It only does it at the start of an
argument, and when you combine the arguments like that it doesn't

$ echo -i~/bin
$ echo -i ~/bin
-i /home/dtucker/bin

This then falls foul of the file existence check inside the -i

case 'i':
        if (stat(optarg, &st) < 0) {
              fprintf(stderr, "Warning: Identity file %s "
                            "not accessible: %s.\n", optarg,
                add_identity_file(&options, NULL, optarg, 1);

and the key doesn't get added before the call to tilde_expand_filename
later.  We could probably fix this by adding a call to
tilde_expand_filename in the -i handling.

You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.

More information about the openssh-bugs mailing list