Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_readconf.c

    r27 r20  
    5252#endif
    5353
    54 extern int set_reverse_lookup (const char * c);
     54extern int set_reverse_lookup (char * c);
    5555
    5656#undef  FIL__
     
    6969  SH_SECTION_USER0,
    7070  SH_SECTION_USER1,
    71   SH_SECTION_USER2,
    72   SH_SECTION_USER3,
    73   SH_SECTION_USER4,
    7471  SH_SECTION_PRELINK,
    7572#if defined (SH_WITH_MAIL)
     
    111108  { N_("[User0]"),            SH_SECTION_USER0},
    112109  { N_("[User1]"),            SH_SECTION_USER1},
    113   { N_("[User2]"),            SH_SECTION_USER2},
    114   { N_("[User3]"),            SH_SECTION_USER3},
    115   { N_("[User4]"),            SH_SECTION_USER4},
    116110  { N_("[Prelink]"),          SH_SECTION_PRELINK},
    117111#ifdef WITH_EXTERNAL
     
    288282  /* The system type, release, and machine.
    289283   */
    290   sl_snprintf(myident, sizeof(myident), _("%s:%s:%s"), 
    291               sh.host.system, /* flawfinder: ignore */
    292               sh.host.release, sh.host.machine);
     284  sprintf(myident, _("%s:%s:%s"),                  /* known to fit  */
     285          sh.host.system, sh.host.release, sh.host.machine);
    293286
    294287
     
    587580}
    588581
    589 int sh_readconf_set_path (char * which, const char * what)
     582int sh_readconf_set_path (char * which, char * what)
    590583{
    591584  int len;
     
    628621}
    629622
    630 int sh_readconf_set_database_path (const char * what)
     623int sh_readconf_set_database_path (char * what)
    631624{
    632625  return (sh_readconf_set_path(sh.data.path, what));
    633626}
    634627
    635 int sh_readconf_set_logfile_path (const char * what)
     628int sh_readconf_set_logfile_path (char * what)
    636629{
    637630  return (sh_readconf_set_path(sh.srvlog.name, what));
    638631}
    639632
    640 int sh_readconf_set_lockfile_path (const char * what)
     633int sh_readconf_set_lockfile_path (char * what)
    641634{
    642635  return( sh_readconf_set_path(sh.srvlog.alt, what));
     
    652645 
    653646   
    654 int sh_readconf_setTime (const char * str, ShTimerItem what)
     647int sh_readconf_setTime (char * str, ShTimerItem what)
    655648{
    656649  unsigned long i = atoi (str);
     
    681674}
    682675
    683 int sh_readconf_setMailtime (const char * c)
     676int sh_readconf_setMailtime (char * c)
    684677{
    685678  return sh_readconf_setTime (c, SET_MAILTIME);
    686679}
    687680
    688 int sh_readconf_setFiletime (const char * c)
     681int sh_readconf_setFiletime (char * c)
    689682{
    690683  return sh_readconf_setTime (c, SET_FILETIME);
    691684}
    692685
    693 int sh_readconf_set_nice (const char * c)
     686int sh_readconf_set_nice (char * c)
    694687{
    695688  long val;
     
    711704
    712705#ifdef FANCY_LIBCAP
    713 int sh_readconf_setCaps(const char * c)
     706int sh_readconf_setCaps(char * c)
    714707{
    715708  int i;
     
    725718  ShSectionType   section;
    726719  ShSectionType   alt_section;
    727   int (*func)(const char * opt);
     720  int (*func)(char * opt);
    728721} cfg_options;
    729722
    730723#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
    731 extern int sh_set_schedule_one(const char * str);
    732 extern int sh_set_schedule_two(const char * str);
     724extern int sh_set_schedule_one(char * str);
     725extern int sh_set_schedule_two(char * str);
    733726#endif
    734727#if defined (SH_WITH_SERVER)
    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 
     728extern int sh_socket_use (char * c);
     729extern int sh_socket_uid (char * c);
     730extern int sh_socket_password (char * c);
     731#endif
     732
     733/* Yes, this isn't very elegant ;)
     734 */
     735#if defined(WITH_EXTERNAL)
     736int 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)
     741int sh_files_setrecursion_wrap (char * str) {
     742  return sh_files_setrecursion ((const char *) str);
     743}
     744int sh_util_setchecksum_wrap (char * str) {
     745  return sh_util_setchecksum ((const char *) str);
     746}
     747#endif
     748int sh_util_setlooptime_wrap (char * str) {
     749  return sh_util_setlooptime ((const char *) str);
     750}
     751#ifdef SH_WITH_MAIL
     752int sh_error_setseverity_wrap (char * str) {
     753  return sh_error_setseverity ((const char *) str);
     754}
     755#endif
     756int sh_calls_set_bind_addr_wrap (char * str) {
     757  return sh_calls_set_bind_addr ((const char *) str);
     758}
     759int sh_unix_setdeamon_wrap (char * str) {
     760  return sh_unix_setdeamon ((const char *) str);
     761}
     762int sh_error_setprint_wrap (char * str) {
     763  return sh_error_setprint ((const char *) str);
     764}
     765int sh_error_setlog_wrap (char * str) {
     766  return sh_error_setlog ((const char *) str);
     767}
     768int sh_error_set_syslog_wrap (char * str) {
     769  return sh_error_set_syslog ((const char *) str);
     770}
     771#ifdef HAVE_LIBPRELUDE
     772int sh_error_set_prelude_wrap (char * str) {
     773  return sh_error_set_prelude ((const char *) str);
     774}
     775#endif
     776#ifdef SH_WITH_CLIENT
     777int sh_error_setexport_wrap (char * str) {
     778  return sh_error_setexport ((const char *) str);
     779}
     780#endif
     781#ifdef SH_WITH_SERVER
     782int sh_forward_set_strip_wrap (char * str) {
     783  return sh_forward_set_strip ((const char *) str);
     784}
     785int sh_unix_set_chroot_wrap (char * str) {
     786  return sh_unix_set_chroot ((const char *) str);
     787}
     788#endif
     789#if defined(WITH_DATABASE)
     790int sh_error_set_database_wrap (char * str) {
     791  return sh_error_set_database ((const char *) str);
     792}
     793#endif
     794 
    740795cfg_options ext_table[] = {
    741796#if defined(WITH_EXTERNAL)
     
    763818    sh_ext_add_or },
    764819  { N_("externalseverity"),SH_SECTION_LOG,      SH_SECTION_EXTERNAL, 
    765     sh_error_set_external },
     820    sh_error_set_external_wrap },
    766821  { N_("externalclass"),   SH_SECTION_LOG,      SH_SECTION_EXTERNAL, 
    767822    sh_error_external_mask },
     
    790845    set_enter_wrapper },
    791846#endif
    792 
    793847
    794848#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
     
    826880  { N_("file"),           SH_SECTION_USER1,      SH_SECTION_NONE,
    827881    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 },
    840882  { N_("dir"),            SH_SECTION_PRELINK,    SH_SECTION_NONE,
    841883    sh_files_pushdir_prelink },
     
    860902    sh_util_obscure_ok },
    861903  { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE,
    862     sh_files_setrecursion },
     904    sh_files_setrecursion_wrap },
    863905  { N_("checksumtest"),       SH_SECTION_MISC,   SH_SECTION_NONE,
    864     sh_util_setchecksum },
     906    sh_util_setchecksum_wrap },
    865907  { N_("reportonlyonce"),     SH_SECTION_MISC,   SH_SECTION_NONE,
    866908    sh_files_reportonce },
     
    911953    sh_files_redef_user1 },
    912954
    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 
    922955  { N_("redefprelink"),         SH_SECTION_MISC,   SH_SECTION_NONE,
    923956    sh_files_redef_prelink },
     
    928961  { N_("setprelinkchecksum"),   SH_SECTION_MISC,   SH_SECTION_NONE,
    929962    sh_prelink_set_hash },
    930 
    931963  /* client or standalone
    932964   */
     
    945977    sh_socket_password },
    946978  { N_("setstripdomain"),      SH_SECTION_SRV,  SH_SECTION_MISC,
    947     sh_forward_set_strip },
     979    sh_forward_set_strip_wrap },
    948980  { N_("useseparatelogs"),     SH_SECTION_SRV,  SH_SECTION_MISC,
    949981    set_flag_sep_log },
    950982  { N_("setchrootdir"),        SH_SECTION_SRV,  SH_SECTION_MISC,
    951     sh_unix_set_chroot },
     983    sh_unix_set_chroot_wrap },
    952984  { N_("setclienttimelimit"),  SH_SECTION_SRV,  SH_SECTION_MISC,
    953985    sh_forward_set_time_limit },
     
    9681000#endif
    9691001
    970 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
     1002#ifdef SH_WITH_CLIENT
    9711003  { N_("exportseverity"),      SH_SECTION_LOG,  SH_SECTION_NONE,
    972     sh_error_setexport },
     1004    sh_error_setexport_wrap },
    9731005  { N_("exportclass"),         SH_SECTION_LOG,  SH_SECTION_NONE,
    9741006    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
    9791007  { N_("setlogserver"),        SH_SECTION_CLT,  SH_SECTION_MISC,
    9801008    sh_forward_setlogserver },
    981 #endif
    9821009#endif
    9831010  { N_("setfilechecktime"),  SH_SECTION_MISC,   SH_SECTION_NONE,
    9841011    sh_readconf_setFiletime },
    9851012  { N_("setlooptime"),     SH_SECTION_MISC,  SH_SECTION_NONE,
    986     sh_util_setlooptime },
     1013    sh_util_setlooptime_wrap },
    9871014
    9881015#ifdef SH_WITH_MAIL
    9891016  { N_("mailseverity"),      SH_SECTION_LOG,   SH_SECTION_NONE,
    990     sh_error_setseverity },
     1017    sh_error_setseverity_wrap },
    9911018  { N_("mailclass"),         SH_SECTION_LOG,   SH_SECTION_NONE,
    9921019    sh_error_mail_mask },
     
    10131040#endif
    10141041  { N_("setbindaddress"),    SH_SECTION_MISC,  SH_SECTION_NONE,
    1015     sh_calls_set_bind_addr },
     1042    sh_calls_set_bind_addr_wrap },
    10161043  { N_("daemon"),            SH_SECTION_MISC,  SH_SECTION_NONE,
    1017     sh_unix_setdeamon },
     1044    sh_unix_setdeamon_wrap },
    10181045  { N_("samhainpath"),       SH_SECTION_MISC,  SH_SECTION_NONE,
    10191046    sh_unix_self_hash },
     
    10241051
    10251052  { N_("printseverity"),     SH_SECTION_LOG,   SH_SECTION_NONE,
    1026     sh_error_setprint },
     1053    sh_error_setprint_wrap },
    10271054  { N_("printclass"),        SH_SECTION_LOG,   SH_SECTION_NONE,
    10281055    sh_error_print_mask },
    10291056
    10301057  { N_("logseverity"),       SH_SECTION_LOG,   SH_SECTION_NONE,
    1031     sh_error_setlog },
     1058    sh_error_setlog_wrap },
    10321059  { N_("logclass"),          SH_SECTION_LOG,   SH_SECTION_NONE,
    10331060    sh_error_log_mask },
    10341061
    10351062  { N_("syslogseverity"),    SH_SECTION_LOG,   SH_SECTION_NONE,
    1036     sh_error_set_syslog },
     1063    sh_error_set_syslog_wrap },
    10371064  { N_("syslogclass"),       SH_SECTION_LOG,   SH_SECTION_NONE,
    10381065    sh_error_syslog_mask },
    10391066#ifdef HAVE_LIBPRELUDE
    10401067  { N_("preludeseverity"),   SH_SECTION_LOG,   SH_SECTION_NONE,
    1041     sh_error_set_prelude },
     1068    sh_error_set_prelude_wrap },
    10421069  { N_("preludeclass"),      SH_SECTION_LOG,   SH_SECTION_NONE,
    10431070    sh_error_prelude_mask },
     
    11201147    N_("severityuser0"),
    11211148    N_("severityuser1"),
    1122     N_("severityuser2"),
    1123     N_("severityuser3"),
    1124     N_("severityuser4"),
    11251149    N_("severityprelink"),
    11261150    NULL
     
    11391163    SH_ERR_T_USER0,       
    11401164    SH_ERR_T_USER1,       
    1141     SH_ERR_T_USER2,       
    1142     SH_ERR_T_USER3,       
    1143     SH_ERR_T_USER4,       
    11441165    SH_ERR_T_PRELINK,       
    11451166  };
Note: See TracChangeset for help on using the changeset viewer.