summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2012-06-18 11:52:31 -0400
committerMark Hatle <mark.hatle@windriver.com>2012-06-18 15:10:31 -0500
commit614837afa1d92fcfef65135c18974165cfcd2612 (patch)
tree970d9e05fdec13eab463c5b3c2795cfa6172de74
parentf2da3586725b4b14953fcf68900f12eaa3e307fb (diff)
downloadmeta-selinux-614837afa1d92fcfef65135c18974165cfcd2612.tar.gz
audit: Uprev audit
The recipe is derived from 2.1.3 with some changes made. 1. configuration files are updated to look for sbin binaries in /usr/sbin 2. a init.d file was derived from Debian to work with busybox's start-stop-daemon 3. the plugin package contents was fine tuned as some of the files from 2.1.3 were required to let audit run. Signed-off-by: Amy Fong <amy.fong@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-rw-r--r--recipes-security/audit/audit-2.2.1/2.2.1-audit-for-cross-compiling.patch311
-rwxr-xr-xrecipes-security/audit/audit-2.2.1/auditd152
-rw-r--r--recipes-security/audit/audit-2.2.1/sbin-in-usr.patch33
-rw-r--r--recipes-security/audit/audit_2.2.1.bb58
4 files changed, 554 insertions, 0 deletions
diff --git a/recipes-security/audit/audit-2.2.1/2.2.1-audit-for-cross-compiling.patch b/recipes-security/audit/audit-2.2.1/2.2.1-audit-for-cross-compiling.patch
new file mode 100644
index 0000000..e2eea95
--- /dev/null
+++ b/recipes-security/audit/audit-2.2.1/2.2.1-audit-for-cross-compiling.patch
@@ -0,0 +1,311 @@
1Fix audit for cross compiling
2
3Add support for CC_FOR_BUILD to the gen_captabs_h....
4
5Signed-off-by: Amy Fong <amy.fong@windriver.com>
6---
7 auparse/Makefile.am | 44 ++++++++++++++++++++++++++++++++++++++++++++
8 configure.ac | 9 +++++++++
9 lib/Makefile.am | 32 ++++++++++++++++++++++++++++++++
10 3 files changed, 85 insertions(+)
11
12--- a/auparse/Makefile.am
13+++ b/auparse/Makefile.am
14@@ -58,114 +58,158 @@
15
16 gen_captabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h captab.h
17 gen_captabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="captab.h"'
18+gen_captabs_h: $(gen_captabs_h_SOURCES)
19+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_captabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
20 captabs.h: gen_captabs_h Makefile
21 ./gen_captabs_h --i2s cap > $@
22
23 gen_clock_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h clocktab.h
24 gen_clock_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="clocktab.h"'
25+gen_clock_h: $(gen_clock_h_SOURCES)
26+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_clock_h_CFLAGS) $(LDFLAGS) -o $@ $<
27 clocktabs.h: gen_clock_h Makefile
28 ./gen_clock_h --i2s clock > $@
29
30 gen_clone_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
31 clone-flagtab.h
32 gen_clone_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="clone-flagtab.h"'
33+gen_clone-flagtabs_h: $(gen_clone_flagtabs_h_SOURCES)
34+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_clone_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
35 clone-flagtabs.h: gen_clone-flagtabs_h Makefile
36 ./gen_clone-flagtabs_h --i2s-transtab clone_flag > $@
37
38 gen_epoll_ctls_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h epoll_ctl.h
39 gen_epoll_ctls_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="epoll_ctl.h"'
40+gen_epoll_ctls_h: $(gen_epoll_ctls_h_SOURCES)
41+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_epoll_ctls_h_CFLAGS) $(LDFLAGS) -o $@ $<
42 epoll_ctls.h: gen_epoll_ctls_h Makefile
43 ./gen_epoll_ctls_h --i2s epoll_ctl > $@
44
45 gen_famtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h famtab.h
46 gen_famtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="famtab.h"'
47+gen_famtabs_h: $(gen_famtabs_h_SOURCES)
48+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_famtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
49 famtabs.h: gen_famtabs_h Makefile
50 ./gen_famtabs_h --i2s fam > $@
51
52 gen_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h flagtab.h
53 # ../auparse/ is used to avoid using ../lib/flagtab.h
54 gen_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="../auparse/flagtab.h"'
55+gen_flagtabs_h: $(gen_flagtabs_h_SOURCES)
56+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
57 flagtabs.h: gen_flagtabs_h Makefile
58 ./gen_flagtabs_h --i2s-transtab flag > $@
59
60 gen_fcntl_cmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
61 fcntl-cmdtab.h
62 gen_fcntl_cmdtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="fcntl-cmdtab.h"'
63+gen_fcntl-cmdtabs_h: $(gen_fcntl_cmdtabs_h_SOURCES)
64+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_fcntl_cmdtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
65 fcntl-cmdtabs.h: gen_fcntl-cmdtabs_h Makefile
66 ./gen_fcntl-cmdtabs_h --i2s fcntl > $@
67
68 gen_icmptypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h icmptypetab.h
69 gen_icmptypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="icmptypetab.h"'
70+gen_icmptypetabs_h: $(gen_icmptypetabs_h_SOURCES)
71+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_icmptypetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
72 icmptypetabs.h: gen_icmptypetabs_h Makefile
73 ./gen_icmptypetabs_h --i2s icmptype > $@
74
75 gen_ipctabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipctab.h
76 gen_ipctabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ipctab.h"'
77+gen_ipctabs_h: $(gen_ipctabs_h_SOURCES)
78+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_ipctabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
79 ipctabs.h: gen_ipctabs_h Makefile
80 ./gen_ipctabs_h --i2s ipc > $@
81
82 gen_mmaptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mmaptab.h
83 gen_mmaptabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="mmaptab.h"'
84+gen_mmaptabs_h: $(gen_mmaptabs_h_SOURCES)
85+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_mmaptabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
86 mmaptabs.h: gen_mmaptabs_h Makefile
87 ./gen_mmaptabs_h --i2s-transtab mmap > $@
88
89 gen_mounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mounttab.h
90 gen_mounttabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="mounttab.h"'
91+gen_mounttabs_h: $(gen_mounttabs_h_SOURCES)
92+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_mounttabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
93 mounttabs.h: gen_mounttabs_h Makefile
94 ./gen_mounttabs_h --i2s-transtab mount > $@
95
96 gen_nfprototabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h nfprototab.h
97 gen_nfprototabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="nfprototab.h"'
98+gen_nfprototabs_h: $(gen_nfprototabs_h_SOURCES)
99+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_nfprototabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
100 nfprototabs.h: gen_nfprototabs_h Makefile
101 ./gen_nfprototabs_h --i2s nfproto > $@
102
103 gen_open_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
104 open-flagtab.h
105 gen_open_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="open-flagtab.h"'
106+gen_open-flagtabs_h: $(gen_open_flagtabs_h_SOURCES)
107+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_open_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
108 open-flagtabs.h: gen_open-flagtabs_h Makefile
109 ./gen_open-flagtabs_h --i2s-transtab open_flag > $@
110
111 gen_persontabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h persontab.h
112 gen_persontabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="persontab.h"'
113+gen_persontabs_h: $(gen_persontabs_h_SOURCES)
114+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_persontabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
115 persontabs.h: gen_persontabs_h Makefile
116 ./gen_persontabs_h --i2s person > $@
117
118 gen_ptracetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ptracetab.h
119 gen_ptracetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ptracetab.h"'
120+gen_ptracetabs_h: $(gen_ptracetabs_h_SOURCES)
121+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_ptracetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
122 ptracetabs.h: gen_ptracetabs_h Makefile
123 ./gen_ptracetabs_h --i2s ptrace > $@
124
125 gen_prottabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prottab.h
126 gen_prottabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="prottab.h"'
127+gen_prottabs_h: $(gen_prottabs_h_SOURCES)
128+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_prottabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
129 prottabs.h: gen_prottabs_h Makefile
130 ./gen_prottabs_h --i2s-transtab prot > $@
131
132 gen_recvtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h recvtab.h
133 gen_recvtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="recvtab.h"'
134+gen_recvtabs_h: $(gen_recvtabs_h_SOURCES)
135+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_recvtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
136 recvtabs.h: gen_recvtabs_h Makefile
137 ./gen_recvtabs_h --i2s-transtab recv > $@
138
139 gen_rlimit_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h rlimittab.h
140 gen_rlimit_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="rlimittab.h"'
141+gen_rlimit_h: $(gen_rlimit_h_SOURCES)
142+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_rlimit_h_CFLAGS) $(LDFLAGS) -o $@ $<
143 rlimittabs.h: gen_rlimit_h Makefile
144 ./gen_rlimit_h --i2s rlimit > $@
145
146 gen_signals_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h signaltab.h
147 gen_signals_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="signaltab.h"'
148+gen_signals_h: $(gen_signals_h_SOURCES)
149+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_signals_h_CFLAGS) $(LDFLAGS) -o $@ $<
150 signaltabs.h: gen_signals_h Makefile
151 ./gen_signals_h --i2s signal > $@
152
153 gen_socktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktab.h
154 gen_socktabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="socktab.h"'
155+gen_socktabs_h: $(gen_socktabs_h_SOURCES)
156+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_socktabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
157 socktabs.h: gen_socktabs_h Makefile
158 ./gen_socktabs_h --i2s sock > $@
159
160 gen_socktypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktypetab.h
161 gen_socktypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="socktypetab.h"'
162+gen_socktypetabs_h: $(gen_socktypetabs_h_SOURCES)
163+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_socktypetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
164 socktypetabs.h: gen_socktypetabs_h Makefile
165 ./gen_socktypetabs_h --i2s sock_type > $@
166
167 gen_typetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h typetab.h
168 gen_typetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="typetab.h"'
169+gen_typetabs_h: $(gen_typetabs_h_SOURCES)
170+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_typetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
171 typetabs.h: gen_typetabs_h Makefile
172 ./gen_typetabs_h --s2i type > $@
173--- a/configure.ac
174+++ b/configure.ac
175@@ -104,6 +104,15 @@
176 fi
177 AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
178
179+if test -z "$CC_FOR_BUILD"; then
180+ if test "x$cross_compiling" = "xno"; then
181+ CC_FOR_BUILD='$(CC)'
182+ else
183+ CC_FOR_BUILD=gcc
184+ fi
185+fi
186+AC_SUBST(CC_FOR_BUILD)
187+
188 #gssapi
189 AC_ARG_ENABLE(gssapi_krb5,
190 [AS_HELP_STRING([--enable-gssapi-krb5],[Enable GSSAPI Kerberos 5 support @<:@default=no@:>@])],
191--- a/lib/Makefile.am
192+++ b/lib/Makefile.am
193@@ -60,12 +60,16 @@
194 endif
195 gen_actiontabs_h_SOURCES = gen_tables.c gen_tables.h actiontab.h
196 gen_actiontabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="actiontab.h"'
197+gen_actiontabs_h: $(gen_actiontabs_h_SOURCES)
198+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_actiontabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
199 actiontabs.h: gen_actiontabs_h Makefile
200 ./gen_actiontabs_h --lowercase --i2s --s2i action > $@
201
202 if USE_ALPHA
203 gen_alpha_tables_h_SOURCES = gen_tables.c gen_tables.h alpha_table.h
204 gen_alpha_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="alpha_table.h"'
205+gen_alpha_tables_h: $(gen_alpha_tables_h_SOURCES)
206+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_alpha_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
207 alpha_tables.h: gen_alpha_tables_h Makefile
208 ./gen_alpha_tables_h --lowercase --i2s --s2i alpha_syscall > $@
209 endif
210@@ -73,73 +77,101 @@
211 if USE_ARMEB
212 gen_armeb_tables_h_SOURCES = gen_tables.c gen_tables.h armeb_table.h
213 gen_armeb_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="armeb_table.h"'
214+gen_armeb_tables_h: $(gen_armeb_tables_h_SOURCES)
215+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_armeb_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
216 armeb_tables.h: gen_armeb_tables_h Makefile
217 ./gen_armeb_tables_h --lowercase --i2s --s2i armeb_syscall > $@
218 endif
219
220 gen_errtabs_h_SOURCES = gen_tables.c gen_tables.h errtab.h
221 gen_errtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="errtab.h"'
222+gen_errtabs_h: $(gen_errtabs_h_SOURCES)
223+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_errtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
224 errtabs.h: gen_errtabs_h Makefile
225 ./gen_errtabs_h --duplicate-ints --uppercase --i2s --s2i err > $@
226
227 gen_fieldtabs_h_SOURCES = gen_tables.c gen_tables.h fieldtab.h
228 gen_fieldtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="fieldtab.h"'
229+gen_fieldtabs_h: $(gen_fieldtabs_h_SOURCES)
230+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_fieldtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
231 fieldtabs.h: gen_fieldtabs_h Makefile
232 ./gen_fieldtabs_h --duplicate-ints --lowercase --i2s --s2i field > $@
233
234 gen_flagtabs_h_SOURCES = gen_tables.c gen_tables.h flagtab.h
235 gen_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="flagtab.h"'
236+gen_flagtabs_h: $(gen_flagtabs_h_SOURCES)
237+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
238 flagtabs.h: gen_flagtabs_h Makefile
239 ./gen_flagtabs_h --lowercase --i2s --s2i flag > $@
240
241 gen_ftypetabs_h_SOURCES = gen_tables.c gen_tables.h ftypetab.h
242 gen_ftypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ftypetab.h"'
243+gen_ftypetabs_h: $(gen_ftypetabs_h_SOURCES)
244+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_ftypetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
245 ftypetabs.h: gen_ftypetabs_h Makefile
246 ./gen_ftypetabs_h --lowercase --i2s --s2i ftype > $@
247
248 gen_i386_tables_h_SOURCES = gen_tables.c gen_tables.h i386_table.h
249 gen_i386_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="i386_table.h"'
250+gen_i386_tables_h: $(gen_i386_tables_h_SOURCES)
251+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_i386_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
252 i386_tables.h: gen_i386_tables_h Makefile
253 ./gen_i386_tables_h --duplicate-ints --lowercase --i2s --s2i \
254 i386_syscall > $@
255
256 gen_ia64_tables_h_SOURCES = gen_tables.c gen_tables.h ia64_table.h
257 gen_ia64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ia64_table.h"'
258+gen_ia64_tables_h: $(gen_ia64_tables_h_SOURCES)
259+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_ia64_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
260 ia64_tables.h: gen_ia64_tables_h Makefile
261 ./gen_ia64_tables_h --lowercase --i2s --s2i ia64_syscall > $@
262
263 gen_machinetabs_h_SOURCES = gen_tables.c gen_tables.h machinetab.h
264 gen_machinetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="machinetab.h"'
265+gen_machinetabs_h: $(gen_machinetabs_h_SOURCES)
266+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_machinetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
267 machinetabs.h: gen_machinetabs_h Makefile
268 ./gen_machinetabs_h --duplicate-ints --lowercase --i2s --s2i machine \
269 > $@
270
271 gen_msg_typetabs_h_SOURCES = gen_tables.c gen_tables.h msg_typetab.h
272 gen_msg_typetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="msg_typetab.h"'
273+gen_msg_typetabs_h: $(gen_msg_typetabs_h_SOURCES)
274+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_msg_typetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
275 msg_typetabs.h: gen_msg_typetabs_h Makefile
276 ./gen_msg_typetabs_h --uppercase --i2s --s2i msg_type > $@
277
278 gen_optabs_h_SOURCES = gen_tables.c gen_tables.h optab.h
279 gen_optabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="optab.h"'
280+gen_optabs_h: $(gen_optabs_h_SOURCES)
281+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_optabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
282 optabs.h: gen_optabs_h Makefile
283 ./gen_optabs_h --i2s op > $@
284
285 gen_ppc_tables_h_SOURCES = gen_tables.c gen_tables.h ppc_table.h
286 gen_ppc_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ppc_table.h"'
287+gen_ppc_tables_h: $(gen_ppc_tables_h_SOURCES)
288+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_ppc_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
289 ppc_tables.h: gen_ppc_tables_h Makefile
290 ./gen_ppc_tables_h --lowercase --i2s --s2i ppc_syscall > $@
291
292 gen_s390_tables_h_SOURCES = gen_tables.c gen_tables.h s390_table.h
293 gen_s390_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="s390_table.h"'
294+gen_s390_tables_h: $(gen_s390_tables_h_SOURCES)
295+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_s390_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
296 s390_tables.h: gen_s390_tables_h Makefile
297 ./gen_s390_tables_h --lowercase --i2s --s2i s390_syscall > $@
298
299 gen_s390x_tables_h_SOURCES = gen_tables.c gen_tables.h s390x_table.h
300 gen_s390x_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="s390x_table.h"'
301+gen_s390x_tables_h: $(gen_s390x_tables_h_SOURCES)
302+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_s390x_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
303 s390x_tables.h: gen_s390x_tables_h Makefile
304 ./gen_s390x_tables_h --lowercase --i2s --s2i s390x_syscall > $@
305
306 gen_x86_64_tables_h_SOURCES = gen_tables.c gen_tables.h x86_64_table.h
307 gen_x86_64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="x86_64_table.h"'
308+gen_x86_64_tables_h: $(gen_x86_64_tables_h_SOURCES)
309+ $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_x86_64_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
310 x86_64_tables.h: gen_x86_64_tables_h Makefile
311 ./gen_x86_64_tables_h --lowercase --i2s --s2i x86_64_syscall > $@
diff --git a/recipes-security/audit/audit-2.2.1/auditd b/recipes-security/audit/audit-2.2.1/auditd
new file mode 100755
index 0000000..cda836a
--- /dev/null
+++ b/recipes-security/audit/audit-2.2.1/auditd
@@ -0,0 +1,152 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: auditd
4# Required-Start: $local_fs
5# Required-Stop: $local_fs
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Audit Daemon
9# Description: Collects audit information from Linux 2.6 Kernels.
10### END INIT INFO
11
12# Author: Philipp Matthias Hahn <pmhahn@debian.org>
13# Based on Debians /etc/init.d/skeleton and Auditds init.d/auditd.init
14
15# June, 2012: Adopted for yocto <amy.fong@windriver.com>
16
17# PATH should only include /usr/* if it runs after the mountnfs.sh script
18PATH=/sbin:/bin:/usr/sbin:/usr/bin
19DESC="audit daemon"
20NAME=auditd
21DAEMON=/usr/sbin/auditd
22PIDFILE=/var/run/"$NAME".pid
23SCRIPTNAME=/etc/init.d/"$NAME"
24
25# Exit if the package is not installed
26[ -x "$DAEMON" ] || exit 0
27
28# Read configuration variable file if it is present
29[ -r /etc/default/"$NAME" ] && . /etc/default/"$NAME"
30
31. /etc/default/rcS
32
33. /etc/init.d/functions
34
35#
36# Function that starts the daemon/service
37#
38do_start()
39{
40 # Return
41 # 0 if daemon has been started
42 # 1 if daemon was already running
43 # 2 if daemon could not be started
44 start-stop-daemon -S --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null \
45 || return 1
46 start-stop-daemon -S --quiet --pidfile "$PIDFILE" --exec "$DAEMON" -- \
47 $EXTRAOPTIONS \
48 || return 2
49 if [ -f /etc/audit/audit.rules ]
50 then
51 /usr/sbin/auditctl -R /etc/audit/audit.rules >/dev/null
52 fi
53}
54
55#
56# Function that stops the daemon/service
57#
58do_stop()
59{
60 # Return
61 # 0 if daemon has been stopped
62 # 1 if daemon was already stopped
63 # 2 if daemon could not be stopped
64 # other if a failure occurred
65 start-stop-daemon -K --quiet --pidfile "$PIDFILE" --name "$NAME"
66 RETVAL="$?"
67 [ "$RETVAL" = 2 ] && return 2
68 # Many daemons don't delete their pidfiles when they exit.
69 rm -f "$PIDFILE"
70 rm -f /var/run/audit_events
71 # Remove watches so shutdown works cleanly
72 case "$AUDITD_CLEAN_STOP" in
73 no|NO) ;;
74 *) /usr/sbin/auditctl -D >/dev/null ;;
75 esac
76 return "$RETVAL"
77}
78
79#
80# Function that sends a SIGHUP to the daemon/service
81#
82do_reload() {
83 start-stop-daemon -K --signal HUP --quiet --pidfile $PIDFILE --name $NAME
84 return 0
85}
86
87if [ ! -e /var/log/audit ]; then
88 mkdir -p /var/log/audit
89fi
90
91case "$1" in
92 start)
93 [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
94 do_start
95 case "$?" in
96 0|1) [ "$VERBOSE" != no ] && echo 0 ;;
97 2) [ "$VERBOSE" != no ] && echo 1 ;;
98 esac
99 ;;
100 stop)
101 [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
102 do_stop
103 case "$?" in
104 0|1) [ "$VERBOSE" != no ] && echo 0 ;;
105 2) [ "$VERBOSE" != no ] && echo 1 ;;
106 esac
107 ;;
108 reload|force-reload)
109 echo "Reloading $DESC" "$NAME"
110 do_reload
111 echo $?
112 ;;
113 restart)
114 echo "Restarting $DESC" "$NAME"
115 do_stop
116 case "$?" in
117 0|1)
118 do_start
119 case "$?" in
120 0) echo 0 ;;
121 1) echo 1 ;; # Old process is still running
122 *) echo 1 ;; # Failed to start
123 esac
124 ;;
125 *)
126 # Failed to stop
127 echo 1
128 ;;
129 esac
130 ;;
131 rotate)
132 echo "Rotating $DESC logs" "$NAME"
133 start-stop-daemon -K --signal USR1 --quiet --pidfile "$PIDFILE" --name "$NAME"
134 echo $?
135 ;;
136 status)
137 pidofproc "$DAEMON" >/dev/null
138 status=$?
139 if [ $status -eq 0 ]; then
140 echo "$NAME is running."
141 else
142 echo "$NAME is not running."
143 fi
144 exit $status
145 ;;
146 *)
147 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|rotate|status}" >&2
148 exit 3
149 ;;
150esac
151
152:
diff --git a/recipes-security/audit/audit-2.2.1/sbin-in-usr.patch b/recipes-security/audit/audit-2.2.1/sbin-in-usr.patch
new file mode 100644
index 0000000..95f98a2
--- /dev/null
+++ b/recipes-security/audit/audit-2.2.1/sbin-in-usr.patch
@@ -0,0 +1,33 @@
1Fix sbindir paths in config files
2
3Change the default PATH of apps to reflect the location of sbindir
4in /usr/sbin
5
6Signed-off-by: Amy Fong <amy.fong@windriver.com>
7---
8 audisp/plugins/remote/au-remote.conf | 2 +-
9 init.d/auditd.conf | 2 +-
10 2 files changed, 2 insertions(+), 2 deletions(-)
11
12--- a/audisp/plugins/remote/au-remote.conf
13+++ b/audisp/plugins/remote/au-remote.conf
14@@ -5,7 +5,7 @@
15
16 active = no
17 direction = out
18-path = /sbin/audisp-remote
19+path = /usr/sbin/audisp-remote
20 type = always
21 #args =
22 format = string
23--- a/init.d/auditd.conf
24+++ b/init.d/auditd.conf
25@@ -10,7 +10,7 @@
26 freq = 20
27 num_logs = 5
28 disp_qos = lossy
29-dispatcher = /sbin/audispd
30+dispatcher = /usr/sbin/audispd
31 name_format = NONE
32 ##name = mydomain
33 max_log_file = 6
diff --git a/recipes-security/audit/audit_2.2.1.bb b/recipes-security/audit/audit_2.2.1.bb
new file mode 100644
index 0000000..8fb9e03
--- /dev/null
+++ b/recipes-security/audit/audit_2.2.1.bb
@@ -0,0 +1,58 @@
1SUMMARY = "User space tools for kernel auditing"
2DESCRIPTION = "The audit package contains the user space utilities for \
3storing and searching the audit records generated by the audit subsystem \
4in the Linux kernel."
5HOMEPAGE = "http://people.redhat.com/sgrubb/audit/"
6SECTION = "base"
7PR = "r1"
8LICENSE = "GPLv2+ & LGPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
10
11SRC_URI = "http://people.redhat.com/sgrubb/audit/audit-${PV}.tar.gz \
12 file://disable-ldap.patch \
13 file://audit-python.patch"
14
15SRC_URI += "file://2.2.1-audit-for-cross-compiling.patch file://sbin-in-usr.patch file://auditd"
16
17inherit autotools
18
19SRC_URI[md5sum] = "dc099fcb2f9242d47ecc35b46d71dfd1"
20SRC_URI[sha256sum] = "9865ca89f5b975ccf25441ddf45a874448f2bba944005aa8cd5e3c3148713a63"
21
22DEPENDS += "python tcp-wrappers libcap-ng linux-libc-headers (>= 2.6.30)"
23
24EXTRA_OECONF += "--without-prelude --with-libwrap --enable-gssapi-krb5=no --disable-ldap --with-libcap-ng=yes --with-python=yes"
25
26EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' PYINC='${STAGING_INCDIR}/$(PYLIBVER)'"
27
28SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher"
29DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \
30interface to the audit system, audispd. These plugins can do things \
31like relay events to remote machines or analyze events for suspicious \
32behavior."
33
34PACKAGES =+ "audispd-plugins ${PN}-libs"
35PACKAGES += "${PN}-python"
36
37FILES_${PN}-libs += "${sysconfdir}/libaudit.conf ${libdir}/libaudit.so.1* ${libdir}/libauparse.so.*"
38FILES_${PN} += "${bindir} ${sbindir}"
39FILES_audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \
40 ${sysconfdir}/audisp/plugins.d/au-remote.conf \
41 ${base_sbindir}/audisp-remote ${localstatedir}/spool/audit \
42 ${mandir}/man8/audisp-remote.8 ${mandir}/man5/audisp-remote.conf.5"
43FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug"
44FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}"
45
46do_install_append() {
47 rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a
48 rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la
49
50 # reuse auditd config
51 [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default
52 mv ${D}/etc/sysconfig/auditd ${D}/etc/default
53 rmdir ${D}/etc/sysconfig/
54
55 # replace init.d
56 install -D -m 0755 ${S}/../auditd ${D}/etc/init.d/auditd
57 rm -rf ${D}/etc/rc.d
58}