[Bug 3816] New: regression: valid_hostname() refuses hostname with comma

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sat Apr 19 05:21:56 AEST 2025


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

            Bug ID: 3816
           Summary: regression: valid_hostname() refuses hostname with
                    comma
           Product: Portable OpenSSH
           Version: 10.0p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: scp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: watanabe.yu at gmail.com

Since 487cf4c18c123b66c1f3f733398cd37e6b2ab6ab, hostname with comma is
refused.
Hostname with comma may be used by scp, e.g.
scp -v vsock,1:/etc/machine-id /tmp

The commit breaks a test case in systemd:
https://github.com/systemd/systemd/blob/defd5060d69ba31c1815e7d5427bde93a3db88c0/test/units/TEST-74-AUX-UTILS.ssh.sh#L65-L71
With openssh 10.0p1, the test case failed with the following:
```
[   78.014567] TEST-74-AUX-UTILS.sh[2634]: + command -v scp
[   78.016996] TEST-74-AUX-UTILS.sh[2694]: ++ mktemp -u
[   78.019724] TEST-74-AUX-UTILS.sh[2634]: +
OUT_FILE=/tmp/tmp.e3WBq62ziC
[   78.021470] TEST-74-AUX-UTILS.sh[2634]: + scp -o
StrictHostKeyChecking=no -v -i /tmp/tmp.L5BYceUUfs
vsock,1:/etc/machine-id /tmp/tmp.e3WBq62ziC
[   78.023570] TEST-74-AUX-UTILS.sh[2695]: Executing: program
/usr/bin/ssh host vsock,1, user (unspecified), command sftp
[   78.031887] TEST-74-AUX-UTILS.sh[2697]: hostname contains invalid
characters
[FAILED] Failed to start TEST-74-AUX-UTILS.service.
[   78.035067] TEST-74-AUX-UTILS.sh[2695]: scp: Connection closed
[   78.037831] TEST-74-AUX-UTILS.sh[307]: + echo 'Subtest
/usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.ssh.sh failed'
[   78.038431] TEST-74-AUX-UTILS.sh[307]: Subtest
/usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.ssh.sh failed
[   78.039110] TEST-74-AUX-UTILS.sh[307]: + return 1
```

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list