~ubuntu-branches/ubuntu/precise/apparmor/precise-security

« back to all changes in this revision

Viewing changes to .pc/0008-apparmor-lp963756.patch/tests/regression/apparmor/Makefile

  • Committer: Package Import Robot
  • Author(s): Steve Beattie, Jamie Strandboge, Serge Hallyn, Steve Beattie
  • Date: 2012-04-12 06:17:42 UTC
  • Revision ID: package-import@ubuntu.com-20120412061742-9v75hjko2mjtbewv
Tags: 2.7.102-0ubuntu3
[ Jamie Strandboge ]
* debian/patches/0007-ubuntu-manpage-updates.patch: update apparmor(5)
  to describe Ubuntu's two-stage policy load and how to add utilize it
  when developing policy (LP: #974089)

[ Serge Hallyn ]
* debian/apparmor.init: do nothing in a container.  This can be
  removed once stacked profiles are supported and used by lxc.
  (LP: #978297)

[ Steve Beattie ]
* debian/patches/0008-apparmor-lp963756.patch: Fix permission mapping
  for change_profile onexec (LP: #963756)
* debian/patches/0009-apparmor-lp959560-part1.patch,
  debian/patches/0010-apparmor-lp959560-part2.patch: Update the parser
  to support the 'in' keyword for value lists, and make mount
  operations aware of 'in' keyword so they can affect the flags build
  list (LP: #959560)
* debian/patches/0011-apparmor-lp872446.patch: fix logprof missing
  exec events in complain mode (LP: #872446)
* debian/patches/0012-apparmor-lp978584.patch: allow inet6 access in
  dovecot imap-login profile (LP: #978584)
* debian/patches/0013-apparmor-lp800826.patch: fix libapparmor
  log parsing library from dropping apparmor network events that
  contain ip addresses or ports in them (LP: #800826)
* debian/patches/0014-apparmor-lp979095.patch: document new mount rule
  syntax and usage in apparmor.d(5) manpage (LP: #979095)
* debian/patches/0015-apparmor-lp963756.patch: Fix change_onexec
  for profiles without attachment specification (LP: #963756,
  LP: #978038)
* debian/patches/0016-apparmor-lp968956.patch: Fix protocol error when
  loading policy to kernels without compat patches (LP: #968956)
* debian/patches/0017-apparmor-lp979135.patch: Fix change_profile to
  grant access to /proc/attr api (LP: #979135)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#       Copyright (C) 2002-2005 Novell/SUSE
 
2
#
 
3
#       This program is free software; you can redistribute it and/or
 
4
#       modify it under the terms of the GNU General Public License as
 
5
#       published by the Free Software Foundation, version 2 of the
 
6
#       License.
 
7
 
 
8
SRC=access.c \
 
9
    introspect.c \
 
10
    changeprofile.c \
 
11
    changehat.c \
 
12
    changehat_fork.c \
 
13
    changehat_misc.c \
 
14
    changehat_misc2.c \
 
15
    changehat_twice.c \
 
16
    changehat_fail.c \
 
17
    changehat_wrapper.c \
 
18
    changehat_pthread.c \
 
19
    chdir.c \
 
20
    chgrp.c \
 
21
    chmod.c \
 
22
    chown.c \
 
23
    clone.c \
 
24
    coredump.c \
 
25
    deleted.c \
 
26
    environ.c \
 
27
    env_check.c \
 
28
    exec.c \
 
29
    exec_qual.c \
 
30
    exec_qual2.c \
 
31
    fchdir.c \
 
32
    fchgrp.c \
 
33
    fchmod.c \
 
34
    fchown.c \
 
35
    fork.c \
 
36
    link.c \
 
37
    link_subset.c \
 
38
    mmap.c \
 
39
    mkdir.c \
 
40
    mount.c \
 
41
    named_pipe.c \
 
42
    net_raw.c \
 
43
    open.c \
 
44
    openat.c \
 
45
    pipe.c \
 
46
    ptrace.c \
 
47
    ptrace_helper.c \
 
48
    pwrite.c \
 
49
    rename.c \
 
50
    readdir.c \
 
51
    rw.c \
 
52
    symlink.c \
 
53
    syscall_mknod.c \
 
54
    swap.c \
 
55
    syscall_chroot.c \
 
56
    syscall_mlockall.c \
 
57
    syscall_ptrace.c \
 
58
    syscall_reboot.c \
 
59
    syscall_setpriority.c \
 
60
    syscall_sethostname.c \
 
61
    syscall_setdomainname.c \
 
62
    syscall_setscheduler.c \
 
63
    syscall_sysctl.c \
 
64
    sysctl_proc.c \
 
65
    tcp.c \
 
66
    unix_fd_client.c \
 
67
    unix_fd_server.c \
 
68
    unlink.c \
 
69
    xattrs.c
 
70
 
 
71
#only do the ioperm/iopl tests for x86 derived architectures
 
72
ifneq (,$(findstring $(shell uname -i),i386 i486 i586 i686 x86 x86_64))
 
73
SRC+=syscall_ioperm.c syscall_iopl.c
 
74
endif
 
75
 
 
76
# Suck, Fedora Core 3 no longer includes /sbin/kernelversion
 
77
KERNELVERSION:=$(shell if [ -x /sbin/kernelversion ] ; then \
 
78
                                /sbin/kernelversion ; \
 
79
                       else \
 
80
                                uname -r ; \
 
81
                       fi )
 
82
KERNELMAJOR:=$(shell echo ${KERNELVERSION} | cut -d. -f1)
 
83
KERNELMINOR:=$(shell echo ${KERNELVERSION} | cut -d. -f2)
 
84
CHANGEHAT_FLAGS=$(shell if [ ! -f /usr/include/sys/apparmor.h ] ; then \
 
85
                                if [ -f /usr/include/sys/immunix.h ] ; then \
 
86
                                        echo -DUSE_COMPAT_IMMUNIX_H ; \
 
87
                                else \
 
88
                                        (echo -DCHANGEHAT_NOT_IN_LIBRARY; \
 
89
                                        [ $(KERNELMAJOR) -eq 2 ] && \
 
90
                                        if [ $(KERNELMINOR) -eq 4 ] ; then \
 
91
                                                echo -DCHANGEHAT_2_4_KERNEL ; \
 
92
                                        elif [ $(KERNELMINOR) -eq 2 ] ; then \
 
93
                                                echo -DCHANGEHAT_2_2_KERNEL ;\
 
94
                                        fi ) \
 
95
                                fi ;\
 
96
                        fi )
 
97
 
 
98
LIBIMMUNIX:=$(shell     if [ -f /usr/lib/libapparmor.so -o -f /usr/lib64/libapparmor.so ] ; then \
 
99
                                echo -lapparmor ; \
 
100
                        elif [ -f /lib/libimmunix.so.1 -o -f /lib64/libimmunix.so ] ; then \
 
101
                                echo -limmunix ; \
 
102
                        fi )
 
103
 
 
104
CFLAGS+=$(CHANGEHAT_FLAGS) -Wall -Wstrict-prototypes
 
105
LDLIBS+=$(LIBIMMUNIX)
 
106
 
 
107
EXEC=$(SRC:%.c=%)
 
108
 
 
109
TESTS=access \
 
110
      introspect \
 
111
      capabilities \
 
112
      changeprofile \
 
113
      changehat \
 
114
      changehat_fork \
 
115
      changehat_misc \
 
116
      chdir \
 
117
      clone \
 
118
      coredump \
 
119
      deleted \
 
120
      environ \
 
121
      exec \
 
122
      exec_qual \
 
123
      fchdir \
 
124
      fork \
 
125
      i18n \
 
126
      link \
 
127
      link_subset \
 
128
      mkdir \
 
129
      mmap \
 
130
      mount \
 
131
      mult_mount \
 
132
      named_pipe \
 
133
      net_raw \
 
134
      open \
 
135
      openat \
 
136
      pipe \
 
137
      ptrace \
 
138
      pwrite \
 
139
      regex \
 
140
      rename \
 
141
      readdir \
 
142
      rw \
 
143
      swap \
 
144
      sd_flags \
 
145
      setattr \
 
146
      symlink \
 
147
      syscall \
 
148
      tcp \
 
149
      unix_fd_server \
 
150
      unlink\
 
151
      xattrs\
 
152
      longpath
 
153
 
 
154
# Tests that can crash the kernel should be placed here
 
155
RISKY_TESTS=
 
156
 
 
157
all: $(EXEC) changehat.h
 
158
 
 
159
changehat_pthread: changehat_pthread.c changehat.h
 
160
        ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ ${LDLIBS} -pthread
 
161
 
 
162
tests: all
 
163
        @if [ `whoami` = "root" ] ;\
 
164
        then \
 
165
                rc=0; \
 
166
                for i in $(TESTS) ;\
 
167
                do \
 
168
                        echo ;\
 
169
                        echo "running $$i" ;\
 
170
                        bash $$i.sh ;\
 
171
                        if [ $$? -ne 0 ] ; then \
 
172
                                rc=1;\
 
173
                        fi;\
 
174
                done ;\
 
175
                exit $$rc;\
 
176
        else \
 
177
                echo "must be root to run tests" ;\
 
178
                exit 1;\
 
179
        fi
 
180
 
 
181
alltests: all
 
182
        @if [ `whoami` = "root" ] ;\
 
183
        then \
 
184
                rc=0; \
 
185
                for i in $(TESTS) $(RISKY_TESTS) ;\
 
186
                do \
 
187
                        echo ;\
 
188
                        echo "running $$i" ;\
 
189
                        bash $$i.sh ;\
 
190
                        if [ $$? -ne 0 ] ; then \
 
191
                                rc=1;\
 
192
                        fi;\
 
193
                done ;\
 
194
                exit $$rc;\
 
195
        else \
 
196
                echo "must be root to run tests" ;\
 
197
                exit 1;\
 
198
        fi
 
199
 
 
200
clean:
 
201
        rm -f $(EXEC)
 
202
 
 
203
regex.sh: open exec