Changeset 22 for trunk/src/sh_readconf.c


Ignore:
Timestamp:
Feb 23, 2006, 12:03:58 AM (19 years ago)
Author:
rainer
Message:

Minor code revisions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_readconf.c

    r20 r22  
    5252#endif
    5353
    54 extern int set_reverse_lookup (char * c);
     54extern int set_reverse_lookup (const char * c);
    5555
    5656#undef  FIL__
     
    282282  /* The system type, release, and machine.
    283283   */
    284   sprintf(myident, _("%s:%s:%s"),                  /* known to fit  */
    285           sh.host.system, sh.host.release, sh.host.machine);
     284  sl_snprintf(myident, sizeof(myident), _("%s:%s:%s"), 
     285              sh.host.system, /* flawfinder: ignore */
     286              sh.host.release, sh.host.machine);
    286287
    287288
     
    580581}
    581582
    582 int sh_readconf_set_path (char * which, char * what)
     583int sh_readconf_set_path (char * which, const char * what)
    583584{
    584585  int len;
     
    621622}
    622623
    623 int sh_readconf_set_database_path (char * what)
     624int sh_readconf_set_database_path (const char * what)
    624625{
    625626  return (sh_readconf_set_path(sh.data.path, what));
    626627}
    627628
    628 int sh_readconf_set_logfile_path (char * what)
     629int sh_readconf_set_logfile_path (const char * what)
    629630{
    630631  return (sh_readconf_set_path(sh.srvlog.name, what));
    631632}
    632633
    633 int sh_readconf_set_lockfile_path (char * what)
     634int sh_readconf_set_lockfile_path (const char * what)
    634635{
    635636  return( sh_readconf_set_path(sh.srvlog.alt, what));
     
    645646 
    646647   
    647 int sh_readconf_setTime (char * str, ShTimerItem what)
     648int sh_readconf_setTime (const char * str, ShTimerItem what)
    648649{
    649650  unsigned long i = atoi (str);
     
    674675}
    675676
    676 int sh_readconf_setMailtime (char * c)
     677int sh_readconf_setMailtime (const char * c)
    677678{
    678679  return sh_readconf_setTime (c, SET_MAILTIME);
    679680}
    680681
    681 int sh_readconf_setFiletime (char * c)
     682int sh_readconf_setFiletime (const char * c)
    682683{
    683684  return sh_readconf_setTime (c, SET_FILETIME);
    684685}
    685686
    686 int sh_readconf_set_nice (char * c)
     687int sh_readconf_set_nice (const char * c)
    687688{
    688689  long val;
     
    704705
    705706#ifdef FANCY_LIBCAP
    706 int sh_readconf_setCaps(char * c)
     707int sh_readconf_setCaps(const char * c)
    707708{
    708709  int i;
     
    718719  ShSectionType   section;
    719720  ShSectionType   alt_section;
    720   int (*func)(char * opt);
     721  int (*func)(const char * opt);
    721722} cfg_options;
    722723
    723724#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);
     725extern int sh_set_schedule_one(const char * str);
     726extern int sh_set_schedule_two(const char * str);
    726727#endif
    727728#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  
     729extern int sh_socket_use (const char * c);
     730extern int sh_socket_uid (const char * c);
     731extern int sh_socket_password (const char * c);
     732#endif
     733
    795734cfg_options ext_table[] = {
    796735#if defined(WITH_EXTERNAL)
     
    818757    sh_ext_add_or },
    819758  { N_("externalseverity"),SH_SECTION_LOG,      SH_SECTION_EXTERNAL, 
    820     sh_error_set_external_wrap },
     759    sh_error_set_external },
    821760  { N_("externalclass"),   SH_SECTION_LOG,      SH_SECTION_EXTERNAL, 
    822761    sh_error_external_mask },
     
    845784    set_enter_wrapper },
    846785#endif
     786
    847787
    848788#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
     
    902842    sh_util_obscure_ok },
    903843  { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE,
    904     sh_files_setrecursion_wrap },
     844    sh_files_setrecursion },
    905845  { N_("checksumtest"),       SH_SECTION_MISC,   SH_SECTION_NONE,
    906     sh_util_setchecksum_wrap },
     846    sh_util_setchecksum },
    907847  { N_("reportonlyonce"),     SH_SECTION_MISC,   SH_SECTION_NONE,
    908848    sh_files_reportonce },
     
    961901  { N_("setprelinkchecksum"),   SH_SECTION_MISC,   SH_SECTION_NONE,
    962902    sh_prelink_set_hash },
     903
    963904  /* client or standalone
    964905   */
     
    977918    sh_socket_password },
    978919  { N_("setstripdomain"),      SH_SECTION_SRV,  SH_SECTION_MISC,
    979     sh_forward_set_strip_wrap },
     920    sh_forward_set_strip },
    980921  { N_("useseparatelogs"),     SH_SECTION_SRV,  SH_SECTION_MISC,
    981922    set_flag_sep_log },
    982923  { N_("setchrootdir"),        SH_SECTION_SRV,  SH_SECTION_MISC,
    983     sh_unix_set_chroot_wrap },
     924    sh_unix_set_chroot },
    984925  { N_("setclienttimelimit"),  SH_SECTION_SRV,  SH_SECTION_MISC,
    985926    sh_forward_set_time_limit },
     
    1002943#ifdef SH_WITH_CLIENT
    1003944  { N_("exportseverity"),      SH_SECTION_LOG,  SH_SECTION_NONE,
    1004     sh_error_setexport_wrap },
     945    sh_error_setexport },
    1005946  { N_("exportclass"),         SH_SECTION_LOG,  SH_SECTION_NONE,
    1006947    sh_error_export_mask },
     
    1011952    sh_readconf_setFiletime },
    1012953  { N_("setlooptime"),     SH_SECTION_MISC,  SH_SECTION_NONE,
    1013     sh_util_setlooptime_wrap },
     954    sh_util_setlooptime },
    1014955
    1015956#ifdef SH_WITH_MAIL
    1016957  { N_("mailseverity"),      SH_SECTION_LOG,   SH_SECTION_NONE,
    1017     sh_error_setseverity_wrap },
     958    sh_error_setseverity },
    1018959  { N_("mailclass"),         SH_SECTION_LOG,   SH_SECTION_NONE,
    1019960    sh_error_mail_mask },
     
    1040981#endif
    1041982  { N_("setbindaddress"),    SH_SECTION_MISC,  SH_SECTION_NONE,
    1042     sh_calls_set_bind_addr_wrap },
     983    sh_calls_set_bind_addr },
    1043984  { N_("daemon"),            SH_SECTION_MISC,  SH_SECTION_NONE,
    1044     sh_unix_setdeamon_wrap },
     985    sh_unix_setdeamon },
    1045986  { N_("samhainpath"),       SH_SECTION_MISC,  SH_SECTION_NONE,
    1046987    sh_unix_self_hash },
     
    1051992
    1052993  { N_("printseverity"),     SH_SECTION_LOG,   SH_SECTION_NONE,
    1053     sh_error_setprint_wrap },
     994    sh_error_setprint },
    1054995  { N_("printclass"),        SH_SECTION_LOG,   SH_SECTION_NONE,
    1055996    sh_error_print_mask },
    1056997
    1057998  { N_("logseverity"),       SH_SECTION_LOG,   SH_SECTION_NONE,
    1058     sh_error_setlog_wrap },
     999    sh_error_setlog },
    10591000  { N_("logclass"),          SH_SECTION_LOG,   SH_SECTION_NONE,
    10601001    sh_error_log_mask },
    10611002
    10621003  { N_("syslogseverity"),    SH_SECTION_LOG,   SH_SECTION_NONE,
    1063     sh_error_set_syslog_wrap },
     1004    sh_error_set_syslog },
    10641005  { N_("syslogclass"),       SH_SECTION_LOG,   SH_SECTION_NONE,
    10651006    sh_error_syslog_mask },
    10661007#ifdef HAVE_LIBPRELUDE
    10671008  { N_("preludeseverity"),   SH_SECTION_LOG,   SH_SECTION_NONE,
    1068     sh_error_set_prelude_wrap },
     1009    sh_error_set_prelude },
    10691010  { N_("preludeclass"),      SH_SECTION_LOG,   SH_SECTION_NONE,
    10701011    sh_error_prelude_mask },
Note: See TracChangeset for help on using the changeset viewer.