Ticket #33589: update_to_2.4.diff
File update_to_2.4.diff, 7.2 KB (added by anatol (Anatol Pomozov), 13 years ago) |
---|
-
files/patch-from-fuse4x.diff
20 20 EXTRA_DIST = sshnodelay.c FAQ.txt 21 21 CLEANFILES = sshnodelay.so 22 22 diff --git a/cache.c b/cache.c 23 index bb23f8f..5b635f210064423 index 2a06726..ab274bc 100644 24 24 --- a/cache.c 25 25 +++ b/cache.c 26 @@ -55 9,6 +559,9 @@ struct fuse_operations *cache_init(struct fuse_cache_operations *oper)26 @@ -553,6 +553,9 @@ struct fuse_operations *cache_init(struct fuse_cache_operations *oper) 27 27 cache.next_oper = oper; 28 28 29 29 cache_unity_fill(oper, &cache_oper); … … 33 33 if (cache.on) { 34 34 cache_fill(oper, &cache_oper); 35 35 pthread_mutex_init(&cache.lock, NULL); 36 @@ -5 93,3 +596,7 @@ int cache_parse_options(struct fuse_args *args)36 @@ -587,3 +590,7 @@ int cache_parse_options(struct fuse_args *args) 37 37 38 38 return fuse_opt_parse(args, &cache, cache_opts, NULL); 39 39 } … … 364 364 + 365 365 +#endif /* semaphore.h */ 366 366 diff --git a/sshfs.c b/sshfs.c 367 index 22bda6b..9698c74100644367 index 7cfa341..39f3286 100644 368 368 --- a/sshfs.c 369 369 +++ b/sshfs.c 370 370 @@ -20,7 +20,11 @@ … … 379 379 #include <pthread.h> 380 380 #include <netdb.h> 381 381 #include <signal.h> 382 @@ -3 5,6 +39,10 @@383 #include < netinet/in.h>384 #include < netinet/tcp.h>385 #include < glib.h>382 @@ -38,6 +42,10 @@ 383 #include <pwd.h> 384 #include <grp.h> 385 #include <limits.h> 386 386 +#ifdef __APPLE__ 387 387 +#include <libgen.h> 388 388 +#include <strings.h> … … 390 390 391 391 #include "cache.h" 392 392 393 @@ -1 18,6 +126,16 @@393 @@ -121,6 +129,16 @@ 394 394 395 395 #define SSHNODELAY_SO "sshnodelay.so" 396 396 … … 407 407 struct buffer { 408 408 uint8_t *p; 409 409 size_t len; 410 @@ -1 67,6 +185,9 @@ struct sshfs_file {410 @@ -183,6 +201,9 @@ struct sshfs_file { 411 411 int connver; 412 412 int modifver; 413 413 int refs; … … 417 417 }; 418 418 419 419 struct sshfs { 420 @@ -2 07,6 +228,10 @@ struct sshfs {420 @@ -234,6 +255,10 @@ struct sshfs { 421 421 int server_version; 422 422 unsigned remote_uid; 423 423 unsigned local_uid; … … 428 428 int remote_uid_detected; 429 429 unsigned blksize; 430 430 char *progname; 431 @@ - 661,8 +686,17 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp)431 @@ -727,8 +752,17 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp) 432 432 } 433 433 } 434 434 … … 443 443 if (sshfs.remote_uid_detected && uid == sshfs.remote_uid) 444 444 uid = sshfs.local_uid; 445 445 +#endif 446 447 memset(stbuf, 0, sizeof(struct stat));448 stbuf->st_mode = mode;449 @@ - 765,11 +799,33 @@ static void ssh_add_arg(const char *arg)446 if (sshfs.idmap == IDMAP_FILE && sshfs.uid_map) 447 if (translate_id(&uid, sshfs.uid_map) == -1) 448 return -EPERM; 449 @@ -837,11 +871,33 @@ static void ssh_add_arg(const char *arg) 450 450 #ifdef SSH_NODELAY_WORKAROUND 451 451 static int do_ssh_nodelay_workaround(void) 452 452 { … … 480 480 snprintf(sopath, sizeof(sopath), "%s/%s", LIBDIR, SSHNODELAY_SO); 481 481 res = access(sopath, R_OK); 482 482 if (res == -1) { 483 @@ - 794,16 +850,24 @@ static int do_ssh_nodelay_workaround(void)483 @@ -866,16 +922,24 @@ static int do_ssh_nodelay_workaround(void) 484 484 return -1; 485 485 } 486 486 } … … 505 505 g_free(newpreload); 506 506 return 0; 507 507 } 508 @@ -15 00,6 +1564,10 @@ static void sftp_detect_uid()508 @@ -1595,6 +1659,10 @@ static void sftp_detect_uid() 509 509 510 510 sshfs.remote_uid = stbuf.st_uid; 511 511 sshfs.local_uid = getuid(); … … 516 516 sshfs.remote_uid_detected = 1; 517 517 DEBUG("remote_uid = %i\n", sshfs.remote_uid); 518 518 519 @@ -2 120,6 +2188,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid)519 @@ -2238,6 +2306,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid) 520 520 buf_init(&buf, 0); 521 521 buf_add_path(&buf, path); 522 522 buf_add_uint32(&buf, SSH_FILEXFER_ATTR_UIDGID); … … 531 531 buf_add_uint32(&buf, uid); 532 532 buf_add_uint32(&buf, gid); 533 533 err = sftp_request(SSH_FXP_SETSTAT, &buf, SSH_FXP_STATUS, NULL); 534 @@ -2 203,6 +2279,9 @@ static int sshfs_open_common(const char *path, mode_t mode,534 @@ -2334,6 +2410,9 @@ static int sshfs_open_common(const char *path, mode_t mode, 535 535 sf = g_new0(struct sshfs_file, 1); 536 536 list_init(&sf->write_reqs); 537 537 pthread_cond_init(&sf->write_finished, NULL); … … 541 541 /* Assume random read after open */ 542 542 sf->is_seq = 0; 543 543 sf->refs = 1; 544 @@ -2 236,11 +2315,21 @@ static int sshfs_open_common(const char *path, mode_t mode,544 @@ -2368,11 +2447,21 @@ static int sshfs_open_common(const char *path, mode_t mode, 545 545 } 546 546 547 547 if (!err) { … … 563 563 g_free(sf); 564 564 } 565 565 buf_free(&buf); 566 @@ -2 295,14 +2384,32 @@ static int sshfs_fsync(const char *path, int isdatasync,566 @@ -2427,14 +2516,32 @@ static int sshfs_fsync(const char *path, int isdatasync, 567 567 568 568 static void sshfs_file_put(struct sshfs_file *sf) 569 569 { … … 596 596 } 597 597 598 598 static int sshfs_release(const char *path, struct fuse_file_info *fi) 599 @@ -3 076,6 +3183,15 @@ static int read_password(void)599 @@ -3352,6 +3459,15 @@ static int read_password(void) 600 600 perror("Failed to allocate locked page for password"); 601 601 return -1; 602 602 } … … 612 612 613 613 /* Don't use fgets() because password might stay in memory */ 614 614 for (n = 0; n < max_password; n++) { 615 @@ -3123,7 +3239,7 @@ static void set_ssh_command(void) 616 replace_arg(&sshfs.ssh_args.argv[0], 617 sshfs.ssh_command); 618 } else { 619 - if (fuse_opt_insert_arg(&sshfs.ssh_args, i, 620 + if (fuse_opt_insert_arg(&sshfs.ssh_args, i, 621 sshfs.ssh_command) == -1) 622 _exit(1); 623 } 624 @@ -3227,8 +3343,13 @@ static int ssh_connect(void) 625 return 0; 615 @@ -3677,8 +3793,13 @@ static inline void load_gid_map(void) 616 read_id_map(sshfs.gid_file, &groupname_to_gid, "gid", &sshfs.gid_map, &sshfs.r_gid_map); 626 617 } 627 618 628 619 -int main(int argc, char *argv[]) … … 636 627 int res; 637 628 struct fuse_args args = FUSE_ARGS_INIT(argc, argv); 638 629 char *tmp; 639 @@ -3 236,6 +3357,10 @@ int main(int argc, char *argv[])630 @@ -3686,6 +3807,10 @@ int main(int argc, char *argv[]) 640 631 const char *sftp_server; 641 632 int libver; 642 633 … … 647 638 g_thread_init(NULL); 648 639 649 640 sshfs.blksize = 4096; 650 @@ -3 243,7 +3368,11 @@ int main(int argc, char *argv[])651 sshfs.max_write = 65536;641 @@ -3694,7 +3819,11 @@ int main(int argc, char *argv[]) 642 sshfs.max_write = 32768; 652 643 sshfs.nodelay_workaround = 1; 653 644 sshfs.nodelaysrv_workaround = 0; 654 645 +#ifdef __APPLE__ … … 659 650 sshfs.truncate_workaround = 0; 660 651 sshfs.buflimit_workaround = 1; 661 652 sshfs.ssh_ver = 2; 662 @@ -3 257,6 +3386,10 @@ int main(int argc, char *argv[])653 @@ -3713,6 +3842,10 @@ int main(int argc, char *argv[]) 663 654 ssh_add_arg("-a"); 664 655 ssh_add_arg("-oClearAllForwardings=yes"); 665 656 -
Portfile
4 4 PortSystem 1.0 5 5 6 6 name sshfs 7 version 2. 37 version 2.4 8 8 categories fuse 9 9 10 10 platforms darwin … … 24 24 master_sites sourceforge:fuse 25 25 license GPL-2 26 26 27 checksums rmd160 5ea1180cbc60ff9401d7e53774dfda3a78f37ab1\28 sha256 ce229f87869d136c8347cca646f1dd6394c604127d021507a57205668d9288bb27 checksums rmd160 01e40fda6272ee601ff2d45050f9d1e635ee38f2 \ 28 sha256 3c93ba8522568093c94ff9c5a3763929380dd229365d905769ff82475d774dd1 29 29 30 30 livecheck.distname sshfs-fuse 31 31