diff options
| author | Michael Forney <mforney@mforney.org> | 2016-06-23 23:26:32 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-06-23 23:26:32 -0700 |
| commit | 663d3abf3e87c0d93128b976d100bb0563ba5052 (patch) | |
| tree | e836953bf5bd54312ada2d6e332aba47e3c71e03 /extra/sshfs/patch | |
| parent | 95692a3a31be1395557e507b090670f4910ded14 (diff) | |
sshfs: Update to 2.8
Diffstat (limited to 'extra/sshfs/patch')
8 files changed, 77 insertions, 77 deletions
diff --git a/extra/sshfs/patch/0001-Add-nocache.c-stub.patch b/extra/sshfs/patch/0001-Add-nocache.c-stub.patch index 18d5a503..3f6669d6 100644 --- a/extra/sshfs/patch/0001-Add-nocache.c-stub.patch +++ b/extra/sshfs/patch/0001-Add-nocache.c-stub.patch @@ -1,4 +1,4 @@ -From 22ee03791d23693b273fa1489aabebca169a91c9 Mon Sep 17 00:00:00 2001 +From d58fbf8ca4a9a72ad8d72c7a6a4d765b419122f6 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 @@ -109,5 +109,5 @@ index 0000000..58d7528 + return 0; +} -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch b/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch index f7b4da93..43128eb2 100644 --- a/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch +++ b/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch @@ -1,4 +1,4 @@ -From fff5db303ec32476cf1457a1388110820b0b53e5 Mon Sep 17 00:00:00 2001 +From 820d2b71f49667fe5459f5cb4be8240c3ce5ae8a 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 ce30a0f..99dcc25 100644 +index f41d987..32db6f4 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -170,6 +170,17 @@ struct request { +@@ -171,6 +171,17 @@ struct request { struct list_head list; }; @@ -29,7 +29,7 @@ index ce30a0f..99dcc25 100644 struct sshfs_io { int num_reqs; pthread_cond_t finished; -@@ -244,7 +255,7 @@ struct sshfs { +@@ -245,7 +256,7 @@ struct sshfs { int slave; char *host; char *base_path; @@ -38,7 +38,7 @@ index ce30a0f..99dcc25 100644 pthread_mutex_t lock; pthread_mutex_t lock_write; int processing_thread_started; -@@ -1239,12 +1250,6 @@ static int do_write(struct iovec *iov, size_t count) +@@ -1241,12 +1252,6 @@ static int do_write(struct iovec *iov, size_t count) return 0; } @@ -51,7 +51,7 @@ index ce30a0f..99dcc25 100644 static void buf_to_iov(const struct buffer *buf, struct iovec *iov) { iov->iov_base = buf->p; -@@ -1337,6 +1342,43 @@ static void request_free(struct request *req) +@@ -1339,6 +1344,43 @@ static void request_free(struct request *req) g_free(req); } @@ -95,7 +95,7 @@ index ce30a0f..99dcc25 100644 static void chunk_free(struct read_chunk *chunk) { while (!list_empty(&chunk->reqs)) { -@@ -1366,21 +1408,6 @@ static void chunk_put_locked(struct read_chunk *chunk) +@@ -1368,21 +1410,6 @@ static void chunk_put_locked(struct read_chunk *chunk) pthread_mutex_unlock(&sshfs.lock); } @@ -117,7 +117,7 @@ index ce30a0f..99dcc25 100644 static int process_one_request(void) { int res; -@@ -1397,8 +1424,7 @@ static int process_one_request(void) +@@ -1399,8 +1426,7 @@ static int process_one_request(void) return -1; pthread_mutex_lock(&sshfs.lock); @@ -127,7 +127,7 @@ index ce30a0f..99dcc25 100644 if (req == NULL) fprintf(stderr, "request %i not found\n", id); else { -@@ -1410,7 +1436,7 @@ static int process_one_request(void) +@@ -1412,7 +1438,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 ce30a0f..99dcc25 100644 } pthread_mutex_unlock(&sshfs.lock); if (req != NULL) { -@@ -1471,6 +1497,9 @@ static void close_conn(void) +@@ -1473,6 +1499,9 @@ static void close_conn(void) static void *process_requests(void *data_) { @@ -146,7 +146,7 @@ index ce30a0f..99dcc25 100644 (void) data_; while (1) { -@@ -1481,7 +1510,20 @@ static void *process_requests(void *data_) +@@ -1483,7 +1512,20 @@ static void *process_requests(void *data_) pthread_mutex_lock(&sshfs.lock); sshfs.processing_thread_started = 0; close_conn(); @@ -168,7 +168,7 @@ index ce30a0f..99dcc25 100644 sshfs.connver ++; sshfs.outstanding_len = 0; pthread_cond_broadcast(&sshfs.outstanding_cond); -@@ -1626,7 +1668,6 @@ static int sftp_error_to_errno(uint32_t error) +@@ -1631,7 +1673,6 @@ static int sftp_error_to_errno(uint32_t error) static void sftp_detect_uid() { int flags; @@ -176,7 +176,7 @@ index ce30a0f..99dcc25 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1636,7 +1677,7 @@ static void sftp_detect_uid() +@@ -1641,7 +1682,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 ce30a0f..99dcc25 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1647,7 +1688,7 @@ static void sftp_detect_uid() +@@ -1652,7 +1693,7 @@ static void sftp_detect_uid() } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -194,7 +194,7 @@ index ce30a0f..99dcc25 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1684,7 +1725,6 @@ out: +@@ -1689,7 +1730,6 @@ out: static int sftp_check_root(const char *base_path) { int flags; @@ -202,7 +202,7 @@ index ce30a0f..99dcc25 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1696,7 +1736,7 @@ static int sftp_check_root(const char *base_path) +@@ -1701,7 +1741,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 ce30a0f..99dcc25 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1707,7 +1747,7 @@ static int sftp_check_root(const char *base_path) +@@ -1712,7 +1752,7 @@ static int sftp_check_root(const char *base_path) } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -220,7 +220,7 @@ index ce30a0f..99dcc25 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1898,7 +1938,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1903,7 +1943,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 ce30a0f..99dcc25 100644 struct request *req = g_new0(struct request, 1); req->want_reply = want_reply; -@@ -1909,8 +1948,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1914,8 +1953,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 ce30a0f..99dcc25 100644 err = start_processing_thread(); if (err) { pthread_mutex_unlock(&sshfs.lock); -@@ -1921,21 +1958,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1926,21 +1963,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 ce30a0f..99dcc25 100644 pthread_mutex_unlock(&sshfs.lock); if (!rmed && !want_reply) { -@@ -2125,7 +2165,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle) +@@ -2130,7 +2170,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 ce30a0f..99dcc25 100644 return 1; else return 0; -@@ -3314,11 +3354,6 @@ static int processing_init(void) +@@ -3336,11 +3376,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 ce30a0f..99dcc25 100644 } -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch b/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch index 01269089..39d1e544 100644 --- a/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch +++ b/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch @@ -1,4 +1,4 @@ -From d5a42cdc54068a731cd6a3803574dee4056e84fa Mon Sep 17 00:00:00 2001 +From b8324473e35fbcfec302955456f545572521872b 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 99dcc25..6836cf4 100644 +index 32db6f4..f43ae5a 100644 --- a/sshfs.c +++ b/sshfs.c @@ -16,6 +16,7 @@ @@ -19,7 +19,7 @@ index 99dcc25..6836cf4 100644 #include <stdio.h> #include <stdlib.h> #include <unistd.h> -@@ -1970,7 +1971,7 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1975,7 +1976,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 99dcc25..6836cf4 100644 pthread_mutex_lock(&sshfs.lock); rmed = !!request_table_lookup(&sshfs.reqtab, req->id); -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch b/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch index 95db227b..d028a336 100644 --- a/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch +++ b/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch @@ -1,4 +1,4 @@ -From b119ab7e98c0ae325027c47515f9d360c9c10800 Mon Sep 17 00:00:00 2001 +From 7b8c2f9e7484db2031ff1190b85be085524dfe2b 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,10 +8,10 @@ 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 6836cf4..bb792ab 100644 +index f43ae5a..14adca5 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -2175,13 +2175,13 @@ static int sshfs_req_pending(struct request *req) +@@ -2180,13 +2180,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) { @@ -28,7 +28,7 @@ index 6836cf4..bb792ab 100644 while (!done || outstanding) { struct request *req; struct buffer name; -@@ -2196,16 +2196,14 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, +@@ -2201,16 +2201,14 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, break; } @@ -48,7 +48,7 @@ index 6836cf4..bb792ab 100644 outstanding--; if (done) { -@@ -2239,7 +2237,7 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, +@@ -2244,7 +2242,7 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h, } } } @@ -58,5 +58,5 @@ index 6836cf4..bb792ab 100644 return err; } -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0005-Use-standard-C-functions.patch b/extra/sshfs/patch/0005-Use-standard-C-functions.patch index e81f7cf2..e58cc29a 100644 --- a/extra/sshfs/patch/0005-Use-standard-C-functions.patch +++ b/extra/sshfs/patch/0005-Use-standard-C-functions.patch @@ -1,4 +1,4 @@ -From 6dd86c99ca057cd7a2c8450e7baa7ab69e8e0501 Mon Sep 17 00:00:00 2001 +From 4714c177e2fde09cfa76609ccaf9c72d62f39bfd 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 @@ -8,10 +8,10 @@ Subject: [PATCH] Use standard C functions 1 file changed, 60 insertions(+), 41 deletions(-) diff --git a/sshfs.c b/sshfs.c -index bb792ab..22c18a7 100644 +index 14adca5..4f3bfe4 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -635,25 +635,25 @@ static inline void buf_add_path(struct buffer *buf, const char *path) +@@ -637,25 +637,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,7 +47,7 @@ index bb792ab..22c18a7 100644 } static int buf_check_get(struct buffer *buf, size_t len) -@@ -946,10 +946,9 @@ nobundle: +@@ -948,10 +948,9 @@ nobundle: pathok: #endif @@ -61,7 +61,7 @@ index bb792ab..22c18a7 100644 #ifdef __APPLE__ if (!newpreload || setenv("DYLD_INSERT_LIBRARIES", newpreload, 1) == -1) -@@ -960,7 +959,7 @@ pathok: +@@ -962,7 +961,7 @@ pathok: "for ssh nodelay workaround\n"); } #endif /* __APPLE__ */ @@ -70,7 +70,7 @@ index bb792ab..22c18a7 100644 return 0; } #endif -@@ -1340,7 +1339,7 @@ static void request_free(struct request *req) +@@ -1342,7 +1341,7 @@ static void request_free(struct request *req) { buf_free(&req->reply); sem_destroy(&req->ready); @@ -79,7 +79,7 @@ index bb792ab..22c18a7 100644 } static int request_table_insert(struct request_table *reqtab, struct request *req) -@@ -1388,9 +1387,9 @@ static void chunk_free(struct read_chunk *chunk) +@@ -1390,9 +1389,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 +91,7 @@ index bb792ab..22c18a7 100644 } static void chunk_put(struct read_chunk *chunk) -@@ -1939,8 +1938,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1944,8 +1943,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, struct request **reqp) { int err; @@ -103,7 +103,7 @@ index bb792ab..22c18a7 100644 req->want_reply = want_reply; req->end_func = end_func; req->data = data; -@@ -2581,7 +2582,9 @@ static int sshfs_open_common(const char *path, mode_t mode, +@@ -2586,7 +2587,9 @@ static int sshfs_open_common(const char *path, mode_t mode, if (fi->flags & O_TRUNC) pflags |= SSH_FXF_TRUNC; @@ -114,7 +114,7 @@ index bb792ab..22c18a7 100644 list_init(&sf->write_reqs); pthread_cond_init(&sf->write_finished, NULL); /* Assume random read after open */ -@@ -2623,7 +2626,7 @@ static int sshfs_open_common(const char *path, mode_t mode, +@@ -2628,7 +2631,7 @@ static int sshfs_open_common(const char *path, mode_t mode, fi->fh = (unsigned long) sf; } else { cache_invalidate(path); @@ -123,7 +123,7 @@ index bb792ab..22c18a7 100644 } buf_free(&buf); return err; -@@ -2679,7 +2682,7 @@ static void sshfs_file_put(struct sshfs_file *sf) +@@ -2701,7 +2704,7 @@ static void sshfs_file_put(struct sshfs_file *sf) { sf->refs--; if (!sf->refs) @@ -132,7 +132,7 @@ index bb792ab..22c18a7 100644 } static void sshfs_file_get(struct sshfs_file *sf) -@@ -2749,9 +2752,11 @@ static void sshfs_read_begin(struct request *req) +@@ -2771,9 +2774,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 +145,7 @@ index bb792ab..22c18a7 100644 pthread_cond_init(&chunk->sio.finished, NULL); list_init(&chunk->reqs); chunk->size = size; -@@ -2765,7 +2770,9 @@ static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, +@@ -2787,7 +2792,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 +156,7 @@ index bb792ab..22c18a7 100644 rreq->sio = &chunk->sio; rreq->size = bsize; buf_init(&rreq->data, 0); -@@ -2836,7 +2843,7 @@ static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) +@@ -2858,7 +2865,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 +165,7 @@ index bb792ab..22c18a7 100644 } } -@@ -3487,9 +3494,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3513,9 +3520,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)) { @@ -178,7 +178,7 @@ index bb792ab..22c18a7 100644 return 0; } return 1; -@@ -3502,9 +3510,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3528,9 +3536,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, return 1; case KEY_PORT: @@ -191,7 +191,7 @@ index bb792ab..22c18a7 100644 return 0; case KEY_COMPRESS: -@@ -3512,9 +3521,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3538,9 +3547,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, return 0; case KEY_CONFIGFILE: @@ -204,7 +204,7 @@ index bb792ab..22c18a7 100644 return 0; case KEY_HELP: -@@ -3729,17 +3739,19 @@ static void fsname_remove_commas(char *fsname) +@@ -3755,17 +3765,19 @@ static void fsname_remove_commas(char *fsname) #if FUSE_VERSION >= 27 static char *fsname_escape_commas(char *fsnameold) { @@ -226,7 +226,7 @@ index bb792ab..22c18a7 100644 return fsname; } -@@ -4055,15 +4067,20 @@ int main(int argc, char *argv[]) +@@ -4081,15 +4093,20 @@ int main(int argc, char *argv[]) exit(1); } @@ -251,7 +251,7 @@ index bb792ab..22c18a7 100644 ssh_add_arg(sshfs.host); if (sshfs.sftp_server) sftp_server = sshfs.sftp_server; -@@ -4099,14 +4116,16 @@ int main(int argc, char *argv[]) +@@ -4125,14 +4142,16 @@ int main(int argc, char *argv[]) fsname = fsname_escape_commas(fsname); else fsname_remove_commas(fsname); @@ -273,5 +273,5 @@ index bb792ab..22c18a7 100644 #if FUSE_VERSION >= 26 -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0006-Add-missing-includes.patch b/extra/sshfs/patch/0006-Add-missing-includes.patch index 9c8b49c6..968d8186 100644 --- a/extra/sshfs/patch/0006-Add-missing-includes.patch +++ b/extra/sshfs/patch/0006-Add-missing-includes.patch @@ -1,4 +1,4 @@ -From 27806ddaac633e9d71b061b57f74d02ff8aac889 Mon Sep 17 00:00:00 2001 +From e969e57612df9b24df2ac16ac545466fca0989f1 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 22c18a7..319bffe 100644 +index 4f3bfe4..cd6abf6 100644 --- a/sshfs.c +++ b/sshfs.c @@ -17,6 +17,7 @@ @@ -30,5 +30,5 @@ index 22c18a7..319bffe 100644 #include <netinet/in.h> #include <netinet/tcp.h> -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch b/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch index 2e4ff69b..1a232a7d 100644 --- a/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch +++ b/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch @@ -1,4 +1,4 @@ -From ab229f7cec14fb428605585a1a0026339997d628 Mon Sep 17 00:00:00 2001 +From d12abc4b94f24c52637bcb19f6ac7819cf66af10 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,10 +8,10 @@ Subject: [PATCH] Disable uidmap and gidmap support 1 file changed, 16 insertions(+) diff --git a/sshfs.c b/sshfs.c -index 319bffe..3448f4d 100644 +index cd6abf6..9af8814 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -241,10 +241,12 @@ struct sshfs { +@@ -242,10 +242,12 @@ struct sshfs { int disable_hardlink; char *uid_file; char *gid_file; @@ -24,7 +24,7 @@ index 319bffe..3448f4d 100644 unsigned max_read; unsigned max_write; unsigned ssh_ver; -@@ -364,7 +366,9 @@ enum { +@@ -366,7 +368,9 @@ enum { enum { IDMAP_NONE, IDMAP_USER, @@ -34,7 +34,7 @@ index 319bffe..3448f4d 100644 }; enum { -@@ -385,7 +389,9 @@ static struct fuse_opt sshfs_opts[] = { +@@ -387,7 +391,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 319bffe..3448f4d 100644 SSHFS_OPT("uidfile=%s", uid_file, 0), SSHFS_OPT("gidfile=%s", gid_file, 0), SSHFS_OPT("nomap=ignore", nomap, NOMAP_IGNORE), -@@ -518,6 +524,7 @@ static int list_empty(const struct list_head *head) +@@ -520,6 +526,7 @@ static int list_empty(const struct list_head *head) return head->next == head; } @@ -52,7 +52,7 @@ index 319bffe..3448f4d 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) -@@ -535,6 +542,7 @@ static inline int translate_id(uint32_t *id, GHashTable *map) +@@ -537,6 +544,7 @@ static inline int translate_id(uint32_t *id, GHashTable *map) abort(); } } @@ -60,7 +60,7 @@ index 319bffe..3448f4d 100644 static inline void buf_init(struct buffer *buf, size_t size) { -@@ -782,12 +790,14 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp) +@@ -784,12 +792,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 319bffe..3448f4d 100644 memset(stbuf, 0, sizeof(struct stat)); stbuf->st_mode = mode; -@@ -2481,12 +2491,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid) +@@ -2486,12 +2496,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__ */ @@ -90,7 +90,7 @@ index 319bffe..3448f4d 100644 buf_init(&buf, 0); buf_add_path(&buf, path); -@@ -3779,6 +3791,7 @@ static int ssh_connect(void) +@@ -3805,6 +3817,7 @@ static int ssh_connect(void) return 0; } @@ -98,7 +98,7 @@ index 319bffe..3448f4d 100644 /* number of ':' separated fields in a passwd/group file that we care * about */ #define IDMAP_FIELDS 3 -@@ -3953,6 +3966,7 @@ static inline void load_gid_map(void) +@@ -3979,6 +3992,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,7 +106,7 @@ index 319bffe..3448f4d 100644 #ifdef __APPLE__ int main(int argc, char *argv[], __unused char *envp[], char **exec_path) -@@ -4020,6 +4034,7 @@ int main(int argc, char *argv[]) +@@ -4046,6 +4060,7 @@ int main(int argc, char *argv[]) if (sshfs.idmap == IDMAP_USER) sshfs.detect_uid = 1; @@ -114,7 +114,7 @@ index 319bffe..3448f4d 100644 else if (sshfs.idmap == IDMAP_FILE) { sshfs.uid_map = NULL; sshfs.gid_map = NULL; -@@ -4034,6 +4049,7 @@ int main(int argc, char *argv[]) +@@ -4060,6 +4075,7 @@ int main(int argc, char *argv[]) if (sshfs.gid_file) load_gid_map(); } @@ -123,5 +123,5 @@ index 319bffe..3448f4d 100644 free(sshfs.gid_file); -- -2.8.1 +2.9.0 diff --git a/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch b/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch index 203dfafb..b21b5d34 100644 --- a/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch +++ b/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch @@ -1,4 +1,4 @@ -From e1b37bd0bbb61e8b425972ee0321ba501b1d4ea2 Mon Sep 17 00:00:00 2001 +From 4d8a47a8754e549dc75d5201547762718de8ce52 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 @@ -8,7 +8,7 @@ Subject: [PATCH] Remove remaining uses of glib 1 file changed, 5 deletions(-) diff --git a/sshfs.c b/sshfs.c -index 3448f4d..d548c98 100644 +index 9af8814..44c13d1 100644 --- a/sshfs.c +++ b/sshfs.c @@ -42,7 +42,6 @@ @@ -19,7 +19,7 @@ index 3448f4d..d548c98 100644 #include <pwd.h> #include <grp.h> #include <limits.h> -@@ -3985,11 +3984,7 @@ int main(int argc, char *argv[]) +@@ -4011,11 +4010,7 @@ int main(int argc, char *argv[]) if (!realpath(*exec_path, sshfs_program_path)) { memset(sshfs_program_path, 0, PATH_MAX); } @@ -32,5 +32,5 @@ index 3448f4d..d548c98 100644 sshfs.blksize = 4096; /* SFTP spec says all servers should allow at least 32k I/O */ -- -2.8.1 +2.9.0 |
