Package: apparmor / 2.13.4-3

upstream-commit-94ff870-remove-subdomainfs-support.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
From: John Johansen <john.johansen@canonical.com>
Date: Sat, 3 Nov 2018 16:39:49 -0700
Subject: remove subdomainfs support

It has been over 10 years since transition from subdomainfs to
using securityfs. Lets drop this deprecated code.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/258
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: seth.arnold@canonical.com
---
 changehat/mod_apparmor/mod_apparmor.pod       |   2 +-
 parser/Makefile                               |   6 +-
 parser/apparmor.pod                           |   2 +-
 parser/apparmor_parser.pod                    |   4 +-
 parser/parser_include.c                       |  68 ++---------------
 parser/rc.apparmor.functions                  |  98 +-----------------------
 parser/subdomain.conf                         |  53 -------------
 parser/subdomain.conf.pod                     | 104 --------------------------
 tests/stress/apparmor/Makefile                |  24 ++++++
 tests/stress/apparmor/change_hat.c            |  51 +++++++++++++
 tests/stress/apparmor/change_hat.profile.pre  |  24 ++++++
 tests/stress/apparmor/child.c                 |  35 +++++++++
 tests/stress/apparmor/child.profile.pre       |  12 +++
 tests/stress/apparmor/kill.sh                 |  19 +++++
 tests/stress/apparmor/open.c                  |  34 +++++++++
 tests/stress/apparmor/open.profile.pre        |  15 ++++
 tests/stress/apparmor/s-2.4.20.sh             |  18 +++++
 tests/stress/apparmor/s.sh                    |  18 +++++
 tests/stress/apparmor/sh.profile.pre          |  24 ++++++
 tests/stress/apparmor/stress.sh               |  20 +++++
 tests/stress/apparmor/stress.sh-2.4.20        |  18 +++++
 tests/stress/apparmor/uservars.inc            |  42 +++++++++++
 tests/stress/subdomain/Makefile               |  24 ------
 tests/stress/subdomain/change_hat.c           |  51 -------------
 tests/stress/subdomain/change_hat.profile.pre |  24 ------
 tests/stress/subdomain/child.c                |  35 ---------
 tests/stress/subdomain/child.profile.pre      |  12 ---
 tests/stress/subdomain/kill.sh                |  20 -----
 tests/stress/subdomain/open.c                 |  34 ---------
 tests/stress/subdomain/open.profile.pre       |  15 ----
 tests/stress/subdomain/s-2.4.20.sh            |  19 -----
 tests/stress/subdomain/s.sh                   |  19 -----
 tests/stress/subdomain/sh.profile.pre         |  24 ------
 tests/stress/subdomain/stress.sh              |  21 ------
 tests/stress/subdomain/stress.sh-2.4.20       |  19 -----
 tests/stress/subdomain/uservars.inc           |  42 -----------
 utils/apparmor/config.py                      |   2 +-
 37 files changed, 368 insertions(+), 684 deletions(-)
 delete mode 100644 parser/subdomain.conf
 delete mode 100644 parser/subdomain.conf.pod
 create mode 100644 tests/stress/apparmor/Makefile
 create mode 100644 tests/stress/apparmor/change_hat.c
 create mode 100644 tests/stress/apparmor/change_hat.profile.pre
 create mode 100644 tests/stress/apparmor/child.c
 create mode 100644 tests/stress/apparmor/child.profile.pre
 create mode 100755 tests/stress/apparmor/kill.sh
 create mode 100644 tests/stress/apparmor/open.c
 create mode 100644 tests/stress/apparmor/open.profile.pre
 create mode 100755 tests/stress/apparmor/s-2.4.20.sh
 create mode 100755 tests/stress/apparmor/s.sh
 create mode 100644 tests/stress/apparmor/sh.profile.pre
 create mode 100755 tests/stress/apparmor/stress.sh
 create mode 100755 tests/stress/apparmor/stress.sh-2.4.20
 create mode 100644 tests/stress/apparmor/uservars.inc
 delete mode 100644 tests/stress/subdomain/Makefile
 delete mode 100644 tests/stress/subdomain/change_hat.c
 delete mode 100644 tests/stress/subdomain/change_hat.profile.pre
 delete mode 100644 tests/stress/subdomain/child.c
 delete mode 100644 tests/stress/subdomain/child.profile.pre
 delete mode 100755 tests/stress/subdomain/kill.sh
 delete mode 100644 tests/stress/subdomain/open.c
 delete mode 100644 tests/stress/subdomain/open.profile.pre
 delete mode 100755 tests/stress/subdomain/s-2.4.20.sh
 delete mode 100755 tests/stress/subdomain/s.sh
 delete mode 100644 tests/stress/subdomain/sh.profile.pre
 delete mode 100755 tests/stress/subdomain/stress.sh
 delete mode 100755 tests/stress/subdomain/stress.sh-2.4.20
 delete mode 100644 tests/stress/subdomain/uservars.inc

diff --git a/changehat/mod_apparmor/mod_apparmor.pod b/changehat/mod_apparmor/mod_apparmor.pod
index f9352ee..54f9f36 100644
--- a/changehat/mod_apparmor/mod_apparmor.pod
+++ b/changehat/mod_apparmor/mod_apparmor.pod
@@ -139,7 +139,7 @@ them at L<https://bugs.launchpad.net/apparmor/+filebug>.
 
 =head1 SEE ALSO
 
-apparmor(7), subdomain.conf(5), apparmor_parser(8), aa_change_hat(2) and
+apparmor(7), apparmor_parser(8), aa_change_hat(2) and
 L<https://wiki.apparmor.net>.
 
 =cut
diff --git a/parser/Makefile b/parser/Makefile
index 73e88f5..558d961 100644
--- a/parser/Makefile
+++ b/parser/Makefile
@@ -30,7 +30,7 @@ SYSTEMD_UNIT_DIR=${DESTDIR}/usr/lib/systemd/system
 CONFDIR=/etc/apparmor
 INSTALL_CONFDIR=${DESTDIR}${CONFDIR}
 LOCALEDIR=/usr/share/locale
-MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 subdomain.conf.5 aa-teardown.8
+MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 aa-teardown.8
 
 YACC	:= bison
 YFLAGS	:= -d
@@ -72,9 +72,6 @@ endif
 # Internationalization support. Define a package and a LOCALEDIR
 EXTRA_CFLAGS+=-DPACKAGE=\"${NAME}\" -DLOCALEDIR=\"${LOCALEDIR}\"
 
