Print this page
Code review comments from jeffpc

Split Close
Expand all
Collapse all
          --- old/usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh
          +++ new/usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28      rm -fr /tmp/secflags-test.$$
  29   29  }
  30   30  
  31   31  trap cleanup EXIT
  32   32  
  33   33  ## gcore-produced core
  34   34  gcore $pid >/dev/null
  35   35  
  36   36  cat > gcore-expected.$$ <<EOF
  37   37      namesz: 0x5
  38      -    descsz: 0x14
       38 +    descsz: 0x28
  39   39      type:   [ NT_SECFLAGS ]
  40   40      name:
  41   41          CORE\0
  42   42      desc: (prsecflags_t)
  43   43          pr_version:    1
  44   44          pr_effective:  [ ASLR ]
  45   45          pr_inherit:    [ ASLR ]
  46   46          pr_lower:      0
  47   47          pr_upper:      [ ASLR FORBIDNULLMAP NOEXECSTACK ]
  48   48  EOF
↓ open down ↓ 2 lines elided ↑ open up ↑
  51   51  
  52   52  if ! diff -u gcore-expected.$$ gcore-output.$$; then
  53   53      exit 1;
  54   54  fi
  55   55  
  56   56  ## kernel-produced core
  57   57  kill -SEGV $pid
  58   58  
  59   59  cat > core-expected.$$ <<EOF
  60   60      namesz: 0x5
  61      -    descsz: 0x14
       61 +    descsz: 0x28
  62   62      type:   [ NT_SECFLAGS ]
  63   63      name:
  64   64          CORE\0
  65   65      desc: (prsecflags_t)
  66   66          pr_version:    1
  67   67          pr_effective:  [ ASLR ]
  68   68          pr_inherit:    [ ASLR ]
  69   69          pr_lower:      0
  70   70          pr_upper:      [ ASLR FORBIDNULLMAP NOEXECSTACK ]
  71   71  EOF
  72   72  
  73   73  /usr/bin/elfdump -n core | grep -B5 -A5 prsecflags_t > core-output.$$
  74   74  
  75   75  if ! diff -u core-expected.$$ core-output.$$; then
  76   76      exit 1;
  77   77  fi
  78   78  
  79   79  exit 0
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX