same as descripted here: https://bugs.php.net/bug.php?id=73524 there is a patch available: https://github.com/php/pecl-networking-ssh2/commit/093906ec1c065e86ad1cd4dabbc89b1ccae11938
For users with the same trouble There is a workaround from "perske at munster dot de" _______________________________________________________ intval() has to be used on every directory access functions as: fopen("ssh2.sftp://".intval($sftp)."/./", 'r'); scandir('ssh2.sftp://' . intval($sftp) . "/dir/"); Also worth mentioning that setting $sftp = intval($sftp) in advance won't work. ________________________________________________________ This works fine here.
Assigning to all packagers collectively, since there is no registered maintainer for this package.
CC: (none) => marja11Assignee: bugsquad => pkg-bugs
Assignee: pkg-bugs => mageiaCC: (none) => mageia
patched & tested the given diff for mga6. before patch, the following script segfaulted: <?php $ssh2 = ssh2_connect('localhost', 22); if (!ssh2_auth_password($ssh2, 'USER','PASSWORD')) { echo("auth error\n"); exit(); } $sftp = ssh2_sftp($ssh2); $te='ssh2.sftp://'.$sftp.'/tmp/'; echo('te='.$te."\n"); echo("before scandir!\n"); $files = scandir($te,SCANDIR_SORT_ASCENDING ); echo("after scandir!\n"); if ($files===false) echo("scandir error\n"); else echo("scandir success\n");
CC: (none) => lists.jjorgeStatus: NEW => ASSIGNED
I have uploaded a patched package for Mageia 5 + 6. You can test this by using the following script (changing Host, Port, Username, Password): <?php $ssh2 = ssh2_connect('localhost', 22); if (!ssh2_auth_password($ssh2, 'USER','PASSWORD')) { echo("auth error\n"); exit(); } $sftp = ssh2_sftp($ssh2); $te='ssh2.sftp://'.$sftp.'/tmp/'; echo('te='.$te."\n"); echo("before scandir!\n"); $files = scandir($te,SCANDIR_SORT_ASCENDING ); echo("after scandir!\n"); if ($files===false) echo("scandir error\n"); else echo("scandir success\n"); Suggested advisory: ======================== Updated php-ssh2 packages fix segmentation fault on ressource access: References: https://bugs.php.net/bug.php?id=73524 https://github.com/php/pecl-networking-ssh2/commit/093906ec1c065e86ad1cd4dabbc89b1ccae11938 ======================== Updated packages in core/updates_testing: ======================== php-ssh2-0.12-9.1.mga5.x86_64.rpm php-ssh2-0.12-10.1.mga6.x86_64.rpm Source RPMs: php-ssh2-0.12-9.1.mga5.src.rpm php-ssh2-0.12-10.1.mga6.src.rpm
Whiteboard: (none) => MGA6TOO
Assignee: mageia => qa-bugs
MGA5-32 on Asus A6000VM Xfce No installation issues Used script from Comment 4 to localhost at CLI: $ php phpsshtest.py te=ssh2.sftp://Resource id #5/tmp/ before scandir! after scandir! scandir success Seems OK.
Whiteboard: MGA6TOO => MGA6TOO MGA5-32-OKCC: (none) => herman.viaene
Keywords: (none) => advisory, has_procedure
Testing M6/64 BEFORE update: php-ssh2-0.12-10.mga6 Used the given script (for which many thanks to Marc; it made testing this update easy & sure) with own username & password; but it failed initially: $ php tmp/phpssh2.php PHP Warning: ssh2_connect(): Unable to connect to localhost on port 22 in /home/lewis/tmp/phpssh2.php on line 2 PHP Warning: ssh2_connect(): Unable to connect to localhost in /home/lewis/tmp/phpssh2.php on line 2 PHP Warning: ssh2_auth_password() expects parameter 1 to be resource, boolean given in /home/lewis/tmp/phpssh2.php on line 3 auth error This was resolved by installing & starting openssh-server: $ php tmp/phpssh2.php te=ssh2.sftp://Resource id #5/tmp/ before scandir! Segmentation fault (core dumped) [as predicted] AFTER update: php-ssh2-0.12-10.1.mga6 $ php tmp/phpssh2.php te=ssh2.sftp://Resource id #5/tmp/ before scandir! after scandir! scandir success So this update is fine. Validating as it has a good M5/32 test.
Whiteboard: MGA6TOO MGA5-32-OK => MGA6TOO MGA5-32-OK MGA6-64-OKKeywords: (none) => validated_updateCC: (none) => lewyssmith, sysadmin-bugs
An update for this issue has been pushed to the Mageia Updates repository. https://advisories.mageia.org/MGAA-2017-0114.html
Resolution: (none) => FIXEDStatus: ASSIGNED => RESOLVED