From:             mattsch at gmail dot com
Operating system: Gentoo
PHP version:      5.4.9
Package:          cURL related
Bug Type:         Bug
Bug description:sftp upload CURLOPT_URL errors with code 79 with directory path

Description:
------------
When specifying a url in CURLOPT_URL with a directory path only using the
sftp protocol, the upload will always fail with error code 79 (An
unspecified error occurred during the SSH session).  If you change the
CURLOPT_URL to be the same path but add a filename at the end of the
directory path, the upload will succeed.


emerge -pv php:5.4

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ~] dev-lang/php-5.4.9:5.4  USE="apache2 bcmath bzip2 calendar
cjk cli crypt ctype curl curlwrappers exif fileinfo filter ftp gd gdbm gmp
hash iconv ipv6 json ldap mhash mysql mysqli mysqlnd nls pcntl pdo phar
posix readline session simplexml snmp soap sockets spell sqlite ssl sysvipc
threads tidy tokenizer truetype unicode wddx xml xmlwriter xpm xsl zip zlib
-berkdb -cdb -cgi -debug -doc -embed -enchant -firebird -flatfile -fpm
(-frontbase) -imap -inifile -intl -iodbc -kerberos (-kolab) -ldap-sasl
-libedit -mssql -oci8-instant-client -odbc -pic -postgres -qdbm -recode
(-selinux) -sharedmem (-sybase-ct) -xmlreader -xmlrpc" 0 kB

emerge -pv curl

These are the packages that would be merged, in order:

Calculating dependencies  e -      ... done!
[ebuild   R   ~] net-misc/curl-7.28.1  USE="idn ipv6 nonblocking ssh ssl
threads -adns -kerberos -ldap -metalink -rtmp -static-libs {-test}"
CURL_SSL="openssl -axtls -cyassl -gnutls -nss -polarssl" 0 kB


emerge -pv libssh2

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ~] net-libs/libssh2-1.4.3  USE="zlib -gcrypt -static-libs
{-test}" 0 kB


curl -V
curl 7.28.1 (x86_64-pc-linux-gnu) libcurl/7.28.1 OpenSSL/1.0.0j zlib/1.2.7
libidn/1.25 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp
scp sftp smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile NTLM NTLM_WB SSL libz



Test script:
---------------
<?php
function upload($url)
{
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_UPLOAD, 1);
        curl_setopt($ch, CURLOPT_INFILE, fopen('/tmp/foo', 'r'));
        curl_setopt($ch, CURLOPT_INFILESIZE, filesize('/tmp/foo'));
        curl_setopt($ch, CURLOPT_USERPWD, 'user:password');
        curl_exec($ch);
        echo curl_errno($ch) . "\n";
}
// prints 79 -- should print 0
upload('sftp://domain.tld:/tmp');
// prints 0
upload('sftp://domain.tld:/tmp/foo');

Expected result:
----------------
0
0


Actual result:
--------------
79
0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63766&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63766&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63766&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63766&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63766&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63766&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63766&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63766&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63766&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63766&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63766&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63766&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63766&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63766&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63766&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63766&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63766&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63766&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63766&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63766&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63766&r=mysqlcfg

Reply via email to