Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libbsm/mkhdr.sh
+++ new/usr/src/lib/libbsm/mkhdr.sh
1 1 #!/bin/sh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 #
24 24
25 25 # Automagically generate the audit_uevents.h header file.
26 26 #
27 27 DATABASE=audit_event.txt
28 28 HEADER_FILE=audit_uevents.h
29 29 CR_YEAR=`/usr/bin/date '+%Y'`
30 30
31 31 cat <<EOF > $HEADER_FILE
32 32 /*
33 33 * CDDL HEADER START
34 34 *
35 35 * The contents of this file are subject to the terms of the
36 36 * Common Development and Distribution License (the "License").
37 37 * You may not use this file except in compliance with the License.
38 38 *
39 39 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
40 40 * or http://www.opensolaris.org/os/licensing.
41 41 * See the License for the specific language governing permissions
42 42 * and limitations under the License.
43 43 *
44 44 * When distributing Covered Code, include this CDDL HEADER in each
45 45 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
46 46 * If applicable, add the following below this CDDL HEADER, with the
47 47 * fields enclosed by brackets "[]" replaced with your own identifying
48 48 * information: Portions Copyright [yyyy] [name of copyright owner]
49 49 *
50 50 * CDDL HEADER END
51 51 */
52 52 /*
53 53 * Copyright (c) 1992, $CR_YEAR, Oracle and/or its affiliates. All rights reserved.
54 54 */
55 55
56 56 #ifndef _BSM_AUDIT_UEVENTS_H
57 57 #define _BSM_AUDIT_UEVENTS_H
58 58
59 59 EOF
60 60
61 61 cat <<EOF >> $HEADER_FILE
62 62
63 63 /*
64 64 * User level audit event numbers.
65 65 *
66 66 * 0 Reserved as an invalid event number.
67 67 * 1 - 2047 Reserved for the Solaris Kernel events.
68 68 * 2048 - 32767 Reserved for the Solaris TCB programs.
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
69 69 * 32768 - 65535 Available for third party TCB applications.
70 70 *
71 71 */
72 72
73 73 #ifdef __cplusplus
74 74 extern "C" {
75 75 #endif
76 76
77 77 EOF
78 78
79 -nawk -F: '{if ((NF == 4) && substr($1,0,1) != "#")
79 +/usr/xpg4/bin/awk -F: '{if ((NF == 4) && substr($1,0,1) != "#")
80 80 if ($1 >= 2048) {
81 81 tlen = length($2);
82 82
83 83 printf("#define\t%s\t", $2)
84 84 if (tlen < 8)
85 85 printf("\t");
86 86 if (tlen < 16)
87 87 printf("\t");
88 88 if (tlen < 24)
89 89 printf("\t");
90 90 printf("%s\n", $1);
91 91 }
92 92 }' \
93 93 < $DATABASE >> $HEADER_FILE
94 94
95 95 cat <<EOF >> $HEADER_FILE
96 96
97 97 #ifdef __cplusplus
98 98 }
99 99 #endif
100 100
101 101 #endif /* _BSM_AUDIT_UEVENTS_H */
102 102 EOF
103 103
104 104 exit 0
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX