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/patch/0005-Use-standard-C-functions.patch | |
| parent | 6b71e5c2419c75c14223196e1fe65cbf8f4ba026 (diff) | |
libfuse, sshfs: Update to 3.1.0, 3.0.0
Diffstat (limited to 'pkg/sshfs/patch/0005-Use-standard-C-functions.patch')
| -rw-r--r-- | pkg/sshfs/patch/0005-Use-standard-C-functions.patch | 97 |
1 files changed, 34 insertions, 63 deletions
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 |