-# Compile-time configuration of the location of the config file
-EXTRA_CFLAGS+=-DSUBDOMAIN_CONFDIR=\"${CONFDIR}\"
-
 SRCS = parser_common.c parser_include.c parser_interface.c parser_lex.c \
        parser_main.c parser_misc.c parser_merge.c parser_symtab.c \
        parser_yacc.c parser_regex.c parser_variable.c parser_policy.c \
@@ -373,7 +370,6 @@ install-arch: $(INSTALLDEPS)
 .PHONY: install-indep
 install-indep: indep
 	install -m 755 -d $(INSTALL_CONFDIR)
-	install -m 644 subdomain.conf $(INSTALL_CONFDIR)
 	install -m 644 parser.conf $(INSTALL_CONFDIR)
 	install -m 755 -d ${DESTDIR}/var/lib/apparmor
 	install -m 755 -d $(APPARMOR_BIN_PREFIX)
diff --git a/parser/apparmor.pod b/parser/apparmor.pod
index 5752002..4d731f3 100644
--- a/parser/apparmor.pod
+++ b/parser/apparmor.pod
@@ -212,7 +212,7 @@ Else, if auditd is running, see auditd(8) and auditd.conf(5).
 =head1 SEE ALSO
 
 apparmor_parser(8), aa_change_hat(2), apparmor.d(5),
-subdomain.conf(5), aa-autodep(1), clean(1),
+aa-autodep(1), clean(1),
 auditd(8),
 aa-unconfined(8), aa-enforce(1), aa-complain(1), and
 L<https://wiki.apparmor.net>.
diff --git a/parser/apparmor_parser.pod b/parser/apparmor_parser.pod
index 2ea283c..8258189 100644
--- a/parser/apparmor_parser.pod
+++ b/parser/apparmor_parser.pod
@@ -179,7 +179,7 @@ defined as relative paths.
 Add element n to the search path when resolving #include directives
 defined as an absolute paths.
 
-=item -f n, --subdomainfs n
+=item -f n, --apparmorfs n
 
 Set the location of the apparmor security filesystem (default is
 "/sys/kernel/security/apparmor").
@@ -407,7 +407,7 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
 
 =head1 SEE ALSO
 
-apparmor(7), apparmor.d(5), subdomain.conf(5), aa_change_hat(2), and
+apparmor(7), apparmor.d(5), aa_change_hat(2), and
 L<https://wiki.apparmor.net>.
 
 =cut
diff --git a/parser/parser_include.c b/parser/parser_include.c
index 9fc8b83..d312488 100644
--- a/parser/parser_include.c
+++ b/parser/parser_include.c
@@ -17,21 +17,21 @@
  *   along with this program; if not, contact Canonical, Ltd.
  */
 
-/* Handle subdomain includes, as a straight forward preprocessing phase.
+/* Handle apparmor includes, as a straight forward preprocessing phase.
    While we are at it we will strip comments.  Why? because it made it
    easier.
 
    We support 2 types of includes
 
 #include <name> which searches for the first occurance of name in the
-   subdomain directory path.
+   apparmor directory path.
 
 #include "name" which will search for a relative or absolute pathed
    file
 
 -p : preprocess only.  Dump output to stdout
 -I path : add a path to be search by #include < >
--b path : set the base path to something other than /etc/subdomain.d
+-b path : set the base path to something other than /etc/apparmor.d
 
 */
 
@@ -57,13 +57,6 @@
 /* maximum depth of nesting */
 #define MAX_NEST_LEVEL 100
 
-/* Location of the subdomain.conf file */
-#ifdef SUBDOMAIN_CONFDIR
-#define SUBDOMAIN_CONF SUBDOMAIN_CONFDIR "/subdomain.conf"
-#else	/* !defined SUBDOMAIN_CONFDIR */
-#define SUBDOMAIN_CONF "/etc/subdomain.conf"
-#endif	/* SUBDOMAIN_CONFDIR */
-
 static char *path[MAX_PATH] = { NULL };
 static int npath = 0;
 
@@ -71,12 +64,11 @@ static int fgetline(FILE * f, char *buffer, size_t len);
 static int stripcomment(char *s);
 static char *stripblanks(char *s);
 
-/* default base directory is /etc/subdomain.d, it can be overriden
+/* default base directory is /etc/apparmor.d, it can be overriden
    with the -b option. */
 
 const char *basedir;
 static const char *default_basedir = "/etc/apparmor.d";
-static const char *old_basedir = "/etc/subdomain.d";
 
 
 /* set up basedir so that it can be overridden/used later. */
@@ -94,12 +86,6 @@ void init_base_dir(void)
 		basedir = default_basedir;
 		return;
 	}
-
-	rc = stat(old_basedir, &sbuf);
-	if (rc == 0 && S_ISDIR(sbuf.st_mode)) {
-		basedir = old_basedir;
-		return;
-	}
 }
 
 /* Set the base dir.  Used to change default path for relative includes */
@@ -164,53 +150,9 @@ int add_search_dir(const char *dir)
 	return 1;
 }
 
-/* Parse Subdomain.conf and put the default dirs in place.  
-
-   subdomain.conf is a shell sourcable file
-   we only parse entries starting with
-   SUBDOMAIN_PATH=
-
-   if there are multiple entries with SUBDOMAIN_PATH=
-   each will get added.
-
-   SUBDOMAIN_PATH=/etc/subdomain.d:/etc/subdomain.d/include
-   is the same as
-   SUBDOMAIN_PATH=/etc/subdomain.d
-   SUBDOMAIN_PATH=/etc/subdomain.d/include */
 void parse_default_paths(void)
 {
-	autofclose FILE *f;
-	char buf[1024];
-	char *t, *s;
-	int saved_npath = npath;
-
-	f = fopen(SUBDOMAIN_CONF, "r");
-	if (f == NULL)
-		goto out;
-
-	memset(buf, 0, sizeof(buf));
-
-	while (fgetline(f, buf, 1024)) {
-		if (stripcomment(buf) && (t = strstr(buf, "SUBDOMAIN_PATH="))) {
-			t += 15;
-			/* handle : separating path elements */
-			do {
-				s = strchr(t, ':');
-				if (s)
-					*s = 0;
-				if (!add_search_dir(stripblanks(t)))
-					break;
-				if (s)
-					t = s + 1;
-			} while (s != NULL);
-		}
-	}
-
-	/* if subdomain.conf doesn't set a base search dir set it to this */
-out:
-	if (npath - saved_npath == 0) {
-		add_search_dir(basedir);
-	}
+	add_search_dir(basedir);
 }
 
 FILE *search_path(char *filename, char **fullpath)
diff --git a/parser/rc.apparmor.functions b/parser/rc.apparmor.functions
index ea3fb43..49026a8 100644
--- a/parser/rc.apparmor.functions
+++ b/parser/rc.apparmor.functions
@@ -33,25 +33,12 @@
 
 CONFIG_DIR=/etc/apparmor
 MODULE=apparmor
