Changeset 399


Ignore:
Timestamp:
Mar 27, 2012, 10:12:22 PM (13 years ago)
Author:
katerina
Message:

Fix for ticket #296 (sh_processes_readps may hang with EAGAIN).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r398 r399  
    113.0.3:
     2        * make sure sh_processes_readps cannot hang forever
    23        * fix for deadlock if sh_processes_readps hangs
    34        * fix for deadlock if suid check and inotify are used together
     5          (reported by A. Jack)
    46        * fixed problem with samhain_stealth.c (handle input config
    57          files that don't end with a newline)
  • trunk/src/sh_processcheck.c

    r398 r399  
    553553  SL_RETURN((0), _("sh_prochk_set_psarg"));
    554554#else
     555  (void) str;
    555556  sh_prochk_psarg = NULL;
    556557  SL_RETURN((-1), _("sh_prochk_set_psarg"));
     
    868869  char c;
    869870  unsigned int  pos = 0;
     871#define SH_TWAIT_MAX 60
     872  volatile unsigned int  twait = 0;
    870873  char tstr[256];
    871874  enum { SKIP_TO_WS, SKIP_WS, SKIP_TO_WS2, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line;
     
    891894              break;
    892895            }
    893           else if (errno == EAGAIN)
     896          else if ((errno == EAGAIN) && (twait < SH_TWAIT_MAX))
    894897            {
    895898              clearerr(in);
     899              retry_msleep(1, 0);
     900              ++twait;
    896901              continue;
    897902            }
Note: See TracChangeset for help on using the changeset viewer.