Changeset 162 for trunk/src


Ignore:
Timestamp:
Feb 1, 2008, 1:03:47 AM (17 years ago)
Author:
katerina
Message:

Fix for ticket #89, #90, and #91 (locking,compile failure).

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain.c

    r160 r162  
    362362  sh.prg_name[7] = '\0';
    363363#endif
     364
     365  sh.pid = (UINT64) getpid();
    364366
    365367  /* The flags.
  • trunk/src/sh_hash.c

    r160 r162  
    12061206          {
    12071207            dlog(1, FIL__, __LINE__,
    1208                  _("The checksum of the file signature database has changed since startup.\n"));
     1208                 _("The checksum of the file signature database has changed since startup: %s -> %s\n"),
     1209                 sh.data.hash, sh_tiger_hash (file_path('D', 'R'), fd, TIGER_NOLIM,
     1210                                           hashbuf, sizeof(hashbuf)));
    12091211            sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_AUTH,
    12101212                             ( (NULL == file_path('D', 'R')) ? _("(null)") :
  • trunk/src/sh_kern.c

    r146 r162  
    266266 * Interrupt Descriptor Table
    267267 */
    268 
     268#ifdef HAVE_ASM_SEGMENT_H
    269269#include <asm/segment.h>
     270#endif
    270271
    271272#define SH_MAXIDT   256
     
    276277{
    277278  switch (segment) {
     279#ifdef __KERNEL_CS
    278280  case __KERNEL_CS:
    279281    return _("KERNEL_CS");
     282#endif
     283#ifdef __KERNEL_DS
    280284  case __KERNEL_DS:
    281285    return _("KERNEL_DS");
     286#endif
     287#ifdef __USER_CS
    282288  case __USER_CS:
    283289    return _("USER_CS");
     290#endif
     291#ifdef __USER_DS
    284292  case __USER_DS:
    285293    return _("USER_DS");
     294#endif
    286295  default:
    287296    return _("unknown");
     
    903912  (void) sl_strlcpy (theFile.fullpath, pcipath, PATH_MAX);
    904913  theFile.check_mask  = sh_files_maskof(SH_LEVEL_READONLY);
    905   theFile.check_mask &= ~(MODI_MTM|MODI_CTM);
     914  theFile.check_mask &= ~(MODI_MTM|MODI_CTM|MODI_INO);
    906915  CLEAR_SH_FFLAG_REPORTED(theFile.file_reported);
    907916  theFile.attr_string = NULL;
     
    938947  struct stat buf;
    939948  int         fd;
     949  int         status;
    940950
    941951  if (0 == stat(pcipath, &buf))
     
    945955       */
    946956      fd = open ( pcipath, O_RDWR );
    947       write( fd, "1", 1 );
     957      do {
     958        status = write( fd, "1", 1 );
     959      } while (status < 0 && errno == EINTR);
    948960      close ( fd );
    949961
     
    951963
    952964      fd = open ( pcipath, O_RDWR );
    953       write( fd, "0", 1 );
     965      do {
     966        status = write( fd, "0", 1 );
     967      } while (status < 0 && errno == EINTR);
    954968      close ( fd );
    955969    }
  • trunk/src/sh_portcheck.c

    r149 r162  
    129129#include "sh_utils.h"
    130130#include "sh_modules.h"
     131#include "sh_static.h"
    131132#include "sh_pthread.h"
    132133
     
    897898           
    898899  SH_MUTEX_LOCK(mutex_resolv);
    899   hent = gethostbyname(portchk_hostname);
     900  hent = sh_gethostbyname(portchk_hostname);
    900901
    901902  while (hent && hent->h_addr_list[i] && (iface_list.used < SH_IFACE_MAX))
  • trunk/src/sh_unix.c

    r160 r162  
    18661866
    18671867    setsid();            /* should not fail         */
     1868    sh.pid = (UINT64) getpid();
    18681869
    18691870    switch (aud_fork(FIL__, __LINE__)) {
     
    18761877     */
    18771878    sh_unix_memlock();
     1879    sh.pid = (UINT64) getpid();
    18781880
    18791881  } else {
     
    38443846      sl_close(fd);
    38453847
    3846       if (status == (int) getpid())
     3848      if (status > 0 && (unsigned int) status == sh.pid)
    38473849        {
    38483850          if (filename != NULL)
     
    40074009  SL_ENTER(_("sh_unix_lock"));
    40084010
    4009   sprintf (myPid, "%ld\n", (long) getpid());           /* known to fit  */
     4011  sprintf (myPid, "%ld\n", (long) sh.pid);             /* known to fit  */
    40104012
    40114013  fd = sl_open_safe_rdwr (lockfile, SL_YESPRIV);       /* fails if file exists */
  • trunk/src/slib.c

    r144 r162  
    577577}
    578578
    579 #if !defined(HOST_IS_I86SOLARIS)
    580 #if !defined (_GNU_SOURCE) && !defined(__linux__)
    581 /* flawfinder: ignore */
    582 extern int vsnprintf ( char *str, size_t n,
    583                        const char *format, va_list ap );
    584 #endif
    585 #endif
    586579
    587580#if !defined (VA_COPY)
Note: See TracChangeset for help on using the changeset viewer.