-OLD_MODULE=subdomain
 if [ -f "${CONFIG_DIR}/${MODULE}.conf" ] ; then
 	APPARMOR_CONF="${CONFIG_DIR}/${MODULE}.conf"
-elif [ -f "${CONFIG_DIR}/${OLD_MODULE}.conf" ] ; then
-	APPARMOR_CONF="${CONFIG_DIR}/${OLD_MODULE}.conf"
-elif [ -f "/etc/immunix/subdomain.conf" ] ; then
-	aa_log_warning_msg "/etc/immunix/subdomain.conf is deprecated, use ${CONFIG_DIR}/subdomain.conf instead"
-	APPARMOR_CONF="/etc/immunix/subdomain.conf"
-elif [ -f "/etc/subdomain.conf" ] ; then
-	aa_log_warning_msg "/etc/subdomain.conf is deprecated, use ${CONFIG_DIR}/subdomain.conf instead"
-	APPARMOR_CONF="/etc/subdomain.conf"
 else
 	aa_log_warning_msg "Unable to find config file in ${CONFIG_DIR}, installation problem?"
 fi
 
-# Read configuration options from /etc/subdomain.conf, default is to
-# warn if subdomain won't load.
-SUBDOMAIN_MODULE_PANIC="warn"
-SUBDOMAIN_ENABLE_OWLSM="no"
 APPARMOR_ENABLE_AAEVENTD="no"
 
 if [ -f "${APPARMOR_CONF}" ] ; then
@@ -61,28 +48,18 @@ fi
 
 PARSER=/sbin/apparmor_parser
 
-# SUBDOMAIN_DIR and APPARMOR_DIR might be defined in subdomain.conf|apparmor.conf
+# APPARMOR_DIR might be defined in apparmor.conf
 if [ -d "${APPARMOR_DIR}" ] ; then
 	PROFILE_DIR=${APPARMOR_DIR}
-elif [ -d "${SUBDOMAIN_DIR}" ] ; then
-	PROFILE_DIR=${SUBDOMAIN_DIR}
 elif [ -d /etc/apparmor.d ] ; then
 	PROFILE_DIR=/etc/apparmor.d
-elif [ -d /etc/subdomain.d ] ; then
-	PROFILE_DIR=/etc/subdomain.d
 fi
 ABSTRACTIONS="-I${PROFILE_DIR}"
 AA_EV_BIN=/usr/sbin/aa-eventd
 AA_EV_PIDFILE=/var/run/aa-eventd.pid
 AA_STATUS=/usr/sbin/aa-status
-SD_EV_BIN=/usr/sbin/sd-event-dispatch.pl
-SD_EV_PIDFILE=/var/run/sd-event-dispatch.init.pid
-SD_STATUS=/usr/sbin/subdomain_status
 SECURITYFS=/sys/kernel/security
 
-SUBDOMAINFS_MOUNTPOINT=$(grep subdomainfs /etc/fstab  | \
-	sed -e 's|^[[:space:]]*[^[:space:]]\+[[:space:]]\+\(/[^[:space:]]*\)[[:space:]]\+subdomainfs.*$|\1|' 2> /dev/null)
-
 # keep exit status from parser during profile load.  0 is good, 1 is bad
 STATUS=0
 
@@ -96,9 +73,6 @@ is_apparmor_present() {
 		shift
 	done
 
-	# check for subdomainfs version of module
-	grep -qE "^($modules)[[:space:]]" /proc/modules
-
 	[ $? -ne 0 -a -d /sys/module/apparmor ]
 
 	return $?
@@ -251,44 +225,17 @@ failstop_system() {
 	return -1
 }
 
-module_panic() {
-	# the module failed to load, determine what action should be taken
-
-	case "$SUBDOMAIN_MODULE_PANIC" in
-		"warn"|"WARN")
-			return 1 ;;
-		"panic"|"PANIC") failstop_system
-			rc=$?
-			return $rc ;;
-		*) aa_log_failure_msg "- invalid AppArmor module fail option"
-			return -1 ;;
-	esac
-}
-
 is_apparmor_loaded() {
 	if ! is_securityfs_mounted ; then
 		mount_securityfs
 	fi
 
-	mount_subdomainfs
-
 	if [ -f "${SECURITYFS}/${MODULE}/profiles" ]; then
 		SFS_MOUNTPOINT="${SECURITYFS}/${MODULE}"
 		return 0
 	fi
 
-	if [ -f "${SECURITYFS}/${OLD_MODULE}/profiles" ]; then
-		SFS_MOUNTPOINT="${SECURITYFS}/${OLD_MODULE}"
-		return 0
-	fi
-
-	if [ -f "${SUBDOMAINFS_MOUNTPOINT}/profiles" ]; then
-		SFS_MOUNTPOINT=${SUBDOMAINFS_MOUNTPOINT}
-		return 0
-	fi
-
-	# check for subdomainfs version of module
-	is_apparmor_present apparmor subdomain
+	is_apparmor_present apparmor
 
 	return $?
 }
@@ -307,26 +254,6 @@ mount_securityfs() {
 	return 0
 }
 
