|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-11-22 20:06 UTC] chupaka at gmail dot com
[2021-02-10 11:29 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 01:00:01 2025 UTC |
Description: ------------ When calling ssh2_auth_pubkey_file with $pubkeyfile or $privkeyfile starting with ~/, it destroys contents of strings (and php70 sometimes Segfaults). Looks like it's connected with "Explode '~/paths' stopgap fix because libssh2 does not accept tilde for homedir" block in ssh2.c Test script: --------------- <?php $pub = '~/.ssh/id_rsa.pub'; $priv = '~/.ssh/id_rsa'; echo "$pub\n$priv\n"; $ssh = ssh2_connect("server.com"); ssh2_auth_pubkey_file($ssh, 'root', $pub, $priv); echo "$pub\n$priv\n"; Expected result: ---------------- [root@test 1]# php56 keyauth.php ~/.ssh/id_rsa.pub ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/id_rsa [root@test 1]# php70 keyauth.php ~/.ssh/id_rsa.pub ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/id_rsa [root@test 1]# Actual result: -------------- [root@test 1]# php56 keyauth.php ~/.ssh/id_rsa.pub ~/.ssh/id_rsa d_rsa.pub ▒9▒<d_rsa [root@test 1]# php70 keyauth.php ~/.ssh/id_rsa.pub ~/.ssh/id_rsa ▒▒;▒>▒▒U▒ ▒'▒d_rsa [root@test 1]#