Changeset 170 for trunk/src


Ignore:
Timestamp:
Apr 30, 2008, 11:56:45 PM (17 years ago)
Author:
katerina
Message:

Plenty of compiler warnings fixed, SQL query length fixed, doc update.

Location:
trunk/src
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cutest_sh_tiger0.c

    r151 r170  
    1010
    1111#if defined(HAVE_PTHREAD) && defined(SH_STEALTH)
    12 extern void sh_g_init();
     12extern void sh_g_init(void);
    1313#endif
    1414
    1515
    16 static void init() {
     16static void init(void) {
    1717
    1818  extern unsigned char TcpFlag[8][PW_LEN+1];
  • trunk/src/samhain.c

    r169 r170  
    167167}
    168168
    169 void sh_g_init()
     169void sh_g_init(void)
    170170{
    171171  if (0 != pthread_key_create(&g_key, sh_g_destroy))
     
    695695#endif
    696696#if defined(SH_WITH_SERVER)
    697   extern int sh_socket_remove ();
     697  extern int sh_socket_remove (void);
    698698#endif
    699699
     
    800800#if defined(__linux__) || defined(sun) || defined(__sun) || defined(__sun__)
    801801#include <dirent.h>
    802 static pid_t * procdirSamhain ()
     802static pid_t * procdirSamhain (void)
    803803{
    804   volatile pid_t        * pidlist = malloc(sizeof(pid_t) * 65535);
    805   pid_t        * dummy;
     804  pid_t        * pidlist;
    806805  struct dirent * d;
    807806  DIR *        dp;
    808807  long         ino;
    809808  struct stat  buf;
    810   int          i = 0;
     809  int          i;
    811810  pid_t        pid, mypid = getpid();
    812811  char       * tail;
    813812  char         exef[128];
    814813
    815   if (!pidlist)
    816     return NULL;
    817 
    818   for (i = 0; i < 65535; ++i) pidlist[i] = 0;
    819   i = 0;
    820 
    821814  if (0 != stat(SH_INSTALL_PATH, &buf))
    822815    {
    823       dummy = (pid_t *)pidlist;
    824       free(dummy);
    825816      return NULL;
    826817    }
     
    830821  if (NULL == (dp = opendir("/proc")))
    831822    {
    832       dummy = (pid_t *)pidlist;
    833       free(dummy);
    834823      return NULL;
    835824    }
     
    837826  SH_MUTEX_LOCK(mutex_readdir);
    838827
     828  pidlist =  malloc(sizeof(pid_t) * 65535);
     829  if (!pidlist)
     830    goto unlock_and_out;
     831
     832  for (i = 0; i < 65535; ++i) pidlist[i] = 0;
     833
     834  i = 0;
    839835  while (NULL != (d = readdir(dp)) && i < 65535)
    840836    {
     
    858854    }
    859855
     856 unlock_and_out:
     857  ;
    860858  SH_MUTEX_UNLOCK(mutex_readdir);
    861859
    862860  closedir(dp);
    863   return (pid_t *)pidlist;
     861  return pidlist;
    864862}
    865863#else
    866 static pid_t * procdirSamhain ()
     864static pid_t * procdirSamhain (void)
    867865{
    868866  return NULL;
     
    11911189#endif
    11921190#if defined(SH_WITH_SERVER)
    1193   extern int    sh_create_tcp_socket();
     1191  extern int    sh_create_tcp_socket(void);
    11941192#endif
    11951193
     
    12081206
    12091207  volatile time_t        told;
    1210   time_t        tcurrent;
     1208  volatile time_t        tcurrent;
    12111209  size_t        tzlen;
    12121210  char *        tzptr;
  • trunk/src/samhain_setpwd.c

    r22 r170  
    231231  int    oldf;
    232232  int    newf;
     233  int    ret;
    233234
    234235  unsigned long bytecount;
     
    396397
    397398
    398       write (newf, buf, dat);
     399      ret = write (newf, buf, dat);
     400      if (dat > 0 && ret < 0)
     401        {
     402          fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn);
     403          fflush(stdout);
     404          return EXIT_FAILURE;
     405        }
    399406    }
    400407
     
    418425
    419426  dat = read (oldf, buf, (GRAB_SIZE / 2));
    420   write (newf, buf, dat);
     427  ret = write (newf, buf, dat);
     428  if (dat > 0 && ret < 0)
     429    {
     430      fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn);
     431      fflush(stdout);
     432      return EXIT_FAILURE;
     433    }
    421434
    422435  bytecount = 0;
     
    469482        }
    470483
    471       write (newf, buf, dat);
     484      ret = write (newf, buf, dat);
     485      if (dat > 0 && ret < 0)
     486        {
     487          fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn);
     488          fflush(stdout);
     489          return EXIT_FAILURE;
     490        }
    472491    }
    473492
  • trunk/src/sh_calls.c

    r169 r170  
    5959typedef struct cht_struct
    6060{
    61   char           * str;
     61  const char           * str;
    6262  unsigned long    val;
    6363} cht_type;
     
    109109/* Need to catch EINTR for these functions.
    110110 */
    111 long int retry_sigaction(char * file, int line,
     111long int retry_sigaction(const char * file, int line,
    112112                         int signum,  const  struct  sigaction  *act,
    113113                         struct sigaction *oldact)
     
    156156
    157157
    158 long int retry_connect(char * file, int line, int sockfd,
     158long int retry_connect(const char * file, int line, int sockfd,
    159159                       struct sockaddr *serv_addr, int addrlen)
    160160{
     
    209209}
    210210
    211 long int retry_accept(char * file, int line, int fd,
     211long int retry_accept(const char * file, int line, int fd,
    212212                      struct sockaddr *serv_addr, int * addrlen)
    213213{
     
    236236}
    237237
    238 long int retry_lstat(char * file, int line,
     238long int retry_lstat(const char * file, int line,
    239239                     const char *file_name, struct stat *buf)
    240240{
     
    259259}
    260260
    261 long int retry_stat(char * file, int line,
     261long int retry_stat(const char * file, int line,
    262262                    const char *file_name, struct stat *buf)
    263263{
     
    282282}
    283283
    284 long int retry_fstat(char * file, int line, int filed, struct stat *buf)
     284long int retry_fstat(const char * file, int line, int filed, struct stat *buf)
    285285{
    286286  int error;
     
    303303}
    304304
    305 long int retry_fcntl(char * file, int line, int fd, int cmd, long arg)
     305long int retry_fcntl(const char * file, int line, int fd, int cmd, long arg)
    306306{
    307307  int error;
     
    389389 ***************************************************/
    390390
    391 long int retry_aud_execve  (char * file, int line,
     391long int retry_aud_execve  (const char * file, int line,
    392392                            const  char *dateiname, char * argv[],
    393393                            char * envp[])
     
    419419
    420420
    421 long int retry_aud_utime (char * file, int line,
    422                            char * path, struct utimbuf *buf)
     421long int retry_aud_utime (const char * file, int line,
     422                          char * path, struct utimbuf *buf)
    423423{
    424424  long int val_return;
     
    450450}
    451451
    452 long int retry_aud_unlink (char * file, int line,
     452long int retry_aud_unlink (const char * file, int line,
    453453                           char * path)
    454454{
     
    477477}
    478478
    479 long int retry_aud_dup2 (char * file, int line,
     479long int retry_aud_dup2 (const char * file, int line,
    480480                         int fd, int fd2)
    481481{
     
    504504}
    505505
    506 long int retry_aud_dup (char * file, int line,
     506long int retry_aud_dup (const char * file, int line,
    507507                        int fd)
    508508{
     
    532532
    533533 
    534 long int retry_aud_chdir (char * file, int line,
     534long int retry_aud_chdir (const char * file, int line,
    535535                          const char *path)
    536536{
     
    560560
    561561
    562 long int aud_open_noatime (char * file, int line, int privs,
     562long int aud_open_noatime (const char * file, int line, int privs,
    563563                           const char *pathname, int flags, mode_t mode,
    564564                           int * o_noatime)
     
    601601}
    602602
    603 long int aud_open (char * file, int line, int privs,
     603long int aud_open (const char * file, int line, int privs,
    604604                   const char *pathname, int flags, mode_t mode)
    605605{
     
    635635}
    636636 
    637 long int aud_kill (char * file, int line, pid_t pid, int sig)
     637long int aud_kill (const char * file, int line, pid_t pid, int sig)
    638638{
    639639  int  myerror;
     
    657657 
    658658/*@noreturn@*/
    659 void aud_exit (char * file, int line, int fd)
     659void aud_exit (const char * file, int line, int fd)
    660660{
    661661  if (sh.flag.audit != 0 && (sh.flag.aud_mask & AUD_EXIT) != 0)
     
    670670
    671671/*@noreturn@*/
    672 void aud__exit (char * file, int line, int fd)
     672void aud__exit (const char * file, int line, int fd)
    673673{
    674674  if (sh.flag.audit != 0 && (sh.flag.aud_mask & AUD_EXIT) != 0)
     
    682682}
    683683
    684 pid_t aud_fork (char * file, int line)
     684pid_t aud_fork (const char * file, int line)
    685685{
    686686  int error;
     
    703703}
    704704
    705 int aud_setuid (char * file, int line, uid_t uid)
     705int aud_setuid (const char * file, int line, uid_t uid)
    706706{
    707707  int error = 0;
     
    731731}
    732732
    733 int aud_setgid (char * file, int line, gid_t gid)
     733int aud_setgid (const char * file, int line, gid_t gid)
    734734{
    735735  int error = 0;
     
    760760}
    761761
    762 int aud_pipe (char * file, int line, int * modus)
     762int aud_pipe (const char * file, int line, int * modus)
    763763{
    764764  int error;
  • trunk/src/sh_cat.c

    r169 r170  
    88/*@-nullassign@*/
    99
    10 char * class_cat[] = {
     10const char * class_cat[] = {
    1111  N_("AUD"),     /*  0 */
    1212  N_("PANIC"),   /*  1 */
     
    263263  { MSG_E_READ,      SH_ERR_ERR,     ERR,   N_("msg=\"Not accessible or not a regular file\" path=\"%s\"")},
    264264  { MSG_E_TIMEOUT,   SH_ERR_ERR,     ERR,   N_("msg=\"Timeout (%d sec) while checksumming file\" path=\"%s\"")},
    265   { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=\"Device not available\" userid=\"%ld\" path=\"%s\"")},
     265  { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=\"Device not available or timeout during read attempt\" userid=\"%ld\" path=\"%s\"")},
    266266  { MSG_LOCKED,      SH_ERR_ERR,     ERR,   N_("msg=\"File lock error\" userid=\"%ld\" path=\"%s\" obj=\"%s\"")},
    267267  { MSG_PIDFILE,      SH_ERR_ERR,     ERR,   N_("msg=\"Could not write PID file\" userid=\"%ld\" path=\"%s\"")},
     
    580580  { MSG_E_READ,      SH_ERR_ERR,     ERR,   N_("msg=<Not accessible or not a regular file>, path=<%s>")},
    581581  { MSG_E_TIMEOUT,   SH_ERR_ERR,     ERR,   N_("msg=<Timeout (%d sec) while checksumming file>, path=<%s>")},
    582   { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=<Device not available>, userid=<%ld>, path=<%s>")},
     582  { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=<Device not available or timeout during read attempt>, userid=<%ld>, path=<%s>")},
    583583  { MSG_LOCKED,      SH_ERR_ERR,     ERR,   N_("msg=<File lock error>, userid=<%ld>, path=<%s>, obj=<%s>")},
    584584  { MSG_PIDFILE,      SH_ERR_ERR,     ERR,   N_("msg=<Could not write PID file>, userid=<%ld>, path=<%s>")},
  • trunk/src/sh_database.c

    r116 r170  
    6161  char            msg[1024];
    6262  char            sev[8];
    63   char            path[12288];
     63  char            path[MAX_PATH_STORE+1];
    6464  char            user[9];
    6565  char            group[9];
     
    8282  char            interface[64];   
    8383  char            ltime[64];   
    84   char            dir[1024];   
    85   char            linked_path[1024];
     84  char            dir[MAX_PATH_STORE+1];   
     85  char            linked_path[MAX_PATH_STORE+1];
    8686  char            service[64];   
    8787  char            facility[32];   
     
    107107  char            chksum_old[50];
    108108  char            chksum_new[50];
    109   char            link_old[1024];
    110   char            link_new[1024];
     109  char            link_old[MAX_PATH_STORE+1];
     110  char            link_new[MAX_PATH_STORE+1];
    111111  char            acl_old[1024];
    112112  char            acl_new[1024];
     
    134134  { NULL, N_("msg"),         0,   4, 1024, 0, offsetof(struct dbins_, msg) },
    135135
    136   { NULL, N_("path"),        0,   5,12288, 0, offsetof(struct dbins_, path)  },
     136  { NULL, N_("path"),        0,   5,MAX_PATH_STORE+1, 0, offsetof(struct dbins_, path)  },
    137137  /* username -> userid; replace (long) 'userid' - below - by 'dummy' */
    138138  { NULL, N_("userid"),      0,   6,    9, 0, offsetof(struct dbins_, user)  },
     
    155155  { NULL, N_("interface"),   0,  24,   64, 0, offsetof(struct dbins_, interface)},
    156156  { NULL, N_("time"),        0,  25,   64, 0, offsetof(struct dbins_, ltime)  },
    157   { NULL, N_("dir"),         0,  26, 1024, 0, offsetof(struct dbins_, dir)  },
    158   { NULL, N_("linked_path"), 0,  27, 1024, 0, offsetof(struct dbins_, linked_path)},
     157  { NULL, N_("dir"),         0,  26, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, dir)  },
     158  { NULL, N_("linked_path"), 0,  27, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, linked_path)},
    159159  { NULL, N_("service"),     0,  29,   64, 0, offsetof(struct dbins_, service)},
    160160  { NULL, N_("facility"),    0,  30,   32, 0, offsetof(struct dbins_, facility) },
     
    178178  { NULL, N_("chksum_old"),  0,  47,   50, 0, offsetof(struct dbins_, chksum_old)},
    179179  { NULL, N_("chksum_new"),  0,  48,   50, 0, offsetof(struct dbins_, chksum_new)},
    180   { NULL, N_("link_old"),    0,  49, 1024, 0, offsetof(struct dbins_, link_old)},
    181   { NULL, N_("link_new"),    0,  50, 1024, 0, offsetof(struct dbins_, link_new)},
     180  { NULL, N_("link_old"),    0,  49, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, link_old)},
     181  { NULL, N_("link_new"),    0,  50, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, link_new)},
    182182                                           
    183183  { NULL, N_("size_old"),     0,  51,    0, 0, 0  },
     
    10341034static int        connection_status = S_FALSE;
    10351035
    1036 void sh_database_reset()
     1036void sh_database_reset(void)
    10371037{
    10381038  connection_status = S_FALSE;
     
    12261226}
    12271227
    1228 #define SH_QUERY_MAX 16383
     1228#define SH_QUERY_MAX SH_MSG_BUF
     1229/* define SH_QUERY_MAX 16383 */
    12291230
    12301231static
     
    14501451static int sh_database_comp_attr (const void *m1, const void *m2)
    14511452{
    1452   my_attr *mi1 = (my_attr *) m1;
    1453   my_attr *mi2 = (my_attr *) m2;
     1453  const my_attr *mi1 = (const my_attr *) m1;
     1454  const my_attr *mi2 = (const my_attr *) m2;
    14541455  return strcmp(mi1->attr, mi2->attr);
    14551456}
    14561457
    14571458
    1458 static void init_attr_table()
     1459static void init_attr_table(void)
    14591460{
    14601461  static  int first = S_TRUE;
  • trunk/src/sh_entropy.c

    r154 r170  
    281281#include "sh_pthread.h"
    282282
    283 int read_mbytes(int timeout_val, char * path, char * nbuf, int nbytes)
     283int read_mbytes(int timeout_val, const char * path, char * nbuf, int nbytes)
    284284{
    285285  int m_count;
  • trunk/src/sh_err_console.c

    r153 r170  
    127127#define MY_MAX_MSG    1022
    128128
    129 static int push_message_queue (char * msg)
     129static int push_message_queue (const char * msg)
    130130{
    131131  struct sh_msgbuf*   recv_msg = NULL;
     
    258258
    259259#if defined(WITH_TRACE) || defined(WITH_TPT)
    260 char *  sh_log_console_name ()
     260char *  sh_log_console_name (void)
    261261{
    262262  if (! sh.srvcons.name || sh.srvcons.name[0] == '\0' ||
     
    273273/* ---- Print out a message. ----
    274274 */
    275 int  sh_log_console (/*@null@*/char *errmsg)
     275int  sh_log_console (const /*@null@*/char *errmsg)
    276276{
    277277  static int service_failure[2] = { 0, 0};
  • trunk/src/sh_err_log.c

    r153 r170  
    184184#endif
    185185
    186   buf  = (char *) SH_ALLOC( 2*SH_BUFSIZE+1 );
    187   bufc = (char *) SH_ALLOC( 2*SH_BUFSIZE+1 );
     186  buf  = (char *) SH_ALLOC( 2*SH_MSG_BUF+1 );
     187  bufc = (char *) SH_ALLOC( 2*SH_MSG_BUF+1 );
    188188
    189189  while (1 == 1)
     
    191191      /* get the log message
    192192       */
    193       if (sh_unix_getline (fd, buf, (2*SH_BUFSIZE)) < 0)
     193      if (sh_unix_getline (fd, buf, (2*SH_MSG_BUF)) < 0)
    194194        break;
    195195
     
    222222          start = 1;
    223223          do {
    224             if ( sh_unix_getline (fd, buf, (2*SH_BUFSIZE)) < 0)
     224            if ( sh_unix_getline (fd, buf, (2*SH_MSG_BUF)) < 0)
    225225              break;
    226226          } while (buf[0] == '\0' || buf[0] == '\n');
     
    293293        {
    294294          do {
    295             if ( sh_unix_getline (fd, bufc, (2*SH_BUFSIZE)) < 0)
     295            if ( sh_unix_getline (fd, bufc, (2*SH_MSG_BUF)) < 0)
    296296              break;
    297297          } while (bufc[0] == '\0' || bufc[0] == '\n');
     
    301301              /* A continuation line. Add the newline.
    302302               */
    303               (void) sl_strlcat(buf, "\n", 2*SH_BUFSIZE+1);
     303              (void) sl_strlcat(buf, "\n", 2*SH_MSG_BUF+1);
    304304              ++len;
    305               (void) sl_strlcat(buf, bufc, 2*SH_BUFSIZE+1);
     305              (void) sl_strlcat(buf, bufc, 2*SH_MSG_BUF+1);
    306306              len += (int) sl_strlen(bufc);
    307307            }
     
    437437        }
    438438     
    439       (void) sl_strlcat ( buf, key, 2*SH_BUFSIZE + 1);
     439      (void) sl_strlcat ( buf, key, 2*SH_MSG_BUF + 1);
    440440     
    441441#ifdef SH_STEALTH
  • trunk/src/sh_err_syslog.c

    r22 r170  
    3131
    3232typedef struct log_fac_struct {
    33   char * name;
     33  const char * name;
    3434  int    facility;
    3535} logfct;
  • trunk/src/sh_error.c

    r159 r170  
    105105static int sh_error_string (struct _log_t * lmsg, va_list vl);
    106106
    107 extern int  sh_log_console (/*@null@*/char *message);
     107extern int  sh_log_console (/*@null@*/const char *message);
    108108extern int  sh_log_syslog  (int  severity, /*@null@*/char *message);
    109109extern int  sh_log_file    (/*@null@*/char *message,
     
    173173
    174174static
    175 void compute_flag_err_debug()
     175void compute_flag_err_debug(void)
    176176{
    177177  if ((errFlags.loglevel & SH_ERR_ALL) != 0)
     
    197197
    198198static
    199 void compute_flag_err_info()
     199void compute_flag_err_info(void)
    200200{
    201201  if ((errFlags.loglevel & SH_ERR_INFO) != 0)
     
    220220}
    221221
    222 void sh_error_dbg_switch()
     222void sh_error_dbg_switch(void)
    223223{
    224224  if (dbg_flag == 0)
     
    466466typedef struct eef
    467467{
    468   char * str;
     468  const char * str;
    469469  int    val;
    470470} eef_struc;
     
    797797/* init or re-init log facilities that need it
    798798 */
    799 void sh_error_fixup()
     799void sh_error_fixup(void)
    800800{
    801801#if defined(HAVE_LIBPRELUDE_9)
     
    813813/* to be called from sh_prelude_reset
    814814 */
    815 void sh_error_init_prelude()
     815void sh_error_init_prelude(void)
    816816{
    817817#if defined(HAVE_LIBPRELUDE_9)
     
    865865SH_MUTEX_RECURSIVE(mutex_err_handle);
    866866
    867 void sh_error_handle (int sev, char * file, long line,
     867void sh_error_handle (int sev, const char * file, long line,
    868868                      long status, unsigned long msg_id, ...)
    869869{
     
    875875  char * fmt;
    876876
    877   int    flag_inet  = S_FALSE;
     877  int    flag_inet;
    878878
    879879#ifdef SH_WITH_SERVER
     
    974974    {
    975975      flag_inet = S_TRUE;
     976    }
     977  else
     978    {
     979      flag_inet  = S_FALSE;
    976980    }
    977981
     
    13551359          *priority = (int) msg_cat[i].priority;
    13561360          *class    = (unsigned int) msg_cat[i].class;
    1357           SL_RETURN (_(msg_cat[i].format), _("get_format"));
     1361          SL_RETURN (((char *) _(msg_cat[i].format)), _("get_format"));
    13581362        }
    13591363      ++i;
     
    15451549      /*@i@*/required = sl_vsnprintf(&(lmsg->msg[len]),
    15461550                                     (lmsg->msg_len - len), lmsg->format, vl);
     1551
    15471552      if ((required >= 0) &&
    15481553          sl_ok_adds(required, len) &&
     
    15561561          lmsg->msg_len = required + len + 4;
    15571562          (void) sl_vsnprintf(&(lmsg->msg[len]),
    1558                               (required + len + 1), lmsg->format, vl2);
     1563                              (required + 1), lmsg->format, vl2);
    15591564        }
    15601565      va_end(vl2);
  • trunk/src/sh_extern.c

    r169 r170  
    825825  if (!ext_com)
    826826    {
    827       SL_RETURN( NULL, ("command_init"));
     827      SL_RETURN( NULL, _("command_init"));
    828828    }
    829829
     
    853853  ext_com->next             = NULL;
    854854
    855   SL_RETURN( ext_com, ("command_init"));
     855  SL_RETURN( ext_com, _("command_init"));
    856856}
    857857
     
    11701170  if (ext_coms == NULL || ext_failed == (-1) || str == NULL)
    11711171    {
    1172       SL_RETURN (-1, ("sh_ext_deadtime"));
     1172      SL_RETURN (-1, _("sh_ext_deadtime"));
    11731173    }
    11741174  deadtime = strtol(str, &tail, 10);
    11751175  if (tail == str || deadtime < 0 || deadtime == LONG_MAX)
    11761176    {
    1177       SL_RETURN (-1, ("sh_ext_deadtime"));
     1177      SL_RETURN (-1, _("sh_ext_deadtime"));
    11781178    }
    11791179 
    11801180  ext_coms->deadtime = (time_t) deadtime; 
    1181   SL_RETURN (0, ("sh_ext_deadtime")); 
     1181  SL_RETURN (0, _("sh_ext_deadtime")); 
    11821182}
    11831183
  • trunk/src/sh_files.c

    r167 r170  
    14821482                              char * relativeName)
    14831483{
    1484   struct sh_dirent * dirlist = NULL;
    1485   struct sh_dirent * dirlist_orig = NULL;
     1484  struct sh_dirent * dirlist;
     1485  struct sh_dirent * dirlist_orig;
    14861486
    14871487  DIR *           thisDir = NULL;
     
    16461646   */
    16471647  SH_MUTEX_LOCK(mutex_readdir);
     1648
     1649  dirlist = NULL;
     1650  dirlist_orig = NULL;
    16481651
    16491652  do {
     
    22732276}
    22742277
    2275 extern void     aud_exit   (char * file, int line, int fd);
     2278extern void     aud_exit   (const char * file, int line, int fd);
    22762279     
    22772280int sh_files_test_setup ()
  • trunk/src/sh_forward.c

    r137 r170  
    22202220/* -- Mark all clients as dead.
    22212221 */
    2222 void sh_forward_mark_dead ()
     2222void sh_forward_mark_dead (void)
    22232223{
    22242224  zAVLCursor avlcursor;
     
    22382238/* -- Clean tree from dead clients.
    22392239 */
    2240 void sh_forward_clean_tree ()
     2240void sh_forward_clean_tree (void)
    22412241{
    22422242  zAVLCursor avlcursor;
     
    24992499/* -- Check for time limit exceeded. --
    25002500 */
    2501 static int client_time_check()
     2501static int client_time_check(void)
    25022502{
    25032503  zAVLCursor avlcursor;
     
    48144814static int sh_tcp_sock = -1;
    48154815
    4816 int sh_create_tcp_socket ()
     4816int sh_create_tcp_socket (void)
    48174817{
    48184818  struct sockaddr_in addr;
     
    53825382}
    53835383
    5384 void  free_client_tree ()
     5384void  free_client_tree (void)
    53855385{
    53865386  SL_ENTER(_("free_client_tree"));
  • trunk/src/sh_getopt.c

    r169 r170  
    5252
    5353typedef struct options {
    54   char * longopt;
     54  const char * longopt;
    5555  const char   shortopt;
    56   char * usage;
     56  const char * usage;
    5757  int          hasArg;
    5858  int (*func)(const char * opt);
     
    313313
    314314
    315 static void sh_getopt_print_log_facilities ()
     315static void sh_getopt_print_log_facilities (void)
    316316{
    317317  fputs (_("Compiled-in log facilities:"), stdout);
     
    372372}
    373373
    374 static void sh_getopt_print_options ()
     374static void sh_getopt_print_options (void)
    375375{
    376376  int num = 0;
     
    484484}
    485485
    486 static void sh_getopt_print_modules ()
     486static void sh_getopt_print_modules (void)
    487487{
    488488#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
     
    686686static int sh_getopt_forever (const char * dummy)
    687687{
    688   dummy = (void *) dummy;
     688  (void) dummy;
    689689  SL_ENTER(_("sh_getopt_forever"));
    690690  sh.flag.loop = S_TRUE;
  • trunk/src/sh_gpg.c

    r159 r170  
    214214static struct startup_info startInfo = { 0, NULL, 0, NULL, NULL, NULL };
    215215
    216 void sh_gpg_log_startup ()
     216void sh_gpg_log_startup (void)
    217217{
    218218  if (startInfo.program != NULL)
  • trunk/src/sh_hash.c

    r169 r170  
    246246
    247247
    248 /* MAX_PATH_STORE must be >= KEY_LEN
    249  */
    250 #define MAX_PATH_STORE 12287
    251 
    252248typedef struct store_info {
    253249
     
    294290} sh_file_t;
    295291
    296   static char  *policy[] = {
     292  static const char  *policy[] = {
    297293    N_("[]"),
    298294    N_("[ReadOnly]"),
     
    426422  char * str;
    427423  char hashbuf[KEYBUF_SIZE];
    428   int  retval = 0;
     424  int  retval;
    429425
    430426  /* --------  find the entry for the file ----------------       */
    431427
    432428  SH_MUTEX_LOCK(mutex_hash);
     429
     430  retval = 0;
    433431
    434432  if (sl_strlen(fullpath) <= MAX_PATH_STORE)
     
    786784}
    787785
    788 static void sh_hash_getline_end ()
     786static void sh_hash_getline_end (void)
    789787{
    790788  fclose (sh_fin_fd);
     
    11231121
    11241122  sh_file_t * p;
    1125   SL_TICKET fd    = (-1);
     1123  SL_TICKET fd;
    11261124  long i;
    11271125  int count = 0;
     
    11341132  char * buf  = NULL;
    11351133  int    bufc;
    1136   int    flag_pgp = S_FALSE;
    1137   int    flag_nohead = S_FALSE;
     1134  int    flag_pgp;
     1135  int    flag_nohead;
    11381136  SL_TICKET fdTmp = (-1);
    11391137  SL_TICKET open_tmp (void);
     
    11441142
    11451143  SH_MUTEX_LOCK(mutex_hash);
     1144
     1145#if defined(WITH_GPG) || defined(WITH_PGP)
     1146  flag_pgp = S_FALSE;
     1147  flag_nohead = S_FALSE;
     1148#endif
    11461149
    11471150  if (IsInit == 1)
     
    11491152      goto unlock_and_return;
    11501153    }
     1154
     1155  fd = (-1);
    11511156
    11521157#if defined(SH_WITH_CLIENT)
     
    13081313  /* } new 1.4.8 check sig also for files downloaded from server */
    13091314
    1310   line = SH_ALLOC(MAX_PATH_STORE+1);
     1315  line = SH_ALLOC(MAX_PATH_STORE+2);
    13111316
    13121317  /* fast forward to start of data
    13131318   */
    1314   sh_hash_setdataent(fd, line, MAX_PATH_STORE, file_path('D', 'R'));
     1319  sh_hash_setdataent(fd, line, MAX_PATH_STORE+1, file_path('D', 'R'));
    13151320
    13161321  for (i = 0; i < TABSIZE; ++i)
     
    13261331        }
    13271332
    1328       p = sh_hash_getdataent (fd, line, MAX_PATH_STORE);
     1333      p = sh_hash_getdataent (fd, line, MAX_PATH_STORE+1);
    13291334      if (p != NULL)
    13301335        {
     
    19221927{
    19231928  sh_file_t * p;
    1924   int retval = 0;
     1929  int retval;
    19251930
    19261931  if (IsInit != 1)
     
    19281933
    19291934  SH_MUTEX_LOCK(mutex_hash);
     1935
     1936  retval = 0;
     1937
    19301938  p = sh_hash_have_it_int (newname);
    19311939
     
    19441952{
    19451953  sh_file_t * p;
    1946   int retval = -1;
     1954  int retval;
    19471955
    19481956  if (IsInit != 1)
     
    19531961
    19541962  SH_MUTEX_LOCK(mutex_hash);
     1963
     1964  retval = (-1);
     1965
    19551966  p = sh_hash_have_it_int (newname);
    19561967  if (p)
     
    19731984{
    19741985  sh_file_t * p;
    1975   int retval = -1;
     1986  int retval;
    19761987
    19771988  if (IsInit != 1)
     
    19821993  if (p)
    19831994    retval = p->fflags;
     1995  else
     1996    retval = -1;
    19841997  SH_MUTEX_UNLOCK(mutex_hash);
    19851998  return retval;
     
    19892002{
    19902003  sh_file_t * p;
    1991   int retval = -1;
     2004  int retval;
    19922005
    19932006  if (IsInit != 1)
     
    20012014      retval = 0;
    20022015    }
     2016  else
     2017    retval = -1;
    20032018  SH_MUTEX_UNLOCK(mutex_hash);
    20042019  return retval;
     
    20352050  sh_file_t * p;
    20362051  char hashbuf[KEYBUF_SIZE];
    2037   int  retval = -1;
     2052  int  retval;
    20382053
    20392054  SL_ENTER(_("sh_hash_set_visited_int"));
     
    20722087      retval = 0;
    20732088    }
     2089  else
     2090    retval = -1;
    20742091
    20752092  SH_MUTEX_UNLOCK(mutex_hash);
     
    23732390  char * format;
    23742391
    2375   char * tmp = SH_ALLOC(SH_BUFSIZE);
    2376   char * msg = SH_ALLOC(SH_BUFSIZE);
     2392  char * tmp = SH_ALLOC(SH_MSG_BUF);
     2393  char * msg = SH_ALLOC(SH_MSG_BUF);
    23772394
    23782395  tmp[0] = '\0';
     
    23852402  else
    23862403    format = _("mode_old=\"%s\" attr_old=\"%s\" imode_old=\"%ld\" iattr_old=\"%ld\" ");
    2387   sl_snprintf(tmp, SH_BUFSIZE, format,
     2404  sl_snprintf(tmp, SH_MSG_BUF, format,
    23882405              theFile->c_mode,
    23892406              theFile->c_attributes,
     
    23972414    format = _("mode_old=\"%s\" imode_old=\"%ld\" ");
    23982415
    2399   sl_snprintf(tmp, SH_BUFSIZE, format,
     2416  sl_snprintf(tmp, SH_MSG_BUF, format,
    24002417              theFile->c_mode,
    24012418              (long) theFile->mode
    24022419              );
    24032420#endif
    2404   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2421  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24052422
    24062423  if (is_new)
     
    24082425  else
    24092426    format = _("hardlinks_old=\"%lu\" ");
    2410   sl_snprintf(tmp, SH_BUFSIZE, format,
     2427  sl_snprintf(tmp, SH_MSG_BUF, format,
    24112428              (unsigned long) theFile->hardlinks);
    2412   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2429  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24132430
    24142431
     
    24172434  else
    24182435    format = _("idevice_old=\"%lu\" ");
    2419   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
    2420   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2436  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->rdev);
     2437  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24212438
    24222439
     
    24252442  else
    24262443    format = _("inode_old=\"%lu\" ");
    2427   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
    2428   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2444  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->ino);
     2445  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24292446
    24302447  /*
     
    24362453  else
    24372454    format = _("dev_old=\"%lu,%lu\" ");
    2438   sl_snprintf(tmp, SH_BUFSIZE, format,               
     2455  sl_snprintf(tmp, SH_MSG_BUF, format,               
    24392456              (unsigned long) major(theFile->dev),
    24402457              (unsigned long) minor(theFile->dev));
    2441   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2458  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24422459#endif
    24432460
     
    24472464  else
    24482465    format = _("owner_old=\"%s\" iowner_old=\"%ld\" ");
    2449   sl_snprintf(tmp, SH_BUFSIZE, format,
     2466  sl_snprintf(tmp, SH_MSG_BUF, format,
    24502467              theFile->c_owner, (long) theFile->owner);
    2451   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2468  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24522469
    24532470
     
    24562473  else
    24572474    format = _("group_old=\"%s\" igroup_old=\"%ld\" ");
    2458   sl_snprintf(tmp, SH_BUFSIZE, format,
     2475  sl_snprintf(tmp, SH_MSG_BUF, format,
    24592476              theFile->c_group, (long) theFile->group);
    2460   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2477  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24612478
    24622479
    24632480  if (is_new)
    2464     sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
     2481    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
    24652482                (UINT64) 0, (UINT64) theFile->size);
    24662483  else
    2467     sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
     2484    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
    24682485                (UINT64) theFile->size, (UINT64) 0);
    2469   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2486  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24702487
    24712488
    24722489  (void) sh_unix_gmttime (theFile->ctime, timstr1c,  sizeof(timstr1c));
    24732490  if (is_new)
    2474     sl_snprintf(tmp, SH_BUFSIZE, _("ctime_new=\"%s\" "), timstr1c);
    2475   else
    2476     sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=\"%s\" "), timstr1c);
    2477   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2491    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_new=\"%s\" "), timstr1c);
     2492  else
     2493    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=\"%s\" "), timstr1c);
     2494  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24782495
    24792496  (void) sh_unix_gmttime (theFile->atime, timstr1a,  sizeof(timstr1a));
    24802497  if (is_new)
    2481     sl_snprintf(tmp, SH_BUFSIZE, _("atime_new=\"%s\" "), timstr1a);
    2482   else
    2483     sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=\"%s\" "), timstr1a);
    2484   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2498    sl_snprintf(tmp, SH_MSG_BUF, _("atime_new=\"%s\" "), timstr1a);
     2499  else
     2500    sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=\"%s\" "), timstr1a);
     2501  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24852502
    24862503  (void) sh_unix_gmttime (theFile->mtime, timstr1m,  sizeof(timstr1m));
    24872504  if (is_new)
    2488     sl_snprintf(tmp, SH_BUFSIZE, _("mtime_new=\"%s\" "), timstr1m);
    2489   else
    2490     sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=\"%s\" "), timstr1m);
    2491   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2505    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_new=\"%s\" "), timstr1m);
     2506  else
     2507    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=\"%s\" "), timstr1m);
     2508  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24922509
    24932510  if (is_new)
    2494     sl_snprintf(tmp, SH_BUFSIZE, _("chksum_new=\"%s\" "), fileHash);
    2495   else
    2496     sl_snprintf(tmp, SH_BUFSIZE, _("chksum_old=\"%s\" "), fileHash);
    2497   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2511    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_new=\"%s\" "), fileHash);
     2512  else
     2513    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_old=\"%s\" "), fileHash);
     2514  sl_strlcat(msg, tmp, SH_MSG_BUF);
    24982515
    24992516  if (theFile->c_mode[0] == 'l' ||
     
    25042521        {
    25052522          if (is_new)
    2506             sl_snprintf(tmp, SH_BUFSIZE, _("link_new=\"%s\" "), tmp_lnk);
     2523            sl_snprintf(tmp, SH_MSG_BUF, _("link_new=\"%s\" "), tmp_lnk);
    25072524          else
    2508             sl_snprintf(tmp, SH_BUFSIZE, _("link_old=\"%s\" "), tmp_lnk);
     2525            sl_snprintf(tmp, SH_MSG_BUF, _("link_old=\"%s\" "), tmp_lnk);
    25092526          SH_FREE(tmp_lnk);
    2510           sl_strlcat(msg, tmp, SH_BUFSIZE);
     2527          sl_strlcat(msg, tmp, SH_MSG_BUF);
    25112528        }
    25122529    }
     
    25182535        {
    25192536          if (is_new)
    2520             sl_snprintf(tmp, SH_BUFSIZE, _("acl_new=\"%s\" "), tmp_lnk);
     2537            sl_snprintf(tmp, SH_MSG_BUF, _("acl_new=\"%s\" "), tmp_lnk);
    25212538          else
    2522             sl_snprintf(tmp, SH_BUFSIZE, _("acl_old=\"%s\" "), tmp_lnk);
     2539            sl_snprintf(tmp, SH_MSG_BUF, _("acl_old=\"%s\" "), tmp_lnk);
    25232540          SH_FREE(tmp_lnk);
    2524           sl_strlcat(msg, tmp, SH_BUFSIZE);
     2541          sl_strlcat(msg, tmp, SH_MSG_BUF);
    25252542        }
    25262543    }
     
    25402557  char * format;
    25412558
    2542   char * tmp = SH_ALLOC(SH_BUFSIZE);
    2543   char * msg = SH_ALLOC(SH_BUFSIZE);
     2559  char * tmp = SH_ALLOC(SH_MSG_BUF);
     2560  char * msg = SH_ALLOC(SH_MSG_BUF);
    25442561
    25452562  tmp[0] = '\0';
     
    25522569  else
    25532570    format = _("mode_old=<%s>, attr_old=<%s>, imode_old=<%ld>, iattr_old=<%ld>, ");
    2554   sl_snprintf(tmp, SH_BUFSIZE, format,
     2571  sl_snprintf(tmp, SH_MSG_BUF, format,
    25552572              theFile->c_mode,
    25562573              theFile->c_attributes,
     
    25642581    format = _("mode_old=<%s>, imode_old=<%ld>, ");
    25652582
    2566   sl_snprintf(tmp, SH_BUFSIZE, format,
     2583  sl_snprintf(tmp, SH_MSG_BUF, format,
    25672584              theFile->c_mode,
    25682585              (long) theFile->mode
    25692586              );
    25702587#endif
    2571   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2588  sl_strlcat(msg, tmp, SH_MSG_BUF);
    25722589
    25732590  if (is_new)
     
    25752592  else
    25762593    format = _("hardlinks_old=<%lu>, ");
    2577   sl_snprintf(tmp, SH_BUFSIZE, format,
     2594  sl_snprintf(tmp, SH_MSG_BUF, format,
    25782595              (unsigned long) theFile->hardlinks);
    2579   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2596  sl_strlcat(msg, tmp, SH_MSG_BUF);
    25802597
    25812598
     
    25842601  else
    25852602    format = _("idevice_old=<%lu>, ");
    2586   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
    2587   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2603  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->rdev);
     2604  sl_strlcat(msg, tmp, SH_MSG_BUF);
    25882605
    25892606
     
    25922609  else
    25932610    format = _("inode_old=<%lu>, ");
    2594   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
    2595   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2611  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->ino);
     2612  sl_strlcat(msg, tmp, SH_MSG_BUF);
    25962613
    25972614
     
    26042621  else
    26052622    format = _("dev_old=<%lu,%lu>, ");
    2606   sl_snprintf(tmp, SH_BUFSIZE, format,               
     2623  sl_snprintf(tmp, SH_MSG_BUF, format,               
    26072624              (unsigned long) major(theFile->dev),
    26082625              (unsigned long) minor(theFile->dev));
    2609   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2626  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26102627#endif
    26112628
     
    26142631  else
    26152632    format = _("owner_old=<%s>, iowner_old=<%ld>, ");
    2616   sl_snprintf(tmp, SH_BUFSIZE, format,
     2633  sl_snprintf(tmp, SH_MSG_BUF, format,
    26172634              theFile->c_owner, (long) theFile->owner);
    2618   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2635  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26192636
    26202637
     
    26232640  else
    26242641    format = _("group_old=<%s>, igroup_old=<%ld>, ");
    2625   sl_snprintf(tmp, SH_BUFSIZE, format,
     2642  sl_snprintf(tmp, SH_MSG_BUF, format,
    26262643              theFile->c_group, (long) theFile->group);
    2627   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2644  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26282645
    26292646
    26302647  if (is_new)
    2631     sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
     2648    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
    26322649                (UINT64) 0, (UINT64) theFile->size);
    26332650  else
    2634     sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
     2651    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
    26352652                (UINT64) theFile->size, (UINT64) 0);
    2636   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2653  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26372654
    26382655
    26392656  (void) sh_unix_gmttime (theFile->ctime, timstr1c,  sizeof(timstr1c));
    26402657  if (is_new)
    2641     sl_snprintf(tmp, SH_BUFSIZE, _("ctime_new=<%s>, "), timstr1c);
    2642   else
    2643     sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=<%s>, "), timstr1c);
    2644   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2658    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_new=<%s>, "), timstr1c);
     2659  else
     2660    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=<%s>, "), timstr1c);
     2661  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26452662
    26462663  (void) sh_unix_gmttime (theFile->atime, timstr1a,  sizeof(timstr1a));
    26472664  if (is_new)
    2648     sl_snprintf(tmp, SH_BUFSIZE, _("atime_new=<%s>, "), timstr1a);
    2649   else
    2650     sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=<%s>, "), timstr1a);
    2651   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2665    sl_snprintf(tmp, SH_MSG_BUF, _("atime_new=<%s>, "), timstr1a);
     2666  else
     2667    sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=<%s>, "), timstr1a);
     2668  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26522669
    26532670  (void) sh_unix_gmttime (theFile->mtime, timstr1m,  sizeof(timstr1m));
    26542671  if (is_new)
    2655     sl_snprintf(tmp, SH_BUFSIZE, _("mtime_new=<%s>, "), timstr1m);
    2656   else
    2657     sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=<%s>, "), timstr1m);
    2658   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2672    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_new=<%s>, "), timstr1m);
     2673  else
     2674    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=<%s>, "), timstr1m);
     2675  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26592676
    26602677  if (is_new)
    2661     sl_snprintf(tmp, SH_BUFSIZE, _("chksum_new=<%s>"), fileHash);
    2662   else
    2663     sl_snprintf(tmp, SH_BUFSIZE, _("chksum_old=<%s>"), fileHash);
    2664   sl_strlcat(msg, tmp, SH_BUFSIZE);
     2678    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_new=<%s>"), fileHash);
     2679  else
     2680    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_old=<%s>"), fileHash);
     2681  sl_strlcat(msg, tmp, SH_MSG_BUF);
    26652682
    26662683  if (theFile->c_mode[0] == 'l' ||
     
    26712688        {
    26722689          if (is_new)
    2673             sl_snprintf(tmp, SH_BUFSIZE, _(", link_new=<%s> "), tmp_lnk);
     2690            sl_snprintf(tmp, SH_MSG_BUF, _(", link_new=<%s> "), tmp_lnk);
    26742691          else
    2675             sl_snprintf(tmp, SH_BUFSIZE, _(", link_old=<%s> "), tmp_lnk);
     2692            sl_snprintf(tmp, SH_MSG_BUF, _(", link_old=<%s> "), tmp_lnk);
    26762693          SH_FREE(tmp_lnk);
    2677           sl_strlcat(msg, tmp, SH_BUFSIZE);
     2694          sl_strlcat(msg, tmp, SH_MSG_BUF);
    26782695        }
    26792696    }
     
    26852702        {
    26862703          if (is_new)
    2687             sl_snprintf(tmp, SH_BUFSIZE, _(", acl_new=<%s> "), tmp_lnk);
     2704            sl_snprintf(tmp, SH_MSG_BUF, _(", acl_new=<%s> "), tmp_lnk);
    26882705          else
    2689             sl_snprintf(tmp, SH_BUFSIZE, _(", acl_old=<%s> "), tmp_lnk);
     2706            sl_snprintf(tmp, SH_MSG_BUF, _(", acl_old=<%s> "), tmp_lnk);
    26902707          SH_FREE(tmp_lnk);
    2691           sl_strlcat(msg, tmp, SH_BUFSIZE);
     2708          sl_strlcat(msg, tmp, SH_MSG_BUF);
    26922709        }
    26932710    }
     
    27472764  int  i;
    27482765
    2749   unsigned long modi_mask = 0;
     2766  unsigned long modi_mask;
    27502767
    27512768  char log_policy[32];
     
    27532770  char hashbuf[KEYBUF_SIZE];
    27542771
    2755   int  retval = 0;
     2772  int  retval;
    27562773
    27572774  SL_ENTER(_("sh_hash_compdata"));
     
    27702787
    27712788  SH_MUTEX_LOCK(mutex_hash);
     2789
     2790  modi_mask = 0;
     2791  retval    = 0;
    27722792
    27732793  if (sl_strlen(theFile->fullpath) <= MAX_PATH_STORE)
     
    30443064  if (modi_mask != 0 && (!SH_FFLAG_REPORTED_SET(p->fflags)))
    30453065    {
    3046       tmp = SH_ALLOC(SH_BUFSIZE);
    3047       msg = SH_ALLOC(SH_BUFSIZE);
     3066      tmp = SH_ALLOC(SH_MSG_BUF);
     3067      msg = SH_ALLOC(SH_MSG_BUF);
    30483068      msg[0] = '\0';
    30493069
     
    30563076        {
    30573077#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
    3058           sl_snprintf(tmp, SH_BUFSIZE,
     3078          sl_snprintf(tmp, SH_MSG_BUF,
    30593079#ifdef SH_USE_XML
    30603080                      _("mode_old=\"%s\" mode_new=\"%s\" attr_old=\"%s\" attr_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" iattr_old=\"%ld\" iattr_new=\"%ld\" "),
     
    30723092#else
    30733093#ifdef SH_USE_XML
    3074           sl_snprintf(tmp, SH_BUFSIZE,
     3094          sl_snprintf(tmp, SH_MSG_BUF,
    30753095                      _("mode_old=\"%s\" mode_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" "),
    30763096                      p->theFile.c_mode, theFile->c_mode,
    30773097                      (long) p->theFile.mode, (long) theFile->mode);
    30783098#else
    3079           sl_snprintf(tmp, SH_BUFSIZE, _("mode_old=<%s>, mode_new=<%s>, "),
     3099          sl_snprintf(tmp, SH_MSG_BUF, _("mode_old=<%s>, mode_new=<%s>, "),
    30803100                      p->theFile.c_mode, theFile->c_mode);
    30813101#endif
    30823102#endif
    3083           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3103          sl_strlcat(msg, tmp, SH_MSG_BUF);
    30843104
    30853105#if defined(USE_ACL) || defined(USE_XATTR)
    30863106          if (theFile->attr_string != NULL || p->attr_string != NULL)
    30873107            {
    3088               sl_snprintf(tmp, SH_BUFSIZE,
     3108              sl_snprintf(tmp, SH_MSG_BUF,
    30893109#ifdef SH_USE_XML
    30903110                          _("acl_old=\"%s\" acl_new=\"%s\" "),
     
    30953115                          (theFile->attr_string) ? theFile->attr_string : _("none"));
    30963116             
    3097               sl_strlcat(msg, tmp, SH_BUFSIZE);
     3117              sl_strlcat(msg, tmp, SH_MSG_BUF);
    30983118            }
    30993119#endif
     
    31353155      if ((modi_mask & MODI_HLN) != 0)
    31363156        {
    3137           sl_snprintf(tmp, SH_BUFSIZE,
     3157          sl_snprintf(tmp, SH_MSG_BUF,
    31383158#ifdef SH_USE_XML
    31393159                      _("hardlinks_old=\"%lu\" hardlinks_new=\"%lu\" "),
     
    31433163                      (unsigned long) p->theFile.hardlinks,
    31443164                      (unsigned long) theFile->hardlinks);
    3145           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3165          sl_strlcat(msg, tmp, SH_MSG_BUF);
    31463166#ifdef REPLACE_OLD
    31473167          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    31523172      if ((modi_mask & MODI_RDEV) != 0)
    31533173        {
    3154           sl_snprintf(tmp, SH_BUFSIZE,
     3174          sl_snprintf(tmp, SH_MSG_BUF,
    31553175#ifdef SH_USE_XML
    31563176                      _("device_old=\"%lu,%lu\" device_new=\"%lu,%lu\" idevice_old=\"%lu\" idevice_new=\"%lu\" "),
     
    31673187#endif
    31683188                      );
    3169           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3189          sl_strlcat(msg, tmp, SH_MSG_BUF);
    31703190#ifdef REPLACE_OLD
    31713191          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    31763196      if ((modi_mask & MODI_INO) != 0)
    31773197        {
    3178           sl_snprintf(tmp, SH_BUFSIZE,
     3198          sl_snprintf(tmp, SH_MSG_BUF,
    31793199#ifdef SH_USE_XML
    31803200                      _("inode_old=\"%lu\" inode_new=\"%lu\" "),
     
    31843204                      (unsigned long) p->theFile.ino,
    31853205                      (unsigned long) theFile->ino);
    3186           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3206          sl_strlcat(msg, tmp, SH_MSG_BUF);
    31873207#ifdef REPLACE_OLD
    31883208          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    32013221      if ((modi_mask & MODI_INO) != 0)
    32023222        {
    3203           sl_snprintf(tmp, SH_BUFSIZE,
     3223          sl_snprintf(tmp, SH_MSG_BUF,
    32043224#ifdef SH_USE_XML
    32053225                      _("dev_old=\"%lu,%lu\" dev_new=\"%lu,%lu\" "),
     
    32123232                      (unsigned long) minor(theFile->dev)
    32133233                      );
    3214           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3234          sl_strlcat(msg, tmp, SH_MSG_BUF);
    32153235#ifdef REPLACE_OLD
    32163236          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    32273247        {
    32283248#ifdef SH_USE_XML
    3229           sl_snprintf(tmp, SH_BUFSIZE,
     3249          sl_snprintf(tmp, SH_MSG_BUF,
    32303250                      _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
    32313251#else
    3232           sl_snprintf(tmp, SH_BUFSIZE,
     3252          sl_snprintf(tmp, SH_MSG_BUF,
    32333253                      _("owner_old=<%s>, owner_new=<%s>, iowner_old=<%ld>, iowner_new=<%ld>, "),
    32343254#endif
     
    32363256                      (long) p->theFile.owner, (long) theFile->owner
    32373257                      );
    3238           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3258          sl_strlcat(msg, tmp, SH_MSG_BUF);
    32393259#ifdef REPLACE_OLD
    32403260          if ((modi_mask & MODI_USR) != 0) {
     
    32553275        {
    32563276#ifdef SH_USE_XML
    3257           sl_snprintf(tmp, SH_BUFSIZE,
     3277          sl_snprintf(tmp, SH_MSG_BUF,
    32583278                      _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
    32593279                      p->theFile.c_group, theFile->c_group,
    32603280                      (long) p->theFile.group, (long) theFile->group);
    32613281#else
    3262           sl_snprintf(tmp, SH_BUFSIZE,
     3282          sl_snprintf(tmp, SH_MSG_BUF,
    32633283                      _("group_old=<%s>, group_new=<%s>, igroup_old=<%ld>, igroup_new=<%ld>, "),
    32643284                      p->theFile.c_group, theFile->c_group,
     
    32663286#endif
    32673287
    3268           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3288          sl_strlcat(msg, tmp, SH_MSG_BUF);
    32693289#ifdef REPLACE_OLD
    32703290          if ((modi_mask & MODI_GRP) != 0) {
     
    32803300      if ((modi_mask & MODI_SIZ) != 0)
    32813301        {
    3282           sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
     3302          sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
    32833303                      (UINT64) p->theFile.size,
    32843304                      (UINT64) theFile->size);
    3285           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3305          sl_strlcat(msg, tmp, SH_MSG_BUF);
    32863306#ifdef REPLACE_OLD
    32873307          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    32953315          (void) sh_unix_gmttime (theFile->ctime,   timstr2c, sizeof(timstr2c));
    32963316#ifdef SH_USE_XML
    3297           sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=\"%s\" ctime_new=\"%s\" "),
     3317          sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=\"%s\" ctime_new=\"%s\" "),
    32983318                      timstr1c, timstr2c);
    32993319#else
    3300           sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=<%s>, ctime_new=<%s>, "),
     3320          sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=<%s>, ctime_new=<%s>, "),
    33013321                      timstr1c, timstr2c);
    33023322#endif
    3303           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3323          sl_strlcat(msg, tmp, SH_MSG_BUF);
    33043324#ifdef REPLACE_OLD
    33053325          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    33133333          (void) sh_unix_gmttime (theFile->atime,   timstr2a, sizeof(timstr2a));
    33143334#ifdef SH_USE_XML
    3315           sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=\"%s\" atime_new=\"%s\" "),
     3335          sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=\"%s\" atime_new=\"%s\" "),
    33163336                      timstr1a, timstr2a);
    33173337#else
    3318           sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=<%s>, atime_new=<%s>, "),
     3338          sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=<%s>, atime_new=<%s>, "),
    33193339                      timstr1a, timstr2a);
    33203340#endif
    3321           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3341          sl_strlcat(msg, tmp, SH_MSG_BUF);
    33223342#ifdef REPLACE_OLD
    33233343          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    33313351          (void) sh_unix_gmttime (theFile->mtime,   timstr2m, sizeof(timstr2m));
    33323352#ifdef SH_USE_XML
    3333           sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=\"%s\" mtime_new=\"%s\" "),
     3353          sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=\"%s\" mtime_new=\"%s\" "),
    33343354                      timstr1m, timstr2m);
    33353355#else
    3336           sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=<%s>, mtime_new=<%s>, "),
     3356          sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=<%s>, mtime_new=<%s>, "),
    33373357                      timstr1m, timstr2m);
    33383358#endif
    3339           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3359          sl_strlcat(msg, tmp, SH_MSG_BUF);
    33403360#ifdef REPLACE_OLD
    33413361          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    33473367      if ((modi_mask & MODI_CHK) != 0)
    33483368        {
    3349           sl_snprintf(tmp, SH_BUFSIZE,
     3369          sl_snprintf(tmp, SH_MSG_BUF,
    33503370#ifdef SH_USE_XML
    33513371                      _("chksum_old=\"%s\" chksum_new=\"%s\" "),
     
    33543374#endif
    33553375                      p->theFile.checksum, fileHash);
    3356           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3376          sl_strlcat(msg, tmp, SH_MSG_BUF);
    33573377#ifdef REPLACE_OLD
    33583378          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    33813401            tmp_lnk_old = sh_util_strdup("-");
    33823402#ifdef SH_USE_XML
    3383           sl_snprintf(tmp, SH_BUFSIZE, _("link_old=\"%s\" link_new=\"%s\" "),
     3403          sl_snprintf(tmp, SH_MSG_BUF, _("link_old=\"%s\" link_new=\"%s\" "),
    33843404                      tmp_lnk_old, tmp_lnk);
    33853405#else
    3386           sl_snprintf(tmp, SH_BUFSIZE, _("link_old=<%s>, link_new=<%s>"),
     3406          sl_snprintf(tmp, SH_MSG_BUF, _("link_old=<%s>, link_new=<%s>"),
    33873407                      tmp_lnk_old, tmp_lnk);
    33883408#endif
    33893409          SH_FREE(tmp_lnk);
    33903410          SH_FREE(tmp_lnk_old);
    3391           sl_strlcat(msg, tmp, SH_BUFSIZE);
     3411          sl_strlcat(msg, tmp, SH_MSG_BUF);
    33923412#ifdef REPLACE_OLD
    33933413          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     
    39083928                                       (unsigned char *)linkpath,
    39093929                                       strlen(linkpath));
     3930
    39103931      clen = dlen * 2 + 1;
     3932
    39113933      do {
    39123934        if (decompressed)
     
    39203942          { fprintf(stderr, _("Error: Data corrupt or incomplete\n")); return -1; }
    39213943      } while (res == Z_BUF_ERROR || clen == clen_o);
     3944
    39223945      decompressed[clen] = '\0';
    39233946      fputs( (char*) decompressed, stdout);
     
    39573980    }
    39583981
    3959   line = SH_ALLOC(MAX_PATH_STORE+1);
     3982  line = SH_ALLOC(MAX_PATH_STORE+2);
    39603983
    39613984  if ( SL_ISERROR(fd = sl_open_read(db_file, SL_YESPRIV)))
     
    39693992  /* fast forward to start of data
    39703993   */
    3971   sh_hash_setdataent(fd, line, MAX_PATH_STORE, db_file);
     3994  sh_hash_setdataent(fd, line, MAX_PATH_STORE+1, db_file);
    39723995
    39733996  while (1)
    39743997    {
    3975       p = sh_hash_getdataent (fd, line, MAX_PATH_STORE);
     3998      p = sh_hash_getdataent (fd, line, MAX_PATH_STORE+1);
    39763999      if ((p != NULL) && (p->fullpath[0] == '/'))
    39774000        {
     
    40224045  if (flag == 0)
    40234046    {
    4024       fprintf(stderr, _("No file found\n"));
     4047      fprintf(stderr, _("File not found\n"));
    40254048      _exit(EXIT_FAILURE);
    40264049    }
  • trunk/src/sh_html.c

    r131 r170  
    277277
    278278static
    279 int sh_html_get_entry ()
     279int sh_html_get_entry (void)
    280280{
    281281  long      retval = SL_ENONE;
     
    390390int comp_arr (const void * ao, const void * bo)
    391391{
    392   sort_arr * a;
    393   sort_arr * b;
     392  const sort_arr * a;
     393  const sort_arr * b;
    394394
    395395  if (ao == NULL && bo == NULL)
     
    400400    return (1);
    401401
    402   a = (sort_arr *) ao;
    403   b = (sort_arr *) bo;
     402  a = (const sort_arr *) ao;
     403  b = (const sort_arr *) bo;
    404404
    405405  return ((-1) * sl_strcmp(a->tim, b->tim));
  • trunk/src/sh_ignore.c

    r22 r170  
    157157}
    158158
    159 int sh_ignore_clean ()
     159int sh_ignore_clean (void)
    160160{
    161161  struct sh_ignore_list * new;
  • trunk/src/sh_mail.c

    r137 r170  
    131131    }
    132132
    133   buf     = SH_ALLOC( (size_t)(SH_BUFSIZE+1));
    134   bufc    = SH_ALLOC( (size_t)(SH_MAXBUF+1));
     133  buf     = SH_ALLOC( (size_t)(SH_MSG_BUF+SH_BUFSIZE+1));
     134  bufc    = SH_ALLOC( (size_t)(SH_MSG_BUF+SH_MAXBUF+1));
    135135
    136136  while (1 == 1)
     
    144144                             sizeof("-----BEGIN MESSAGE-----")-1))
    145145        {
    146           (void) sh_unix_getline (fd, buf, SH_BUFSIZE);
     146          (void) sh_unix_getline (fd, buf, SH_MSG_BUF+SH_BUFSIZE);
    147147          if (buf[0] == '\0')
    148148            {
     
    163163      while (1 == 1)
    164164        {
    165           (void) sh_unix_getline (fd, buf, SH_BUFSIZE);
     165          (void) sh_unix_getline (fd, buf, SH_MSG_BUF+SH_BUFSIZE);
    166166          if (0 == sl_strncmp(buf, _("-----BEGIN SIGNATURE-----"),
    167167                              sizeof("-----BEGIN SIGNATURE-----")-1))
     
    169169          if (buf[0] == '\0')
    170170            _exit (EXIT_FAILURE);
    171           (void) sh_util_compress(bufc, buf, SH_MAXBUF-KEY_LEN);
     171          (void) sh_util_compress(bufc, buf, SH_MSG_BUF+SH_MAXBUF-KEY_LEN);
    172172        }
    173173     
     
    283283  size_t  s;
    284284
    285   char  * dup;
     285  char  * dupp;
    286286  char  * p;
    287287  char  * end;
     
    314314  *ntok = 0;
    315315
    316   dup = sh_util_strdup(argstring);
    317   p   = dup;
     316  dupp = sh_util_strdup(argstring);
     317  p   = dupp;
    318318
    319319  do
     
    369369
    370370  *ntok = i;
    371   SH_FREE(dup);
     371  SH_FREE(dupp);
    372372
    373373  SL_RETURN (0, _("sh_filter_filteradd"));
     
    18881888  HEADER * header;
    18891889  int      type, rdlength, pref;
    1890   unsigned int count, index;
     1890  unsigned int count, theindex;
    18911891  dnsrep * retval;
    18921892
     
    19531953   */
    19541954  count = ntohs (header->qdcount);
    1955   for (index = 0; index < count; ++index)
     1955  for (theindex = 0; theindex < count; ++theindex)
    19561956    {
    19571957      ret = dn_skipname (comp_dn, eom);
     
    21012101static dnsrep * return_mx (char *domain)
    21022102{
    2103   struct hostent *host = NULL;
     2103  struct hostent *host;
    21042104  dnsrep * answers = NULL;
    21052105  mx     * result;
    2106   dnsrep * retval  = NULL;
     2106  dnsrep * retval;
    21072107  char     errmsg[128];
    21082108  size_t   len;
     
    21442144
    21452145      SH_MUTEX_LOCK(mutex_resolv);
     2146
     2147      host   = NULL;
     2148      retval = NULL;
     2149
    21462150      if (domain != NULL)
    21472151        host = /*@-unrecog@*/sh_gethostbyname (domain)/*@+unrecog@*/;
  • trunk/src/sh_mem.c

    r154 r170  
    4343#include "sh_pthread.h"
    4444
    45 extern int safe_logger (int signal, int method, char * details);
     45extern int safe_logger (int thesignal, int method, char * details);
    4646
    4747#undef  FIL__
     
    258258
    259259
    260 void sh_mem_free (void * a, char * file, int line)
    261 {
    262   volatile memlist_t * this   = memlist;
    263   volatile memlist_t * before = memlist;
     260void sh_mem_free (void * aa, char * file, int line)
     261{
     262  memlist_t * this;
     263  memlist_t * before;
    264264  unsigned long        size   = 0;
    265 
     265  void      * a;
    266266  SL_ENTER(_("sh_mem_free"));
    267267
     
    269269  SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
    270270
     271  a      = aa;
     272  this   = memlist;
     273  before = memlist;
     274 
    271275  if ( a == NULL )
    272276    {
     
    315319  free(a);
    316320  if (this)
    317     free((void*)this);
     321    free(this);
    318322  ++Free_Count;
    319323  --Now_Alloc_Count;
  • trunk/src/sh_portcheck.c

    r169 r170  
    179179    }
    180180
    181   val = (val <= 0 ? 60 : val);
    182 
    183181  sh_portchk_interval = (time_t) val;
    184182  SL_RETURN(0, _("sh_portchk_set_interval"));
     
    251249/* Interface to initialize port check
    252250 */
    253 int sh_portchk_init ();
     251int sh_portchk_init (struct mod_type * arg);
    254252
    255253/* Interface to reset port check
    256254 */
    257 int sh_portchk_reset ();
     255int sh_portchk_reset (void);
    258256
    259257/* Interface to run port check
    260258 */
    261 int sh_portchk_check ();
     259int sh_portchk_check (void);
    262260
    263261
     
    317315 * Thereafter, we check for entries that are still UNKN.
    318316 */
    319 static void sh_portchk_reset_lists ()
     317static void sh_portchk_reset_lists (void)
    320318{
    321319  struct sh_portentry * portlist;
     
    364362}
    365363 
     364/* These variables are not used anywhere. They only exist
     365 * to assign &pre, &ptr to them, which keeps gcc from
     366 * putting it into a register, and avoids the 'clobbered
     367 * by longjmp' warning. And no, 'volatile' proved insufficient.
     368 */
     369static void * sh_dummy_pre = NULL;
     370static void * sh_dummy_ptr = NULL;
     371
    366372/* check the list of open ports for any that are marked as UNKN
    367373 */
     
    372378  char errbuf[256];
    373379
     380  /* Take the address to keep gcc from putting them into registers.
     381   * Avoids the 'clobbered by longjmp' warning.
     382   */
     383  sh_dummy_pre = (void*) &pre;
     384  sh_dummy_ptr = (void*) &ptr;
     385 
    374386  while (ptr)
    375387    {
     
    817829          flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
    818830          retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
    819           write (fd, _("SSH-2.0-Foobar"), 14);
    820           write (fd, "\r\n", 2);
     831          retval = write (fd, _("SSH-2.0-Foobar"), 14);
     832          if (retval > 0) retval = write (fd, "\r\n", 2);
    821833        }
    822834      else if (port == 25)  /* smtp */
     
    824836          flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
    825837          retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
    826           write (fd, _("QUIT"), 4);
    827           write (fd, "\r\n", 2);
     838          retval = write (fd, _("QUIT"), 4);
     839          if (retval > 0) retval = write (fd, "\r\n", 2);
    828840        }
    829841      else if (port == 79)  /* finger */
     
    831843          flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
    832844          retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
    833           write (fd, "\r\n", 2);
     845          retval = write (fd, "\r\n", 2);
    834846        }
    835847      else if (port == 110) /* pop3 */
     
    837849          flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
    838850          retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
    839           write (fd, _("QUIT"), 4);
    840           write (fd, "\r\n", 2);
     851          retval = write (fd, _("QUIT"), 4);
     852          if (retval > 0) retval = write (fd, "\r\n", 2);
    841853        }
    842854      else if (port == 143) /* imap */
     
    844856          flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
    845857          retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
    846           write (fd, _("A01 LOGOUT"), 10);
    847           write (fd, "\r\n", 2);
    848         }
     858          retval = write (fd, _("A01 LOGOUT"), 10);
     859          if (retval > 0) retval = write (fd, "\r\n", 2);
     860        }
     861
     862      if (portchk_debug && retval < 0)
     863        fprintf(stderr, _("check port: error writing to port %5d\n"),
     864                port);
    849865     }
    850866  close (fd);
     
    878894{
    879895  struct hostent * hent;
    880   int              i = 0;
     896  volatile int     i; /* might be clobbered by ‘longjmp’ or ‘vfork’*/
    881897  char errbuf[256];
    882898
     
    899915  SH_MUTEX_LOCK(mutex_resolv);
    900916  hent = sh_gethostbyname(portchk_hostname);
    901 
     917  i = 0;
    902918  while (hent && hent->h_addr_list[i] && (iface_list.used < SH_IFACE_MAX))
    903919    {
     
    945961
    946962#if !defined(TEST_ONLY)
    947 int sh_portchk_reconf ()
     963int sh_portchk_reconf (void)
    948964{
    949965  SH_MUTEX_LOCK(mutex_port_check);
     
    962978}
    963979
    964 int sh_portchk_cleanup ()
     980int sh_portchk_cleanup (void)
    965981{
    966982  return sh_portchk_reconf ();
     
    983999static int check_port_generic (int port, int type, int protocol)
    9841000{
    985   int              i    =  0;
     1001  volatile int     i    =  0;
    9861002  int              sock = -1;
    9871003  int              flag =  1; /* non-zero to enable an option */
     
    10021018      if ((sock = socket(AF_INET, type, protocol)) < 0 )
    10031019        {
     1020          ++i;
    10041021#ifdef TEST_ONLY
    10051022          if (portchk_debug)
     
    10101027                          sh_error_message(errno, errbuf, sizeof(errbuf)), _("socket"));
    10111028          SH_MUTEX_UNLOCK(mutex_thread_nolog);
    1012           ++i;
     1029#endif
    10131030          continue;
    1014 #endif
    10151031        }
    10161032      if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
    10171033                      (void *) &flag, sizeof(flag)) < 0 )
    10181034        {
     1035          ++i;
    10191036#ifdef TEST_ONLY
    10201037          if (portchk_debug)
     
    10261043          SH_MUTEX_UNLOCK(mutex_thread_nolog);
    10271044#endif
    1028           ++i;
    10291045          continue;
    10301046        }
     
    10561072
    10571073
    1058 static int sh_portchk_scan_ports_generic (int min_port, int max_port, int type, int protocol)
     1074static int sh_portchk_scan_ports_generic (int min_port, int max_port_arg, int type, int protocol)
    10591075{
    10601076  /*
     
    10631079  */
    10641080
    1065   int port;
     1081  volatile int port; /*  might be clobbered by ‘longjmp’ or ‘vfork’*/
     1082  volatile int max_port = max_port_arg;
    10661083  int retval;
    10671084  int sock   = -1;
     
    14441461int sh_portchk_check ()
    14451462{
    1446   int min_port = 0;
     1463  volatile int min_port;
    14471464
    14481465  SH_MUTEX_LOCK(mutex_port_check);
     1466
     1467  min_port = 0;
     1468
    14491469  if (sh_portchk_active != S_FALSE)
    14501470    {
  • trunk/src/sh_prelude.c

    r169 r170  
    723723        *tmp = '\0';
    724724
     725        /* Get interface
     726         */
    725727        ip = strdup(ptr);
    726728        if ( ip ) {
     
    769771        *tmp = '\0';
    770772
     773        /* Get port number
     774         */
    771775        port = strtol(ptr, &end, 0);
    772776        if ( *ptr && *end == '\0' && port >= 0 && port < 65536) {
     
    810814        *tmp = '\0';
    811815
     816        /* Get service
     817         */
    812818        srv = strdup(ptr);
    813819        if ( srv ) {
     
    830836                }
    831837
    832                 ret = idmef_service_new_ident(service, &str);
     838                ret = idmef_service_new_name(service, &str);
    833839                if ( ret < 0 ) {
    834840                        free(srv);
  • trunk/src/sh_processcheck.c

    r169 r170  
    394394}
    395395
     396/* These variables are not used anywhere. They only exist
     397 * to assign &userold, &user to them, which keeps gcc from
     398 * putting them into a register, and avoids the 'clobbered
     399 * by longjmp' warning. And no, 'volatile' proved insufficient.
     400 */
     401static void * sh_dummy_watchlist = NULL;
     402
    396403static void check_watchlist (short * res)
    397404{
     
    399406  char * tmp;
    400407  size_t indx;
     408
     409  /* Take the address to keep gcc from putting them into registers.
     410   * Avoids the 'clobbered by longjmp' warning.
     411   */
     412  sh_dummy_watchlist = (void*) &list;
    401413
    402414  while (list)
     
    409421            {
    410422              SH_MUTEX_LOCK(mutex_thread_nolog);
     423              tmp = sh_util_safe_name (list->str);
    411424              sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0,
    412425                              MSG_PCK_MISS,
    413                               list->str);
     426                              tmp);
    414427              SH_MUTEX_UNLOCK(mutex_thread_nolog);
    415428            }
     
    428441              if (S_FALSE == is_in_list(&list_missing, list->str, 0))
    429442                {
     443                  SH_MUTEX_LOCK(mutex_thread_nolog);
    430444                  tmp = sh_util_safe_name (list->str);
    431                   SH_MUTEX_LOCK(mutex_thread_nolog);
    432445                  sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0,
    433446                                  MSG_PCK_MISS,
     
    594607    }
    595608
    596   val = (val <= 0 ? 60 : val);
    597 
    598609  sh_prochk_interval = (time_t) val;
    599610  SL_RETURN(0, _("sh_prochk_set_interval"));
     
    625636static int proc_max_pid (size_t * procpid)
    626637{
     638  char * ret;
    627639  unsigned long  pid;
    628640  FILE * fd;
     
    640652        {
    641653          str[0] = '\0';
    642           fgets(str, 128, fd);
    643           if (*str != '\0')
     654          ret = fgets(str, 128, fd);
     655          if (ret && *str != '\0')
    644656            {
    645657              pid = strtoul(str, &ptr, 0);
     
    10551067static int sh_process_check_int (short * res)
    10561068{
    1057   size_t i, j;
     1069  volatile size_t i;
     1070  size_t j;
    10581071  char  tests[512];
    1059   int   retval;
     1072  volatile int   retval;
    10601073
    10611074  pid_t this_pid;
     
    12071220/* Initialise.
    12081221 */
    1209 static int sh_prochk_init_internal()
     1222static int sh_prochk_init_internal(void)
    12101223{
    12111224  SL_ENTER(_("sh_prochk_init"));
     
    12671280int sh_prochk_check(void)
    12681281{
    1269   int status = 0;
     1282  int status;
    12701283
    12711284  SL_ENTER(_("sh_prochk_check"));
    12721285
    12731286  SH_MUTEX_LOCK(mutex_proc_check);
     1287
     1288  status = 0;
     1289
    12741290  if( ShProchkActive != S_FALSE )
    12751291    {
  • trunk/src/sh_pthread.c

    r143 r170  
    2222}
    2323
    24 int sh_pthread_init_threadspecific()
     24int sh_pthread_init_threadspecific(void)
    2525{
    2626  int rc = 0;
    2727#ifdef SH_STEALTH
    28   extern int sh_g_thread();
     28  extern int sh_g_thread(void);
    2929
    3030  rc = sh_g_thread();
  • trunk/src/sh_readconf.c

    r169 r170  
    9696
    9797typedef struct str_ListSections {
    98   char * name;
     98  const char * name;
    9999  int    type;
    100100} sh_str_ListSections;
     
    721721
    722722typedef struct _cfg_options {
    723   char * optname;
     723  const char * optname;
    724724  ShSectionType   section;
    725725  ShSectionType   alt_section;
     
    11111111{
    11121112  char * key;
    1113   char * value;
     1113  const char * value;
    11141114  char * tmp;
    11151115  int    i;
     
    11201120#endif
    11211121
    1122   static char  *dummy = N_("dummy");
    1123 
    1124   static char  *closing[] = {
     1122  static const char  *dummy = N_("dummy");
     1123
     1124  static const char  *closing[] = {
    11251125    N_("closecommand"),
    11261126    NULL
    11271127  };
    11281128
    1129   static char  *ident[] = {
     1129  static const char  *ident[] = {
    11301130    N_("severityreadonly"),
    11311131    N_("severitylogfiles"),
  • trunk/src/sh_socket.c

    r132 r170  
    178178static void sh_socket_add2list (struct socket_cmd * in);
    179179
    180 static void sh_socket_probe4reload ()
     180static void sh_socket_probe4reload (void)
    181181{
    182182  struct reload_cmd  * new;
     
    222222}
    223223
    224 char * sh_get_sockpass ()
     224char * sh_get_sockpass (void)
    225225{
    226226  size_t j = 0;
     
    236236}
    237237
    238 void sh_set_sockpass ()
     238void sh_set_sockpass (void)
    239239{
    240240  int j;
  • trunk/src/sh_static.c

    r150 r170  
    283283}
    284284
     285struct passwd * getpwuid(uid_t uid)
     286{
     287        return sh_getpwuid(uid);
     288}
     289
    285290struct group * sh_getgrgid(gid_t gid)
    286291{
     
    293298}
    294299
     300struct group * getgrgid(gid_t gid)
     301{
     302        return sh_getgrgid(gid);
     303}
    295304
    296305struct passwd * sh_getpwnam(const char *name)
     
    15601569}
    15611570
    1562 static int __open_nameservers()
     1571static int __open_nameservers(void)
    15631572{
    15641573        FILE *fp;
     
    18871896
    18881897        if(type == AF_INET) {
    1889                 unsigned char *tmp_addr = (unsigned char *)addr;
     1898                const unsigned char *tmp_addr = (const unsigned char *)addr;
    18901899
    18911900                memcpy(&in->s_addr, addr, len);
  • trunk/src/sh_suidchk.c

    r167 r170  
    859859  int             fflags;
    860860  char          * fs;
    861   long            sl_status = SL_ENONE;
     861  long            sl_status;
    862862  file_type       theFile;
    863863  char            fileHash[2*(KEY_LEN + 1)];
    864864
    865   struct sh_dirent * dirlist = NULL;
    866   struct sh_dirent * dirlist_orig = NULL;
     865  struct sh_dirent * dirlist;
     866  struct sh_dirent * dirlist_orig;
    867867  char errbuf[SH_ERRBUF_SIZE];
    868868
     
    896896  SH_MUTEX_LOCK(mutex_readdir);
    897897
     898  dirlist      = NULL;
     899  dirlist_orig = NULL;
     900
    898901  do {
    899902
     
    918921
    919922  dirlist_orig = dirlist;
     923
     924  sl_status = SL_ENONE;
    920925
    921926  do {
     
    13451350
    13461351
    1347 static void sh_suidchk_free_schedule ()
     1352static void sh_suidchk_free_schedule (void)
    13481353{
    13491354  sh_schedule_t * current = ShSuidchkSched;
  • trunk/src/sh_tiger0.c

    r167 r170  
    6464#if defined(TIGER_64_BIT)
    6565
    66 void tiger_t(word64 *str, word64 length, word64 * res);
    67 void tiger(word64 *str, word64 length, word64 * res);
     66void tiger_t(const word64 *str, word64 length, word64 * res);
     67void tiger(const word64 *str, word64 length, word64 * res);
    6868
    6969#ifdef TIGER_DBG
     
    7575#endif
    7676#else
    77 void tiger(sh_word32 *str, sh_word32 length, sh_word32 * res);
    78 void tiger_t(sh_word32 *str, sh_word32 length, sh_word32 * res);
     77void tiger(const sh_word32 *str, sh_word32 length, sh_word32 * res);
     78void tiger_t(const sh_word32 *str, sh_word32 length, sh_word32 * res);
    7979
    8080#ifdef TIGER_DBG
     
    139139
    140140#if defined(TIGER_64_BIT)
    141 #define TIGER_CAST (word64*)
     141#define TIGER_CAST (const word64*)
    142142  /* word64 res[3]; */
    143143  res[0]= (word64) 0x0123456789ABCDEFLL;
     
    145145  res[2]= (word64) 0xF096A5B4C3B2E187LL;
    146146#else
    147 #define TIGER_CAST (sh_word32*)
     147#define TIGER_CAST (const sh_word32*)
    148148  /* sh_word32 res[6]; */
    149149  res[0]= (sh_word32) 0x89ABCDEF;
  • trunk/src/sh_tiger1.c

    r18 r170  
    267267
    268268void
    269 tiger_t(sh_word32 *str, sh_word32 length, sh_word32 res[6])
     269tiger_t(const sh_word32 *str, sh_word32 length, sh_word32 res[6])
    270270{
    271271  register sh_word32 i;
  • trunk/src/sh_tiger1_64.c

    r46 r170  
    404404}
    405405
    406 void tiger(word64 *str, word64 length, word64 res[3])
     406void tiger(const word64 *str, word64 length, word64 res[3])
    407407{
    408408  register word64 i;
  • trunk/src/sh_tools.c

    r169 r170  
    475475  char   * host_name;
    476476
    477   int    fd = (-1);
     477  volatile int    fd = (-1);
    478478  int    status;
    479   int    fail   = 0;
     479  volatile int    fail   = 0;
    480480  int    cached = 0;
    481481
     
    522522#endif
    523523        {
     524          SH_MUTEX_LOCK(mutex_resolv);
     525
    524526          host_name = NULL;
    525 
    526           SH_MUTEX_LOCK(mutex_resolv);
    527527
    528528          host_entry = sh_gethostbyname(address);
  • trunk/src/sh_unix.c

    r169 r170  
    356356extern int OnlyStderr;
    357357
    358 int safe_logger (int signal, int method, char * details)
     358int safe_logger (int thesignal, int method, char * details)
    359359{
    360360  unsigned int i = 0;
     
    396396  if (p && *p)
    397397    sl_strlcat(msg, p, 128);
    398   if (signal == 0)
     398  if (thesignal == 0)
    399399    {
    400400      if (details == NULL) {
     
    408408    {
    409409      sl_strlcat(msg, _("]: exit on signal "), 128);
    410       p = safe_itoa(signal, str, 128);
     410      p = safe_itoa(thesignal, str, 128);
    411411      if (p && *p)
    412412        sl_strlcat(msg, p, 128);
     
    461461}
    462462
    463 void safe_fatal (char * details,
    464                  char * file, int line)
     463void safe_fatal (const char * details,
     464                 const char * file, int line)
    465465{
    466466  char msg[128];
    467467  char str[128];
    468468  char * p;
    469   int  signal = 0;
     469  int  thesignal = 0;
    470470  int  method = 0;
    471471
     
    479479  }
    480480  sl_strlcat(msg, details, 128);
    481   (void) safe_logger (signal, method, msg);
     481  (void) safe_logger (thesignal, method, msg);
    482482  _exit(EXIT_FAILURE);
    483483}
     
    10601060}
    10611061
    1062 extern uid_t   sl_trust_baduid();
    1063 extern gid_t   sl_trust_badgid();
     1062extern uid_t   sl_trust_baduid(void);
     1063extern gid_t   sl_trust_badgid(void);
    10641064
    10651065#if defined(HOST_IS_CYGWIN) || defined(__cygwin__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
     
    15621562  struct hostent * he1;
    15631563  int              i;
    1564   int              ddot = 0;
     1564  int              ddot;
    15651565  int              len;
    15661566  char           * p;
     
    16321632   */
    16331633  len = sl_strlen(sh.host.name);
     1634  ddot = 0;
    16341635  for (i = 0; i < len; ++i)
    16351636    if (sh.host.name[i] == '.') ++ddot;
     
    16601661  struct hostent * he1;
    16611662  int              i;
    1662   int              ddot = 0;
     1663  int              ddot;
    16631664  int              len;
    16641665  char             hostname[1024];
     
    16911692   */
    16921693  len = sl_strlen(sh.host.name);
     1694  ddot = 0;
    16931695  for (i = 0; i < len; ++i)
    16941696    if (sh.host.name[i] == '.') ++ddot;
     
    17721774}
    17731775
    1774 int sh_unix_chroot()
     1776int sh_unix_chroot(void)
    17751777{
    17761778  int status;
     
    17941796/* #ifdef SH_WITH_SERVER */
    17951797#else
    1796 int sh_unix_chroot() { return 0; }
     1798int sh_unix_chroot(void) { return 0; }
    17971799#endif
    17981800
     
    18501852  pid_t  oldpid = getpid();
    18511853#if defined(SH_WITH_SERVER)
    1852   extern int sh_socket_open_int ();
     1854  extern int sh_socket_open_int (void);
    18531855#endif
    18541856  char errbuf[SH_ERRBUF_SIZE];
     
    34113413              UINT64 length_nolim = TIGER_NOLIM;
    34123414
    3413               if ((theFile->check_mask & MODI_TXT) != 0 && fbuf.st_size < (10 * SH_TXT_MAX))
     3415              if (MODI_TXT_ENABLED(theFile->check_mask) && fbuf.st_size < (10 * SH_TXT_MAX))
    34143416                {
    34153417                  sl_init_content (rval_open, fbuf.st_size);
     
    34643466              UINT64 length_nolim = TIGER_NOLIM;
    34653467
    3466               if ((theFile->check_mask & MODI_TXT) != 0 && fbuf.st_size < (10 * SH_TXT_MAX))
     3468              if (MODI_TXT_ENABLED(theFile->check_mask) && fbuf.st_size < (10 * SH_TXT_MAX))
    34673469                {
    34683470                  sl_init_content (rval_open, fbuf.st_size);
     
    43014303SH_MUTEX_STATIC(mutex_mlock,PTHREAD_MUTEX_INITIALIZER);
    43024304
    4303 int sh_unix_mlock (char * file, int line, void * in_addr, size_t len)
     4305int sh_unix_mlock (const char * file, int line, void * in_addr, size_t len)
    43044306{
    43054307  int         num_pages;
  • trunk/src/sh_utils.c

    r167 r170  
    313313char * sh_util_strsep (char **str, const char *delim)
    314314{
    315   char *ret, *c, *d;
     315  char *ret, *c;
     316  const char *d;
    316317
    317318  SL_ENTER(_("sh_util_strsep"));
     
    321322
    322323  for (c = *str; *c != '\0'; c++) {
    323     for (d = (char *) delim; *d != '\0'; d++) {
     324    for (d = delim; *d != '\0'; d++) {
    324325      if (*c == *d) {
    325326        *c = '\0';
     
    14761477
    14771478  for (i = 0; i < 6; ++i)
    1478     bufy[i] = taus_get(&(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));
     1479    bufy[i] = taus_get();
    14791480
    14801481  p = sh_tiger_hash ((char *) bufy, TIGER_DATA,
     
    15081509  const int     sh_val_utf8_4 = 4;
    15091510
    1510   size_t        len = strlen((char *)str);
     1511  size_t        len = strlen((const char *)str);
    15111512  size_t        l   = 0;
    15121513  int           typ = 0;
     
    21022103        {
    21032104          if (lin == 0)
    2104             lin = strlen((char *)instr);
     2105            lin = strlen((const char *)instr);
    21052106
    21062107          do {
     
    21492150
    21502151  *out = SH_ALLOC(outlen);
    2151   return sh_util_base64_enc((unsigned char *)*out, (unsigned char *)in, inlen);
     2152  return sh_util_base64_enc((unsigned char *)*out, (const unsigned char *)in, inlen);
    21522153}
    21532154
     
    21642165    {
    21652166      if (lin == 0)
    2166         lin = strlen((char *)in);
     2167        lin = strlen((const char *)in);
    21672168
    21682169      for (i = 0; i < lin; i++)
     
    21892190          else if (c == ')' || c == '/')
    21902191            {
    2191               b = 64;
     2192              b = 63;
    21922193            }
    21932194          else if (c == '?' || c == '=')
  • trunk/src/sh_utmp.c

    r154 r170  
    472472 *************/
    473473
    474 static int sh_utmp_init_internal ()
     474static int sh_utmp_init_internal (void)
    475475{
    476476
     
    516516 *************/
    517517#ifdef HAVE_UTTYPE
    518 static int sh_utmp_login_clean();
     518static int sh_utmp_login_clean(void);
    519519#endif
    520520
     
    633633int sh_utmp_set_login_timer (const char * c)
    634634{
    635   int retval = 0;
    636635  long val;
    637636
     
    644643                       _("utmp timer"), c);
    645644      SH_MUTEX_UNLOCK(mutex_thread_nolog);
    646       retval = -1;
    647     }
    648 
    649   val = (val <= 0 ? 60 : val);
     645      SL_RETURN((-1), _("sh_utmp_set_login_timer"));
     646    }
    650647
    651648  ShUtmpInterval = (time_t) val;
     
    670667static struct login_ct * login_ct_list = NULL;
    671668
    672 static int sh_utmp_login_clean()
     669static int sh_utmp_login_clean(void)
    673670{
    674671  struct login_ct * list = login_ct_list;
     
    776773 * by longjmp' warning. And no, 'volatile' proved insufficient.
    777774 */
    778 void * sh_dummy_userold = NULL;
    779 void * sh_dummy_user    = NULL;
     775static void * sh_dummy_userold = NULL;
     776static void * sh_dummy_user    = NULL;
    780777
    781778
     
    10631060  int           error;
    10641061  struct SH_UTMP_S * ut;
    1065   unsigned long this_read = 0;
     1062  unsigned long this_read;
    10661063  int           val_retry;
    10671064
     
    11231120   * we need to do this here
    11241121   */
     1122  this_read = 0;
     1123
    11251124  if (mode < 2)
    11261125    {
  • trunk/src/slib.c

    r169 r170  
    123123}
    124124
    125 FILE * sl_tracefile_open(char * file, char * mode)
     125FILE * sl_tracefile_open(const char * file, const char * mode)
    126126{
    127127  FILE * xp = NULL;
     
    132132}
    133133
    134 void sl_trace_in(char * str, char * file, int line)
     134void sl_trace_in(const char * str, const char * file, int line)
    135135{
    136136  int    i;
     
    165165}
    166166
    167 void sl_trace_out(char * str, char * file, int line)
     167void sl_trace_out(const char * str, const char * file, int line)
    168168{
    169169  int    i;
     
    200200}
    201201
    202 extern int sh_log_console (char * msg);
     202extern int sh_log_console (const char * msg);
    203203
    204204static int dlogActive = 0;
     
    215215 *      = 3 backtrace
    216216 */
    217 int dlog (int flag, char * file, int line,  const char *fmt, ...)
     217int dlog (int flag, const char * file, int line,  const char *fmt, ...)
    218218{
    219219  va_list     ap;
     
    14961496 * Do nothing if not SUID.
    14971497 */
    1498 int sl_policy_get_user(char * user)
     1498int sl_policy_get_user(const char * user)
    14991499{
    15001500  SL_ENTER(_("sl_policy_get_user"));
     
    24442444
    24452445
    2446 int sl_write (SL_TICKET ticket, void * msg_in, long nbytes)
     2446int sl_write (SL_TICKET ticket, const void * msg_in, long nbytes)
    24472447{
    24482448  long bytewritten;
     
    24502450  int  fd;
    24512451
    2452   char * msg;
     2452  const char * msg;
    24532453
    24542454  SL_ENTER(_("sl_write"));
     
    24612461    SL_IRETURN(fd, _("sl_write"));
    24622462
    2463   msg = (char *) msg_in;
     2463  msg = (const char *) msg_in;
    24642464
    24652465  /* write
     
    24852485}
    24862486
    2487 int sl_write_line (SL_TICKET ticket, void * msg, long nbytes)
     2487int sl_write_line (SL_TICKET ticket, const void * msg, long nbytes)
    24882488{
    24892489  int  status;
     
    25822582
    25832583
    2584 char * sl_trust_errfile()
     2584char * sl_trust_errfile(void)
    25852585{
    25862586  return &tf_path[0];
     
    25882588
    25892589extern uid_t tf_baduid;
    2590 uid_t   sl_trust_baduid()
     2590uid_t   sl_trust_baduid(void)
    25912591{
    25922592  return tf_baduid;
     
    25942594
    25952595extern gid_t tf_badgid;
    2596 gid_t   sl_trust_badgid()
     2596gid_t   sl_trust_badgid(void)
    25972597{
    25982598  return tf_badgid;
     
    26022602static int trust_count = 0;
    26032603
    2604 int  sl_trust_purge_user ()
     2604int  sl_trust_purge_user (void)
    26052605{
    26062606  int i;
  • trunk/src/trustfile.c

    r137 r170  
    781781          register int lsym;            /* num chars in symlink ref  */
    782782          register int i;               /* trustworthy or not?       */
     783          const char * t_const;
    783784
    784785          /*
     
    821822              /* smack on the /../
    822823               */
    823               t = "/../";
     824              t_const = "/../";
    824825              while(*t && b < &full[MAXFILENAME])
    825                 *b++ = *t++;
     826                *b++ = *t_const++;
    826827
    827828              /* append the symlink referent
Note: See TracChangeset for help on using the changeset viewer.