Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_readconf.c

    r20 r27  
    5252#endif
    5353
    54 extern int set_reverse_lookup (char * c);
     54extern int set_reverse_lookup (const 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,
    7174  SH_SECTION_PRELINK,
    7275#if defined (SH_WITH_MAIL)
     
    108111  { N_("[User0]"),            SH_SECTION_USER0},
    109112  { N_("[User1]"),            SH_SECTION_USER1},
     113  { N_("[User2]"),            SH_SECTION_USER2},
     114  { N_("[User3]"),            SH_SECTION_USER3},
     115  { N_("[User4]"),            SH_SECTION_USER4},
    110116  { N_("[Prelink]"),          SH_SECTION_PRELINK},
    111117#ifdef WITH_EXTERNAL
     
    282288  /* The system type, release, and machine.
    283289   */
    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);
    286293
    287294
     
    580587}
    581588
    582 int sh_readconf_set_path (char * which, char * what)
     589int sh_readconf_set_path (char * which, const char * what)
    583590{
    584591  int len;
     
    621628}
    622629
    623 int sh_readconf_set_database_path (char * what)
     630int sh_readconf_set_database_path (const char * what)
    624631{
    625632  return (sh_readconf_set_path(sh.data.path, what));
    626633}
    627634
    628 int sh_readconf_set_logfile_path (char * what)
     635int sh_readconf_set_logfile_path (const char * what)
    629636{
    630637  return (sh_readconf_set_path(sh.srvlog.name, what));
    631638}
    632639
    633 int sh_readconf_set_lockfile_path (char * what)
     640int sh_readconf_set_lockfile_path (const char * what)
    634641{
    635642  return( sh_readconf_set_path(sh.srvlog.alt, what));
     
    645652 
    646653   
    647 int sh_readconf_setTime (char * str, ShTimerItem what)
     654int sh_readconf_setTime (const char * str, ShTimerItem what)
    648655{
    649656  unsigned long i = atoi (str);
     
    674681}
    675682
    676 int sh_readconf_setMailtime (char * c)
     683int sh_readconf_setMailtime (const char * c)
    677684{
    678685  return sh_readconf_setTime (c, SET_MAILTIME);
    679686}
    680687
    681 int sh_readconf_setFiletime (char * c)
     688int sh_readconf_setFiletime (const char * c)
    682689{
    683690  return sh_readconf_setTime (c, SET_FILETIME);
    684691}
    685692
    686 int sh_readconf_set_nice (char * c)
     693int sh_readconf_set_nice (const char * c)
    687694{
    688695  long val;
     
    704711
    705712#ifdef FANCY_LIBCAP
    706 int sh_readconf_setCaps(char * c)
     713int sh_readconf_setCaps(const char * c)
    707714{
    708715  int i;
     
    718725  ShSectionType   section;
    719726  ShSectionType   alt_section;
    720   int (*func)(char * opt);
     727  int (*func)(const char * opt);
    721728} cfg_options;
    722729
    723730#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
    724 extern int sh_set_schedule_one(char * str);
    725 extern int sh_set_schedule_two(char * str);
     731extern int sh_set_schedule_one(const char * str);
     732extern int sh_set_schedule_two(const char * str);
    726733#endif
    727734#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  
     735extern int sh_socket_use (const char * c);
     736extern int sh_socket_uid (const char * c);
     737extern int sh_socket_password (const char * c);
     738#endif
     739
    795740cfg_options ext_table[] = {
    796741#if defined(WITH_EXTERNAL)
     
    818763    sh_ext_add_or },
    819764  { N_("externalseverity"),SH_SECTION_LOG,      SH_SECTION_EXTERNAL, 
    820     sh_error_set_external_wrap },
     765    sh_error_set_external },
    821766  { N_("externalclass"),   SH_SECTION_LOG,      SH_SECTION_EXTERNAL, 
    822767    sh_error_external_mask },
     
    845790    set_enter_wrapper },
    846791#endif
     792
    847793
    848794#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
     
    880826  { N_("file"),           SH_SECTION_USER1,      SH_SECTION_NONE,
    881827    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 },
    882840  { N_("dir"),            SH_SECTION_PRELINK,    SH_SECTION_NONE,
    883841    sh_files_pushdir_prelink },
     
    902860    sh_util_obscure_ok },
    903861  { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE,
    904     sh_files_setrecursion_wrap },
     862    sh_files_setrecursion },
    905863  { N_("checksumtest"),       SH_SECTION_MISC,   SH_SECTION_NONE,
    906     sh_util_setchecksum_wrap },
     864    sh_util_setchecksum },
    907865  { N_("reportonlyonce"),     SH_SECTION_MISC,   SH_SECTION_NONE,
    908866    sh_files_reportonce },
     
    953911    sh_files_redef_user1 },
    954912
     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
    955922  { N_("redefprelink"),         SH_SECTION_MISC,   SH_SECTION_NONE,
    956923    sh_files_redef_prelink },
     
    961928  { N_("setprelinkchecksum"),   SH_SECTION_MISC,   SH_SECTION_NONE,
    962929    sh_prelink_set_hash },
     930
    963931  /* client or standalone
    964932   */
     
    977945    sh_socket_password },
    978946  { N_("setstripdomain"),      SH_SECTION_SRV,  SH_SECTION_MISC,
    979     sh_forward_set_strip_wrap },
     947    sh_forward_set_strip },
    980948  { N_("useseparatelogs"),     SH_SECTION_SRV,  SH_SECTION_MISC,
    981949    set_flag_sep_log },
    982950  { N_("setchrootdir"),        SH_SECTION_SRV,  SH_SECTION_MISC,
    983     sh_unix_set_chroot_wrap },
     951    sh_unix_set_chroot },
    984952  { N_("setclienttimelimit"),  SH_SECTION_SRV,  SH_SECTION_MISC,
    985953    sh_forward_set_time_limit },
     
    1000968#endif
    1001969
    1002 #ifdef SH_WITH_CLIENT
     970#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
    1003971  { N_("exportseverity"),      SH_SECTION_LOG,  SH_SECTION_NONE,
    1004     sh_error_setexport_wrap },
     972    sh_error_setexport },
    1005973  { N_("exportclass"),         SH_SECTION_LOG,  SH_SECTION_NONE,
    1006974    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
    1007979  { N_("setlogserver"),        SH_SECTION_CLT,  SH_SECTION_MISC,
    1008980    sh_forward_setlogserver },
     981#endif
    1009982#endif
    1010983  { N_("setfilechecktime"),  SH_SECTION_MISC,   SH_SECTION_NONE,
    1011984    sh_readconf_setFiletime },
    1012985  { N_("setlooptime"),     SH_SECTION_MISC,  SH_SECTION_NONE,
    1013     sh_util_setlooptime_wrap },
     986    sh_util_setlooptime },
    1014987
    1015988#ifdef SH_WITH_MAIL
    1016989  { N_("mailseverity"),      SH_SECTION_LOG,   SH_SECTION_NONE,
    1017     sh_error_setseverity_wrap },
     990    sh_error_setseverity },
    1018991  { N_("mailclass"),         SH_SECTION_LOG,   SH_SECTION_NONE,
    1019992    sh_error_mail_mask },
     
    10401013#endif
    10411014  { N_("setbindaddress"),    SH_SECTION_MISC,  SH_SECTION_NONE,
    1042     sh_calls_set_bind_addr_wrap },
     1015    sh_calls_set_bind_addr },
    10431016  { N_("daemon"),            SH_SECTION_MISC,  SH_SECTION_NONE,
    1044     sh_unix_setdeamon_wrap },
     1017    sh_unix_setdeamon },
    10451018  { N_("samhainpath"),       SH_SECTION_MISC,  SH_SECTION_NONE,
    10461019    sh_unix_self_hash },
     
    10511024
    10521025  { N_("printseverity"),     SH_SECTION_LOG,   SH_SECTION_NONE,
    1053     sh_error_setprint_wrap },
     1026    sh_error_setprint },
    10541027  { N_("printclass"),        SH_SECTION_LOG,   SH_SECTION_NONE,
    10551028    sh_error_print_mask },
    10561029
    10571030  { N_("logseverity"),       SH_SECTION_LOG,   SH_SECTION_NONE,
    1058     sh_error_setlog_wrap },
     1031    sh_error_setlog },
    10591032  { N_("logclass"),          SH_SECTION_LOG,   SH_SECTION_NONE,
    10601033    sh_error_log_mask },
    10611034
    10621035  { N_("syslogseverity"),    SH_SECTION_LOG,   SH_SECTION_NONE,
    1063     sh_error_set_syslog_wrap },
     1036    sh_error_set_syslog },
    10641037  { N_("syslogclass"),       SH_SECTION_LOG,   SH_SECTION_NONE,
    10651038    sh_error_syslog_mask },
    10661039#ifdef HAVE_LIBPRELUDE
    10671040  { N_("preludeseverity"),   SH_SECTION_LOG,   SH_SECTION_NONE,
    1068     sh_error_set_prelude_wrap },
     1041    sh_error_set_prelude },
    10691042  { N_("preludeclass"),      SH_SECTION_LOG,   SH_SECTION_NONE,
    10701043    sh_error_prelude_mask },
     
    11471120    N_("severityuser0"),
    11481121    N_("severityuser1"),
     1122    N_("severityuser2"),
     1123    N_("severityuser3"),
     1124    N_("severityuser4"),
    11491125    N_("severityprelink"),
    11501126    NULL
     
    11631139    SH_ERR_T_USER0,       
    11641140    SH_ERR_T_USER1,       
     1141    SH_ERR_T_USER2,       
     1142    SH_ERR_T_USER3,       
     1143    SH_ERR_T_USER4,       
    11651144    SH_ERR_T_PRELINK,       
    11661145  };
Note: See TracChangeset for help on using the changeset viewer.