php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lars dot van-casteren at aircom dot co dot uk
New email:
PHP Version: OS:

 

 [2006-04-19 14:24 UTC] lars dot van-casteren at aircom dot co dot uk
Description:
------------
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:

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

I added the extension=ssh2.so 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
<?php
$connection = ssh2_connect('backbase', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_pubkey_file($connection, 'admin',
                       '/export/home/admin/.ssh/id_rsa.pub',
                         '/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 ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-19 14:51 UTC] pollita@php.net
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-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 20 11:01:30 2019 UTC