Changes in trunk/src/sh_readconf.c [20:27]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_readconf.c
r20 r27 52 52 #endif 53 53 54 extern int set_reverse_lookup (c har * c);54 extern int set_reverse_lookup (const char * c); 55 55 56 56 #undef FIL__ … … 69 69 SH_SECTION_USER0, 70 70 SH_SECTION_USER1, 71 SH_SECTION_USER2, 72 SH_SECTION_USER3, 73 SH_SECTION_USER4, 71 74 SH_SECTION_PRELINK, 72 75 #if defined (SH_WITH_MAIL) … … 108 111 { N_("[User0]"), SH_SECTION_USER0}, 109 112 { N_("[User1]"), SH_SECTION_USER1}, 113 { N_("[User2]"), SH_SECTION_USER2}, 114 { N_("[User3]"), SH_SECTION_USER3}, 115 { N_("[User4]"), SH_SECTION_USER4}, 110 116 { N_("[Prelink]"), SH_SECTION_PRELINK}, 111 117 #ifdef WITH_EXTERNAL … … 282 288 /* The system type, release, and machine. 283 289 */ 284 sprintf(myident, _("%s:%s:%s"), /* known to fit */ 285 sh.host.system, sh.host.release, sh.host.machine); 290 sl_snprintf(myident, sizeof(myident), _("%s:%s:%s"), 291 sh.host.system, /* flawfinder: ignore */ 292 sh.host.release, sh.host.machine); 286 293 287 294 … … 580 587 } 581 588 582 int sh_readconf_set_path (char * which, c har * what)589 int sh_readconf_set_path (char * which, const char * what) 583 590 { 584 591 int len; … … 621 628 } 622 629 623 int sh_readconf_set_database_path (c har * what)630 int sh_readconf_set_database_path (const char * what) 624 631 { 625 632 return (sh_readconf_set_path(sh.data.path, what)); 626 633 } 627 634 628 int sh_readconf_set_logfile_path (c har * what)635 int sh_readconf_set_logfile_path (const char * what) 629 636 { 630 637 return (sh_readconf_set_path(sh.srvlog.name, what)); 631 638 } 632 639 633 int sh_readconf_set_lockfile_path (c har * what)640 int sh_readconf_set_lockfile_path (const char * what) 634 641 { 635 642 return( sh_readconf_set_path(sh.srvlog.alt, what)); … … 645 652 646 653 647 int sh_readconf_setTime (c har * str, ShTimerItem what)654 int sh_readconf_setTime (const char * str, ShTimerItem what) 648 655 { 649 656 unsigned long i = atoi (str); … … 674 681 } 675 682 676 int sh_readconf_setMailtime (c har * c)683 int sh_readconf_setMailtime (const char * c) 677 684 { 678 685 return sh_readconf_setTime (c, SET_MAILTIME); 679 686 } 680 687 681 int sh_readconf_setFiletime (c har * c)688 int sh_readconf_setFiletime (const char * c) 682 689 { 683 690 return sh_readconf_setTime (c, SET_FILETIME); 684 691 } 685 692 686 int sh_readconf_set_nice (c har * c)693 int sh_readconf_set_nice (const char * c) 687 694 { 688 695 long val; … … 704 711 705 712 #ifdef FANCY_LIBCAP 706 int sh_readconf_setCaps(c har * c)713 int sh_readconf_setCaps(const char * c) 707 714 { 708 715 int i; … … 718 725 ShSectionType section; 719 726 ShSectionType alt_section; 720 int (*func)(c har * opt);727 int (*func)(const char * opt); 721 728 } cfg_options; 722 729 723 730 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 724 extern int sh_set_schedule_one(c har * str);725 extern int sh_set_schedule_two(c har * str);731 extern int sh_set_schedule_one(const char * str); 732 extern int sh_set_schedule_two(const char * str); 726 733 #endif 727 734 #if defined (SH_WITH_SERVER) 728 extern int sh_socket_use (char * c); 729 extern int sh_socket_uid (char * c); 730 extern int sh_socket_password (char * c); 731 #endif 732 733 /* Yes, this isn't very elegant ;) 734 */ 735 #if defined(WITH_EXTERNAL) 736 int sh_error_set_external_wrap (char * str) { 737 return sh_error_set_external ((const char *) str); 738 } 739 #endif 740 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 741 int sh_files_setrecursion_wrap (char * str) { 742 return sh_files_setrecursion ((const char *) str); 743 } 744 int sh_util_setchecksum_wrap (char * str) { 745 return sh_util_setchecksum ((const char *) str); 746 } 747 #endif 748 int sh_util_setlooptime_wrap (char * str) { 749 return sh_util_setlooptime ((const char *) str); 750 } 751 #ifdef SH_WITH_MAIL 752 int sh_error_setseverity_wrap (char * str) { 753 return sh_error_setseverity ((const char *) str); 754 } 755 #endif 756 int sh_calls_set_bind_addr_wrap (char * str) { 757 return sh_calls_set_bind_addr ((const char *) str); 758 } 759 int sh_unix_setdeamon_wrap (char * str) { 760 return sh_unix_setdeamon ((const char *) str); 761 } 762 int sh_error_setprint_wrap (char * str) { 763 return sh_error_setprint ((const char *) str); 764 } 765 int sh_error_setlog_wrap (char * str) { 766 return sh_error_setlog ((const char *) str); 767 } 768 int sh_error_set_syslog_wrap (char * str) { 769 return sh_error_set_syslog ((const char *) str); 770 } 771 #ifdef HAVE_LIBPRELUDE 772 int sh_error_set_prelude_wrap (char * str) { 773 return sh_error_set_prelude ((const char *) str); 774 } 775 #endif 776 #ifdef SH_WITH_CLIENT 777 int sh_error_setexport_wrap (char * str) { 778 return sh_error_setexport ((const char *) str); 779 } 780 #endif 781 #ifdef SH_WITH_SERVER 782 int sh_forward_set_strip_wrap (char * str) { 783 return sh_forward_set_strip ((const char *) str); 784 } 785 int sh_unix_set_chroot_wrap (char * str) { 786 return sh_unix_set_chroot ((const char *) str); 787 } 788 #endif 789 #if defined(WITH_DATABASE) 790 int sh_error_set_database_wrap (char * str) { 791 return sh_error_set_database ((const char *) str); 792 } 793 #endif 794 735 extern int sh_socket_use (const char * c); 736 extern int sh_socket_uid (const char * c); 737 extern int sh_socket_password (const char * c); 738 #endif 739 795 740 cfg_options ext_table[] = { 796 741 #if defined(WITH_EXTERNAL) … … 818 763 sh_ext_add_or }, 819 764 { N_("externalseverity"),SH_SECTION_LOG, SH_SECTION_EXTERNAL, 820 sh_error_set_external _wrap},765 sh_error_set_external }, 821 766 { N_("externalclass"), SH_SECTION_LOG, SH_SECTION_EXTERNAL, 822 767 sh_error_external_mask }, … … 845 790 set_enter_wrapper }, 846 791 #endif 792 847 793 848 794 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) … … 880 826 { N_("file"), SH_SECTION_USER1, SH_SECTION_NONE, 881 827 sh_files_pushfile_user1 }, 828 { N_("dir"), SH_SECTION_USER2, SH_SECTION_NONE, 829 sh_files_pushdir_user2 }, 830 { N_("file"), SH_SECTION_USER2, SH_SECTION_NONE, 831 sh_files_pushfile_user2 }, 832 { N_("dir"), SH_SECTION_USER3, SH_SECTION_NONE, 833 sh_files_pushdir_user3 }, 834 { N_("file"), SH_SECTION_USER3, SH_SECTION_NONE, 835 sh_files_pushfile_user3 }, 836 { N_("dir"), SH_SECTION_USER4, SH_SECTION_NONE, 837 sh_files_pushdir_user4 }, 838 { N_("file"), SH_SECTION_USER4, SH_SECTION_NONE, 839 sh_files_pushfile_user4 }, 882 840 { N_("dir"), SH_SECTION_PRELINK, SH_SECTION_NONE, 883 841 sh_files_pushdir_prelink }, … … 902 860 sh_util_obscure_ok }, 903 861 { N_("setrecursionlevel"), SH_SECTION_MISC, SH_SECTION_NONE, 904 sh_files_setrecursion _wrap},862 sh_files_setrecursion }, 905 863 { N_("checksumtest"), SH_SECTION_MISC, SH_SECTION_NONE, 906 sh_util_setchecksum _wrap},864 sh_util_setchecksum }, 907 865 { N_("reportonlyonce"), SH_SECTION_MISC, SH_SECTION_NONE, 908 866 sh_files_reportonce }, … … 953 911 sh_files_redef_user1 }, 954 912 913 { N_("redefuser2"), SH_SECTION_MISC, SH_SECTION_NONE, 914 sh_files_redef_user2 }, 915 916 { N_("redefuser3"), SH_SECTION_MISC, SH_SECTION_NONE, 917 sh_files_redef_user3 }, 918 919 { N_("redefuser4"), SH_SECTION_MISC, SH_SECTION_NONE, 920 sh_files_redef_user4 }, 921 955 922 { N_("redefprelink"), SH_SECTION_MISC, SH_SECTION_NONE, 956 923 sh_files_redef_prelink }, … … 961 928 { N_("setprelinkchecksum"), SH_SECTION_MISC, SH_SECTION_NONE, 962 929 sh_prelink_set_hash }, 930 963 931 /* client or standalone 964 932 */ … … 977 945 sh_socket_password }, 978 946 { N_("setstripdomain"), SH_SECTION_SRV, SH_SECTION_MISC, 979 sh_forward_set_strip _wrap},947 sh_forward_set_strip }, 980 948 { N_("useseparatelogs"), SH_SECTION_SRV, SH_SECTION_MISC, 981 949 set_flag_sep_log }, 982 950 { N_("setchrootdir"), SH_SECTION_SRV, SH_SECTION_MISC, 983 sh_unix_set_chroot _wrap},951 sh_unix_set_chroot }, 984 952 { N_("setclienttimelimit"), SH_SECTION_SRV, SH_SECTION_MISC, 985 953 sh_forward_set_time_limit }, … … 1000 968 #endif 1001 969 1002 #if def SH_WITH_CLIENT970 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 1003 971 { N_("exportseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 1004 sh_error_setexport _wrap},972 sh_error_setexport }, 1005 973 { N_("exportclass"), SH_SECTION_LOG, SH_SECTION_NONE, 1006 974 sh_error_export_mask }, 975 #if defined(SH_WITH_SERVER) 976 { N_("setlogserver"), SH_SECTION_SRV, SH_SECTION_MISC, 977 sh_forward_setlogserver }, 978 #else 1007 979 { N_("setlogserver"), SH_SECTION_CLT, SH_SECTION_MISC, 1008 980 sh_forward_setlogserver }, 981 #endif 1009 982 #endif 1010 983 { N_("setfilechecktime"), SH_SECTION_MISC, SH_SECTION_NONE, 1011 984 sh_readconf_setFiletime }, 1012 985 { N_("setlooptime"), SH_SECTION_MISC, SH_SECTION_NONE, 1013 sh_util_setlooptime _wrap},986 sh_util_setlooptime }, 1014 987 1015 988 #ifdef SH_WITH_MAIL 1016 989 { N_("mailseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 1017 sh_error_setseverity _wrap},990 sh_error_setseverity }, 1018 991 { N_("mailclass"), SH_SECTION_LOG, SH_SECTION_NONE, 1019 992 sh_error_mail_mask }, … … 1040 1013 #endif 1041 1014 { N_("setbindaddress"), SH_SECTION_MISC, SH_SECTION_NONE, 1042 sh_calls_set_bind_addr _wrap},1015 sh_calls_set_bind_addr }, 1043 1016 { N_("daemon"), SH_SECTION_MISC, SH_SECTION_NONE, 1044 sh_unix_setdeamon _wrap},1017 sh_unix_setdeamon }, 1045 1018 { N_("samhainpath"), SH_SECTION_MISC, SH_SECTION_NONE, 1046 1019 sh_unix_self_hash }, … … 1051 1024 1052 1025 { N_("printseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 1053 sh_error_setprint _wrap},1026 sh_error_setprint }, 1054 1027 { N_("printclass"), SH_SECTION_LOG, SH_SECTION_NONE, 1055 1028 sh_error_print_mask }, 1056 1029 1057 1030 { N_("logseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 1058 sh_error_setlog _wrap},1031 sh_error_setlog }, 1059 1032 { N_("logclass"), SH_SECTION_LOG, SH_SECTION_NONE, 1060 1033 sh_error_log_mask }, 1061 1034 1062 1035 { N_("syslogseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 1063 sh_error_set_syslog _wrap},1036 sh_error_set_syslog }, 1064 1037 { N_("syslogclass"), SH_SECTION_LOG, SH_SECTION_NONE, 1065 1038 sh_error_syslog_mask }, 1066 1039 #ifdef HAVE_LIBPRELUDE 1067 1040 { N_("preludeseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 1068 sh_error_set_prelude _wrap},1041 sh_error_set_prelude }, 1069 1042 { N_("preludeclass"), SH_SECTION_LOG, SH_SECTION_NONE, 1070 1043 sh_error_prelude_mask }, … … 1147 1120 N_("severityuser0"), 1148 1121 N_("severityuser1"), 1122 N_("severityuser2"), 1123 N_("severityuser3"), 1124 N_("severityuser4"), 1149 1125 N_("severityprelink"), 1150 1126 NULL … … 1163 1139 SH_ERR_T_USER0, 1164 1140 SH_ERR_T_USER1, 1141 SH_ERR_T_USER2, 1142 SH_ERR_T_USER3, 1143 SH_ERR_T_USER4, 1165 1144 SH_ERR_T_PRELINK, 1166 1145 };
Note:
See TracChangeset
for help on using the changeset viewer.