Changeset 92 for trunk


Ignore:
Timestamp:
Feb 18, 2007, 5:23:32 PM (18 years ago)
Author:
rainer
Message:

Move fd closing more towards program start. Fix OpenBSD 4.0 compatibility for kernel check.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r89 r92  
    112.3.2:
     2        * move file descriptor closing more towards program startup
     3        * fix samhain_hide module (in-)compatibility with recent kernels
    24        * fix regression in full stealth mode (incorrect comparison of
    35          bytes read vs. maximum capacity), reported by B. Fleming
  • trunk/include/kern_head.h

    r9 r92  
    780780  "_sys___semctl",         /* 295  */
    781781  "_sys_shmctl",           /* 296  */
    782   "_sys_msgctl",       /*       297 */
     782  "_sys_msgctl",           /* 297  */
     783  "_sys_sched_yield",      /* 298  */
     784  "_sys_getthrid",         /* 299  */
     785  "_sys_thrsleep",         /* 300  */
     786  "_sys_thrwakeup",        /* 301  */
     787  "_sys_threxit",          /* 302  */
     788  "_sys_thrsigdivert",     /* 303  */
     789  "_sys___getcwd",         /* 304  */
    783790  NULL
    784791};
  • trunk/src/kern_head.c

    r51 r92  
    726726  if      (utbuf.release[0] == '3')
    727727    which = 38;
     728  else if (utbuf.release[0] == '4')
     729    which = 40;
    728730#else
    729731  if      (utbuf.release[0] == '4')
     
    791793    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
    792794                 utbuf.release, utbuf.machine, "callz_fbsd5");
    793   else if (which == 38)
     795  else if (which == 38 || which == 40)
    794796    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
    795797                 utbuf.release, utbuf.machine, "callz_obsd");
     
    817819      }
    818820  }
    819   else if (which == 38) {
     821  else if (which == 38 || which == 40) {
    820822    while ((callz_obsd[i] != NULL) && (i < SYS_MAXSYSCALL))
    821823      {
  • trunk/src/samhain.c

    r86 r92  
    914914      default:
    915915        times = 0;
    916         while (times < 120) {
     916        while (times < 300) {
    917917          respid = waitpid(pid, &status, WNOHANG|WUNTRACED);
    918918          if ((pid_t)-1 == respid)
     
    11221122  SL_ENTER(_("main"));
    11231123
     1124  /* --- Close all but first three file descriptors. ---
     1125   */
     1126  sh_unix_closeall(3, -1); /* at program start */
     1127
     1128
    11241129  if (argc >= 2 && 0 != getuid() &&
    11251130      (0 == strcmp(argv[1], _("start")) ||
     
    13111316  sh.flag.opts = S_FALSE;
    13121317 
    1313 
    1314   /* close all other files
    1315    */
    1316   sh_unix_closeall(3, -1); /* after processing CL options; only stderr here */
    1317 
    13181318
    13191319  /* --- Get user info. ---
  • trunk/src/sh_unix.c

    r89 r92  
    18491849  if (goDaemon == 1)
    18501850    {
    1851       /* close all file descriptors
     1851      /* Close first tree file descriptors
    18521852       */
    1853       sh_unix_closeall (0, -1);  /* if running as daemon */
     1853      close (0);  /* if running as daemon */
     1854      close (1);  /* if running as daemon */
     1855      close (2);  /* if running as daemon */
    18541856
    18551857      /* Enable full error logging
     
    19131915  else
    19141916    {
    1915       sh_unix_closeall(3, -1);  /* if not daemon */
    19161917      sh_error_enable_unsafe (S_TRUE);
    19171918#if defined(HAVE_LIBPRELUDE)
Note: See TracChangeset for help on using the changeset viewer.