diff options
| author | Michael Forney <mforney@mforney.org> | 2017-07-09 02:49:39 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2017-07-10 10:34:19 -0700 |
| commit | a6ca58071917538c6efd6c3df86d5d347be681fc (patch) | |
| tree | 26bc5c189ef20d0a739fe897fac39d51a61faf79 /pkg/sshfs | |
| parent | 6b71e5c2419c75c14223196e1fe65cbf8f4ba026 (diff) | |
libfuse, sshfs: Update to 3.1.0, 3.0.0
Diffstat (limited to 'pkg/sshfs')
| -rw-r--r-- | pkg/sshfs/config.h | 11 | ||||
| -rw-r--r-- | pkg/sshfs/gen.rc | 9 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0001-Add-nocache.c-stub.patch | 86 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch | 46 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch | 8 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch | 17 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0005-Use-standard-C-functions.patch | 97 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0006-Add-missing-includes.patch | 6 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch | 34 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch | 18 | ||||
| -rw-r--r-- | pkg/sshfs/patch/0009-Fix-poll.h-include.patch | 25 | ||||
| -rw-r--r-- | pkg/sshfs/rev | 2 | ||||
| m--------- | pkg/sshfs/src | 0 |
13 files changed, 135 insertions, 224 deletions
diff --git a/pkg/sshfs/config.h b/pkg/sshfs/config.h index 00042458..01f41c15 100644 --- a/pkg/sshfs/config.h +++ b/pkg/sshfs/config.h @@ -1,11 +1,2 @@ #define IDMAP_DEFAULT "none" - -#define PACKAGE "sshfs" -#define PACKAGE_BUGREPORT "" -#define PACKAGE_NAME "sshfs" -#define PACKAGE_STRING "sshfs 2.9" -#define PACKAGE_TARNAME "sshfs" -#define PACKAGE_URL "" -#define PACKAGE_VERSION "2.9" -/* #undef SSH_NODELAY_WORKAROUND */ -#define VERSION "2.9" +#define PACKAGE_VERSION "3.0.0" diff --git a/pkg/sshfs/gen.rc b/pkg/sshfs/gen.rc index 41839ce6..ef906919 100644 --- a/pkg/sshfs/gen.rc +++ b/pkg/sshfs/gen.rc @@ -1,11 +1,12 @@ cflags\ - -D '_FILE_OFFSET_BITS=64' \ - -D 'FUSE_USE_VERSION=26' \ + -D 'FUSE_USE_VERSION=31' \ -isystem pkg/libfuse/src/include\ -I '$dir' -build '$outdir'/sshfs.1 sed '$srcdir'/sshfs.1.in ; with\ - expr 's,__UNMOUNT_COMMAND__,''fusermount -u'',' +build '$outdir'/sshfs.1 sed '$srcdir'/sshfs.1.in ; exprs=(\ + -e 's,@UNMOUNT_COMMAND@,''fusermount3 -u'',' \ + -e 's,@IDMAP_DEFAULT@,''"none"'',' \ +) with expr $"exprs exe sshfs -d '$builddir'/pkg/libfuse/fetch.stamp\ sshfs.c nocache.c '$builddir'/pkg/libfuse/libfuse.a diff --git a/pkg/sshfs/patch/0001-Add-nocache.c-stub.patch b/pkg/sshfs/patch/0001-Add-nocache.c-stub.patch index ced0e1c4..b5737719 100644 --- a/pkg/sshfs/patch/0001-Add-nocache.c-stub.patch +++ b/pkg/sshfs/patch/0001-Add-nocache.c-stub.patch @@ -1,32 +1,21 @@ -From 1d990b641269c1b9be9e03d835444041df6cc0b8 Mon Sep 17 00:00:00 2001 +From 243d834a3d6b665bbc935278908d445f39a69100 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:13:58 -0700 Subject: [PATCH] Add nocache.c stub --- - nocache.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 94 insertions(+) + nocache.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) create mode 100644 nocache.c diff --git a/nocache.c b/nocache.c new file mode 100644 -index 0000000..58d7528 +index 0000000..7c2833e --- /dev/null +++ b/nocache.c -@@ -0,0 +1,94 @@ +@@ -0,0 +1,24 @@ +#include "cache.h" + -+struct cache { -+ struct fuse_cache_operations *next_oper; -+}; -+ -+static struct cache cache; -+ -+struct fuse_cache_dirhandle { -+ fuse_dirh_t h; -+ fuse_dirfil_t filler; -+}; -+ +void cache_invalidate(const char *path) +{ +} @@ -40,68 +29,9 @@ index 0000000..58d7528 + return 0; +} + -+static int cache_unity_dirfill(fuse_cache_dirh_t ch, const char *name, -+ const struct stat *stbuf) ++struct fuse_operations *cache_wrap(struct fuse_operations *oper) +{ -+ (void) stbuf; -+ return ch->filler(ch->h, name, 0, 0); -+} -+ -+static int cache_unity_getdir(const char *path, fuse_dirh_t h, -+ fuse_dirfil_t filler) -+{ -+ struct fuse_cache_dirhandle ch; -+ ch.h = h; -+ ch.filler = filler; -+ return cache.next_oper->cache_getdir(path, &ch, cache_unity_dirfill); -+} -+ -+static void cache_unity_fill(struct fuse_cache_operations *oper, -+ struct fuse_operations *cache_oper) -+{ -+#if FUSE_VERSION >= 23 -+ cache_oper->init = oper->oper.init; -+#endif -+ cache_oper->getattr = oper->oper.getattr; -+ cache_oper->access = oper->oper.access; -+ cache_oper->readlink = oper->oper.readlink; -+ cache_oper->getdir = cache_unity_getdir; -+ cache_oper->mknod = oper->oper.mknod; -+ cache_oper->mkdir = oper->oper.mkdir; -+ cache_oper->symlink = oper->oper.symlink; -+ cache_oper->unlink = oper->oper.unlink; -+ cache_oper->rmdir = oper->oper.rmdir; -+ cache_oper->rename = oper->oper.rename; -+ cache_oper->link = oper->oper.link; -+ cache_oper->chmod = oper->oper.chmod; -+ cache_oper->chown = oper->oper.chown; -+ cache_oper->truncate = oper->oper.truncate; -+ cache_oper->utime = oper->oper.utime; -+ cache_oper->open = oper->oper.open; -+ cache_oper->read = oper->oper.read; -+ cache_oper->write = oper->oper.write; -+ cache_oper->flush = oper->oper.flush; -+ cache_oper->release = oper->oper.release; -+ cache_oper->fsync = oper->oper.fsync; -+ cache_oper->statfs = oper->oper.statfs; -+ cache_oper->setxattr = oper->oper.setxattr; -+ cache_oper->getxattr = oper->oper.getxattr; -+ cache_oper->listxattr = oper->oper.listxattr; -+ cache_oper->removexattr = oper->oper.removexattr; -+#if FUSE_VERSION >= 25 -+ cache_oper->create = oper->oper.create; -+ cache_oper->ftruncate = oper->oper.ftruncate; -+ cache_oper->fgetattr = oper->oper.fgetattr; -+#endif -+} -+ -+struct fuse_operations *cache_init(struct fuse_cache_operations *oper) -+{ -+ static struct fuse_operations cache_oper; -+ cache.next_oper = oper; -+ -+ cache_unity_fill(oper, &cache_oper); -+ return &cache_oper; ++ return oper; +} + +int cache_parse_options(struct fuse_args *args) @@ -109,5 +39,5 @@ index 0000000..58d7528 + return 0; +} -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch b/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch index 007991ec..90f24465 100644 --- a/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch +++ b/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch @@ -1,4 +1,4 @@ -From 00c4f3a1d34c8fed239e42e5ee66bbd4e678bb7e Mon Sep 17 00:00:00 2001 +From 6ff3918c325fb7cef56c081cbaa7538435bb2f7a Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:25:36 -0700 Subject: [PATCH] Use a compact array and free list for requests @@ -8,10 +8,10 @@ Subject: [PATCH] Use a compact array and free list for requests 1 file changed, 80 insertions(+), 45 deletions(-) diff --git a/sshfs.c b/sshfs.c -index 8cde971..14a302d 100644 +index a20f727..5adb290 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -173,6 +173,17 @@ struct request { +@@ -171,6 +171,17 @@ struct request { struct list_head list; }; @@ -29,7 +29,7 @@ index 8cde971..14a302d 100644 struct sshfs_io { int num_reqs; pthread_cond_t finished; -@@ -247,7 +258,7 @@ struct sshfs { +@@ -249,7 +260,7 @@ struct sshfs { int slave; char *host; char *base_path; @@ -38,7 +38,7 @@ index 8cde971..14a302d 100644 pthread_mutex_t lock; pthread_mutex_t lock_write; int processing_thread_started; -@@ -1243,12 +1254,6 @@ static int do_write(struct iovec *iov, size_t count) +@@ -1149,12 +1160,6 @@ static int do_write(struct iovec *iov, size_t count) return 0; } @@ -51,7 +51,7 @@ index 8cde971..14a302d 100644 static void buf_to_iov(const struct buffer *buf, struct iovec *iov) { iov->iov_base = buf->p; -@@ -1341,6 +1346,43 @@ static void request_free(struct request *req) +@@ -1247,6 +1252,43 @@ static void request_free(struct request *req) g_free(req); } @@ -95,7 +95,7 @@ index 8cde971..14a302d 100644 static void chunk_free(struct read_chunk *chunk) { while (!list_empty(&chunk->reqs)) { -@@ -1370,21 +1412,6 @@ static void chunk_put_locked(struct read_chunk *chunk) +@@ -1276,21 +1318,6 @@ static void chunk_put_locked(struct read_chunk *chunk) pthread_mutex_unlock(&sshfs.lock); } @@ -117,7 +117,7 @@ index 8cde971..14a302d 100644 static int process_one_request(void) { int res; -@@ -1401,8 +1428,7 @@ static int process_one_request(void) +@@ -1307,8 +1334,7 @@ static int process_one_request(void) return -1; pthread_mutex_lock(&sshfs.lock); @@ -127,7 +127,7 @@ index 8cde971..14a302d 100644 if (req == NULL) fprintf(stderr, "request %i not found\n", id); else { -@@ -1414,7 +1440,7 @@ static int process_one_request(void) +@@ -1320,7 +1346,7 @@ static int process_one_request(void) sshfs.outstanding_len <= sshfs.max_outstanding_len) { pthread_cond_broadcast(&sshfs.outstanding_cond); } @@ -136,7 +136,7 @@ index 8cde971..14a302d 100644 } pthread_mutex_unlock(&sshfs.lock); if (req != NULL) { -@@ -1475,6 +1501,9 @@ static void close_conn(void) +@@ -1381,6 +1407,9 @@ static void close_conn(void) static void *process_requests(void *data_) { @@ -146,7 +146,7 @@ index 8cde971..14a302d 100644 (void) data_; while (1) { -@@ -1485,7 +1514,20 @@ static void *process_requests(void *data_) +@@ -1391,7 +1420,20 @@ static void *process_requests(void *data_) pthread_mutex_lock(&sshfs.lock); sshfs.processing_thread_started = 0; close_conn(); @@ -168,7 +168,7 @@ index 8cde971..14a302d 100644 sshfs.connver ++; sshfs.outstanding_len = 0; pthread_cond_broadcast(&sshfs.outstanding_cond); -@@ -1633,7 +1675,6 @@ static int sftp_error_to_errno(uint32_t error) +@@ -1539,7 +1581,6 @@ static int sftp_error_to_errno(uint32_t error) static void sftp_detect_uid() { int flags; @@ -176,7 +176,7 @@ index 8cde971..14a302d 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1643,7 +1684,7 @@ static void sftp_detect_uid() +@@ -1549,7 +1590,7 @@ static void sftp_detect_uid() buf_init(&buf, 5); buf_add_string(&buf, "."); buf_to_iov(&buf, &iov[0]); @@ -185,7 +185,7 @@ index 8cde971..14a302d 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1654,7 +1695,7 @@ static void sftp_detect_uid() +@@ -1560,7 +1601,7 @@ static void sftp_detect_uid() } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -194,7 +194,7 @@ index 8cde971..14a302d 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1691,7 +1732,6 @@ out: +@@ -1597,7 +1638,6 @@ out: static int sftp_check_root(const char *base_path) { int flags; @@ -202,7 +202,7 @@ index 8cde971..14a302d 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1703,7 +1743,7 @@ static int sftp_check_root(const char *base_path) +@@ -1609,7 +1649,7 @@ static int sftp_check_root(const char *base_path) buf_init(&buf, 0); buf_add_string(&buf, remote_dir); buf_to_iov(&buf, &iov[0]); @@ -211,7 +211,7 @@ index 8cde971..14a302d 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1714,7 +1754,7 @@ static int sftp_check_root(const char *base_path) +@@ -1620,7 +1660,7 @@ static int sftp_check_root(const char *base_path) } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -220,7 +220,7 @@ index 8cde971..14a302d 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1905,7 +1945,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1819,7 +1859,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, struct request **reqp) { int err; @@ -228,7 +228,7 @@ index 8cde971..14a302d 100644 struct request *req = g_new0(struct request, 1); req->want_reply = want_reply; -@@ -1916,8 +1955,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1830,8 +1869,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, pthread_mutex_lock(&sshfs.lock); if (begin_func) begin_func(req); @@ -237,7 +237,7 @@ index 8cde971..14a302d 100644 err = start_processing_thread(); if (err) { pthread_mutex_unlock(&sshfs.lock); -@@ -1928,21 +1965,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1842,21 +1879,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, while (sshfs.outstanding_len > sshfs.max_outstanding_len) pthread_cond_wait(&sshfs.outstanding_cond, &sshfs.lock); @@ -266,7 +266,7 @@ index 8cde971..14a302d 100644 pthread_mutex_unlock(&sshfs.lock); if (!rmed && !want_reply) { -@@ -2132,7 +2172,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle) +@@ -2029,7 +2069,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle) static int sshfs_req_pending(struct request *req) { @@ -275,7 +275,7 @@ index 8cde971..14a302d 100644 return 1; else return 0; -@@ -3338,11 +3378,6 @@ static int processing_init(void) +@@ -3277,11 +3317,6 @@ static int processing_init(void) pthread_mutex_init(&sshfs.lock, NULL); pthread_mutex_init(&sshfs.lock_write, NULL); pthread_cond_init(&sshfs.outstanding_cond, NULL); @@ -288,5 +288,5 @@ index 8cde971..14a302d 100644 } -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch b/pkg/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch index 422b892e..18089b1b 100644 --- a/pkg/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch +++ b/pkg/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch @@ -1,4 +1,4 @@ -From 2a59f8d0b96d24dd3dc297ccc9ec6fa146c765d7 Mon Sep 17 00:00:00 2001 +From 99b77e751af9ae7f0a1395f93aae8b885706c859 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:28:40 -0700 Subject: [PATCH] Use bool instead of gboolean @@ -8,7 +8,7 @@ Subject: [PATCH] Use bool instead of gboolean 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sshfs.c b/sshfs.c -index 14a302d..fc4b775 100644 +index 5adb290..6c4272b 100644 --- a/sshfs.c +++ b/sshfs.c @@ -18,6 +18,7 @@ @@ -19,7 +19,7 @@ index 14a302d..fc4b775 100644 #include <stdio.h> #include <stdlib.h> #include <unistd.h> -@@ -1977,7 +1978,7 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1891,7 +1892,7 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, err = -EIO; if (sftp_send_iov(type, req->id, iov, count) == -1) { @@ -29,5 +29,5 @@ index 14a302d..fc4b775 100644 pthread_mutex_lock(&sshfs.lock); rmed = !!request_table_lookup(&sshfs.reqtab, req->id); -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch b/pkg/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch index e04e67c7..9cc8fa37 100644 --- a/pkg/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch +++ b/pkg/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch @@ -1,4 +1,4 @@ -From 3fb50aef5d683e8101fe1025cfa62f381487628c Mon Sep 17 00:00:00 2001 +From 0999525da1aa7c5c32f64df50f741dc0861e12de Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:30:20 -0700 Subject: [PATCH] Use struct list_head instead of GList @@ -8,12 +8,12 @@ Subject: [PATCH] Use struct list_head instead of GList 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sshfs.c b/sshfs.c -index fc4b775..3c69852 100644 +index 6c4272b..6958a2a 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -2182,13 +2182,13 @@ static int sshfs_req_pending(struct request *req) - static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, - fuse_cache_dirfil_t filler) +@@ -2079,14 +2079,14 @@ static int sshfs_req_pending(struct request *req) + static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset, + fuse_fill_dir_t filler) { + int done = 0; int err = 0; @@ -24,11 +24,12 @@ index fc4b775..3c69852 100644 - int done = 0; + struct list_head list; + assert(offset == 0); + list_init(&list); while (!done || outstanding) { struct request *req; struct buffer name; -@@ -2203,16 +2203,14 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, +@@ -2101,16 +2101,14 @@ static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset, break; } @@ -48,7 +49,7 @@ index fc4b775..3c69852 100644 outstanding--; if (done) { -@@ -2246,7 +2244,7 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, +@@ -2144,7 +2142,7 @@ static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset, } } } @@ -58,5 +59,5 @@ index fc4b775..3c69852 100644 return err; } -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0005-Use-standard-C-functions.patch b/pkg/sshfs/patch/0005-Use-standard-C-functions.patch index f85f34ea..fae6393d 100644 --- a/pkg/sshfs/patch/0005-Use-standard-C-functions.patch +++ b/pkg/sshfs/patch/0005-Use-standard-C-functions.patch @@ -1,17 +1,17 @@ -From 71bb2f5ed36aa61bf9891948cc83ef5bbafa69ca Mon Sep 17 00:00:00 2001 +From 2ac64fcc424a0883ef988d46eea9add27ec9cc8a Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:42:29 -0700 Subject: [PATCH] Use standard C functions --- - sshfs.c | 101 ++++++++++++++++++++++++++++++++++++++-------------------------- - 1 file changed, 60 insertions(+), 41 deletions(-) + sshfs.c | 89 +++++++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/sshfs.c b/sshfs.c -index 3c69852..e4a44f1 100644 +index 6958a2a..2e7429b 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -639,25 +639,25 @@ static inline void buf_add_path(struct buffer *buf, const char *path) +@@ -647,25 +647,25 @@ static inline void buf_add_path(struct buffer *buf, const char *path) if (sshfs.base_path[0]) { if (path[1]) { if (sshfs.base_path[strlen(sshfs.base_path)-1] != '/') { @@ -47,30 +47,7 @@ index 3c69852..e4a44f1 100644 } static int buf_check_get(struct buffer *buf, size_t len) -@@ -950,10 +950,9 @@ nobundle: - pathok: - #endif - -- newpreload = g_strdup_printf("%s%s%s", -- oldpreload ? oldpreload : "", -- oldpreload ? " " : "", -- sopath); -+ if (asprintf(&newpreload, "%s%s%s", -+ oldpreload ? oldpreload : "", oldpreload ? " " : "", sopath) < 0) -+ abort(); - - #ifdef __APPLE__ - if (!newpreload || setenv("DYLD_INSERT_LIBRARIES", newpreload, 1) == -1) -@@ -964,7 +963,7 @@ pathok: - "for ssh nodelay workaround\n"); - } - #endif /* __APPLE__ */ -- g_free(newpreload); -+ free(newpreload); - return 0; - } - #endif -@@ -1344,7 +1343,7 @@ static void request_free(struct request *req) +@@ -1250,7 +1250,7 @@ static void request_free(struct request *req) { buf_free(&req->reply); sem_destroy(&req->ready); @@ -79,7 +56,7 @@ index 3c69852..e4a44f1 100644 } static int request_table_insert(struct request_table *reqtab, struct request *req) -@@ -1392,9 +1391,9 @@ static void chunk_free(struct read_chunk *chunk) +@@ -1298,9 +1298,9 @@ static void chunk_free(struct read_chunk *chunk) rreq = list_entry(chunk->reqs.prev, struct read_req, list); list_del(&rreq->list); buf_free(&rreq->data); @@ -91,7 +68,7 @@ index 3c69852..e4a44f1 100644 } static void chunk_put(struct read_chunk *chunk) -@@ -1946,8 +1945,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1860,8 +1860,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, struct request **reqp) { int err; @@ -103,7 +80,7 @@ index 3c69852..e4a44f1 100644 req->want_reply = want_reply; req->end_func = end_func; req->data = data; -@@ -2588,7 +2589,9 @@ static int sshfs_open_common(const char *path, mode_t mode, +@@ -2552,7 +2554,9 @@ static int sshfs_open_common(const char *path, mode_t mode, if (fi->flags & O_TRUNC) pflags |= SSH_FXF_TRUNC; @@ -114,16 +91,16 @@ index 3c69852..e4a44f1 100644 list_init(&sf->write_reqs); pthread_cond_init(&sf->write_finished, NULL); /* Assume random read after open */ -@@ -2630,7 +2633,7 @@ static int sshfs_open_common(const char *path, mode_t mode, - fi->fh = (unsigned long) sf; +@@ -2596,7 +2600,7 @@ static int sshfs_open_common(const char *path, mode_t mode, } else { - cache_invalidate(path); + if (sshfs.dir_cache) + cache_invalidate(path); - g_free(sf); + free(sf); } buf_free(&buf); return err; -@@ -2703,7 +2706,7 @@ static void sshfs_file_put(struct sshfs_file *sf) +@@ -2663,7 +2667,7 @@ static void sshfs_file_put(struct sshfs_file *sf) { sf->refs--; if (!sf->refs) @@ -132,7 +109,7 @@ index 3c69852..e4a44f1 100644 } static void sshfs_file_get(struct sshfs_file *sf) -@@ -2773,9 +2776,11 @@ static void sshfs_read_begin(struct request *req) +@@ -2733,9 +2737,11 @@ static void sshfs_read_begin(struct request *req) static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, off_t offset) { @@ -145,7 +122,7 @@ index 3c69852..e4a44f1 100644 pthread_cond_init(&chunk->sio.finished, NULL); list_init(&chunk->reqs); chunk->size = size; -@@ -2789,7 +2794,9 @@ static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, +@@ -2749,7 +2755,9 @@ static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, struct read_req *rreq; size_t bsize = size < sshfs.max_read ? size : sshfs.max_read; @@ -156,7 +133,7 @@ index 3c69852..e4a44f1 100644 rreq->sio = &chunk->sio; rreq->size = bsize; buf_init(&rreq->data, 0); -@@ -2860,7 +2867,7 @@ static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) +@@ -2820,7 +2828,7 @@ static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) size -= rreq->res; list_del(&rreq->list); buf_free(&rreq->data); @@ -165,7 +142,7 @@ index 3c69852..e4a44f1 100644 } } -@@ -3515,9 +3522,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3436,9 +3444,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, switch (key) { case FUSE_OPT_KEY_OPT: if (is_ssh_opt(arg)) { @@ -177,9 +154,9 @@ index 3c69852..e4a44f1 100644 + free(tmp); return 0; } - return 1; -@@ -3530,9 +3538,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, - return 1; + /* Pass through */ +@@ -3463,9 +3472,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, + case KEY_PORT: - tmp = g_strdup_printf("-oPort=%s", arg + 2); @@ -191,7 +168,7 @@ index 3c69852..e4a44f1 100644 return 0; case KEY_COMPRESS: -@@ -3540,9 +3549,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3473,9 +3483,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, return 0; case KEY_CONFIGFILE: @@ -203,9 +180,9 @@ index 3c69852..e4a44f1 100644 + free(tmp); return 0; - case KEY_HELP: -@@ -3757,17 +3767,19 @@ static void fsname_remove_commas(char *fsname) - #if FUSE_VERSION >= 27 + default: +@@ -3631,17 +3642,19 @@ static char *find_base_path(void) + static char *fsname_escape_commas(char *fsnameold) { - char *fsname = g_malloc(strlen(fsnameold) * 2 + 1); @@ -226,9 +203,9 @@ index 3c69852..e4a44f1 100644 return fsname; } -@@ -4088,15 +4100,20 @@ int main(int argc, char *argv[]) - exit(1); - } +@@ -3978,15 +3991,20 @@ int main(int argc, char *argv[]) + else + sshfs.max_outstanding_len = ~0; - fsname = g_strdup(sshfs.host); - sshfs.base_path = g_strdup(find_base_path()); @@ -251,27 +228,21 @@ index 3c69852..e4a44f1 100644 ssh_add_arg(sshfs.host); if (sshfs.sftp_server) sftp_server = sshfs.sftp_server; -@@ -4132,14 +4149,16 @@ int main(int argc, char *argv[]) - fsname = fsname_escape_commas(fsname); - else - fsname_remove_commas(fsname); +@@ -4013,10 +4031,11 @@ int main(int argc, char *argv[]) + sshfs.max_write = 65536; + + fsname = fsname_escape_commas(fsname); - tmp = g_strdup_printf("-osubtype=sshfs,fsname=%s", fsname); + if (asprintf(&tmp, "-osubtype=sshfs,fsname=%s", fsname) < 0) + abort(); - #else - fsname_remove_commas(fsname); -- tmp = g_strdup_printf("-ofsname=sshfs#%s", fsname); -+ if (asprintf(&tmp, "-ofsname=sshfs#%s", fsname) < 0) -+ abort(); - #endif fuse_opt_insert_arg(&args, 1, tmp); - g_free(tmp); - g_free(fsname); + free(tmp); + free(fsname); - check_large_read(&args); - #if FUSE_VERSION >= 26 + + #if !defined(__CYGWIN__) -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0006-Add-missing-includes.patch b/pkg/sshfs/patch/0006-Add-missing-includes.patch index 17395add..29dc4f03 100644 --- a/pkg/sshfs/patch/0006-Add-missing-includes.patch +++ b/pkg/sshfs/patch/0006-Add-missing-includes.patch @@ -1,4 +1,4 @@ -From dd47e1904e2b7f7359008743769a02a77b4611e2 Mon Sep 17 00:00:00 2001 +From 82b0a628df4a8190fc7db8342f8360f6da8c7067 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 18:21:02 -0700 Subject: [PATCH] Add missing includes @@ -10,7 +10,7 @@ sys/param.h for MIN 1 file changed, 2 insertions(+) diff --git a/sshfs.c b/sshfs.c -index e4a44f1..dcc3707 100644 +index 2e7429b..04f1892 100644 --- a/sshfs.c +++ b/sshfs.c @@ -19,6 +19,7 @@ @@ -30,5 +30,5 @@ index e4a44f1..dcc3707 100644 #include <netinet/in.h> #include <netinet/tcp.h> -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch b/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch index 9ecac7ad..9578d8d1 100644 --- a/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch +++ b/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch @@ -1,4 +1,4 @@ -From b35559e8decc8440ed5712c3a74c225946864f38 Mon Sep 17 00:00:00 2001 +From 8cc018747c2ecc882484c3c58015453a6d267aeb Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 18:24:16 -0700 Subject: [PATCH] Disable uidmap and gidmap support @@ -8,11 +8,11 @@ Subject: [PATCH] Disable uidmap and gidmap support 1 file changed, 16 insertions(+) diff --git a/sshfs.c b/sshfs.c -index dcc3707..0b12ef6 100644 +index 04f1892..e027265 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -244,10 +244,12 @@ struct sshfs { - int disable_hardlink; +@@ -246,10 +246,12 @@ struct sshfs { + char *mountpoint; char *uid_file; char *gid_file; +#if 0 @@ -24,7 +24,7 @@ index dcc3707..0b12ef6 100644 unsigned max_read; unsigned max_write; unsigned ssh_ver; -@@ -368,7 +370,9 @@ enum { +@@ -382,7 +384,9 @@ enum { enum { IDMAP_NONE, IDMAP_USER, @@ -34,7 +34,7 @@ index dcc3707..0b12ef6 100644 }; enum { -@@ -389,7 +393,9 @@ static struct fuse_opt sshfs_opts[] = { +@@ -403,7 +407,9 @@ static struct fuse_opt sshfs_opts[] = { SSHFS_OPT("workaround=%s", workarounds, 0), SSHFS_OPT("idmap=none", idmap, IDMAP_NONE), SSHFS_OPT("idmap=user", idmap, IDMAP_USER), @@ -44,7 +44,7 @@ index dcc3707..0b12ef6 100644 SSHFS_OPT("uidfile=%s", uid_file, 0), SSHFS_OPT("gidfile=%s", gid_file, 0), SSHFS_OPT("nomap=ignore", nomap, NOMAP_IGNORE), -@@ -522,6 +528,7 @@ static int list_empty(const struct list_head *head) +@@ -530,6 +536,7 @@ static int list_empty(const struct list_head *head) return head->next == head; } @@ -52,7 +52,7 @@ index dcc3707..0b12ef6 100644 /* given a pointer to the uid/gid, and the mapping table, remap the * uid/gid, if necessary */ static inline int translate_id(uint32_t *id, GHashTable *map) -@@ -539,6 +546,7 @@ static inline int translate_id(uint32_t *id, GHashTable *map) +@@ -547,6 +554,7 @@ static inline int translate_id(uint32_t *id, GHashTable *map) abort(); } } @@ -60,7 +60,7 @@ index dcc3707..0b12ef6 100644 static inline void buf_init(struct buffer *buf, size_t size) { -@@ -786,12 +794,14 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp) +@@ -794,12 +802,14 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp) if (sshfs.remote_uid_detected && uid == sshfs.remote_uid) uid = sshfs.local_uid; #endif /* __APPLE__ */ @@ -75,7 +75,7 @@ index dcc3707..0b12ef6 100644 memset(stbuf, 0, sizeof(struct stat)); stbuf->st_mode = mode; -@@ -2488,12 +2498,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid) +@@ -2459,12 +2469,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid, if (sshfs.remote_uid_detected && uid == sshfs.local_uid) uid = sshfs.remote_uid; #endif /* __APPLE__ */ @@ -89,8 +89,8 @@ index dcc3707..0b12ef6 100644 +#endif buf_init(&buf, 0); - buf_add_path(&buf, path); -@@ -3807,6 +3819,7 @@ static int ssh_connect(void) + if (sf == NULL) +@@ -3681,6 +3693,7 @@ static int ssh_connect(void) return 0; } @@ -98,7 +98,7 @@ index dcc3707..0b12ef6 100644 /* number of ':' separated fields in a passwd/group file that we care * about */ #define IDMAP_FIELDS 3 -@@ -3981,6 +3994,7 @@ static inline void load_gid_map(void) +@@ -3855,6 +3868,7 @@ static inline void load_gid_map(void) { read_id_map(sshfs.gid_file, &groupname_to_gid, "gid", &sshfs.gid_map, &sshfs.r_gid_map); } @@ -106,15 +106,15 @@ index dcc3707..0b12ef6 100644 #ifdef __APPLE__ int main(int argc, char *argv[], __unused char *envp[], char **exec_path) -@@ -4053,6 +4067,7 @@ int main(int argc, char *argv[]) - +@@ -3947,6 +3961,7 @@ int main(int argc, char *argv[]) + if (sshfs.idmap == IDMAP_USER) sshfs.detect_uid = 1; +#if 0 else if (sshfs.idmap == IDMAP_FILE) { sshfs.uid_map = NULL; sshfs.gid_map = NULL; -@@ -4067,6 +4082,7 @@ int main(int argc, char *argv[]) +@@ -3961,6 +3976,7 @@ int main(int argc, char *argv[]) if (sshfs.gid_file) load_gid_map(); } @@ -123,5 +123,5 @@ index dcc3707..0b12ef6 100644 free(sshfs.gid_file); -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch b/pkg/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch index 914ec726..24cffb94 100644 --- a/pkg/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch +++ b/pkg/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch @@ -1,14 +1,14 @@ -From 4bbbae8849274c24b3fdbd938876ef0c1afa47f7 Mon Sep 17 00:00:00 2001 +From cabb791c3fb5f73b12132f8236216f508d4612bb Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 18:24:31 -0700 Subject: [PATCH] Remove remaining uses of glib --- - sshfs.c | 2 -- - 1 file changed, 2 deletions(-) + sshfs.c | 1 - + 1 file changed, 1 deletion(-) diff --git a/sshfs.c b/sshfs.c -index 0b12ef6..2b274bd 100644 +index e027265..b035d65 100644 --- a/sshfs.c +++ b/sshfs.c @@ -44,7 +44,6 @@ @@ -19,14 +19,6 @@ index 0b12ef6..2b274bd 100644 #include <pwd.h> #include <grp.h> #include <limits.h> -@@ -4014,7 +4013,6 @@ int main(int argc, char *argv[]) - memset(sshfs_program_path, 0, PATH_MAX); - } - #endif /* __APPLE__ */ -- g_thread_init(NULL); - - sshfs.blksize = 4096; - /* SFTP spec says all servers should allow at least 32k I/O */ -- -2.13.1 +2.13.2 diff --git a/pkg/sshfs/patch/0009-Fix-poll.h-include.patch b/pkg/sshfs/patch/0009-Fix-poll.h-include.patch new file mode 100644 index 00000000..c7e5cd9e --- /dev/null +++ b/pkg/sshfs/patch/0009-Fix-poll.h-include.patch @@ -0,0 +1,25 @@ +From a884734005e08d9e9f65d12c51a7795cab3da8a1 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 9 Jul 2017 02:20:20 -0700 +Subject: [PATCH] Fix poll.h include + +--- + sshfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sshfs.c b/sshfs.c +index b035d65..ab5bfd8 100644 +--- a/sshfs.c ++++ b/sshfs.c +@@ -41,7 +41,7 @@ + #include <sys/utsname.h> + #include <sys/mman.h> + #include <sys/param.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <netinet/in.h> + #include <netinet/tcp.h> + #include <pwd.h> +-- +2.13.2 + diff --git a/pkg/sshfs/rev b/pkg/sshfs/rev index 0cfbf088..00750edc 100644 --- a/pkg/sshfs/rev +++ b/pkg/sshfs/rev @@ -1 +1 @@ -2 +3 diff --git a/pkg/sshfs/src b/pkg/sshfs/src -Subproject 1dbda317865c49825de733e210fc6119d3ee157 +Subproject ff6194b5c76e4b0a9d522e5d93efbfab0b23d2d |
