|
22 | 22 | #include "rsync.h"
|
23 | 23 | #include "itypes.h"
|
24 | 24 | #include "ifuncs.h"
|
25 |
| -#include "latest-year.h" |
26 |
| -#include "git-version.h" |
27 | 25 | #include <popt.h>
|
28 | 26 |
|
29 | 27 | extern int module_id;
|
30 | 28 | extern int local_server;
|
31 | 29 | extern int sanitize_paths;
|
32 | 30 | extern unsigned int module_dirlen;
|
33 |
| -extern struct name_num_obj valid_checksums; |
34 |
| -extern struct name_num_obj valid_compressions; |
35 | 31 | extern filter_rule_list filter_list;
|
36 | 32 | extern filter_rule_list daemon_filter_list;
|
37 | 33 |
|
@@ -576,225 +572,6 @@ void negate_output_levels(void)
|
576 | 572 | debug_levels[j] *= -1;
|
577 | 573 | }
|
578 | 574 |
|
579 |
| -static char *istring(const char *fmt, int val) |
580 |
| -{ |
581 |
| - char *str; |
582 |
| - if (asprintf(&str, fmt, val) < 0) |
583 |
| - out_of_memory("istring"); |
584 |
| - return str; |
585 |
| -} |
586 |
| - |
587 |
| -static void print_info_flags(enum logcode f) |
588 |
| -{ |
589 |
| - STRUCT_STAT *dumstat; |
590 |
| - char line_buf[75]; |
591 |
| - int line_len, j; |
592 |
| - char *info_flags[] = { |
593 |
| - |
594 |
| - "*Capabilities", |
595 |
| - |
596 |
| - istring("%d-bit files", (int)(sizeof (OFF_T) * 8)), |
597 |
| - istring("%d-bit inums", (int)(sizeof dumstat->st_ino * 8)), /* Don't check ino_t! */ |
598 |
| - istring("%d-bit timestamps", (int)(sizeof (time_t) * 8)), |
599 |
| - istring("%d-bit long ints", (int)(sizeof (int64) * 8)), |
600 |
| - |
601 |
| -#ifndef HAVE_SOCKETPAIR |
602 |
| - "no " |
603 |
| -#endif |
604 |
| - "socketpairs", |
605 |
| - |
606 |
| -#ifndef SUPPORT_HARD_LINKS |
607 |
| - "no " |
608 |
| -#endif |
609 |
| - "hardlinks", |
610 |
| - |
611 |
| -#ifndef CAN_HARDLINK_SPECIAL |
612 |
| - "no " |
613 |
| -#endif |
614 |
| - "hardlink-specials", |
615 |
| - |
616 |
| -#ifndef SUPPORT_LINKS |
617 |
| - "no " |
618 |
| -#endif |
619 |
| - "symlinks", |
620 |
| - |
621 |
| -#ifndef INET6 |
622 |
| - "no " |
623 |
| -#endif |
624 |
| - "IPv6", |
625 |
| - |
626 |
| -#ifndef SUPPORT_ATIMES |
627 |
| - "no " |
628 |
| -#endif |
629 |
| - "atimes", |
630 |
| - |
631 |
| - "batchfiles", |
632 |
| - |
633 |
| -#ifndef HAVE_FTRUNCATE |
634 |
| - "no " |
635 |
| -#endif |
636 |
| - "inplace", |
637 |
| - |
638 |
| -#ifndef HAVE_FTRUNCATE |
639 |
| - "no " |
640 |
| -#endif |
641 |
| - "append", |
642 |
| - |
643 |
| -#ifndef SUPPORT_ACLS |
644 |
| - "no " |
645 |
| -#endif |
646 |
| - "ACLs", |
647 |
| - |
648 |
| -#ifndef SUPPORT_XATTRS |
649 |
| - "no " |
650 |
| -#endif |
651 |
| - "xattrs", |
652 |
| - |
653 |
| -#ifdef RSYNC_USE_PROTECTED_ARGS |
654 |
| - "default " |
655 |
| -#else |
656 |
| - "optional " |
657 |
| -#endif |
658 |
| - "protect-args", |
659 |
| - |
660 |
| -#ifndef ICONV_OPTION |
661 |
| - "no " |
662 |
| -#endif |
663 |
| - "iconv", |
664 |
| - |
665 |
| -#ifndef CAN_SET_SYMLINK_TIMES |
666 |
| - "no " |
667 |
| -#endif |
668 |
| - "symtimes", |
669 |
| - |
670 |
| -#ifndef SUPPORT_PREALLOCATION |
671 |
| - "no " |
672 |
| -#endif |
673 |
| - "prealloc", |
674 |
| - |
675 |
| -#ifndef HAVE_MKTIME |
676 |
| - "no " |
677 |
| -#endif |
678 |
| - "stop-at", |
679 |
| - |
680 |
| -#ifndef SUPPORT_CRTIMES |
681 |
| - "no " |
682 |
| -#endif |
683 |
| - "crtimes", |
684 |
| - |
685 |
| - "*Optimizations", |
686 |
| - |
687 |
| -#ifndef HAVE_SIMD |
688 |
| - "no " |
689 |
| -#endif |
690 |
| - "SIMD", |
691 |
| - |
692 |
| -#ifndef HAVE_ASM |
693 |
| - "no " |
694 |
| -#endif |
695 |
| - "asm", |
696 |
| - |
697 |
| -#ifndef USE_OPENSSL |
698 |
| - "no " |
699 |
| -#endif |
700 |
| - "openssl-crypto", |
701 |
| - |
702 |
| - NULL |
703 |
| - }; |
704 |
| - |
705 |
| - for (line_len = 0, j = 0; ; j++) { |
706 |
| - char *str = info_flags[j], *next_nfo = str ? info_flags[j+1] : NULL; |
707 |
| - int str_len = str && *str != '*' ? strlen(str) : 1000; |
708 |
| - int need_comma = next_nfo && *next_nfo != '*' ? 1 : 0; |
709 |
| - if (line_len && line_len + 1 + str_len + need_comma >= (int)sizeof line_buf) { |
710 |
| - rprintf(f, " %s\n", line_buf); |
711 |
| - line_len = 0; |
712 |
| - } |
713 |
| - if (!str) |
714 |
| - break; |
715 |
| - if (*str == '*') { |
716 |
| - rprintf(f, "%s:\n", str+1); |
717 |
| - continue; |
718 |
| - } |
719 |
| - line_len += snprintf(line_buf+line_len, sizeof line_buf - line_len, " %s%s", str, need_comma ? "," : ""); |
720 |
| - } |
721 |
| -} |
722 |
| - |
723 |
| -const char *rsync_version(void) |
724 |
| -{ |
725 |
| - return RSYNC_GITVER; |
726 |
| -} |
727 |
| - |
728 |
| -static void print_rsync_version(enum logcode f) |
729 |
| -{ |
730 |
| - char tmpbuf[256], *subprotocol = ""; |
731 |
| - |
732 |
| -#if SUBPROTOCOL_VERSION != 0 |
733 |
| - subprotocol = istring(".PR%d", SUBPROTOCOL_VERSION); |
734 |
| -#endif |
735 |
| - rprintf(f, "%s version %s protocol version %d%s\n", |
736 |
| - RSYNC_NAME, rsync_version(), PROTOCOL_VERSION, subprotocol); |
737 |
| - |
738 |
| - rprintf(f, "Copyright (C) 1996-" LATEST_YEAR " by Andrew Tridgell, Wayne Davison, and others.\n"); |
739 |
| - rprintf(f, "Web site: https://rsync.samba.org/\n"); |
740 |
| - |
741 |
| - print_info_flags(f); |
742 |
| - |
743 |
| - rprintf(f, "Checksum list:\n"); |
744 |
| - get_default_nno_list(&valid_checksums, tmpbuf, sizeof tmpbuf, '('); |
745 |
| - rprintf(f, " %s\n", tmpbuf); |
746 |
| - |
747 |
| - rprintf(f, "Compress list:\n"); |
748 |
| - get_default_nno_list(&valid_compressions, tmpbuf, sizeof tmpbuf, '('); |
749 |
| - rprintf(f, " %s\n", tmpbuf); |
750 |
| - |
751 |
| -#ifdef MAINTAINER_MODE |
752 |
| - rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); |
753 |
| -#endif |
754 |
| - |
755 |
| -#if SIZEOF_INT64 < 8 |
756 |
| - rprintf(f, "WARNING: no 64-bit integers on this platform!\n"); |
757 |
| -#endif |
758 |
| - if (sizeof (int64) != SIZEOF_INT64) { |
759 |
| - rprintf(f, |
760 |
| - "WARNING: size mismatch in SIZEOF_INT64 define (%d != %d)\n", |
761 |
| - (int) SIZEOF_INT64, (int) sizeof (int64)); |
762 |
| - } |
763 |
| - |
764 |
| - rprintf(f,"\n"); |
765 |
| - rprintf(f,"rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n"); |
766 |
| - rprintf(f,"are welcome to redistribute it under certain conditions. See the GNU\n"); |
767 |
| - rprintf(f,"General Public Licence for details.\n"); |
768 |
| -} |
769 |
| - |
770 |
| - |
771 |
| -void usage(enum logcode F) |
772 |
| -{ |
773 |
| - print_rsync_version(F); |
774 |
| - |
775 |
| - rprintf(F,"\n"); |
776 |
| - rprintf(F,"rsync is a file transfer program capable of efficient remote update\n"); |
777 |
| - rprintf(F,"via a fast differencing algorithm.\n"); |
778 |
| - |
779 |
| - rprintf(F,"\n"); |
780 |
| - rprintf(F,"Usage: rsync [OPTION]... SRC [SRC]... DEST\n"); |
781 |
| - rprintf(F," or rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST\n"); |
782 |
| - rprintf(F," or rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST\n"); |
783 |
| - rprintf(F," or rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST\n"); |
784 |
| - rprintf(F," or rsync [OPTION]... [USER@]HOST:SRC [DEST]\n"); |
785 |
| - rprintf(F," or rsync [OPTION]... [USER@]HOST::SRC [DEST]\n"); |
786 |
| - rprintf(F," or rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]\n"); |
787 |
| - rprintf(F,"The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect\n"); |
788 |
| - rprintf(F,"to an rsync daemon, and require SRC or DEST to start with a module name.\n"); |
789 |
| - rprintf(F,"\n"); |
790 |
| - rprintf(F,"Options\n"); |
791 |
| -#include "help-rsync.h" |
792 |
| - rprintf(F,"\n"); |
793 |
| - rprintf(F,"Use \"rsync --daemon --help\" to see the daemon-mode command-line options.\n"); |
794 |
| - rprintf(F,"Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation.\n"); |
795 |
| - rprintf(F,"See https://rsync.samba.org/ for updates, bug reports, and answers\n"); |
796 |
| -} |
797 |
| - |
798 | 575 | enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
|
799 | 576 | OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP,
|
800 | 577 | OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
|
@@ -1055,18 +832,6 @@ static struct poptOption long_options[] = {
|
1055 | 832 | {0,0,0,0, 0, 0, 0}
|
1056 | 833 | };
|
1057 | 834 |
|
1058 |
| -static void daemon_usage(enum logcode F) |
1059 |
| -{ |
1060 |
| - print_rsync_version(F); |
1061 |
| - |
1062 |
| - rprintf(F,"\n"); |
1063 |
| - rprintf(F,"Usage: rsync --daemon [OPTION]...\n"); |
1064 |
| -#include "help-rsyncd.h" |
1065 |
| - rprintf(F,"\n"); |
1066 |
| - rprintf(F,"If you were not trying to invoke rsync as a daemon, avoid using any of the\n"); |
1067 |
| - rprintf(F,"daemon-specific rsync options. See also the rsyncd.conf(5) man page.\n"); |
1068 |
| -} |
1069 |
| - |
1070 | 835 | static struct poptOption long_daemon_options[] = {
|
1071 | 836 | /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
|
1072 | 837 | {"address", 0, POPT_ARG_STRING, &bind_address, 0, 0, 0 },
|
|
0 commit comments