From ae03e33ce82a8cc2f209bac54d81e6aa36d2cbe3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 23 Sep 2013 23:27:45 +0200 Subject: [PATCH] curlftpfs: add Fedora patches for some bugfixes. --- .../patches/curlftpfs-0.9.2-create-fix.patch | 32 +++++++++++ .../curlftpfs-0.9.2-memleak#591298.patch | 11 ++++ ...urlftpfs-0.9.2-memleak-cached#591299.patch | 53 +++++++++++++++++++ .../curlftpfs-0.9.2-offset_64_another.patch | 18 +++++++ srcpkgs/curlftpfs/template | 2 +- 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-create-fix.patch create mode 100644 srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak#591298.patch create mode 100644 srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak-cached#591299.patch create mode 100644 srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-offset_64_another.patch diff --git a/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-create-fix.patch b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-create-fix.patch new file mode 100644 index 00000000000..5f071a38d33 --- /dev/null +++ b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-create-fix.patch @@ -0,0 +1,32 @@ +--- ftpfs.c 2013-05-12 14:31:57.000000000 +0400 ++++ ftpfs.c 2013-05-12 14:29:00.906721322 +0400 +@@ -759,13 +759,13 @@ + err = -ENOTSUP; + } + +- if ((fi->flags & O_EXCL)) +- { +- DEBUG(1, "opening %s with O_EXCL - testing existence\n", path); +- int exists_r = test_exists(path); +- if (exists_r != -ENOENT) +- err = -EACCES; +- } ++// if ((fi->flags & O_EXCL)) ++// { ++// DEBUG(1, "opening %s with O_EXCL - testing existence\n", path); ++// int exists_r = test_exists(path); ++// if (exists_r != -ENOENT) ++// err = -EACCES; ++// } + + if (!err) + { +@@ -816,6 +816,8 @@ + #if FUSE_VERSION >= 25 + static int ftpfs_create(const char* path, mode_t mode, + struct fuse_file_info* fi) { ++// return ftpfs_open_common(path, mode, fi); ++ ftpfs_mknod(path, mode, NULL); + return ftpfs_open_common(path, mode, fi); + } + #endif diff --git a/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak#591298.patch b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak#591298.patch new file mode 100644 index 00000000000..bc995aed60a --- /dev/null +++ b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak#591298.patch @@ -0,0 +1,11 @@ +--- ftpfs.c ++++ ftpfs.c +@@ -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); + } + diff --git a/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak-cached#591299.patch b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak-cached#591299.patch new file mode 100644 index 00000000000..fc7d8fcc801 --- /dev/null +++ b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-memleak-cached#591299.patch @@ -0,0 +1,53 @@ +--- cache.c ++++ cache.c +@@ -25,7 +25,7 @@ struct cache { + time_t last_cleaned; + }; + +-static struct cache cache; ++struct cache cache; + + struct node { + struct stat stat; +--- ftpfs-ls.c ++++ ftpfs-ls.c +@@ -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 +250,10 @@ int parse_dir(const char* list, const ch + 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 +266,10 @@ int parse_dir(const char* list, const ch + 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); diff --git a/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-offset_64_another.patch b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-offset_64_another.patch new file mode 100644 index 00000000000..940ddb0191b --- /dev/null +++ b/srcpkgs/curlftpfs/patches/curlftpfs-0.9.2-offset_64_another.patch @@ -0,0 +1,18 @@ +--- ftpfs.c ++++ ftpfs.c +@@ -503,7 +503,6 @@ static void *ftpfs_write_thread(void *da + + 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); +@@ -645,7 +645,6 @@ static int create_empty_file(const char + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_INFILESIZE, 0); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_UPLOAD, 1); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_READDATA, NULL); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); diff --git a/srcpkgs/curlftpfs/template b/srcpkgs/curlftpfs/template index 5ebde3b38bb..6a0e1237767 100644 --- a/srcpkgs/curlftpfs/template +++ b/srcpkgs/curlftpfs/template @@ -1,7 +1,7 @@ # Template file for 'curlftpfs' pkgname=curlftpfs version=0.9.2 -revision=2 +revision=3 build_style=gnu-configure configure_args="ac_cv_func_working_mktime=yes ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ac_cv_func_chown_works=yes"