ID: 46303 User updated by: eric_intzandt at tvworks dot com Reported By: eric_intzandt at tvworks dot com -Status: Open +Status: Bogus Bug Type: Network related Operating System: linux red hat enterprise 4 PHP Version: 5.2.6 New Comment:
needed to sleep() it longer than i thought. sorry to be a pita Previous Comments: ------------------------------------------------------------------------ [2008-10-15 15:11:25] eric_intzandt at tvworks dot com Description: ------------ I create an ssh connection to server b. I then call ssh2_exec to create a file. In the same connection, I then call ssh2_scp_recv to grab the file. However, this returns the file with a size of 0. If I take out the ssh2_exec() call, and just use ssh2_scp_recv with a pre-existing file it works fine. see code modules: './configure' '--host=x86_64-redhat-linux-gnu' '--build=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--without-sqlite' '--disable-json' '--without-pspell' Reproduce code: --------------- //////////////////////// Assumes we are connecting to host B, from host A. //////////////////////// $conn = ssh2_connect($host,22); if(ssh2_auth_password($conn,SSH_USER,SSH_PASS)) { $command = "/usr/bin/pg_dump -F t -U ".COMMAND_USER." -d tv -f /home/admin/command_db.tar -i"; ssh2_exec($conn, $command );//creates file successfully ssh2_scp_recv($conn,'/home/admin/command_db.tar',$dir.'command/'.$host.'/command_db.tar'); } else echo "Failed to authenticate"; Expected result: ---------------- I would expect a file command_db to be created on host b, then transferred to host a. Actual result: -------------- File gets created on host B, transferred to host A, but the filesize on host A is 0. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46303&edit=1