|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56964 ssh2 crashes php
Submitted: 2006-04-19 14:24 UTC Modified: 2006-04-20 06:06 UTC
From: lars dot van-casteren at aircom dot co dot uk Assigned:
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.1.2 OS: solaris 10
Private report: No CVE-ID: None
 [2006-04-19 14:24 UTC] lars dot van-casteren at aircom dot co dot uk
ssh2 functionality makes 5.1.2 crash
I installed ssh2 this way: 

downloaded the package (because it expects /usr or /usr/local)
in the main directory of ssh2.0.10 I ran this:

./configure --with-ssh2=/opt/csw
make all install

I added the to my php.ini file
restarted apache

First I tried to check phpinfo.php and that showed me the new streams and the new ssh2 module loaded successfully.

A small script, which was used to test generated a core dump
when executed from the command line. 
Apache just throws a seg fault in it's log

Reproduce code:
-bash-3.00$ cat ssh.php
$connection = ssh2_connect('backbase', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_pubkey_file($connection, 'admin',
                         '/export/home/admin/.ssh/id_rsa', 'secret')) {
echo "Public Key Authentication Successful\n";
} else {
die('Public Key Authentication Failed');

Expected result:
I should have been able to log in or atleast get an error back.
Using other scripts in executing ssh2_connect all result in a core dump.

Actual result:
#0  libssh2_packet_write (session=0x0, data=0xffbfe6c0 "\005", data_len=17) at packet.c:1152
#1  0xfdc7f50c in libssh2_session_startup (session=0x5182a0, socket=-4201003) at session.c:333
#2  0xfdca3c64 in php_ssh2_session_connect (host=0x5121d8 "backbase", port=5341856, methods=0x512250, callbacks=0x0)
    at /tmp/ssh2-0.10/ssh2.c:424
#3  0xfdca438c in zif_ssh2_connect (ht=3, return_value=0x512278, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
    at /tmp/ssh2-0.10/ssh2.c:455
#4  0x0023cc7c in execute ()
#5  0x0023c98c in execute ()
#6  0x0020fc1c in zend_execute_scripts ()
#7  0x001a6618 in php_execute_script ()
#8  0x0027900c in main ()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-19 14:51 UTC]
What version of libssh2 do you have installed?
 [2006-04-20 06:06 UTC] lars dot van-casteren at aircom dot co dot uk
After checking the core I found my problem. 
libssh was compiled against the wrong libraries. 

sorry for wasting some time here
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 12:01:32 2024 UTC