|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesssh2-auth-none-segfault-fix (last revision 2014-09-16 00:41 UTC by felipe at weckx dot net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-07-15 07:36 UTC] langemeijer@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: langemeijer
[2015-07-15 07:36 UTC] langemeijer@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ Some simpler devices (e.g. older Cisco Devices, Dell SonicWall firewalls, Motorola RFS 7000 switches) implement the SSH service without any authentication (they show a prompt after the connection is established). If a ssh2_auth_password or ssh2_auth_agent is called on a connection to one of these devices a segfault occurs because libssh2_userauth_list returns NULL. The problem can be prevented by calling ssh2_auth_none and checking if the return value is TRUE, but I believe the ssh2_auth_password should fail gracefully. Test script: --------------- $host = '95.215.46.98'; $port = 2200; $conn = ssh2_connect($host, $port); if (!$conn) { echo "Error connecting to '{$host}:{$port}'\n"; die(1); } echo "Connected to '{$host}:{$port}'. Trying password authentication\n"; ssh2_auth_password($conn, 'test', 'test'); echo "OK\n"; Expected result: ---------------- Connected to '95.215.46.98:2200'. Trying password authentication Segmentation fault (core dumped)