Changeset 102


Ignore:
Timestamp:
Apr 26, 2007, 9:59:55 PM (18 years ago)
Author:
rainer
Message:

Flush before fork (fix for ticket #60), and fix for kcheck on 2.6.21 (ticket #63).

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r101 r102  
    18511851        if test "x${withval}" != "xno"; then
    18521852                AC_DEFINE(SH_USE_KERN)
     1853
     1854                kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
     1855                AC_DEFINE_UNQUOTED(SH_KERNEL_NUMBER, ${kernel_numeric}, [Kernel number])
     1856
    18531857                kernelversion=`uname -r`
    18541858                AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
  • trunk/docs/Changelog

    r101 r102  
    112.3.4:
    2         * fixed compilation of kern_head (problem reported by S. Clormann)
     2        * sh_kern.c: for 2.6.21+ don't check proc_root_lookup (not possible
     3          anymore? proc_root_inode.lookup != proc_root_lookup)
     4        * sh_extern.c: flush streams before forking (problem if [Prelink]
     5          used together with prelude logging, reported by M. deJong)
     6        * fixed compilation of kern_head (regression cause by cross-compiling
     7          fix; problem reported by S. Clormann)
    38        * more typos fixed (reported by John Horne)
    49
  • trunk/include/sh_prelink.h

    r22 r102  
    1010/* return S_TRUE if ELF file, S_FALSE otherwise
    1111 */
    12 int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout);
     12int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout, char * path);
    1313
    1414/* configuration
  • trunk/src/sh_entropy.c

    r78 r102  
    607607  }
    608608 
     609  fflush (NULL);
     610
    609611  source->pid = aud_fork(FIL__, __LINE__);
    610612 
  • trunk/src/sh_extern.c

    r96 r102  
    126126  int         pfd = -1;
    127127#endif
    128  
     128
    129129  SL_ENTER(_("sh_ext_popen"));
    130130
     
    218218
    219219  PDBG(3);
    220  
     220
    221221  /*
    222    * -- Fork
     222   * -- Flush streams and fork
    223223   */
     224  fflush (NULL);
     225
    224226  task->pid = aud_fork(FIL__, __LINE__);
    225227
  • trunk/src/sh_gpg.c

    r87 r102  
    426426      SL_RETURN( (NULL), _("sh_gpg_popen"));
    427427    }
     428
     429  fflush (NULL);
    428430 
    429431  source->pid = aud_fork(FIL__, __LINE__);
  • trunk/src/sh_kern.c

    r93 r102  
    987987static void check_proc_root (struct sh_kernel_info * kinfo)
    988988{
     989  struct proc_dir_entry   proc_root_dir;
     990
     991/* 2.6.21 (((2) << 16) + ((6) << 8) + (21)) */
     992#if SH_KERNEL_NUMBER < 132629
    989993  struct inode_operations proc_root_inode;
    990   struct proc_dir_entry   proc_root_dir;
    991994
    992995  memcpy (&proc_root_inode, &(kinfo->proc_root_inode), sizeof(struct inode_operations));
    993   memcpy (&proc_root_dir,   &(kinfo->proc_root_dir),   sizeof(struct proc_dir_entry));
    994 
     996
     997  /* Seems that the info does not relate anymore to proc_root_lookup(?)
     998   */
    995999  if ( (unsigned int) *proc_root_inode.lookup != proc_root_lookup)
    9961000    {
     
    9981002                       _("proc_root_inode_operations.lookup != proc_root_lookup"));
    9991003    }
    1000   else if (    (((unsigned int) * &proc_root_dir.proc_iops) != proc_root_iops)
     1004#endif
     1005
     1006  memcpy (&proc_root_dir,   &(kinfo->proc_root_dir),   sizeof(struct proc_dir_entry));
     1007  if (    (((unsigned int) * &proc_root_dir.proc_iops) != proc_root_iops)
    10011008            && (proc_root_dir.size != proc_root_iops)
    10021009            && (((unsigned int) * &proc_root_dir.proc_fops) != proc_root_iops)
     
    10061013                       _("proc_root.proc_iops != proc_root_inode_operations"));
    10071014    }
     1015
    10081016  return;
    10091017}
  • trunk/src/sh_prelink.c

    r101 r102  
    7171}
    7272
    73 int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout)
    74 {
    75   long status;
    76   char magic[4];
     73int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout, char * path)
     74{
     75  long   status;
     76  char   magic[4];
     77  char * tmp;
    7778
    7879  /* 42 bytes is about the minimum an ELF binary might have
     
    9596      /*@+usedef@*/
    9697    }
     98  else
     99    {
     100      tmp = sh_util_safe_name (path);
     101      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGPATH,
     102                      _("Error reading file"), _("sh_prelink_iself"), tmp);
     103      SH_FREE(path);
     104    }
    97105  return S_FALSE;
    98106}
  • trunk/src/sh_processcheck.c

    r82 r102  
    786786}
    787787
     788extern int flag_err_debug;
     789
    788790static int sh_processes_readps (FILE * in, short * res,
    789791                                char * str, size_t len,
     
    844846            {
    845847              tstr[pos-1] = '\0';
     848              if (flag_err_debug == SL_TRUE)
     849                {
     850                  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, num, MSG_E_SUBGEN,
     851                                  tstr,
     852                                  _("sh_processes_readps"));
     853                }
    846854              /* fprintf(stderr, "<%ld> %s\n", num, tstr); */
    847855              line = SKIP_WS; pos = 0;
     
    10391047      if ((res[j] & SH_PR_ANY) || (res[j] & SH_PR_PS_ANY))
    10401048        {
     1049          /* list all tests where the pid was found
     1050           */
    10411051          sh_processes_tlist (tests, sizeof(tests), res[j]);
     1052
    10421053          /*
    10431054           * case 1: in ps and found
  • trunk/src/sh_tiger0.c

    r93 r102  
    361361    else
    362362      tiger_fd = (-1);
    363 
    364363
    365364    SL_RETURN( res, _("sh_tiger_hash_val"));
  • trunk/src/sh_unix.c

    r98 r102  
    32113211          else if ((theFile->check_mask & MODI_PREL) != 0 &&
    32123212                   S_TRUE == sh_prelink_iself(rval_open, fbuf.st_size,
    3213                                               alert_timeout))
     3213                                              alert_timeout, theFile->fullpath))
    32143214            {
    32153215              if (0 != sh_prelink_run (theFile->fullpath,
     
    32513251          else if (policy == SH_LEVEL_PRELINK &&
    32523252                   S_TRUE == sh_prelink_iself(rval_open, fbuf.st_size,
    3253                                               alert_timeout))
     3253                                              alert_timeout, theFile->fullpath))
    32543254            {
    32553255              if (0 != sh_prelink_run (theFile->fullpath,
Note: See TracChangeset for help on using the changeset viewer.