-
-mount_subdomainfs() {
-	# for backwords compatibility
-	if grep -q subdomainfs /proc/filesystems && \
-	   ! grep -q subdomainfs /proc/mounts && \
-	   [ -n "${SUBDOMAINFS_MOUNTPOINT}" ]; then
-		aa_action "Mounting subdomainfs on ${SUBDOMAINFS_MOUNTPOINT}" \
-				mount "${SUBDOMAINFS_MOUNTPOINT}"
-		return $?
-	fi
-	return 0
-}
-
-unmount_subdomainfs() {
-	SUBDOMAINFS=$(grep subdomainfs /proc/mounts  | cut -d" " -f2 2> /dev/null)
-	if [ -n "${SUBDOMAINFS}" ]; then
-		aa_action "Unmounting subdomainfs" umount ${SUBDOMAINFS}
-	fi
-}
-
 apparmor_start() {
 	aa_log_daemon_msg "Starting AppArmor"
 	if ! is_apparmor_present ; then
@@ -360,7 +287,7 @@ apparmor_start() {
 
 remove_profiles() {
 
-	# removing profiles as we directly read from subdomainfs
+	# removing profiles as we directly read from apparmorfs
 	# doesn't work, since we are removing entries which screws up
 	# our position.  Lets hope there are never enough profiles to
 	# overflow the variable
@@ -410,11 +337,8 @@ apparmor_kill() {
 		return 1
 	fi
 
-	unmount_subdomainfs
 	if is_apparmor_present apparmor ; then
 		MODULE=apparmor
-	elif is_apparmor_present subdomain ; then
-		MODULE=subdomain
 	else
 		aa_log_failure_msg "AppArmor is builtin"
 		return 1
@@ -461,27 +385,11 @@ apparmor_try_restart() {
 	return $?
 }
 
-configure_owlsm () {
-	if [ "${SUBDOMAIN_ENABLE_OWLSM}" = "yes" -a -f ${SFS_MOUNTPOINT}/control/owlsm ] ; then
-		# Sigh, the "sh -c" is necessary for the SuSE aa_action
-		# and it can't be abstracted out as a seperate function, as
-		# that breaks under RedHat's action, which needs a
-		# binary to invoke.
-		aa_action "Enabling OWLSM extension" sh -c "echo -n \"1\" > \"${SFS_MOUNTPOINT}/control/owlsm\""
-	elif [ -f "${SFS_MOUNTPOINT}/control/owlsm" ] ; then
-		aa_action "Disabling OWLSM extension" sh -c "echo -n \"0\" > \"${SFS_MOUNTPOINT}/control/owlsm\""
-	fi
-}
-
 apparmor_status () {
 	if test -x ${AA_STATUS} ; then
 		${AA_STATUS} --verbose
 		return $?
 	fi
-	if test -x ${SD_STATUS} ; then
-		${SD_STATUS} --verbose
-		return $?
-	fi
 	if ! is_apparmor_loaded ; then
 		echo "AppArmor is not loaded."
 		rc=1
diff --git a/parser/subdomain.conf b/parser/subdomain.conf
deleted file mode 100644
index 20e7cab..0000000
--- a/parser/subdomain.conf
+++ /dev/null
@@ -1,53 +0,0 @@
-# subdomain.conf is a shared AppArmor configuration file that is sh sourcable.
-
-################## AppArmor init.d configuration ################
-
-# Move this to /etc/sysconfig/apparmor eventually
-## Path: 	System/AppArmor
-## Description: Enable the OWLSM extension to AppArmor
-## Type: 	yesno
-## Default:	no
-#
-# Enable OWLSM extension to AppArmor?
-# OWLSM is an extension to AppArmor that prevents processes from
-# following symlinks they don't own and creating hardlinks to files they
-# don't own, in an attempt to prevent /tmp race attacks. However, OWLSM
-# can break some applications, so is disabled by default.
-SUBDOMAIN_ENABLE_OWLSM="no"
-
-## Path: 	System/AppArmor
-## Description: Enable the AppArmor event daemon for reporting
-## Type: 	yesno
-## Default:	no
-#
-# Enable the AppArmor event daemon for reporting?
-APPARMOR_ENABLE_AAEVENTD="no"
-
-#SUBDOMAIN_MODULE_PANIC=XXX
-#This option controls how subdomain behaves when the init script attempts
-#to load the AppArmor module and fails.  There are 4 options
-#warn  - log a failure message. (default behavior)
-#build - attempt to build the AppArmor module is the module can't be loaded.
-#        If successful
-#           the module will be built for the running kernel and loaded.
-#        If the build fails
-#           a failure message is logged
-#panic - If the AppArmor module fails to load
-#           a failure message will be logged
-#           and the machine will drop to runlevel 1 (single user)
-#build-panic - If the AppArmor module fails to load
-#                 attempt to build the module
-#                 If building the module fails
-#                    panic (drop to runlevel 1)  
-
-#SUBDOMAIN_MODULE_PANIC=warn
-
-################## subdomain_parser configuration ################
-
-#SUBDOMAIN_PATH=XXXX
-#This option specifies the include path that the subdomain_parser will
-#use by default.  If no entry is specified /etc/subdomain.d is used by
-#default.
-
-#SUBDOMAIN_PATH=/etc/subdomain.d
-
diff --git a/parser/subdomain.conf.pod b/parser/subdomain.conf.pod
deleted file mode 100644
index b38f748..0000000
--- a/parser/subdomain.conf.pod
+++ /dev/null
@@ -1,104 +0,0 @@
-# ----------------------------------------------------------------------
-#    Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-#                  2008, 2009
-#    NOVELL (All rights reserved)
-#
-#    Copyright (c) 2010 - 2012
-#    Canonical Ltd. (All rights reserved)
-#
-#    This program is free software; you can redistribute it and/or
-#    modify it under the terms of version 2 of the GNU General Public
-#    License published by the Free Software Foundation.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with this program; if not, contact Novell, Inc.
-# ----------------------------------------------------------------------
-
-
-=pod
-
-=head1 NAME
-
-/etc/apparmor/subdomain.conf - configuration file for fine-tuning the
-behavior of the AppArmor security tool.
-
-=head1 DESCRIPTION
-
-The AppArmor security tool can be configured to have
-certain default behaviors based on configuration options set
-in subdomain.conf. There are two variables that can be set in
-subdomain.conf: B<SUBDOMAIN_PATH>, and B<SUBDOMAIN_MODULE_PANIC>.
-
-=begin comment
-
-FIXME keep quiet about OWLSM support for now.
-
-=head2 SUBDOMAIN_ENABLE_OWLSM
-
-This veriable is a yes/no toggle and is by default set to I<no>.
-
-This variable determines whether the AppArmor initscript will enable
-or disable the OWLsm security extension to AppArmor when the AppArmor
-security tool is started. When enabled the OWLsm feature prevents programs
-from following symlinks in temporary directories that are not owned by
-the program's UID, and prevents processes from creating hardlinks to
-files not owned by their UID.
-
-=end comment
-
-=head2 SUBDOMAIN_PATH
-
-This variable accepts a string (path), and is by default set to
-'/etc/apparmor.d/' This variable defines where the AppArmor security
-tool looks for its policy definitions (a.k.a. AppArmor profiles).
-
-=head2 SUBDOMAIN_MODULE_PANIC
-
-This variable accepts a string that is one of four values: I<warn>,
-I<build>, I<panic>, or I<build-panic>, and is set by default to I<warn>. 
-
-This setting controls the behavior of the AppArmor initscript if it
-cannot successfully load the AppArmor kernel module on startup. The four
-possible settings are:
-
-=over 4
-
-=item I<warn> 
-
-Log a failure message (the default behavior).
-
-=item I<build> 
-
-Attempt to build the AppArmor module against the currently running
-kernel. If the compilation is successful, the module will be loaded and
-AppArmor started; if the compilation fails, a failure message is logged.
-
-=item I<panic> 
-
-Log a failure message and drop to runlevel 1 (single user).
-
-=item I<build-panic>
-
-Attempt to build the module against the running kernel (like I<build>)
-and if the compilation fails, drop to runlevel 1 (single user).
-
-=back
-
-=head1 BUGS
-
-Setting the initscript to recompile the module will fail on SUSE, as the
-module source is no longer installed by default. However, the module has
-been included with the SUSE kernel, so no rebuilding should be necessary.
-
-If you find any additional bugs, please report them at
-L<https://bugs.launchpad.net/apparmor/+filebug>.
-
-=head1 SEE ALSO
-
-apparmor(7), apparmor_parser(8), and
-L<https://wiki.apparmor.net>.
diff --git a/tests/stress/apparmor/Makefile b/tests/stress/apparmor/Makefile
new file mode 100644
index 0000000..59a0053
--- /dev/null
+++ b/tests/stress/apparmor/Makefile
@@ -0,0 +1,24 @@
+TARGETS=change_hat child open
+PROFILES=change_hat.profile  child.profile  open.profile  sh.profile
+LIB:=apparmor
+LIBS=-l$(LIB)
+
+all: targets profiles
+
+targets: $(TARGETS)
+
+profiles:
+	for i in $(PROFILES) ;\
+	do \
+		sed "s~BASE~$$PWD~" $$i.pre | sed "s/AA/${LIB}/" > $$i ;\
+	done
+
+change_hat: change_hat.c
+	cc -Wall -o $@ $< $(LIBS)
+child: child.c
+	cc -Wall -o $@ $< $(LIBS)
+open: open.c
+	cc -Wall -o $@ $< $(LIBS)
+
+clean:
+	rm -f $(TARGETS) $(PROFILES)
diff --git a/tests/stress/apparmor/change_hat.c b/tests/stress/apparmor/change_hat.c
new file mode 100644
index 0000000..637a55b
--- /dev/null
+++ b/tests/stress/apparmor/change_hat.c
@@ -0,0 +1,51 @@
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <linux/unistd.h>
+
+#include "sys/apparmor.h"
+
+#define SD_ID_MAGIC 0xdeadbeef
+
+int main(int argc, char *argv[])
+{
+	int fd, error;
+	char *hat_name;
+	int hat_magic;
+	char *o_file = "/bin/ls";
+
+	while (1) {
+	hat_name = "/subprofile/foo";
+	hat_magic = SD_ID_MAGIC + 1;
+	if (argc > 1)
+		hat_name = argv[1];
+
+	printf("before entering change_hat\n");
+	error = change_hat(hat_name, hat_magic);
+	printf("change_hat(%s, 0x%x): %s\n", hat_name, hat_magic,
+							strerror(errno));
+
+	errno = 0;
+	fd = open(o_file, O_RDONLY);
+	printf("open(%s): %s\n", o_file, strerror(errno));
+	if (fd != -1)
+		close(fd);
+
+	hat_name = NULL;
+	printf("before leaving change_hat\n");
+	errno = 0;
+	error = change_hat(hat_name, hat_magic);
+	printf("change_hat(%s, 0x%x): %s\n", "NULL", hat_magic,
+							strerror(errno));
+
+	errno = 0;
+	fd = open(o_file, O_RDONLY);
+	printf("open(%s): %s\n", o_file, strerror(errno));
+	if (fd != -1)
+		close(fd);
+	}
+}
diff --git a/tests/stress/apparmor/change_hat.profile.pre b/tests/stress/apparmor/change_hat.profile.pre
new file mode 100644
index 0000000..1591e97
--- /dev/null
+++ b/tests/stress/apparmor/change_hat.profile.pre
@@ -0,0 +1,24 @@
+BASE/change_hat {
+/lib/lib*.so				rm,
+/usr/lib/lib*.so			rm,
+/lib/lib*.so.*				rm,
+/lib/i[356]86/lib*.so			rm,
+/lib/tls/lib*.*.so			rm,
+/lib/ld-*.so				rix,
+/etc/ld.so.*				r,
+BASE/change_hat 			r,
+/bin/ls					rix,
+/dev/pts/*				rw,
+/dev/tty*				rw,
+/dev/null				rw,
+/dev/urandom                            r,
+
+    ^/subprofile/foo {
+	/bin/bash			rix,
+	/tmp/foobar			r,
+	/bin/ls				rix,
+	/dev/pts/*			rw,
+	/dev/tty*			rw,
+	/dev/null			rw,
+    }
+}
diff --git a/tests/stress/apparmor/child.c b/tests/stress/apparmor/child.c
new file mode 100644
index 0000000..40fba28
--- /dev/null
+++ b/tests/stress/apparmor/child.c
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+
+static int zombies;
+
+void sigchld(int num)
+{
+	zombies++;
+}
+
+int main()
+{
+	pid_t pid;
+	int i;
+
+	signal(SIGCHLD, sigchld);
+again:
+	for (i = 0; i < 500; i++) {
+		pid = fork();
+		if (pid > 0)
+			continue;
+		else if (pid == 0)
+			exit(0);
+		else
+			printf("fork: %s\n", strerror(errno));
+	}
+	while (waitpid(0, NULL, WNOHANG) > 0);
+	goto again;
+}
diff --git a/tests/stress/apparmor/child.profile.pre b/tests/stress/apparmor/child.profile.pre
new file mode 100644
index 0000000..5c2d841
--- /dev/null
+++ b/tests/stress/apparmor/child.profile.pre
@@ -0,0 +1,12 @@
+BASE/child {
+/lib/libc-*.so				rm,
+/lib/libc-*.so.*			rm,
+/lib/ld-*.so				rix,
+/lib/ld-*.so.*				rix,
+/{usr/,}lib/libAA*			rm,
+/etc/ld.so.*				r,
+BASE/child				r,
+/bin/ls					r,
+/dev/pts/*				rw,
+/dev/tty*				rw,
+}
diff --git a/tests/stress/apparmor/kill.sh b/tests/stress/apparmor/kill.sh
new file mode 100755
index 0000000..4c4d3d1
--- /dev/null
+++ b/tests/stress/apparmor/kill.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. ./uservars.inc
+
+if [ `whoami` != root ]
+then
+	echo "$0: must be root" >&2
+	exit 1
+fi
+
+$subdomain_parser -R change_hat.profile 2>&1 > /dev/null
+$subdomain_parser change_hat.profile
+
+./change_hat > /dev/null 2>&1 &
+
+while :
+do
+	$subdomain_parser -r change_hat.profile > /dev/null 2>&1 &
+done &
diff --git a/tests/stress/apparmor/open.c b/tests/stress/apparmor/open.c
new file mode 100644
index 0000000..099c14a
--- /dev/null
+++ b/tests/stress/apparmor/open.c
@@ -0,0 +1,34 @@
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <linux/unistd.h>
+
+#define MAX_LOOP	1000000
+int main(int argc, char *argv[])
+{
+	int fd, i, success, fail;
+	char *o_file = "/bin/ls";
+
+	if (argc > 1)
+		o_file = argv[1];
+
+	for (i=0, success=0, fail=0; i<MAX_LOOP; i++) {
+//	for (i=0, success=0, fail=0; !i; i++) {
+		fd = open(o_file, O_RDONLY);
+		if (fd != -1) {
+			success++;
+			close(fd);
+		} else {
+			printf("open: %s\n", strerror(errno));
+			fail++;
+		}
+	}
+	printf("Iterations: %d\tSuccess: %d\t Fail: %d\n",
+			MAX_LOOP, success, fail);
+
+	return 0;
+}
diff --git a/tests/stress/apparmor/open.profile.pre b/tests/stress/apparmor/open.profile.pre
new file mode 100644
index 0000000..182e131
--- /dev/null
+++ b/tests/stress/apparmor/open.profile.pre
@@ -0,0 +1,15 @@
+BASE/open {
+/lib/libc-*.so				rm,
+/lib/libc-*.so.*			rm,
+/lib/ld-*.so				rix,
+/lib/ld-*.so.*				rix,
+/{usr/,}lib/libAA*			rm,
+/etc/ld.so.*				r,
+BASE/open				r,
+/bin/ls					r,
+/dev/pts/*				rw,
+/dev/tty*				rw,
+/tmp/foobar				rw,
+/tmp/baz				rw,
+/tmp/{a,b,c,d,e,f,g}			rw,
+}
diff --git a/tests/stress/apparmor/s-2.4.20.sh b/tests/stress/apparmor/s-2.4.20.sh
new file mode 100755
index 0000000..c7ef30a
--- /dev/null
+++ b/tests/stress/apparmor/s-2.4.20.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+subdomain_parser=./subdomain_parser
+
+cat change_hat.profile child.profile open.profile | ${subdomain_parser}
+
+#./open & ./open /tmp/foobar &
+
+#./child & ./child &
+
+#./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
+
+while :
+do
+	cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+	cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+	cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+done &
diff --git a/tests/stress/apparmor/s.sh b/tests/stress/apparmor/s.sh
new file mode 100755
index 0000000..c7ef30a
--- /dev/null
+++ b/tests/stress/apparmor/s.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+subdomain_parser=./subdomain_parser
+
+cat change_hat.profile child.profile open.profile | ${subdomain_parser}
+
+#./open & ./open /tmp/foobar &
+
+#./child & ./child &
+
+#./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
+
+while :
+do
+	cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+	cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+	cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+done &
diff --git a/tests/stress/apparmor/sh.profile.pre b/tests/stress/apparmor/sh.profile.pre
new file mode 100644
index 0000000..378dbb0
--- /dev/null
+++ b/tests/stress/apparmor/sh.profile.pre
@@ -0,0 +1,24 @@
+BASE/sh {
+/bin/*					rix,
+/dev/tty				rw,
+/dev/pts/*				rw,
+/etc/fstab				r,
+/etc/inputrc				r,
+/etc/ld.so.*				r,
+/etc/mtab				r,
+/etc/nsswitch.conf			r,
+/etc/passwd				r,
+/etc/termcap				r,
+BASE/sh					r,
+BASE/*					rix,
+/lib/libc-*.so				rm,
+/lib/libc-*.so.*			rm,
+/lib/ld-*.so				rix,
+/lib/ld-*.so.*				rix,
+/lib/**					rm,
+/{usr/,}/lib/libAA*			rm,
+/proc/meminfo				r,
+/usr/lib/locale/**			r,
+/usr/share/locale/**			r,
+/**.bash_history			r,
+}
diff --git a/tests/stress/apparmor/stress.sh b/tests/stress/apparmor/stress.sh
new file mode 100755
index 0000000..d8b01e5
--- /dev/null
+++ b/tests/stress/apparmor/stress.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. ./uservars.inc
+
+${subdomain_parser} change_hat.profile child.profile open.profile
+
+rm -f /tmp/foobar && touch /tmp/foobar
+
+./open & ./open /tmp/foobar &
+
+./child & ./child &
+
+./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
+
+while :
+do
+	${subdomain_parser} -r change_hat.profile > /dev/null 2>&1 &
+	${subdomain_parser} -r child.profile > /dev/null 2>&1 &
+	${subdomain_parser} -r open.profile > /dev/null 2>&1 &
+done &
diff --git a/tests/stress/apparmor/stress.sh-2.4.20 b/tests/stress/apparmor/stress.sh-2.4.20
new file mode 100755
index 0000000..ef326d9
--- /dev/null
+++ b/tests/stress/apparmor/stress.sh-2.4.20
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+subdomain_parser=./subdomain_parser
+
+cat change_hat.profile child.profile open.profile | ${subdomain_parser}
+
+#./open & ./open /tmp/foobar &
+
+#./child & ./child &
+
+./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
+
+while :
+do
+	cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+	cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+	cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
+done &
diff --git a/tests/stress/apparmor/uservars.inc b/tests/stress/apparmor/uservars.inc
new file mode 100644
index 0000000..c0b27a7
--- /dev/null
+++ b/tests/stress/apparmor/uservars.inc
@@ -0,0 +1,42 @@
+if [ -e /sbin/subdomain_parser ] ; then
+	subdomain_parser=/sbin/subdomain_parser
+else
+	subdomain_parser=/sbin/apparmor_parser
+fi
+
+if [ -n "`grep subdomainfs /proc/filesystems`" ]
+then
+	subdomainfs=/subdomain
+elif [ -n "`grep securityfs /proc/filesystems`" ]
+then
+	if [ -e /sys/kernel/security/subdomain ] ; then
+		subdomainfs=/sys/kernel/security/subdomain
+	else
+		subdomainfs=/sys/kernel/security/apparmor
+	fi
+else
+	echo "$0: Unable to find subdomainfs" >&2
+	exit 1
+fi
+
+if [ ! -x $subdomain_parser ]
+then
+	echo "$0: $subdomain_parser not executable" >&2
+	exit 1
+fi
+
+if [ -z "`grep '^subdomain ' /proc/modules`" ]
+then
+	if [ -z "`grep '^apparmor ' /proc/modules`" ] ; then
+		if [ ! -d "/sys/module/apparmor" ] ; then
+			echo "$0: apparmor module not loaded" >&2
+			exit 1
+		fi
+	fi
+fi
+
+if [ ! -w $subdomainfs/.load ]
+then
+	echo "$0: $subdomainfs/.load not present" >&2
+	exit 1
+fi
diff --git a/tests/stress/subdomain/Makefile b/tests/stress/subdomain/Makefile
deleted file mode 100644
index 4cbc83f..0000000
--- a/tests/stress/subdomain/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TARGETS=change_hat child open
-PROFILES=change_hat.profile  child.profile  open.profile  sh.profile
-LIB:=apparmor
-LIBS=-l$(LIB)
-
-all: targets profiles
-
-targets: $(TARGETS)
-
-profiles:
-	for i in $(PROFILES) ;\
-	do \
-		sed "s~BASE~$$PWD~" $$i.pre | sed "s/AA/${LIB}/" > $$i ;\
-	done	
-
-change_hat: change_hat.c
-	cc -Wall -o $@ $< $(LIBS)
-child: child.c
-	cc -Wall -o $@ $< $(LIBS)
-open: open.c
-	cc -Wall -o $@ $< $(LIBS)
-
-clean:
-	rm -f $(TARGETS) $(PROFILES)
diff --git a/tests/stress/subdomain/change_hat.c b/tests/stress/subdomain/change_hat.c
deleted file mode 100644
index bef0024..0000000
--- a/tests/stress/subdomain/change_hat.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <linux/unistd.h>
-
-#include "sys/apparmor.h"
-
-#define SD_ID_MAGIC 0xdeadbeef
-
-int main(int argc, char *argv[])
-{
-	int fd, error;
-	char *hat_name;
-	int hat_magic;
-	char *o_file = "/bin/ls";
-
-	while (1) {
-	hat_name = "/subprofile/foo";
-	hat_magic = SD_ID_MAGIC + 1;
-	if (argc > 1)
-		hat_name = argv[1];
-
-	printf("before entering change_hat\n");
-	error = change_hat(hat_name, hat_magic);
-	printf("change_hat(%s, 0x%x): %s\n", hat_name, hat_magic,
-							strerror(errno));
-
-	errno = 0;
-	fd = open(o_file, O_RDONLY);
-	printf("open(%s): %s\n", o_file, strerror(errno));
-	if (fd != -1)
-		close(fd);
-	
-	hat_name = NULL;
-	printf("before leaving change_hat\n");
-	errno = 0;
-	error = change_hat(hat_name, hat_magic);
-	printf("change_hat(%s, 0x%x): %s\n", "NULL", hat_magic,
-							strerror(errno));
-
-	errno = 0;
-	fd = open(o_file, O_RDONLY);
-	printf("open(%s): %s\n", o_file, strerror(errno));
-	if (fd != -1)
-		close(fd);
-	}
-}
diff --git a/tests/stress/subdomain/change_hat.profile.pre b/tests/stress/subdomain/change_hat.profile.pre
deleted file mode 100644
index 1591e97..0000000
--- a/tests/stress/subdomain/change_hat.profile.pre
+++ /dev/null
@@ -1,24 +0,0 @@
-BASE/change_hat {
-/lib/lib*.so				rm,
-/usr/lib/lib*.so			rm,
-/lib/lib*.so.*				rm,
-/lib/i[356]86/lib*.so			rm,
-/lib/tls/lib*.*.so			rm,
-/lib/ld-*.so				rix,
-/etc/ld.so.*				r,
-BASE/change_hat 			r,
-/bin/ls					rix,
-/dev/pts/*				rw,
-/dev/tty*				rw,
-/dev/null				rw,
-/dev/urandom                            r,
-
-    ^/subprofile/foo {
-	/bin/bash			rix,
-	/tmp/foobar			r,
-	/bin/ls				rix,
-	/dev/pts/*			rw,
-	/dev/tty*			rw,
-	/dev/null			rw,
-    }
-}
diff --git a/tests/stress/subdomain/child.c b/tests/stress/subdomain/child.c
deleted file mode 100644
index 2f00e5b..0000000
--- a/tests/stress/subdomain/child.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-
-static int zombies;
-
-void sigchld(int num)
-{
-	zombies++;
-}
-
-int main()
-{
-	pid_t pid;
-	int i;
-	
-	signal(SIGCHLD, sigchld);
-again:
-	for (i = 0; i < 500; i++) {
-		pid = fork();
-		if (pid > 0) 
-			continue;
-		else if (pid == 0)
-			exit(0);
-		else
-			printf("fork: %s\n", strerror(errno));
-	}
-	while (waitpid(0, NULL, WNOHANG) > 0);
-	goto again;
-}
diff --git a/tests/stress/subdomain/child.profile.pre b/tests/stress/subdomain/child.profile.pre
deleted file mode 100644
index 5c2d841..0000000
--- a/tests/stress/subdomain/child.profile.pre
+++ /dev/null
@@ -1,12 +0,0 @@
-BASE/child {
-/lib/libc-*.so				rm,
-/lib/libc-*.so.*			rm,
-/lib/ld-*.so				rix,
-/lib/ld-*.so.*				rix,
-/{usr/,}lib/libAA*			rm,
-/etc/ld.so.*				r,
-BASE/child				r,
-/bin/ls					r,
-/dev/pts/*				rw,
-/dev/tty*				rw,
-}
diff --git a/tests/stress/subdomain/kill.sh b/tests/stress/subdomain/kill.sh
deleted file mode 100755
index f41f930..0000000
--- a/tests/stress/subdomain/kill.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-. ./uservars.inc
-
-if [ `whoami` != root ]
-then
-	echo "$0: must be root" >&2
-	exit 1
-fi
-
-$subdomain_parser -R change_hat.profile 2>&1 > /dev/null
-$subdomain_parser change_hat.profile 
-
-./change_hat > /dev/null 2>&1 &
-
-while :
-do
-	$subdomain_parser -r change_hat.profile > /dev/null 2>&1 &
-done &
-
diff --git a/tests/stress/subdomain/open.c b/tests/stress/subdomain/open.c
deleted file mode 100644
index acf838b..0000000
--- a/tests/stress/subdomain/open.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <linux/unistd.h>
-
-#define MAX_LOOP	1000000
-int main(int argc, char *argv[])
-{
-	int fd, i, success, fail;
-	char *o_file = "/bin/ls";
-
-	if (argc > 1)
-		o_file = argv[1];
-
-	for (i=0, success=0, fail=0; i<MAX_LOOP; i++) {
-//	for (i=0, success=0, fail=0; !i; i++) {
-		fd = open(o_file, O_RDONLY);
-		if (fd != -1) {
-			success++;
-			close(fd);
-		} else {
-			printf("open: %s\n", strerror(errno));
-			fail++;
-		}
-	}
-	printf("Iterations: %d\tSuccess: %d\t Fail: %d\n",
-			MAX_LOOP, success, fail);
-	
-	return 0;
-}
diff --git a/tests/stress/subdomain/open.profile.pre b/tests/stress/subdomain/open.profile.pre
deleted file mode 100644
index 182e131..0000000
--- a/tests/stress/subdomain/open.profile.pre
+++ /dev/null
@@ -1,15 +0,0 @@
-BASE/open {
-/lib/libc-*.so				rm,
-/lib/libc-*.so.*			rm,
-/lib/ld-*.so				rix,
-/lib/ld-*.so.*				rix,
-/{usr/,}lib/libAA*			rm,
-/etc/ld.so.*				r,
-BASE/open				r,
-/bin/ls					r,
-/dev/pts/*				rw,
-/dev/tty*				rw,
-/tmp/foobar				rw,
-/tmp/baz				rw,
-/tmp/{a,b,c,d,e,f,g}			rw,
-}
diff --git a/tests/stress/subdomain/s-2.4.20.sh b/tests/stress/subdomain/s-2.4.20.sh
deleted file mode 100755
index 7bd049a..0000000
--- a/tests/stress/subdomain/s-2.4.20.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-subdomain_parser=./subdomain_parser
-
-cat change_hat.profile child.profile open.profile | ${subdomain_parser}
-
-#./open & ./open /tmp/foobar &
-
-#./child & ./child &
-
-#./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
-
-while :
-do
-	cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-	cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-	cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-done &
-
diff --git a/tests/stress/subdomain/s.sh b/tests/stress/subdomain/s.sh
deleted file mode 100755
index 7bd049a..0000000
--- a/tests/stress/subdomain/s.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-subdomain_parser=./subdomain_parser
-
-cat change_hat.profile child.profile open.profile | ${subdomain_parser}
-
-#./open & ./open /tmp/foobar &
-
-#./child & ./child &
-
-#./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
-
-while :
-do
-	cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-	cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-	cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-done &
-
diff --git a/tests/stress/subdomain/sh.profile.pre b/tests/stress/subdomain/sh.profile.pre
deleted file mode 100644
index 378dbb0..0000000
--- a/tests/stress/subdomain/sh.profile.pre
+++ /dev/null
@@ -1,24 +0,0 @@
-BASE/sh {
-/bin/*					rix,
-/dev/tty				rw,
-/dev/pts/*				rw,
-/etc/fstab				r,
-/etc/inputrc				r,
-/etc/ld.so.*				r,
-/etc/mtab				r,
-/etc/nsswitch.conf			r,
-/etc/passwd				r,
-/etc/termcap				r,
-BASE/sh					r,
-BASE/*					rix,
-/lib/libc-*.so				rm,
-/lib/libc-*.so.*			rm,
-/lib/ld-*.so				rix,
-/lib/ld-*.so.*				rix,
-/lib/**					rm,
-/{usr/,}/lib/libAA*			rm,
-/proc/meminfo				r,
-/usr/lib/locale/**			r,
-/usr/share/locale/**			r,
-/**.bash_history			r,
-}
diff --git a/tests/stress/subdomain/stress.sh b/tests/stress/subdomain/stress.sh
deleted file mode 100755
index 9df71e0..0000000
--- a/tests/stress/subdomain/stress.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-. ./uservars.inc
-
-${subdomain_parser} change_hat.profile child.profile open.profile 
-
-rm -f /tmp/foobar && touch /tmp/foobar
-
-./open & ./open /tmp/foobar &
-
-./child & ./child &
-
-./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
-
-while :
-do
-	${subdomain_parser} -r change_hat.profile > /dev/null 2>&1 &
-	${subdomain_parser} -r child.profile > /dev/null 2>&1 &
-	${subdomain_parser} -r open.profile > /dev/null 2>&1 &
-done &
-
diff --git a/tests/stress/subdomain/stress.sh-2.4.20 b/tests/stress/subdomain/stress.sh-2.4.20
deleted file mode 100755
index 66bf731..0000000
--- a/tests/stress/subdomain/stress.sh-2.4.20
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-subdomain_parser=./subdomain_parser
-
-cat change_hat.profile child.profile open.profile | ${subdomain_parser}
-
-#./open & ./open /tmp/foobar &
-
-#./child & ./child &
-
-./change_hat > /dev/null 2>&1 & ./change_hat /tmp/foo > /dev/null 2>&1 &
-
-while :
-do
-	cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-	cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-	cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
-done &
-
diff --git a/tests/stress/subdomain/uservars.inc b/tests/stress/subdomain/uservars.inc
deleted file mode 100644
index c0b27a7..0000000
--- a/tests/stress/subdomain/uservars.inc
+++ /dev/null
@@ -1,42 +0,0 @@
-if [ -e /sbin/subdomain_parser ] ; then
-	subdomain_parser=/sbin/subdomain_parser
-else
-	subdomain_parser=/sbin/apparmor_parser
-fi
-
-if [ -n "`grep subdomainfs /proc/filesystems`" ]
-then
-	subdomainfs=/subdomain
-elif [ -n "`grep securityfs /proc/filesystems`" ]
-then
-	if [ -e /sys/kernel/security/subdomain ] ; then
-		subdomainfs=/sys/kernel/security/subdomain
-	else
-		subdomainfs=/sys/kernel/security/apparmor
-	fi
-else
-	echo "$0: Unable to find subdomainfs" >&2
-	exit 1
-fi
-
-if [ ! -x $subdomain_parser ]
-then
-	echo "$0: $subdomain_parser not executable" >&2
-	exit 1
-fi
-
-if [ -z "`grep '^subdomain ' /proc/modules`" ]
-then
-	if [ -z "`grep '^apparmor ' /proc/modules`" ] ; then
-		if [ ! -d "/sys/module/apparmor" ] ; then
-			echo "$0: apparmor module not loaded" >&2
-			exit 1
-		fi
-	fi
-fi
-
-if [ ! -w $subdomainfs/.load ]
-then
-	echo "$0: $subdomainfs/.load not present" >&2
-	exit 1
-fi
diff --git a/utils/apparmor/config.py b/utils/apparmor/config.py
index 64334c9..b8fcc0d 100644
--- a/utils/apparmor/config.py
+++ b/utils/apparmor/config.py
@@ -40,7 +40,7 @@ from apparmor.common import AppArmorException, open_file_read  # , warn, msg,
 
 # CFG = None
 # REPO_CFG = None
-# SHELL_FILES = ['easyprof.conf', 'notify.conf', 'parser.conf', 'subdomain.conf']
+# SHELL_FILES = ['easyprof.conf', 'notify.conf', 'parser.conf']
 class Config(object):
     def __init__(self, conf_type, conf_dir='/etc/apparmor'):
         self.CONF_DIR = conf_dir