mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 15:25:27 +00:00
Merge in stress test changes before ext4 eats them.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
TARGETS=change_hat child open
|
TARGETS=change_hat child open
|
||||||
PROFILES=change_hat.profile child.profile open.profile sh.profile
|
PROFILES=change_hat.profile child.profile open.profile sh.profile
|
||||||
LIB:=$(shell if [ `ls /lib/apparmor* 2>/dev/null` ] ; then echo "apparmor" ; else echo "immunix" ; fi)
|
LIB:=apparmor
|
||||||
LIBS=-l$(LIB)
|
LIBS=-l$(LIB)
|
||||||
|
|
||||||
all: targets profiles
|
all: targets profiles
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <linux/unistd.h>
|
#include <linux/unistd.h>
|
||||||
|
|
||||||
#include "sys/immunix.h"
|
#include "sys/apparmor.h"
|
||||||
|
|
||||||
#define SD_ID_MAGIC 0xdeadbeef
|
#define SD_ID_MAGIC 0xdeadbeef
|
||||||
|
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
BASE/change_hat {
|
BASE/change_hat {
|
||||||
/lib/lib*.so r,
|
/lib/lib*.so rm,
|
||||||
/lib/lib*.so.* r,
|
/usr/lib/lib*.so rm,
|
||||||
/lib/i[356]86/lib*.so r,
|
/lib/lib*.so.* rm,
|
||||||
/lib/tls/lib*.*.so r,
|
/lib/i[356]86/lib*.so rm,
|
||||||
|
/lib/tls/lib*.*.so rm,
|
||||||
/lib/ld-*.so rix,
|
/lib/ld-*.so rix,
|
||||||
/etc/ld.so.* r,
|
/etc/ld.so.* r,
|
||||||
BASE/change_hat r,
|
BASE/change_hat r,
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
BASE/child {
|
BASE/child {
|
||||||
/lib/libc-*.so r,
|
/lib/libc-*.so rm,
|
||||||
/lib/libc-*.so.* r,
|
/lib/libc-*.so.* rm,
|
||||||
/lib/ld-*.so rix,
|
/lib/ld-*.so rix,
|
||||||
/lib/ld-*.so.* rix,
|
/lib/ld-*.so.* rix,
|
||||||
/lib/libAA* r,
|
/{usr/,}lib/libAA* rm,
|
||||||
/etc/ld.so.* r,
|
/etc/ld.so.* r,
|
||||||
BASE/child r,
|
BASE/child r,
|
||||||
/bin/ls r,
|
/bin/ls r,
|
||||||
|
@@ -8,13 +8,13 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat change_hat.profile | $subdomain_parser -R 2>&1 > /dev/null
|
$subdomain_parser -R change_hat.profile 2>&1 > /dev/null
|
||||||
cat change_hat.profile | $subdomain_parser
|
$subdomain_parser change_hat.profile
|
||||||
|
|
||||||
./change_hat > /dev/null 2>&1 &
|
./change_hat > /dev/null 2>&1 &
|
||||||
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
cat change_hat.profile | $subdomain_parser -r > /dev/null 2>&1 &
|
$subdomain_parser -r change_hat.profile > /dev/null 2>&1 &
|
||||||
done &
|
done &
|
||||||
|
|
||||||
|
@@ -16,8 +16,8 @@ int main(int argc, char *argv[])
|
|||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
o_file = argv[1];
|
o_file = argv[1];
|
||||||
|
|
||||||
// for (i=0, success=0, fail=0; i<MAX_LOOP; i++) {
|
for (i=0, success=0, fail=0; i<MAX_LOOP; i++) {
|
||||||
for (i=0, success=0, fail=0; !i; i++) {
|
// for (i=0, success=0, fail=0; !i; i++) {
|
||||||
fd = open(o_file, O_RDONLY);
|
fd = open(o_file, O_RDONLY);
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
success++;
|
success++;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
BASE/open {
|
BASE/open {
|
||||||
/lib/libc-*.so r,
|
/lib/libc-*.so rm,
|
||||||
/lib/libc-*.so.* r,
|
/lib/libc-*.so.* rm,
|
||||||
/lib/ld-*.so rix,
|
/lib/ld-*.so rix,
|
||||||
/lib/ld-*.so.* rix,
|
/lib/ld-*.so.* rix,
|
||||||
/lib/libAA* r,
|
/{usr/,}lib/libAA* rm,
|
||||||
/etc/ld.so.* r,
|
/etc/ld.so.* r,
|
||||||
BASE/open r,
|
BASE/open r,
|
||||||
/bin/ls r,
|
/bin/ls r,
|
||||||
|
@@ -11,11 +11,12 @@ BASE/sh {
|
|||||||
/etc/termcap r,
|
/etc/termcap r,
|
||||||
BASE/sh r,
|
BASE/sh r,
|
||||||
BASE/* rix,
|
BASE/* rix,
|
||||||
/lib/libc-*.so r,
|
/lib/libc-*.so rm,
|
||||||
/lib/libc-*.so.* r,
|
/lib/libc-*.so.* rm,
|
||||||
/lib/ld-*.so rix,
|
/lib/ld-*.so rix,
|
||||||
/lib/ld-*.so.* rix,
|
/lib/ld-*.so.* rix,
|
||||||
/lib/** r,
|
/lib/** rm,
|
||||||
|
/{usr/,}/lib/libAA* rm,
|
||||||
/proc/meminfo r,
|
/proc/meminfo r,
|
||||||
/usr/lib/locale/** r,
|
/usr/lib/locale/** r,
|
||||||
/usr/share/locale/** r,
|
/usr/share/locale/** r,
|
||||||
|
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
. ./uservars.inc
|
. ./uservars.inc
|
||||||
|
|
||||||
cat change_hat.profile child.profile open.profile | ${subdomain_parser}
|
${subdomain_parser} change_hat.profile child.profile open.profile
|
||||||
|
|
||||||
|
rm -f /tmp/foobar && touch /tmp/foobar
|
||||||
|
|
||||||
./open & ./open /tmp/foobar &
|
./open & ./open /tmp/foobar &
|
||||||
|
|
||||||
@@ -12,8 +14,8 @@ cat change_hat.profile child.profile open.profile | ${subdomain_parser}
|
|||||||
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
|
${subdomain_parser} -r change_hat.profile > /dev/null 2>&1 &
|
||||||
cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
|
${subdomain_parser} -r child.profile > /dev/null 2>&1 &
|
||||||
cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
|
${subdomain_parser} -r open.profile > /dev/null 2>&1 &
|
||||||
done &
|
done &
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user