This commit is contained in:
TriForceX
2019-09-25 20:51:37 -03:00
commit 6203ff3e7c
11215 changed files with 428258 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
Borrowed from the curlftpfs_0.9.2-5 Debian package.
CURLOPT_INFILESIZE does not support -1 arg. This fix bug #556012.
--- curlftpfs-0.9.2/ftpfs.c.old 2009-12-13 14:12:25.000000000 +0100
+++ curlftpfs-0.9.2/ftpfs.c 2009-12-13 14:12:32.000000000 +0100
@@ -503,7 +503,6 @@
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1);
- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, -1);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READDATA, fh);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_LOW_SPEED_LIMIT, 1);

View File

@@ -0,0 +1,14 @@
Borrowed from the curlftpfs_0.9.2-5 Debian package.
Fix a memory leak. See Bug #587250.
--- a/ftpfs.c 2008-04-30 01:05:47.000000000 +0200
+++ a/ftpfs.c.slesimple 2010-01-01 22:12:10.000000000 +0100
@@ -615,6 +615,8 @@ static void free_ftpfs_file(struct ftpfs
sem_destroy(&fh->data_need);
sem_destroy(&fh->data_written);
sem_destroy(&fh->ready);
+ if (fh->buf.size) { buf_free(&fh->buf); }
+ if (fh->stream_buf.size) { buf_free(&fh->stream_buf); }
free(fh);
}

View File

@@ -0,0 +1,59 @@
Borrowed from the curlftpfs_0.9.2-5 Debian package.
Fix a memory leak when cache is disabled. Closes: #614347.
diff -ur curlftpfs-0.9.2/cache.c curlftpfs-0.9.2-olexat/cache.c
--- curlftpfs-0.9.2/cache.c 2008-04-30 01:03:09.000000000 +0200
+++ curlftpfs-0.9.2-olexat/cache.c 2011-02-04 16:43:05.000000000 +0100
@@ -25,7 +25,7 @@
time_t last_cleaned;
};
-static struct cache cache;
+struct cache cache;
struct node {
struct stat stat;
diff -ur curlftpfs-0.9.2/ftpfs-ls.c curlftpfs-0.9.2-olexat/ftpfs-ls.c
--- curlftpfs-0.9.2/ftpfs-ls.c 2008-04-23 12:55:41.000000000 +0200
+++ curlftpfs-0.9.2-olexat/ftpfs-ls.c 2011-02-07 17:23:37.000000000 +0100
@@ -25,6 +25,13 @@
#include "charset_utils.h"
#include "ftpfs-ls.h"
+struct cache {
+ int on;
+ char incomplete[];
+};
+
+extern struct cache cache;
+
static int parse_dir_unix(const char *line,
struct stat *sbuf,
char *file,
@@ -243,8 +256,10 @@
reallink = g_strdup(link);
}
int linksize = strlen(reallink);
- cache_add_link(full_path, reallink, linksize+1);
- DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
+ if (cache.on) {
+ cache_add_link(full_path, reallink, linksize+1);
+ DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
+ }
if (linkbuf && linklen) {
if (linksize > linklen) linksize = linklen - 1;
strncpy(linkbuf, reallink, linksize);
@@ -257,8 +272,10 @@
DEBUG(1, "filler: %s\n", file);
filler(h, file, &stat_buf);
} else {
- DEBUG(1, "cache_add_attr: %s\n", full_path);
- cache_add_attr(full_path, &stat_buf);
+ if (cache.on) {
+ DEBUG(1, "cache_add_attr: %s\n", full_path);
+ cache_add_attr(full_path, &stat_buf);
+ }
}
DEBUG(2, "comparing %s %s\n", name, file);

View File

@@ -0,0 +1,39 @@
Use off_t instead of __off_t
__off_t is an internal C library type, which shouldn't be used by
applications. It is not defined by the musl C library, so use the
public off_t type instead.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/ftpfs.c
===================================================================
--- a/ftpfs.c
+++ b/ftpfs.c
@@ -687,7 +687,7 @@
return ftpfs_getattr(path, &sbuf);
}
-static __off_t test_size(const char* path)
+static off_t test_size(const char* path)
{
struct stat sbuf;
int err = ftpfs_getattr(path, &sbuf);
@@ -950,7 +950,7 @@
/* fix openoffice problem, truncating exactly to file length */
- __off_t size = (long long int)test_size(path);
+ off_t size = (long long int)test_size(path);
DEBUG(1, "ftpfs_truncate: %s check filesize=%lld\n", path, (long long int)size);
if (offset == size)
@@ -978,7 +978,7 @@
}
/* fix openoffice problem, truncating exactly to file length */
- __off_t size = test_size(path);
+ off_t size = test_size(path);
DEBUG(1, "ftpfs_ftruncate: %s check filesize=%lld\n", path, (long long int)size);
if (offset == size)

View File

@@ -0,0 +1,20 @@
config BR2_PACKAGE_CURLFTPFS
bool "curlftpfs (FUSE)"
depends on BR2_USE_WCHAR # glib2
depends on BR2_TOOLCHAIN_HAS_THREADS # libfuse, glib2
depends on BR2_USE_MMU # libfuse, glib2
depends on !BR2_STATIC_LIBS # libfuse
select BR2_PACKAGE_LIBFUSE
select BR2_PACKAGE_LIBGLIB2
select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_LIBCURL
help
CurlFtpFS is a filesystem for accessing FTP hosts based on
FUSE and libcurl.
http://curlftpfs.sourceforge.net/
comment "curlftpfs needs a toolchain w/ wchar, threads, dynamic library"
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS

View File

@@ -0,0 +1,2 @@
# Locally computed:
sha256 4eb44739c7078ba0edde177bdd266c4cfb7c621075f47f64c85a06b12b3c6958 curlftpfs-0.9.2.tar.gz

View File

@@ -0,0 +1,17 @@
################################################################################
#
# curlftpfs
#
################################################################################
CURLFTPFS_VERSION = 0.9.2
CURLFTPFS_SITE = http://downloads.sourceforge.net/project/curlftpfs/curlftpfs/$(CURLFTPFS_VERSION)
CURLFTPFS_CONF_ENV = ac_cv_path__libcurl_config=$(STAGING_DIR)/usr/bin/curl-config
CURLFTPFS_LICENSE = GPL-2.0
CURLFTPFS_LICENSE_FILES = COPYING
CURLFTPFS_DEPENDENCIES = \
libglib2 libfuse openssl libcurl \
$(TARGET_NLS_DEPENDENCIES) \
$(if $(BR2_ENABLE_LOCALE),,libiconv)
$(eval $(autotools-package))