Print this page
NEX-13644 File access audit logging
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/auditreduce/proc.c
          +++ new/usr/src/cmd/auditreduce/proc.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  24   26   */
  25   27  
  26   28  /*
  27   29   * Main processor for auditreduce.
  28   30   * Mproc() is the entry point for this module. It is the only visible
  29   31   * function in this module.
  30   32   */
  31   33  
  32   34  #include <sys/types.h>
  33   35  #include <locale.h>
↓ open down ↓ 766 lines elided ↑ open up ↑
 800  802                              gettext("auditreduce: bad token %u, terminating "
 801  803                              "file %s\n"), tokenid, (pcb->pcb_cur)->fcb_file);
 802  804                          return (-2);
 803  805                  }
 804  806  
 805  807                  /* Are we finished? */
 806  808                  if (flags == checkflags)
 807  809                          return (0);
 808  810          }
 809  811  
      812 +        /* let PAD_FAILURE satisfy success/failure selection */
      813 +        if ((flags & M_SORF) != 0 && (checkflags & M_SORF) == 0 &&
      814 +            (((global_class & mask.am_success) != 0 &&
      815 +            (id_modifier & PAD_FAILURE) == 0) ||
      816 +            ((global_class & mask.am_failure) != 0 &&
      817 +            (id_modifier & PAD_FAILURE) != 0))) {
      818 +                checkflags |= M_SORF;
      819 +        }
      820 +
      821 +
 810  822          /*
 811      -         * So, we haven't seen all that we need to see.  Reject record.
      823 +         * If we haven't seen all that we need to see, reject the record.
 812  824           */
 813  825  
 814      -        return (-1);
      826 +        return ((checkflags == flags) ? 0 : -1);
 815  827  }
 816  828  
 817  829  
 818  830  /*
 819  831   * .func check_order - Check temporal sequence.
 820  832   * .call check_order(pcb).
 821  833   * .arg  pcb - ptr to audit_pcb_t.
 822  834   * .desc        Check to see if the records are out of temporal sequence, ie,
 823  835   *      a record has a time stamp older than its predecessor.
 824  836   *      Also check to see if the current record is within the bounds of
↓ open down ↓ 223 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX