|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-12-14 06:55 UTC] mattsch at gmail dot com
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
In addition, if I modify the test script and it with a slash at the end, it also fails in the same way: upload('sftp://domain.tld:/tmp/');