| Summary: | sshd dies if passed host key with relative path on command line | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Marc Bejarano <bugzilla.mindrot.org> | ||||||||||
| Component: | sshd | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||||||
| Status: | CLOSED FIXED | ||||||||||||
| Severity: | normal | CC: | djm, dtucker | ||||||||||
| Priority: | P2 | ||||||||||||
| Version: | 4.5p1 | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 1626 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Marc Bejarano
2007-03-02 11:25:50 AEDT
What version is it that you're testing on Linux, and do you see the same results with a version built form vanilla source? I suspect it's not dependant on the the OS but rather on whether or not re-exec is enabled. the testing i did for this bug report was with ubuntu's sshd OpenSSH_4.3p2 from their 4.3p2-5ubuntu1 deb. anyway, using vanilla 4.5p1 source with all defaults on the same linux test box does indeed break things like the other OS's when using a relative path for host key. and adding the -r flag fixes things again so you're right about this being related to re-exec :) Created attachment 1288 [details]
require absolute paths
It is pretty easy to fix the specific case of the '-h' option not accepting relative paths, but fixing the more general problem of paths specified on the commandline using -oConfigItem=value or in configuration files is surprisingly tricky because of the way we pass the configuration between the original sshd instance and the re-executed child.
Rather than writing a lot of code to fix this edge case, I think it is better that we just make the requirement to use absolute paths explicit and provide error feedback when the daemon is started, not when it tries to accept a connection.
Created attachment 1289 [details]
better patch
Actually, the last patch had two bugs: it broke the AuthorizedKeysFile directive (which allows paths relative to $HOME) and absolute paths specified using ~/ or ~user/. This one fixes these problems.
Created attachment 1290 [details]
Working patch
It helps if one saves the file that one is working on before making a broken patch and posting it for the world to see...
target for 5.4 Created attachment 1776 [details]
/home/djm/sshd-abspath.diff
de-relativise host key paths
Comment on attachment 1776 [details]
/home/djm/sshd-abspath.diff
ignore the Makefile.inc hunk
Comment on attachment 1776 [details]
/home/djm/sshd-abspath.diff
ok minus the XXX debugs.
revised patch applied, so this will be in OpenSSH 5.4. Thanks for the report. With the release of 5.4p1, this bug is now considered closed. |