mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-04 16:25:10 +00:00
Compare commits
2257 Commits
apparmor-2
...
v2.9.5
Author | SHA1 | Date | |
---|---|---|---|
|
da132a75fb | ||
|
3aea5913bf | ||
|
6080d9b619 | ||
|
d62aaf0e1a | ||
|
051f68a662 | ||
|
85881a877e | ||
|
05de7e693e | ||
|
9c36523ca0 | ||
|
8b3c98e044 | ||
|
ecab50f62a | ||
|
e6c890e336 | ||
|
cf9c996cdc | ||
|
69ba59f944 | ||
|
e1415d35db | ||
|
bb6818a8c1 | ||
|
c71c36de2c | ||
|
1e6897f458 | ||
|
259d925619 | ||
|
0bcdaa45c0 | ||
|
959d062f14 | ||
|
b33997a2fa | ||
|
5a671b05d3 | ||
|
b6ae84f27d | ||
|
b0df52a7e5 | ||
|
e0c253176a | ||
|
66280702af | ||
|
105dfb2a9d | ||
|
ccb9f412b4 | ||
|
e11226e9b2 | ||
|
5531d0adf1 | ||
|
524ff50160 | ||
|
0c687f1876 | ||
|
5b1135a833 | ||
|
019d2943d3 | ||
|
72637677cf | ||
|
7ecd62fc18 | ||
|
533fb92e24 | ||
|
9f2ead4c97 | ||
|
3882b2fd4a | ||
|
43cba9723a | ||
|
f6ad591a83 | ||
|
95b29546b4 | ||
|
23a489256c | ||
|
5ddf027996 | ||
|
674b42702e | ||
|
096c9b5dbc | ||
|
28b8be7bcb | ||
|
a15aee5490 | ||
|
36ad13a9cd | ||
|
cb9c8a41ea | ||
|
bbcb2727a6 | ||
|
c1d5c659c4 | ||
|
eddd542b46 | ||
|
d173892c26 | ||
|
414f5d6bce | ||
|
5f7014af8c | ||
|
95aefde14c | ||
|
a708c0dc57 | ||
|
e5ca1ace1d | ||
|
0dc638f5af | ||
|
1e0014b4a9 | ||
|
24aa2fcd11 | ||
|
561a0c0e3b | ||
|
ccea109dfc | ||
|
d96b06e56d | ||
|
5cb3fb29f6 | ||
|
21a61c8501 | ||
|
ddb73a9c1d | ||
|
cac4fd95c9 | ||
|
9620c54d01 | ||
|
44bf19257b | ||
|
84b045b89f | ||
|
ae9d172f7e | ||
|
580d49cbf0 | ||
|
7397ca0148 | ||
|
700162143d | ||
|
e594a321c8 | ||
|
fd38788524 | ||
|
aa11bcf5b3 | ||
|
52256d71ff | ||
|
4cb12733d3 | ||
|
6d55c72764 | ||
|
9950f71d0d | ||
|
5138e08372 | ||
|
25fab7f65c | ||
|
a404f32349 | ||
|
43b3a872f2 | ||
|
40e24e9b29 | ||
|
28a64d280c | ||
|
f20df05f2d | ||
|
f6d84c7af5 | ||
|
620d75600f | ||
|
1af6055748 | ||
|
88e5b24db2 | ||
|
3ebd441223 | ||
|
c7b6454fb0 | ||
|
a2a5dc7677 | ||
|
9c6fae0c02 | ||
|
c950c2a358 | ||
|
0a6c17de54 | ||
|
7b3a87ca8f | ||
|
260c0458a7 | ||
|
e024dd3ca9 | ||
|
17f4905b2e | ||
|
55d325d21b | ||
|
e23168bc60 | ||
|
778a92f9a3 | ||
|
a741ce1ee6 | ||
|
7fb34ede01 | ||
|
400da57849 | ||
|
cbe5cd44e7 | ||
|
eff8f2a211 | ||
|
144a16baf1 | ||
|
223322ef47 | ||
|
afe74c6faa | ||
|
6eb3d719c1 | ||
|
8011b9d9b6 | ||
|
301731ef34 | ||
|
b885d62a8a | ||
|
49e82df101 | ||
|
247d3fc22e | ||
|
480c83343b | ||
|
92b528b6db | ||
|
7876f356bf | ||
|
a70167db0e | ||
|
b7a8b6a689 | ||
|
641b25d88f | ||
|
27664acf9a | ||
|
dccd5a18cb | ||
|
6ae4a3c2f0 | ||
|
39ebf164de | ||
|
16e6d5ffd9 | ||
|
56ac5c3e5a | ||
|
bc8c770e3f | ||
|
da7719a717 | ||
|
56e7b70dd7 | ||
|
8e065f85c1 | ||
|
473bf9c164 | ||
|
7a82798f6b | ||
|
b5a7142652 | ||
|
967e50c2b3 | ||
|
c79588b1f6 | ||
|
e3e77409a3 | ||
|
76e975a0c5 | ||
|
5d9d26d1da | ||
|
946f586747 | ||
|
9ba11eb14a | ||
|
c2777bb25a | ||
|
431bce2a85 | ||
|
2c63bd020a | ||
|
6ae047d0c1 | ||
|
e20463df79 | ||
|
1d29db0cd7 | ||
|
3adde7290e | ||
|
ea72078cc4 | ||
|
43a8d7703d | ||
|
b4b6af96c9 | ||
|
b37bd8a1aa | ||
|
ead71a306a | ||
|
aa45be1c10 | ||
|
c1c5192532 | ||
|
2b9260f27a | ||
|
4063647a5f | ||
|
b4048cf3de | ||
|
8a475341e8 | ||
|
5ca6986b43 | ||
|
4b58cf3bc4 | ||
|
a373b4ee93 | ||
|
8d5569f20b | ||
|
5390777e45 | ||
|
79240e7ddd | ||
|
494daee246 | ||
|
194cbfa94c | ||
|
9452e1e2af | ||
|
1556f782e3 | ||
|
7d1ff607fe | ||
|
242ece320a | ||
|
dc1d8e5253 | ||
|
0ac23ee34a | ||
|
5bc15cda41 | ||
|
9ebb1913bd | ||
|
720f6624e6 | ||
|
387de4458f | ||
|
38a69f5ebc | ||
|
7d84c61b6c | ||
|
f836ebd42b | ||
|
52b6aeb04c | ||
|
475a9bc691 | ||
|
0f7bf53afb | ||
|
8dcd54e365 | ||
|
097eb4258f | ||
|
9bc15eb6b8 | ||
|
9d6f7f53cb | ||
|
c1ae887576 | ||
|
0ec6ce96d2 | ||
|
8c19eb5521 | ||
|
21a41deabe | ||
|
576e8fe33b | ||
|
3c928c04e1 | ||
|
37b872b155 | ||
|
5ab8b7a483 | ||
|
b813f4ba53 | ||
|
05ab11fec4 | ||
|
2d7ba0871f | ||
|
c98b26069a | ||
|
70dc81c4fd | ||
|
1b68baf7a3 | ||
|
6af7faa2b7 | ||
|
a1529a16bd | ||
|
321a2c1dcb | ||
|
735ef5d32b | ||
|
9428498d90 | ||
|
3ea1e541c7 | ||
|
29b0634f34 | ||
|
586222c94e | ||
|
232b51504c | ||
|
df099620dd | ||
|
22d647ecb1 | ||
|
07b0886796 | ||
|
9da31bf281 | ||
|
c5ff27a91b | ||
|
cf4afcb860 | ||
|
75a186fa9f | ||
|
05bef291d7 | ||
|
76f71f7d84 | ||
|
34f2c1c6ea | ||
|
67dae2f1cf | ||
|
bbaaa00249 | ||
|
9ed8789918 | ||
|
f45628d749 | ||
|
602decfbfc | ||
|
9aa1efd744 | ||
|
c51a68eaaf | ||
|
49b739b184 | ||
|
53d071adf5 | ||
|
70cda06789 | ||
|
e8ffc1c4e8 | ||
|
09c93be47c | ||
|
ac8d886645 | ||
|
ec1dda24d0 | ||
|
e7e9053598 | ||
|
4a0f65ef52 | ||
|
235328fdf8 | ||
|
f184609c7a | ||
|
0bf2e4f2e1 | ||
|
43ef5bfc70 | ||
|
7de5ebd18f | ||
|
7140bc27c3 | ||
|
d336d23e4d | ||
|
b3523fa920 | ||
|
4485d039dc | ||
|
149cdbc210 | ||
|
3e222f4b42 | ||
|
a79caef4c7 | ||
|
c791881633 | ||
|
7131f4a7f9 | ||
|
5295ba27d1 | ||
|
826bdc27fd | ||
|
dc50135bf6 | ||
|
f05649e518 | ||
|
c1ed3481e2 | ||
|
d82e9a3bec | ||
|
8346ef0f77 | ||
|
e1da7759dd | ||
|
94ebc95eb3 | ||
|
93ca0c2ff9 | ||
|
ad17e03b9d | ||
|
b1c28c7a23 | ||
|
ff5024d703 | ||
|
a98426820b | ||
|
c7626ec0eb | ||
|
b6dd8bbb81 | ||
|
8841086c01 | ||
|
a5d38d3dc9 | ||
|
21b6e70865 | ||
|
c7f5f55160 | ||
|
c308e6b24e | ||
|
806374b5f9 | ||
|
b57a229c56 | ||
|
3c7621b511 | ||
|
742adeeeb7 | ||
|
d27d5f6ba2 | ||
|
534148d9aa | ||
|
961ab6d6e0 | ||
|
fc1489863d | ||
|
a3aee5ce33 | ||
|
5d148c4ac6 | ||
|
23da51b079 | ||
|
be287de823 | ||
|
3364eadafc | ||
|
365d7036a5 | ||
|
422680714b | ||
|
1a9505a4ef | ||
|
4dd956461b | ||
|
4c30cb0e64 | ||
|
e188f04ce4 | ||
|
c38062f9b0 | ||
|
6b4cede82c | ||
|
a3d9de704c | ||
|
43f8bd778f | ||
|
3bf5e5b1d9 | ||
|
e26f139025 | ||
|
c35a4c412d | ||
|
06c3e0be75 | ||
|
d32e838be3 | ||
|
77fff04076 | ||
|
93eb36404d | ||
|
37fc93807a | ||
|
cc71c4210c | ||
|
c11ad5a800 | ||
|
542f6301e9 | ||
|
57a8d2c94c | ||
|
0fb504868e | ||
|
53517ee6dc | ||
|
8e2a7304cb | ||
|
9b4516e5ef | ||
|
49e30d2b90 | ||
|
71e54288bd | ||
|
7d3e375e25 | ||
|
5bafecdcaa | ||
|
d3524c3b7b | ||
|
12b3b63594 | ||
|
bedcb8c19c | ||
|
c504acb09e | ||
|
39b9985afb | ||
|
2758e2e2a1 | ||
|
1203923be3 | ||
|
aeebcbc243 | ||
|
31c4dc80a8 | ||
|
31a57bdfa9 | ||
|
4f4eded593 | ||
|
4f9183b23e | ||
|
3cb61c5dae | ||
|
c613d8a884 | ||
|
d11055aa0c | ||
|
7e84f4efe9 | ||
|
9a960a22a9 | ||
|
7ef2ae9b05 | ||
|
a4685bebf3 | ||
|
e08c45a65f | ||
|
d9cc289022 | ||
|
ada96afd84 | ||
|
29f1b9ec7f | ||
|
5fee046bfe | ||
|
dcb39f494c | ||
|
c2b8a72317 | ||
|
dc9474fe5a | ||
|
b34e81e606 | ||
|
8bc6a176f6 | ||
|
de9fcf1def | ||
|
1e437a3cd8 | ||
|
22af3ba507 | ||
|
e70f8f2f78 | ||
|
f1c86e2486 | ||
|
3b5bede154 | ||
|
44d2e9dacf | ||
|
52cd4835e2 | ||
|
6c5efcc5ea | ||
|
d00f01d0a8 | ||
|
ed1e2f3321 | ||
|
a44b6ce0a2 | ||
|
ce70c84f5c | ||
|
655b1534e7 | ||
|
95994ed64a | ||
|
bcb1cd750e | ||
|
7bf0c15ef8 | ||
|
85db44b586 | ||
|
84b6f98007 | ||
|
0262f44eb7 | ||
|
2b22c70e74 | ||
|
3368c9bc40 | ||
|
48a755d471 | ||
|
12b09ecd9e | ||
|
f31b44ff2d | ||
|
deaa692aa2 | ||
|
ce2abf01d5 | ||
|
1d867ae7ba | ||
|
3d902d57fc | ||
|
1842767cf3 | ||
|
4ae5e94aec | ||
|
9e93e6eaf5 | ||
|
8fb91c8e9d | ||
|
32e48a077d | ||
|
8b030e8877 | ||
|
297716d7e7 | ||
|
862bbb91eb | ||
|
9e385d86c9 | ||
|
5153701317 | ||
|
3fb09b20f2 | ||
|
eea15ce54b | ||
|
0daaaca946 | ||
|
bd681b8977 | ||
|
a154d14f5a | ||
|
ffa2f682ea | ||
|
0a01abf370 | ||
|
c32681a236 | ||
|
01b754b24d | ||
|
1519d46325 | ||
|
f22496cdac | ||
|
5def2f5693 | ||
|
08bc0441d4 | ||
|
c48d7dc71f | ||
|
f4b5811109 | ||
|
b7ff639d73 | ||
|
bc06f9f23a | ||
|
b6d33f2c16 | ||
|
68b3af026c | ||
|
503fcc1ad9 | ||
|
79fe4cbfb5 | ||
|
ff1ae04853 | ||
|
3ca8bbe6a7 | ||
|
b80559ab20 | ||
|
8418703863 | ||
|
b421cf7c1a | ||
|
e67f6561c4 | ||
|
cd539e0a21 | ||
|
b099168e6b | ||
|
298df16292 | ||
|
4d93599568 | ||
|
0371afa3fc | ||
|
2f85b775d3 | ||
|
f2e4a44191 | ||
|
47ec6707e5 | ||
|
d3bf71c20a | ||
|
c9bf33e17f | ||
|
40a829ef6b | ||
|
525451de43 | ||
|
251a8a9650 | ||
|
2f54f0d97a | ||
|
70119a81d8 | ||
|
0e7c2e4296 | ||
|
4e7dbabd61 | ||
|
63976b49d4 | ||
|
575d75eca8 | ||
|
e9fbdbf74b | ||
|
3035660716 | ||
|
4985e50a41 | ||
|
f63f08d79a | ||
|
e5528ff87b | ||
|
ce8fbf63fd | ||
|
6bc1b6ef43 | ||
|
bafb5ff2b4 | ||
|
79698cdbfe | ||
|
cdd23798bb | ||
|
2259857281 | ||
|
c2f7e5ff80 | ||
|
5bd93faf73 | ||
|
d99222b1b9 | ||
|
4dd76b704e | ||
|
049cb96106 | ||
|
826e9d998b | ||
|
3a5106527c | ||
|
b05cc0f36f | ||
|
e8d7dcd321 | ||
|
37adff769c | ||
|
59b5b8bab6 | ||
|
365b6d603c | ||
|
74da13e7a3 | ||
|
b86d83759a | ||
|
6d34893d4d | ||
|
9e4c01f8d3 | ||
|
29c776e4fc | ||
|
e119901e3a | ||
|
4a616e3545 | ||
|
4f80b4d5ca | ||
|
0005895e3d | ||
|
b5c3ce638d | ||
|
4ed3dd090d | ||
|
ab93c858d3 | ||
|
e811d8f2bf | ||
|
19c942e5c2 | ||
|
fb53ec793b | ||
|
df961a3e02 | ||
|
e86f850d59 | ||
|
ee7bf1dc28 | ||
|
73c74d044d | ||
|
831db5985f | ||
|
ade71dc171 | ||
|
e85777a57c | ||
|
5b46e3b334 | ||
|
019de74059 | ||
|
dd44858e60 | ||
|
0d4f802572 | ||
|
0b355ebaac | ||
|
72cde9a4f4 | ||
|
288fc40d1a | ||
|
95c393ae29 | ||
|
e1ef7e5582 | ||
|
9dfa9611ea | ||
|
8566ed0a0a | ||
|
1f003c0120 | ||
|
1245d9c287 | ||
|
c4d40cede0 | ||
|
659e5ff11d | ||
|
9e37c3278e | ||
|
a620f18cf0 | ||
|
4608322da9 | ||
|
1930675a9b | ||
|
bccca11bf6 | ||
|
f5704761b5 | ||
|
54655cf9a4 | ||
|
d3c229fc48 | ||
|
9fe1e72c44 | ||
|
0465bdbf81 | ||
|
ac481f142e | ||
|
6db2f7d4eb | ||
|
502e992c42 | ||
|
5006abbbb2 | ||
|
427258d07a | ||
|
784837301b | ||
|
51eb1bd69c | ||
|
ddd78f97d9 | ||
|
0ba4c8cd7e | ||
|
74f82b022f | ||
|
e46fa6d92f | ||
|
a2d0cc1a97 | ||
|
f7465573b7 | ||
|
1cd336386e | ||
|
fc8c936361 | ||
|
0c904eb476 | ||
|
61ac0a0ac4 | ||
|
d5e6058370 | ||
|
c814443a83 | ||
|
356e7cb199 | ||
|
265270b83c | ||
|
c7f7b8d7e0 | ||
|
d6f1895465 | ||
|
241544ad8a | ||
|
37ca3dd556 | ||
|
be6cb6724d | ||
|
ab2ac92ecf | ||
|
3ec7f81dcc | ||
|
dd3b6a8d4a | ||
|
95ef7cabcb | ||
|
aeebd69555 | ||
|
a04a6bfdaf | ||
|
5f8b035a71 | ||
|
9106aa7e59 | ||
|
0c64863c97 | ||
|
1619144323 | ||
|
43b128473d | ||
|
abf92ecf67 | ||
|
faff4b97c4 | ||
|
c71af8b926 | ||
|
16d7e971c3 | ||
|
dd41f0ff87 | ||
|
dd3df80f01 | ||
|
c42bc173ac | ||
|
495b4c2c36 | ||
|
8b79c9beb1 | ||
|
372764355a | ||
|
0f6be43d8e | ||
|
b3c7f00669 | ||
|
70926b5d55 | ||
|
1b29c35db8 | ||
|
8f60678946 | ||
|
2edbaca0bf | ||
|
999cb6e4f5 | ||
|
f9ea3d47a6 | ||
|
f77d5666d4 | ||
|
7c14d01d7a | ||
|
3bd3573dbb | ||
|
f3fd90ea57 | ||
|
7f29e7edee | ||
|
80cb9dd67b | ||
|
b917e30c35 | ||
|
d2d6cdb1c2 | ||
|
4a753029bb | ||
|
84082805e0 | ||
|
c1e06843eb | ||
|
6e127a5deb | ||
|
2a8c44ad83 | ||
|
092ac30ee5 | ||
|
da7c856f5d | ||
|
f32daf1e34 | ||
|
a79453fb1f | ||
|
0d4257462d | ||
|
f8ed2e1d0d | ||
|
f6f4ef7ee9 | ||
|
cf9a7287fe | ||
|
8eebcf28ac | ||
|
d2b62fff47 | ||
|
4bff5778e0 | ||
|
29469c6e2a | ||
|
0cf50140a5 | ||
|
5ffb6eb26b | ||
|
5fee376411 | ||
|
5cde820d4c | ||
|
b2c4934bc1 | ||
|
8c28481311 | ||
|
24210c084d | ||
|
fdc55ff203 | ||
|
e08eaa39e2 | ||
|
ea4cbd68e7 | ||
|
46586a6334 | ||
|
e7001e0d94 | ||
|
cb5306e2c5 | ||
|
f4c0353061 | ||
|
62fdd3bd3a | ||
|
e83d05e521 | ||
|
6aab291185 | ||
|
17fa550665 | ||
|
236c7db4b3 | ||
|
c7d180c43b | ||
|
d3030f8627 | ||
|
b3863c8af7 | ||
|
0033f683fd | ||
|
55fe4c4a4e | ||
|
a67d9be5a2 | ||
|
e9019eb650 | ||
|
876e30a3c5 | ||
|
f8f3d16d4c | ||
|
bd129145ad | ||
|
6b85a158e9 | ||
|
ddf977faf5 | ||
|
432bf597ae | ||
|
496502b150 | ||
|
81c6fc9ff1 | ||
|
5cf1c6973d | ||
|
49b51e8070 | ||
|
071e956981 | ||
|
288faefae3 | ||
|
844b5cbd42 | ||
|
0cc659cdb4 | ||
|
a1a7c78755 | ||
|
559f0a72fa | ||
|
f19c9f9511 | ||
|
b222731c4f | ||
|
b10965b78e | ||
|
2e01c945aa | ||
|
f5494f0331 | ||
|
7907132269 | ||
|
77cd2e34a0 | ||
|
746cecf4b7 | ||
|
564ffd3c8d | ||
|
727489fffd | ||
|
2097398232 | ||
|
6ecf828a13 | ||
|
d05313f555 | ||
|
b9b99508e8 | ||
|
f7e12a9bc5 | ||
|
873ae31d29 | ||
|
0d42a832c1 | ||
|
30b5eef230 | ||
|
53216edd1d | ||
|
e4cc8d1396 | ||
|
c9ed990016 | ||
|
6eeaabb33c | ||
|
94632cdca5 | ||
|
d44a16e1f0 | ||
|
1f01ade154 | ||
|
0f4ad98321 | ||
|
01b8e1c609 | ||
|
79f80314ed | ||
|
ac540cff74 | ||
|
86ce4ba305 | ||
|
a066f80372 | ||
|
54a24c2b6a | ||
|
a26b7a5a79 | ||
|
40c2d811f9 | ||
|
29208310a9 | ||
|
74b523f248 | ||
|
01ecdee3b2 | ||
|
5a826d8a5c | ||
|
731358f3bc | ||
|
cbf8a59ef1 | ||
|
52955d1e98 | ||
|
3ecb969a12 | ||
|
62ea36073b | ||
|
e5d9d541f6 | ||
|
5dce40c97f | ||
|
87d1c1e9f4 | ||
|
13af2c37f0 | ||
|
ea79ad206c | ||
|
d0edb879b8 | ||
|
5f3fc904b5 | ||
|
6557090ac3 | ||
|
ad2973e89f | ||
|
19cf0fd89d | ||
|
12d13a4a33 | ||
|
d9deb90953 | ||
|
05ef0c51a0 | ||
|
fa1a5f8a61 | ||
|
61fb0e9cea | ||
|
212586fceb | ||
|
7d96d41f8e | ||
|
757cc25163 | ||
|
579aa7cb3e | ||
|
0e33e27401 | ||
|
2eb307661f | ||
|
d37de1fd46 | ||
|
0f32b02deb | ||
|
a18b499552 | ||
|
eb76275cea | ||
|
bea00cf66b | ||
|
daf437f4e3 | ||
|
390cfb2cd5 | ||
|
7580a02c6c | ||
|
07bcb79b1d | ||
|
6ceb2030f9 | ||
|
c4ef115e3d | ||
|
2a5587439f | ||
|
6cf4cbea21 | ||
|
3575ca4ac9 | ||
|
4f8dea0db8 | ||
|
fc24ae63ef | ||
|
9bfb0d911e | ||
|
09af9efd5c | ||
|
6a44e0eef5 | ||
|
781d237798 | ||
|
5045d74716 | ||
|
20f26a0680 | ||
|
0dede73da8 | ||
|
fc7a7004da | ||
|
6744feeb76 | ||
|
429f077679 | ||
|
7e60928b34 | ||
|
7b9d8a1f9d | ||
|
410e1eb132 | ||
|
361f08bad8 | ||
|
33857562af | ||
|
a5d003f90d | ||
|
ce8429523d | ||
|
2e3d542c28 | ||
|
295a836324 | ||
|
1c731c92fd | ||
|
72fa616362 | ||
|
00ca3bf967 | ||
|
e4c534fc99 | ||
|
192ca1dc57 | ||
|
59e97687b1 | ||
|
96fd3f8bd0 | ||
|
2eb7390aa2 | ||
|
ff2be24203 | ||
|
ea8e02412e | ||
|
c77143b542 | ||
|
20e0063dfc | ||
|
c3b258f602 | ||
|
b98c40181c | ||
|
7fab3a7a69 | ||
|
ec7676bdec | ||
|
503d951673 | ||
|
6812e5e550 | ||
|
8a0951be18 | ||
|
e9c30a9361 | ||
|
a482139616 | ||
|
3cbbeac60d | ||
|
edb874a2de | ||
|
4d2b9b5c5d | ||
|
35e79ef66d | ||
|
0aefb378f9 | ||
|
b432cf45c9 | ||
|
3ee30ca14c | ||
|
b70d3fe48e | ||
|
8e5f15c603 | ||
|
f88539d230 | ||
|
37ecdcfce5 | ||
|
841c0e767c | ||
|
311163203a | ||
|
e61d8bda60 | ||
|
f54a574ee4 | ||
|
56b01b6eaa | ||
|
3b726b996d | ||
|
2db3a226dc | ||
|
be2296edf1 | ||
|
81b3db3dbf | ||
|
f652178a02 | ||
|
d318ff6100 | ||
|
15a95e3b36 | ||
|
bf655b530f | ||
|
e9db24ac23 | ||
|
32e0931588 | ||
|
f989dd0132 | ||
|
b3b4fd448e | ||
|
c1c0eab113 | ||
|
46f5f51909 | ||
|
975e389f1d | ||
|
c43d4eaa93 | ||
|
d27752350a | ||
|
4987e5b158 | ||
|
0525932561 | ||
|
35e1936202 | ||
|
395c429cb1 | ||
|
4b01cb2544 | ||
|
0c5d6f4660 | ||
|
4b950117f9 | ||
|
0d613279ba | ||
|
2001fb6f81 | ||
|
5df1ac3610 | ||
|
0a8e97098d | ||
|
572fe066da | ||
|
19038d063b | ||
|
a38ce71813 | ||
|
8b802b3fe6 | ||
|
1126e1f8d7 | ||
|
21d1c4572d | ||
|
c82fda86b6 | ||
|
bdaf2592e8 | ||
|
0fa4676d30 | ||
|
df94a355fc | ||
|
86ed060f25 | ||
|
6733da5fcd | ||
|
cb679f3206 | ||
|
9bb81e1ed3 | ||
|
f65368068f | ||
|
1fd3b5ed5a | ||
|
fb3baeaf23 | ||
|
8237c6fb28 | ||
|
d4c8971b65 | ||
|
78fe398a2f | ||
|
39564bbdf5 | ||
|
6e701f798f | ||
|
5f18a7c237 | ||
|
fdd89f1da5 | ||
|
52b3458972 | ||
|
016e1f1b19 | ||
|
6fd2f36bd8 | ||
|
c98f54ecdc | ||
|
8250e061d4 | ||
|
1a008da295 | ||
|
124f598090 | ||
|
3d155a3016 | ||
|
eff2a32082 | ||
|
087ec5e1ce | ||
|
637a6bfe9f | ||
|
2d504e3c71 | ||
|
960a8aee87 | ||
|
32eb900317 | ||
|
1886ab9f35 | ||
|
b3c9d8b86b | ||
|
2edb7d57be | ||
|
f6af922088 | ||
|
5bae654061 | ||
|
68fbe714a4 | ||
|
6e2733a945 | ||
|
bae37248f5 | ||
|
cb7e717a7e | ||
|
f9d1005b9d | ||
|
62d636f125 | ||
|
49ec571bd0 | ||
|
831870b122 | ||
|
aae194cc54 | ||
|
a5a9e6c7a8 | ||
|
252829aee0 | ||
|
58f96365d9 | ||
|
9c1890fe13 | ||
|
b9b1f7efe7 | ||
|
f6f8232b6c | ||
|
2559b9cfd8 | ||
|
46685a5637 | ||
|
38aae1d1f0 | ||
|
9fcbd8af1c | ||
|
b6cb988ed7 | ||
|
92eae9d2d9 | ||
|
35f89fc3d6 | ||
|
7ba571395e | ||
|
3fb0689b84 | ||
|
f0b154528d | ||
|
22855508e8 | ||
|
c6f1034177 | ||
|
598f7a0b5b | ||
|
11301681aa | ||
|
c478f8f0e1 | ||
|
260d73f752 | ||
|
a72f0693f3 | ||
|
6552d192a6 | ||
|
c37643e8a0 | ||
|
3edc4d16ac | ||
|
aa6b86a1c3 | ||
|
d64797e4c3 | ||
|
9b82f1286f | ||
|
28964ebe24 | ||
|
42ea5f4f67 | ||
|
4146495b05 | ||
|
68a9f24fb5 | ||
|
513d507423 | ||
|
cc1a6f0e55 | ||
|
62c13f66b0 | ||
|
d60f1a19da | ||
|
f0cfec62cd | ||
|
b62f6d3982 | ||
|
d3bc4e43a5 | ||
|
690f35f61c | ||
|
2e8f7fff7c | ||
|
d50169fc06 | ||
|
30a215009d | ||
|
9a4b1c6493 | ||
|
500c5cca68 | ||
|
de13aa5126 | ||
|
b83810af84 | ||
|
98f0202c99 | ||
|
d5ee5d0c65 | ||
|
99e509065f | ||
|
1580ba5ac1 | ||
|
b7e9efdc98 | ||
|
738427a151 | ||
|
fa9c9f14a6 | ||
|
7a42de3eae | ||
|
dfb4d9a48b | ||
|
8bda1488dc | ||
|
73a5f13175 | ||
|
7e71162ed5 | ||
|
8498f129d3 | ||
|
26498aac58 | ||
|
5a15953a76 | ||
|
0e09546391 | ||
|
fb33689ec3 | ||
|
cfd8478ba4 | ||
|
dd8c646920 | ||
|
c7019d4d14 | ||
|
7694eae167 | ||
|
4e82541ead | ||
|
010f3c9575 | ||
|
067a87dc30 | ||
|
208cf752a1 | ||
|
151fb20972 | ||
|
49ba23dc1a | ||
|
8d21d1e1fe | ||
|
f4fd695853 | ||
|
b235dea47b | ||
|
b5b42f3de1 | ||
|
61aebaeb4c | ||
|
055b68289c | ||
|
1c86517e79 | ||
|
36704d4224 | ||
|
71b441020e | ||
|
b566174cc5 | ||
|
a80c27ece3 | ||
|
89bae9e64b | ||
|
218e727163 | ||
|
98d57db313 | ||
|
5593678542 | ||
|
1303ad0d16 | ||
|
1d1ccf7488 | ||
|
825f5864d3 | ||
|
7237146ea5 | ||
|
7adcc25aa4 | ||
|
fa8fecd610 | ||
|
38934d74ae | ||
|
859774482f | ||
|
037924384f | ||
|
744f434a32 | ||
|
7841b26c18 | ||
|
ca01679379 | ||
|
fb712c3987 | ||
|
eb61520753 | ||
|
aa0a24a0f1 | ||
|
a69f5655d8 | ||
|
b3bf36175d | ||
|
5c2bea1b4f | ||
|
2aad74d8cc | ||
|
b216d488f9 | ||
|
99a58c93d3 | ||
|
aa53ef66e2 | ||
|
8aa976458c | ||
|
2542705390 | ||
|
c3e2e9cf26 | ||
|
b2d8e25f41 | ||
|
9c50ff9fb3 | ||
|
3d26d2431c | ||
|
a5bf039819 | ||
|
5161dca58a | ||
|
cd3a23e7bf | ||
|
0c4d2a0fc5 | ||
|
a32c85c1c2 | ||
|
3093465dc7 | ||
|
cf57476d6b | ||
|
9bbf089634 | ||
|
f85bf5fa68 | ||
|
d22b985e3f | ||
|
3bbf269afb | ||
|
9d375934dd | ||
|
f1a566ec6b | ||
|
f3e549e772 | ||
|
4f8c524839 | ||
|
5b908d7502 | ||
|
c70710d4c7 | ||
|
ef8a468f1f | ||
|
6d2b2ef2b9 | ||
|
a28e66c5fe | ||
|
dc76404590 | ||
|
59dc00bc30 | ||
|
a34059b1e5 | ||
|
b0a1488820 | ||
|
173d8fca00 | ||
|
7cccd1fae5 | ||
|
be63388638 | ||
|
72e0aac551 | ||
|
63efd5d96a | ||
|
a8a19da607 | ||
|
24f3b67b56 | ||
|
6f46a777ca | ||
|
37529a4cd1 | ||
|
381ff97efa | ||
|
0b0aeeda29 | ||
|
93d59eb6eb | ||
|
4debd1ea79 | ||
|
86e7c22196 | ||
|
2c19d7f3da | ||
|
61ed67f27b | ||
|
e44863e908 | ||
|
72f9a80c76 | ||
|
1d3c2be0be | ||
|
877f8253c3 | ||
|
0b73862cfe | ||
|
17f0565afc | ||
|
ec7381483a | ||
|
198f660ee8 | ||
|
b512123303 | ||
|
3d0307a5a9 | ||
|
e41a8aec0e | ||
|
3f9526c1ac | ||
|
a8a1878281 | ||
|
9482ccdb74 | ||
|
1eddb70396 | ||
|
49c51368eb | ||
|
3d989e822d | ||
|
398ed04958 | ||
|
74d72d6028 | ||
|
f6c192f584 | ||
|
53d6e4bff3 | ||
|
2763f0c064 | ||
|
6c64b35f4d | ||
|
3ce3adf3fe | ||
|
98ee5a5741 | ||
|
eb0d2d9851 | ||
|
46ae49a305 | ||
|
93198cc7dd | ||
|
a1bf63dbe9 | ||
|
fce987ffc8 | ||
|
6047bca2c3 | ||
|
2c7ba24977 | ||
|
a76b0d8d74 | ||
|
a41e4696a0 | ||
|
994d1ddbba | ||
|
c0ef28186e | ||
|
54b6b527c7 | ||
|
e5ce6f92ac | ||
|
d68f67bf5c | ||
|
dd5145131e | ||
|
ebabb30abd | ||
|
54382a9bf5 | ||
|
2ce5fd6267 | ||
|
bdc2677f7b | ||
|
c7a74802ab | ||
|
27efe62a92 | ||
|
05029cb9b7 | ||
|
2420c573d0 | ||
|
a5213b572c | ||
|
781ff9c3d9 | ||
|
41b9aa112d | ||
|
9af7906180 | ||
|
5490dddbda | ||
|
8801abf380 | ||
|
f2dfd613f8 | ||
|
1fb521418d | ||
|
ed28caeba6 | ||
|
457604014f | ||
|
d1791ff286 | ||
|
6ce67f3cbe | ||
|
2a1e419bf8 | ||
|
396b504b5f | ||
|
f12667c011 | ||
|
5886faf63b | ||
|
4f4a8f6163 | ||
|
05e695c7d3 | ||
|
3212422921 | ||
|
cbedbdde81 | ||
|
eacdddaf12 | ||
|
fe3ccea370 | ||
|
5aa58bef7c | ||
|
a9c594d5bc | ||
|
5bddcaa84d | ||
|
de69b2242c | ||
|
2d9f37be87 | ||
|
da49e6a3ee | ||
|
d48c88428e | ||
|
bb4c83d404 | ||
|
68afe0f0e9 | ||
|
d680eb7b6d | ||
|
2fbea1ceea | ||
|
e78dd6e9bc | ||
|
553d0d9eaf | ||
|
7c817bde70 | ||
|
670a1815ed | ||
|
ab84444d3a | ||
|
1aba3394a3 | ||
|
8f378e3ce2 | ||
|
928e4503c6 | ||
|
1af5f1f03f | ||
|
375fc3b5bb | ||
|
bcceaa9c28 | ||
|
5abbc86d37 | ||
|
8e47307fed | ||
|
60def06040 | ||
|
d97f0c6b7d | ||
|
e727c62e76 | ||
|
211b404195 | ||
|
af034537fc | ||
|
da9cd60ec4 | ||
|
f5b43cc7b4 | ||
|
f4b89ce45b | ||
|
a33c95f8b1 | ||
|
2ba755318f | ||
|
f745f7df33 | ||
|
ddcf88b827 | ||
|
bf0674c40b | ||
|
ccee5cd5e0 | ||
|
38b8d4527c | ||
|
58f48db381 | ||
|
03908feacc | ||
|
48fdbda9cd | ||
|
b3767766ef | ||
|
7b50892339 | ||
|
5b8abaee50 | ||
|
6753f46bf5 | ||
|
e03a9ba22f | ||
|
54a5c2a5c4 | ||
|
1974c22e54 | ||
|
9b7a7d797e | ||
|
80f5a9a448 | ||
|
4eb5fa017d | ||
|
1423e8f8ff | ||
|
7d81fbcd05 | ||
|
43f29bbc58 | ||
|
063095bcaa | ||
|
0d86e64114 | ||
|
b6c9a7623a | ||
|
887c0a9a44 | ||
|
e4ad1bde21 | ||
|
1c10749be2 | ||
|
c70af14af3 | ||
|
9692fbfd89 | ||
|
47679582aa | ||
|
758d1c6e7d | ||
|
a3a3624c57 | ||
|
b6c9f6cc53 | ||
|
c832f82027 | ||
|
6f38bb5c0e | ||
|
80ce4c557b | ||
|
adb9936959 | ||
|
6d32f3cb94 | ||
|
e40445dea7 | ||
|
647d7c1585 | ||
|
58f5df11e6 | ||
|
e3c0425857 | ||
|
b643a42dfd | ||
|
c0123646f6 | ||
|
5d220486e9 | ||
|
8a2efb0dec | ||
|
ae2cdf0fad | ||
|
5f871cfad2 | ||
|
7679ac49b1 | ||
|
7e9c7c37be | ||
|
53f9cd79f5 | ||
|
0c3899065b | ||
|
8f931d8fd6 | ||
|
f4716805aa | ||
|
3c41028cd5 | ||
|
e91ac70739 | ||
|
52d8345a55 | ||
|
c4947a5a1c | ||
|
f86e2858a2 | ||
|
a9e0ae35ba | ||
|
4962992516 | ||
|
cc2beb996e | ||
|
902c48d748 | ||
|
e80eeb3296 | ||
|
e3e47a7b61 | ||
|
33bfedb95a | ||
|
fd26b2c044 | ||
|
ce8bb0863b | ||
|
1cc0885890 | ||
|
3810ecb08b | ||
|
39b1aa98eb | ||
|
f536c8c50d | ||
|
fb510f8d5b | ||
|
d19097c5e1 | ||
|
f9b9212100 | ||
|
5a053dc580 | ||
|
3690a2e1c0 | ||
|
039e8d285b | ||
|
66717a2aec | ||
|
40d4e22249 | ||
|
3298ac489c | ||
|
7baf9a4d36 | ||
|
826a84aca1 | ||
|
6a8e98d4b7 | ||
|
7d5f45d9e3 | ||
|
d633495817 | ||
|
4ede12c5c0 | ||
|
849a8bd4d2 | ||
|
b9043f2785 | ||
|
0857616d9f | ||
|
fab491b44c | ||
|
8e70fdcdfd | ||
|
8c7c5a6a80 | ||
|
4791fb1bc8 | ||
|
702a6edcb9 | ||
|
0e88c3ac70 | ||
|
6fe8e80388 | ||
|
50d89bc579 | ||
|
528d7c463a | ||
|
3a9cb05d58 | ||
|
5ae05cc2f4 | ||
|
0742f72f4f | ||
|
a8f5562bde | ||
|
aa6407d07b | ||
|
457d19beaf | ||
|
a324724cf3 | ||
|
08d91ef714 | ||
|
7eeaa74dd9 | ||
|
0cd5965fcc | ||
|
06cc33166d | ||
|
f2050ec13a | ||
|
c92491621b | ||
|
091bcd72fd | ||
|
981188e17a | ||
|
72995c5bcb | ||
|
cb3d73424b | ||
|
392b5e07c0 | ||
|
ea6b1568b4 | ||
|
3ad2820ebd | ||
|
fd4986e726 | ||
|
bb58f40ae3 | ||
|
ec5973a3e6 | ||
|
72dbf597cc | ||
|
c062a8a841 | ||
|
056e642d2b | ||
|
3fe45e4a9b | ||
|
064887dfbd | ||
|
a13efcfe0a | ||
|
cf24f21a77 | ||
|
5ce539c432 | ||
|
7756e48197 | ||
|
ed0f41c650 | ||
|
80a59da4b8 | ||
|
cafd8c9b3e | ||
|
d7b2cb6a50 | ||
|
c0821032fb | ||
|
51256d8fe7 | ||
|
1fdc3a5e99 | ||
|
7157a62d2b | ||
|
354486e326 | ||
|
f826be087d | ||
|
a995c08356 | ||
|
1e80b85296 | ||
|
5a026afd9f | ||
|
c0b5035b1a | ||
|
175120fdd7 | ||
|
1b2aaaa440 | ||
|
bf2eebd54d | ||
|
19a6b9673e | ||
|
9c42360b34 | ||
|
8eb069cce5 | ||
|
55d6f869fc | ||
|
aa4f2813e4 | ||
|
ee71bf3b71 | ||
|
d64d860c93 | ||
|
83a48dd395 | ||
|
58646ebf20 | ||
|
f7d1df0aab | ||
|
e7da3d81d1 | ||
|
3d4a98bed9 | ||
|
a465a211c2 | ||
|
09ab5e4d65 | ||
|
87d912e4db | ||
|
18ea588e5c | ||
|
3418d895f2 | ||
|
5fcbcf3ddc | ||
|
9f19fb7b53 | ||
|
00505ab2dc | ||
|
dac3c00862 | ||
|
5b6b2bbc01 | ||
|
ad7fecf48e | ||
|
cc06a43142 | ||
|
79aa2d1138 | ||
|
1fd88819be | ||
|
7b98d8a227 | ||
|
b0443467aa | ||
|
41b454f2e5 | ||
|
2347b6628d | ||
|
64a8698a5f | ||
|
cc1c57727d | ||
|
af26d11dd2 | ||
|
ac3628c1fd | ||
|
41a960ecc7 | ||
|
89933a4cb0 | ||
|
352542d12b | ||
|
d418a16703 | ||
|
440e9c3d5d | ||
|
1db463f4de | ||
|
279b5945cb | ||
|
d2bcf440e8 | ||
|
33557e22ed | ||
|
67ce4c3bd9 | ||
|
dd91c7791b | ||
|
fc6b59e8b1 | ||
|
ebe8803e80 | ||
|
a078c1feb5 | ||
|
b6c08d74a6 | ||
|
68297d9398 | ||
|
6f27ba3abb | ||
|
7afa066be3 | ||
|
562eb63964 | ||
|
852907e1cc | ||
|
50aa2335eb | ||
|
3ff29d2e4b | ||
|
24e46508d5 | ||
|
f7ce93b27c | ||
|
f67168cf2d | ||
|
c80254eb3f | ||
|
01fe7f42a0 | ||
|
f37f59f47b | ||
|
521b237e8b | ||
|
daa5b9f496 | ||
|
18ddf78dbe | ||
|
3356dc4edd | ||
|
c1722cdfdb | ||
|
5c09f44f8b | ||
|
40588d182a | ||
|
83ead1217f | ||
|
4a89f974f6 | ||
|
93308e4a29 | ||
|
593cb59d38 | ||
|
1439d006cd | ||
|
b4feb99841 | ||
|
63c43ae9f5 | ||
|
a31e1349ce | ||
|
f4240fcc74 | ||
|
8eaeb44f56 | ||
|
bfc1032fc1 | ||
|
65f90c0942 | ||
|
4fcd1f33dc | ||
|
86527a2f4c | ||
|
648166ecca | ||
|
2e3b5ff134 | ||
|
3c9cdfb841 | ||
|
e7f6e0f9f1 | ||
|
7fcbd543d7 | ||
|
2f603cc73e | ||
|
69dc13efdf | ||
|
456220db56 | ||
|
c50858a877 | ||
|
a11efe838a | ||
|
d6dc04d737 | ||
|
feeea88a58 | ||
|
36d44a3b25 | ||
|
fc5f4dc86f | ||
|
59c0bb0f46 | ||
|
fae11e12cf | ||
|
e0a74881bf | ||
|
ce38857061 | ||
|
c8e134930f | ||
|
3876299fa0 | ||
|
b0b2bde160 | ||
|
3a1b7bb54c | ||
|
04ef92ca94 | ||
|
d7a6860a23 | ||
|
5e361a4a05 | ||
|
cf5f7ef9c2 | ||
|
811d8aefa3 | ||
|
37f446dd79 | ||
|
1a01b5c296 | ||
|
b47197b881 | ||
|
3e5ae57164 | ||
|
a0048ec064 | ||
|
c35e10f875 | ||
|
46d9aae952 | ||
|
bd67bb909a | ||
|
c454964e5b | ||
|
e61b7b9241 | ||
|
954dc6f694 | ||
|
c9e31b7fbd | ||
|
df46234c55 | ||
|
662ad60cd7 | ||
|
a5640ec89c | ||
|
93cd01d7e6 | ||
|
ca9b813aea | ||
|
cbe3f33daf | ||
|
b8f36df713 | ||
|
e087db57b2 | ||
|
dd7427d1eb | ||
|
4a4ec1c54a | ||
|
18c87e98bf | ||
|
8a3edd677c | ||
|
def8c20168 | ||
|
613997fd7e | ||
|
eabeb4f7b3 | ||
|
ac6c7dd37f | ||
|
e7c550243c | ||
|
6f95ff5637 | ||
|
82a20d9bb8 | ||
|
fb55e9cddc | ||
|
4d406621ee | ||
|
e074def743 | ||
|
13e959f8c0 | ||
|
5151168071 | ||
|
77f37e84eb | ||
|
8e3b75c40a | ||
|
4037c3ae65 | ||
|
c817e01774 | ||
|
8d1e8c9c2e | ||
|
b0ad1303ac | ||
|
e4e173233c | ||
|
dd1756ba9e | ||
|
cec0d50cfd | ||
|
1ef2d7e757 | ||
|
03976a038e | ||
|
83a3de91f8 | ||
|
e7cc3e2094 | ||
|
4fa434a3d0 | ||
|
44ca1c0f11 | ||
|
a0fbc1f26c | ||
|
62a7934ea6 | ||
|
5fdf33c689 | ||
|
7031a91aec | ||
|
39a3f5b08d | ||
|
7eee94290b | ||
|
45e7265c82 | ||
|
3c2684b674 | ||
|
b1a8e7cf44 | ||
|
7887d5906d | ||
|
b0ef4d2b6a | ||
|
c626e62da6 | ||
|
b93c49974c | ||
|
d045d609be | ||
|
333cd41d33 | ||
|
2526933747 | ||
|
a33c5822a9 | ||
|
d6c4f56da8 | ||
|
25f800ac7d | ||
|
ad0f942bb5 | ||
|
1ff5a08f60 | ||
|
8a223ce3d5 | ||
|
2f85e0b7d2 | ||
|
6d55882b4a | ||
|
c5ccbb50d2 | ||
|
572bab7e84 | ||
|
f561b8cdfe | ||
|
3ff8b4d19a | ||
|
47280bb483 | ||
|
2b4e235ffd | ||
|
27dacf2eca | ||
|
15e4f8a05f | ||
|
0cb4e48344 | ||
|
f29c0cc377 | ||
|
960d19b6cb | ||
|
4b34c77a39 | ||
|
61b614543c | ||
|
30c8dfe12c | ||
|
3d42221ba8 | ||
|
bd56500d03 | ||
|
401363854a | ||
|
a6d274dcb0 | ||
|
9d20afa95c | ||
|
32362d2f79 | ||
|
3a201bf72b | ||
|
d15fcb69ab | ||
|
c1850f9855 | ||
|
b9bbcdc45c | ||
|
ff98d79963 | ||
|
6ef6f605b0 | ||
|
7f9c79e345 | ||
|
37e2975d4d | ||
|
49142c74a5 | ||
|
98f196506a | ||
|
c52f417406 | ||
|
ec68828a30 | ||
|
c259deb5b2 | ||
|
f0f520eeff | ||
|
a9697cec28 | ||
|
9e6a13fa78 | ||
|
95015dae9f | ||
|
cba77b26a5 | ||
|
0069bf82a6 | ||
|
9e9a7ff572 | ||
|
18821b079b | ||
|
2674a8b708 | ||
|
8bc30c8851 | ||
|
bd10235397 | ||
|
35b7ee91eb | ||
|
d452f53576 | ||
|
9d374d4726 | ||
|
4beee46c52 | ||
|
319cd6c038 | ||
|
bd66fba55f | ||
|
3c11c66ff2 | ||
|
c52cf4d537 | ||
|
1e8dc4f375 | ||
|
7988124de5 | ||
|
f0aa65c832 | ||
|
1c96c09ec9 | ||
|
9685aae967 | ||
|
c7a6608777 | ||
|
bca67d3d27 | ||
|
9c39909a9c | ||
|
f278505db2 | ||
|
e91cc118df | ||
|
e1763ba13c | ||
|
cad0c3c8a9 | ||
|
49103b30f2 | ||
|
df47a59ecb | ||
|
091ec763f9 | ||
|
33b7c5316f | ||
|
986093cf8d | ||
|
33c62acc5c | ||
|
8b671f013a | ||
|
5789ab84a6 | ||
|
6d6e04dc12 | ||
|
7a7c99f3a1 | ||
|
9896f5edbd | ||
|
12a98135bf | ||
|
a30dfb6b19 | ||
|
a4d4eddd92 | ||
|
b393893c7a | ||
|
572fb7e943 | ||
|
7173d7a6a5 | ||
|
7b577d72b5 | ||
|
5a140c2e5c | ||
|
e922cdb113 | ||
|
189da8236c | ||
|
2c62d802b6 | ||
|
23df761b70 | ||
|
6a80641ee2 | ||
|
02e1e94ab9 | ||
|
f28b91b8cf | ||
|
6849615de6 | ||
|
743f84099d | ||
|
a041b1738c | ||
|
1056ef8418 | ||
|
ac77e10a0f | ||
|
eae6f0525c | ||
|
341b7e61da | ||
|
eb6d2224bd | ||
|
bb1b5f986b | ||
|
1c1cc65cbd | ||
|
5dedd16bf5 | ||
|
66d51b575d | ||
|
f26df713c0 | ||
|
b8f486dee9 | ||
|
ac7e66684c | ||
|
be3d2bc1a4 | ||
|
8f28eebe5a | ||
|
d17a87bd28 | ||
|
59eb0af705 | ||
|
7d5840d449 | ||
|
fb7f0ddaaa | ||
|
4bdc7ea51a | ||
|
3ac9f7e676 | ||
|
843ef93202 | ||
|
00726ed51a | ||
|
0cbad5b99b | ||
|
d180252c52 | ||
|
ca5cd28d48 | ||
|
12e0d064cd | ||
|
386a5abc7d | ||
|
084233a207 | ||
|
94e665b3fa | ||
|
0a5c4fa159 | ||
|
9fddd7a716 | ||
|
92473dfc46 | ||
|
8ee0292d8e | ||
|
174105b9fa | ||
|
7f45708c86 | ||
|
015229d551 | ||
|
267e9610c7 | ||
|
32797f5780 | ||
|
ce85512673 | ||
|
5f630f2c5d | ||
|
4fc9106d37 | ||
|
614c051a71 | ||
|
94f06d23c0 | ||
|
a8e0b0d0a3 | ||
|
0f3263f710 | ||
|
2a81cadd27 | ||
|
f69822107f | ||
|
4dec6cab65 | ||
|
0287ce0c9d | ||
|
aae597bfde | ||
|
8347fb69c2 | ||
|
685632db0c | ||
|
5169b4556a | ||
|
3f099da257 | ||
|
d4c4cbe62b | ||
|
c66975ffc5 | ||
|
c35ac067b2 | ||
|
851a8c8b3a | ||
|
d081f7cb85 | ||
|
2c5534ca18 | ||
|
08fb58e10d | ||
|
13c3e40044 | ||
|
b5e525b251 | ||
|
663698c7a6 | ||
|
957f1ae00f | ||
|
763855fe9e | ||
|
e6880f9584 | ||
|
786f592d7e | ||
|
38d83c3c76 | ||
|
7897ba2293 | ||
|
a43931e987 | ||
|
2fec4eb2b4 | ||
|
3f59259dec | ||
|
2c110ed3d5 | ||
|
0d9a39bd26 | ||
|
5e273b0892 | ||
|
e91c83964a | ||
|
35acee98d5 | ||
|
8434463621 | ||
|
20f117500f | ||
|
850bce2754 | ||
|
7c05b9ed91 | ||
|
5abb79d5be | ||
|
70a06835b8 | ||
|
2e73225586 | ||
|
65c7473407 | ||
|
901e67a83f | ||
|
33c615e5f9 | ||
|
fdae9784f4 | ||
|
25f7aa6621 | ||
|
156a980c30 | ||
|
e9d5d491b8 | ||
|
b9bfc10d0f | ||
|
12876afa07 | ||
|
e66e56b020 | ||
|
6a7a20da88 | ||
|
35cdeebe19 | ||
|
c2fdcf7d39 | ||
|
627638a6cf | ||
|
414e5bf560 | ||
|
343749dc26 | ||
|
6a68aa2ecb | ||
|
70bb296a70 | ||
|
a25a2ec0d9 | ||
|
1644ce31e7 | ||
|
abcf66292d | ||
|
42a5483ba9 | ||
|
83282f8700 | ||
|
8485c8e417 | ||
|
4670afee7c | ||
|
e946b88d82 | ||
|
780ae4663d | ||
|
34676334b6 | ||
|
d799edbcc6 | ||
|
00f32d555d | ||
|
b7a8a01ac7 | ||
|
3a8546732a | ||
|
d656afa1d5 | ||
|
5b3190d39c | ||
|
c5dca95504 | ||
|
dce1d5d5e6 | ||
|
bb31faff1b | ||
|
162b49b417 | ||
|
f8b43d5ba9 | ||
|
e8f297db5a | ||
|
4d332ff241 | ||
|
83007d7600 | ||
|
5f72ae98eb | ||
|
940ead1fb8 | ||
|
bb28ca5371 | ||
|
0edae73a9a | ||
|
19a2d6d169 | ||
|
f3b847c4b0 | ||
|
1a2484e5bc | ||
|
6ed55cb1d5 | ||
|
099f19f99c | ||
|
7d2a6b53d4 | ||
|
6f0c68a4d4 | ||
|
9a377bb9da | ||
|
3cfe47d3f0 | ||
|
84c0bba1ef | ||
|
6aad970d1c | ||
|
298a36bffb | ||
|
846cee5066 | ||
|
50760ef05b | ||
|
0b383ad769 | ||
|
55bad42088 | ||
|
258c39d4a5 | ||
|
9819bf5df0 | ||
|
174c89f772 | ||
|
52e14b5c93 | ||
|
83ef426514 | ||
|
e14c6c39f1 | ||
|
d1789d1469 | ||
|
2fed7cdb61 | ||
|
cd97402779 | ||
|
ca4906c0a3 | ||
|
a28e39cd06 | ||
|
3768096308 | ||
|
3dde3d5322 | ||
|
9df0a29e9e | ||
|
da1e958eb9 | ||
|
52ca88141a | ||
|
4cd73b7a93 | ||
|
fb188972dc | ||
|
6e6b57fbd1 | ||
|
ee0d5b7d50 | ||
|
6d62a3634e | ||
|
54fd453d35 | ||
|
18537e6c38 | ||
|
7e78ee6363 | ||
|
d788969c25 | ||
|
db70a37621 | ||
|
b8be715227 | ||
|
24a47e2faa | ||
|
c56ec9eea7 | ||
|
a39d6e36e8 | ||
|
4e01f55a81 | ||
|
6c7492af89 | ||
|
4c8d4490cb | ||
|
5a56604f99 | ||
|
f471bc4018 | ||
|
596cba37e8 | ||
|
3c8538c0c6 | ||
|
4df8c4c09c | ||
|
bf9a559dcc | ||
|
974d0a33b0 | ||
|
b5cd93aa2f | ||
|
ef2fa2c895 | ||
|
4ff5b80ee8 | ||
|
fb8d5d05dc | ||
|
cef7289d75 | ||
|
94dfe15b28 | ||
|
788bdcafb9 | ||
|
0cfa2b2cf8 | ||
|
37ac8ede4f | ||
|
09edd269aa | ||
|
61e7aac455 | ||
|
bf02536fa3 | ||
|
74b2fdc52c | ||
|
1459c9eb20 | ||
|
1005bfdf7e | ||
|
52453313c1 | ||
|
6f620e9247 | ||
|
1c2591de1e | ||
|
93ae7808cb | ||
|
14d8bac7b2 | ||
|
dd3a964249 | ||
|
d088727bdf | ||
|
0807a74490 | ||
|
b12d93a739 | ||
|
2796c58eca | ||
|
22f912b9f1 | ||
|
0e87acb318 | ||
|
f7c6a848bb | ||
|
cb96345f21 | ||
|
d03c2e681f | ||
|
73c1283e98 | ||
|
e400b296d8 | ||
|
8180aa0bd3 | ||
|
e356c4b19e | ||
|
5c040c6149 | ||
|
d097df8226 | ||
|
add5d47fc3 | ||
|
2227de709b | ||
|
84b5f6e441 | ||
|
1f2b4a5a19 | ||
|
1b78752db6 | ||
|
ca30e18692 | ||
|
36f6da62aa | ||
|
046cfe305f | ||
|
5272c9ef0a | ||
|
aa7304f01e | ||
|
acfcdfe750 | ||
|
39b5240966 | ||
|
b11fd82d96 | ||
|
3973387295 | ||
|
a6dc414f57 | ||
|
723a20ba7d | ||
|
46e96476d8 | ||
|
b3c6ec3ded | ||
|
319777962b | ||
|
283abda83c | ||
|
77be2c450f | ||
|
4eea3ae073 | ||
|
c059224811 | ||
|
a29078ac04 | ||
|
851b7655c1 | ||
|
bdea9e5678 | ||
|
6d6df2a16b | ||
|
240c4e3674 | ||
|
fb61ea7635 | ||
|
d4ca9f3ba0 | ||
|
49f27414e0 | ||
|
77b864527a | ||
|
e5f4aa4140 | ||
|
289dcfb492 | ||
|
79828d1f10 | ||
|
7296af3f39 | ||
|
2ade2782d4 | ||
|
34c78d34b1 | ||
|
7c1f5fd932 | ||
|
810f54ffdd | ||
|
8740fd517d | ||
|
7ef28d9fdc | ||
|
83c4a5132e | ||
|
85c133cd84 | ||
|
d551a1a9ab | ||
|
e87e45c0a2 | ||
|
72aa490e49 | ||
|
35d55fce81 | ||
|
5578299445 | ||
|
99a7991664 | ||
|
15567a55dc | ||
|
5b68e0f7c4 | ||
|
eaa6a3c297 | ||
|
d53bb7f811 | ||
|
29c6f7e3ac | ||
|
14e7d94701 | ||
|
318351376c | ||
|
af8b3b84ef | ||
|
b64921a5ec | ||
|
f1a3f66515 | ||
|
6b4dff4bee | ||
|
de2dec2bec | ||
|
fae7cac15c | ||
|
8972e4f577 | ||
|
0ad84d93f9 | ||
|
ac9553de19 | ||
|
6801346b81 | ||
|
04d6c727e1 | ||
|
aec77cecde | ||
|
0f26d8f097 | ||
|
cb2ebc3102 | ||
|
d2581332db | ||
|
adb0973d61 | ||
|
7f987f93d1 | ||
|
c5fa0e98b3 | ||
|
a84844cea5 | ||
|
51f443c7b6 | ||
|
c2601dbd30 | ||
|
2fb64fa85e | ||
|
4e80416a4f | ||
|
a949b075b4 | ||
|
36e99af7fb | ||
|
9b99039fdb | ||
|
344e11a539 | ||
|
ca1d891799 | ||
|
485df894ab | ||
|
38cefc358a | ||
|
6d2d55057c | ||
|
4b9a2683ed | ||
|
06b4d7db0d | ||
|
225c779225 | ||
|
6717e29909 | ||
|
7f1b117675 | ||
|
632b6aaf1f | ||
|
3e8a61d626 | ||
|
fb418015e3 | ||
|
db30c2bc19 | ||
|
f6b043b434 | ||
|
abcd1f2975 | ||
|
5849c7ab78 | ||
|
19fa8a3ed9 | ||
|
875a06b9d7 | ||
|
c90b199488 | ||
|
0e1158c71d | ||
|
b19f77d5c7 | ||
|
7e0969bf82 | ||
|
8e51a7b31e | ||
|
317197a6b5 | ||
|
39902eff28 | ||
|
2cb3463cc8 | ||
|
60b014667a | ||
|
d7fde9d109 | ||
|
72701bd2a0 | ||
|
6b81b50d36 | ||
|
862836548d | ||
|
feb70284bc | ||
|
3a1fbb49f4 | ||
|
02e86864da | ||
|
b465b91ec9 | ||
|
7aac7a23a3 | ||
|
8fd1f15ae7 | ||
|
5c43890b31 | ||
|
073064bdb0 | ||
|
59597775e5 | ||
|
4c666b4d2f | ||
|
1e098b5928 | ||
|
4fcd7e94f5 | ||
|
513611ff92 | ||
|
fe3cce7828 | ||
|
edb1ae1798 | ||
|
85c20fb564 | ||
|
834efc7b2c | ||
|
d2c61794ea | ||
|
b56e654f26 | ||
|
d256e1f9c0 | ||
|
8762c1dcfb | ||
|
1f1a303457 | ||
|
046e1fb215 | ||
|
341877416e | ||
|
6c31d0d894 | ||
|
40751c2ed3 | ||
|
d72422b369 | ||
|
291066dcbd | ||
|
c96c8a391f | ||
|
7536899894 | ||
|
44f2e73d1b | ||
|
9e99dfc8b2 | ||
|
42cd946ff2 | ||
|
cbbf3ea75e | ||
|
23a77d70e8 | ||
|
e1e85f285c | ||
|
6988cd07a0 | ||
|
1bdb6069da | ||
|
0978a1ad8a | ||
|
350520a650 | ||
|
2a3aae6d57 | ||
|
d472cf13b1 | ||
|
eace04e2e7 | ||
|
f9187ac661 | ||
|
9c3fb960e8 | ||
|
b550fa291c | ||
|
6fb3f5c4a6 | ||
|
f25949cf84 | ||
|
cc434a1c7f | ||
|
5c8581a345 | ||
|
6259edac38 | ||
|
f0220611aa | ||
|
5c8051994b | ||
|
62f2e7f06e | ||
|
24e3b5296e | ||
|
9533ac3405 | ||
|
b5c780d2a1 | ||
|
06ebb0b6d6 | ||
|
5f76ba2ae3 | ||
|
32d899eb6d | ||
|
b30b4c1877 | ||
|
0d357a892b | ||
|
e180ed4ccb | ||
|
27ce962708 | ||
|
084f975d5e | ||
|
624aee531a | ||
|
a92f9e67b3 | ||
|
5649f5237b | ||
|
24a05b0bf5 | ||
|
359514432f | ||
|
cf706a37f0 | ||
|
4be07c3265 | ||
|
837f47c921 | ||
|
bfb96638f6 | ||
|
6453a41a28 | ||
|
1d9ca54cec | ||
|
1cc6ef54d0 | ||
|
af3476afb9 | ||
|
4f8e01ff36 | ||
|
d0dcab10f1 | ||
|
1004f039ec | ||
|
da6df9fdc5 | ||
|
a30ecbfe3c | ||
|
49530d5fe5 | ||
|
2d2897f426 | ||
|
d744377f4a | ||
|
23bc2980c6 | ||
|
f8c7cee59c | ||
|
6737031eb9 | ||
|
7cfc7e1133 | ||
|
67bd489ba8 | ||
|
34f5510faf | ||
|
0e07298340 | ||
|
a7fd5abe37 | ||
|
a029b16066 | ||
|
ea4756a802 | ||
|
7d76eea05a | ||
|
7d22b5bdce | ||
|
8e97e4a405 | ||
|
d6713e49cd | ||
|
369e18202f | ||
|
96b1328967 | ||
|
0254d63fdc | ||
|
b0a9f46bb7 | ||
|
d295e3b444 | ||
|
6186118aa0 | ||
|
98d20bf257 | ||
|
c38f0f22bc | ||
|
24446dd1d0 | ||
|
cd90674f37 | ||
|
4cfe8e9d48 | ||
|
5ceb1fa1c9 | ||
|
4fb9a702f0 | ||
|
daffe30e47 | ||
|
f0b380fe5e | ||
|
4e039d07f3 | ||
|
b403bbdf82 | ||
|
8c7fea39d4 | ||
|
9efd526f6f | ||
|
4ab92b62f5 | ||
|
bd1b72ad42 | ||
|
bccd45a22e | ||
|
3b9b2158c1 | ||
|
2a0df39961 | ||
|
21875a520d | ||
|
6c23d48649 | ||
|
4094043011 | ||
|
970807f01a | ||
|
66286494a2 | ||
|
140495fe64 | ||
|
04a872f927 | ||
|
60f6153446 | ||
|
e2737566ff | ||
|
dd3a979827 | ||
|
69d59f80ed | ||
|
ebe59ca483 | ||
|
fc669861fe | ||
|
61c61f9aab | ||
|
fd3baa930e | ||
|
df05261cd3 | ||
|
75d858a764 | ||
|
5709d94710 | ||
|
4f5686901b | ||
|
725328c209 | ||
|
ee00b0cea2 | ||
|
eafddd3cea | ||
|
94b2a345f2 | ||
|
e0ca522633 | ||
|
a58c1b5119 | ||
|
7d940743cb | ||
|
f999b49843 | ||
|
7592c80db5 | ||
|
60fb075419 | ||
|
91f0f0053f | ||
|
56d1be6ca6 | ||
|
516e3f60e4 | ||
|
db796ef3f1 | ||
|
335b088dd0 | ||
|
98ea04e7c6 | ||
|
737cd15707 | ||
|
3d899affcf | ||
|
858d535389 | ||
|
767bf6d1d7 | ||
|
29a95e10de | ||
|
8dd795dec1 | ||
|
8bcfa1a32f | ||
|
e984b6ff74 | ||
|
1179c1a42c | ||
|
69ebfc4cda | ||
|
26499f965b | ||
|
75b07641fd | ||
|
80c7ee74a2 | ||
|
f9906a9584 | ||
|
91dd7527d9 | ||
|
d4d9dda5cb | ||
|
e8b3312f2e | ||
|
3fd950e823 | ||
|
d98c8ae8b5 | ||
|
b8b2b48949 | ||
|
636ee4a11a | ||
|
fe08d62e91 | ||
|
d87145ad23 | ||
|
dce395e7ad | ||
|
926b0c72e8 | ||
|
4f044e753c | ||
|
b69c5e9972 | ||
|
fc597b736b | ||
|
56a9fded36 | ||
|
17a67d7227 | ||
|
09ced81ee5 | ||
|
8304b7db87 | ||
|
2f9259a215 | ||
|
fd07a7b17a | ||
|
369a280f64 | ||
|
8d760811b8 | ||
|
8b54df93dd | ||
|
2d8246668c | ||
|
ebedab89e5 | ||
|
a0e8bf9661 | ||
|
938385db40 | ||
|
45dc9d4d08 | ||
|
b2952da4bd | ||
|
d6a2f8258f | ||
|
92b9063527 | ||
|
40e8c9f6e6 | ||
|
3c43ce869c | ||
|
190329745d | ||
|
b4c355e17e | ||
|
4173f0a558 | ||
|
0d2518551f | ||
|
6fa3406b0e | ||
|
da6c9246f5 | ||
|
84565d5407 | ||
|
b0ae3243d5 | ||
|
6e42e18191 | ||
|
694c9916b9 | ||
|
4265cecdfa | ||
|
317a3a0ad2 | ||
|
0018491c1e | ||
|
aced280818 | ||
|
0320e0e849 | ||
|
e43065cfe0 | ||
|
6998f6fc3d | ||
|
747d7da402 | ||
|
c80b2c9766 | ||
|
ed8530d9b6 | ||
|
7e962a409c | ||
|
bf7c9c8567 | ||
|
07d3b17eb4 | ||
|
9e27a95b8e | ||
|
4f3e6daae9 | ||
|
9c532c444b | ||
|
22d883b4d3 | ||
|
c8fa7815a6 | ||
|
b8cde97ab7 | ||
|
098598c98d | ||
|
f9c5756b4d | ||
|
1b069745b3 | ||
|
5a8a692628 | ||
|
da52731c75 | ||
|
ed86641695 | ||
|
f579d5efe6 | ||
|
a7a1cb3827 | ||
|
ab3d7edcdc | ||
|
33d01a980a | ||
|
af902dddf1 | ||
|
1fd75ff4f4 | ||
|
c4c430dcd0 | ||
|
627c044e4d | ||
|
0137b992b4 | ||
|
397ead10af | ||
|
6afe6185be | ||
|
298b32e82e | ||
|
f67f92652a | ||
|
8a780d6f6d | ||
|
a03d354ee5 | ||
|
a08658b46d | ||
|
100d791e84 | ||
|
3850ede5cf | ||
|
5a2b875b81 | ||
|
54037862e6 | ||
|
5998357682 | ||
|
b240be37cc | ||
|
5d38632153 | ||
|
719bfd2011 | ||
|
c3f9d75abe | ||
|
b02e3ff0cd | ||
|
be5ddfa59b | ||
|
b1fab26057 | ||
|
19ddb3bfa4 | ||
|
0208c5b5d6 | ||
|
62372fe628 | ||
|
a9ff89cd5d | ||
|
1acfd92d8a | ||
|
947a77bcde | ||
|
24ddc6f081 | ||
|
27b8275d5a | ||
|
ff1dc201b1 | ||
|
13f73b626b | ||
|
087182be9a | ||
|
01519b3ae0 | ||
|
59f0d08417 | ||
|
4fc0bd5881 | ||
|
262075ca80 | ||
|
1def78f1c4 | ||
|
9574478aaa | ||
|
458a6c0418 | ||
|
1910575215 | ||
|
28ba83a313 | ||
|
9d87470a60 | ||
|
5148942b90 | ||
|
037d7b5a57 | ||
|
c4a2786ff7 | ||
|
a4c3f33245 | ||
|
72bdec2f76 | ||
|
e18d431b0e | ||
|
edfa025814 | ||
|
2e5807b6c4 | ||
|
9bf970a4c1 | ||
|
e9e58b9887 | ||
|
7fdf8d9925 | ||
|
4c3df3ae53 | ||
|
39343c8675 | ||
|
77caea2cc7 | ||
|
07ded00bd3 | ||
|
f1348fb693 | ||
|
1e3e427263 | ||
|
a64d8142c9 | ||
|
e1a2c27cfd | ||
|
de3ed997a7 | ||
|
a8fea9babc | ||
|
b017899f12 | ||
|
0491e8d707 | ||
|
c0533b390b | ||
|
1855fde331 | ||
|
91eb71e9fa | ||
|
77eb67b5a0 | ||
|
6cfcb1a823 | ||
|
aed481debe | ||
|
96e124bf8d | ||
|
cc923edf3c | ||
|
6b793b1a8b | ||
|
b07ec7d81b | ||
|
052c58403d | ||
|
5b97455878 | ||
|
8db35802f9 | ||
|
6c39288cec | ||
|
528b1435da | ||
|
4f2821bce0 | ||
|
ecf9412623 | ||
|
f6d502017d | ||
|
7d6b94b4c2 | ||
|
6911dfd7d6 | ||
|
42c43bb520 | ||
|
6b6c57887c | ||
|
1b0dd32cca | ||
|
32696e32bc | ||
|
7d8f597c86 | ||
|
a77734a600 | ||
|
7e49a0004b | ||
|
aab94f31c0 | ||
|
434bbfc409 | ||
|
148ed13b5e | ||
|
f772109c4d | ||
|
288aed8886 | ||
|
e56ed9a68a | ||
|
e6e3447c19 | ||
|
023fe19c6d | ||
|
449abea6b5 | ||
|
f1de0575d1 | ||
|
5c9177fa81 | ||
|
6c526f081f | ||
|
0ebee05092 | ||
|
93f22b7fd6 | ||
|
2873f3effd | ||
|
b3a1923a8f | ||
|
fe07cb1e6c | ||
|
c149ae6097 | ||
|
ac88f71c63 | ||
|
f2dec0e337 | ||
|
4fb77c6f5d | ||
|
ddfb6fb978 | ||
|
6a3e6c68be | ||
|
748e398c21 | ||
|
e663e7c0b0 | ||
|
2781d88abc | ||
|
58b8a58e86 | ||
|
f670eaf464 | ||
|
100ff7cabb | ||
|
d8df8830f1 | ||
|
8420935617 | ||
|
5655293cf8 | ||
|
303721fca2 | ||
|
8f13e0d60d | ||
|
0c95606e03 | ||
|
3b11aa9050 | ||
|
b2f4863231 | ||
|
aa0b2030c7 | ||
|
be495f2125 | ||
|
3897c52414 | ||
|
9e8c5e9914 | ||
|
cb9f84a61e | ||
|
838d22220a | ||
|
9a1f1a5689 | ||
|
8d3ff10db1 | ||
|
787cb39f81 | ||
|
934e00a1de | ||
|
8c47189e19 | ||
|
c82947b8b7 |
183
.bzrignore
Normal file
183
.bzrignore
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
apparmor-*
|
||||||
|
parser/po/*.mo
|
||||||
|
parser/af_names.h
|
||||||
|
parser/cap_names.h
|
||||||
|
parser/tst_misc
|
||||||
|
parser/tst_regex
|
||||||
|
parser/tst_symtab
|
||||||
|
parser/tst_variable
|
||||||
|
parser/tst/simple_tests/generated_*/*
|
||||||
|
parser/parser_lex.c
|
||||||
|
parser/parser_version.h
|
||||||
|
parser/parser_yacc.c
|
||||||
|
parser/parser_yacc.h
|
||||||
|
parser/pod2htm*.tmp
|
||||||
|
parser/*.7
|
||||||
|
parser/*.5
|
||||||
|
parser/*.8
|
||||||
|
parser/*.7.html
|
||||||
|
parser/*.5.html
|
||||||
|
parser/*.8.html
|
||||||
|
parser/common
|
||||||
|
parser/apparmor_parser
|
||||||
|
parser/libapparmor_re/regexp.cc
|
||||||
|
parser/techdoc.aux
|
||||||
|
parser/techdoc.log
|
||||||
|
parser/techdoc.pdf
|
||||||
|
parser/techdoc.toc
|
||||||
|
libraries/libapparmor/Makefile
|
||||||
|
libraries/libapparmor/Makefile.in
|
||||||
|
libraries/libapparmor/aclocal.m4
|
||||||
|
libraries/libapparmor/audit.log
|
||||||
|
libraries/libapparmor/autom4te.cache
|
||||||
|
libraries/libapparmor/compile
|
||||||
|
libraries/libapparmor/config.guess
|
||||||
|
libraries/libapparmor/config.log
|
||||||
|
libraries/libapparmor/config.status
|
||||||
|
libraries/libapparmor/config.sub
|
||||||
|
libraries/libapparmor/configure
|
||||||
|
libraries/libapparmor/depcomp
|
||||||
|
libraries/libapparmor/install-sh
|
||||||
|
libraries/libapparmor/libtool
|
||||||
|
libraries/libapparmor/ltmain.sh
|
||||||
|
libraries/libapparmor/missing
|
||||||
|
libraries/libapparmor/ylwrap
|
||||||
|
libraries/libapparmor/doc/Makefile
|
||||||
|
libraries/libapparmor/doc/Makefile.in
|
||||||
|
libraries/libapparmor/doc/*.2
|
||||||
|
libraries/libapparmor/doc/aa_*.3
|
||||||
|
libraries/libapparmor/include/Makefile
|
||||||
|
libraries/libapparmor/include/sys/Makefile
|
||||||
|
libraries/libapparmor/src/.deps
|
||||||
|
libraries/libapparmor/src/.libs
|
||||||
|
libraries/libapparmor/src/Makefile
|
||||||
|
libraries/libapparmor/src/Makefile.in
|
||||||
|
libraries/libapparmor/src/af_protos.h
|
||||||
|
libraries/libapparmor/src/change_hat.lo
|
||||||
|
libraries/libapparmor/src/features.lo
|
||||||
|
libraries/libapparmor/src/grammar.lo
|
||||||
|
libraries/libapparmor/src/kernel.lo
|
||||||
|
libraries/libapparmor/src/kernel_interface.lo
|
||||||
|
libraries/libapparmor/src/libaalogparse.lo
|
||||||
|
libraries/libapparmor/src/libimmunix_warning.lo
|
||||||
|
libraries/libapparmor/src/policy_cache.lo
|
||||||
|
libraries/libapparmor/src/private.lo
|
||||||
|
libraries/libapparmor/src/scanner.lo
|
||||||
|
libraries/libapparmor/src/libapparmor.pc
|
||||||
|
libraries/libapparmor/src/libapparmor.la
|
||||||
|
libraries/libapparmor/src/libimmunix.la
|
||||||
|
libraries/libapparmor/src/grammar.c
|
||||||
|
libraries/libapparmor/src/grammar.h
|
||||||
|
libraries/libapparmor/src/scanner.c
|
||||||
|
libraries/libapparmor/src/scanner.h
|
||||||
|
libraries/libapparmor/src/tst_aalogmisc
|
||||||
|
libraries/libapparmor/swig/Makefile
|
||||||
|
libraries/libapparmor/swig/Makefile.in
|
||||||
|
libraries/libapparmor/swig/perl/LibAppArmor.bs
|
||||||
|
libraries/libapparmor/swig/perl/LibAppArmor.pm
|
||||||
|
libraries/libapparmor/swig/perl/Makefile
|
||||||
|
libraries/libapparmor/swig/perl/Makefile.PL
|
||||||
|
libraries/libapparmor/swig/perl/Makefile.in
|
||||||
|
libraries/libapparmor/swig/perl/Makefile.perl
|
||||||
|
libraries/libapparmor/swig/perl/MYMETA.json
|
||||||
|
libraries/libapparmor/swig/perl/MYMETA.yml
|
||||||
|
libraries/libapparmor/swig/perl/blib
|
||||||
|
libraries/libapparmor/swig/perl/libapparmor_wrap.c
|
||||||
|
libraries/libapparmor/swig/perl/pm_to_blib
|
||||||
|
libraries/libapparmor/swig/python/__init__.py
|
||||||
|
libraries/libapparmor/swig/python/build/
|
||||||
|
libraries/libapparmor/swig/python/libapparmor_wrap.c
|
||||||
|
libraries/libapparmor/swig/python/Makefile
|
||||||
|
libraries/libapparmor/swig/python/Makefile.in
|
||||||
|
libraries/libapparmor/swig/python/setup.py
|
||||||
|
libraries/libapparmor/swig/python/test/Makefile
|
||||||
|
libraries/libapparmor/swig/ruby/Makefile
|
||||||
|
libraries/libapparmor/swig/ruby/Makefile.in
|
||||||
|
libraries/libapparmor/testsuite/.deps
|
||||||
|
libraries/libapparmor/testsuite/.libs
|
||||||
|
libraries/libapparmor/testsuite/Makefile
|
||||||
|
libraries/libapparmor/testsuite/Makefile.in
|
||||||
|
libraries/libapparmor/testsuite/libaalogparse.log
|
||||||
|
libraries/libapparmor/testsuite/libaalogparse.sum
|
||||||
|
libraries/libapparmor/testsuite/site.exp
|
||||||
|
libraries/libapparmor/testsuite/test_multi.multi
|
||||||
|
libraries/libapparmor/testsuite/config/Makefile
|
||||||
|
libraries/libapparmor/testsuite/config/Makefile.in
|
||||||
|
libraries/libapparmor/testsuite/lib/Makefile
|
||||||
|
libraries/libapparmor/testsuite/lib/Makefile.in
|
||||||
|
libraries/libapparmor/testsuite/libaalogparse.test/Makefile
|
||||||
|
libraries/libapparmor/testsuite/libaalogparse.test/Makefile.in
|
||||||
|
libraries/libapparmor/testsuite/test_multi/out
|
||||||
|
changehat/mod_apparmor/.libs
|
||||||
|
changehat/mod_apparmor/common
|
||||||
|
changehat/pam_apparmor/common
|
||||||
|
changehat/tomcat_apparmor/common
|
||||||
|
utils/common
|
||||||
|
utils/*.8
|
||||||
|
utils/*.8.html
|
||||||
|
utils/*.5
|
||||||
|
utils/*.5.html
|
||||||
|
utils/*.tmp
|
||||||
|
utils/po/*.mo
|
||||||
|
tests/regression/apparmor/access
|
||||||
|
tests/regression/apparmor/changehat
|
||||||
|
tests/regression/apparmor/changehat_fail
|
||||||
|
tests/regression/apparmor/changehat_fork
|
||||||
|
tests/regression/apparmor/changehat_misc
|
||||||
|
tests/regression/apparmor/changehat_misc2
|
||||||
|
tests/regression/apparmor/changehat_pthread
|
||||||
|
tests/regression/apparmor/changehat_twice
|
||||||
|
tests/regression/apparmor/changehat_wrapper
|
||||||
|
tests/regression/apparmor/changeprofile
|
||||||
|
tests/regression/apparmor/chdir
|
||||||
|
tests/regression/apparmor/chgrp
|
||||||
|
tests/regression/apparmor/chmod
|
||||||
|
tests/regression/apparmor/chown
|
||||||
|
tests/regression/apparmor/clone
|
||||||
|
tests/regression/apparmor/deleted
|
||||||
|
tests/regression/apparmor/env_check
|
||||||
|
tests/regression/apparmor/environ
|
||||||
|
tests/regression/apparmor/exec
|
||||||
|
tests/regression/apparmor/exec_qual
|
||||||
|
tests/regression/apparmor/exec_qual2
|
||||||
|
tests/regression/apparmor/fchdir
|
||||||
|
tests/regression/apparmor/fchgrp
|
||||||
|
tests/regression/apparmor/fchmod
|
||||||
|
tests/regression/apparmor/fchown
|
||||||
|
tests/regression/apparmor/fork
|
||||||
|
tests/regression/apparmor/link
|
||||||
|
tests/regression/apparmor/link_subset
|
||||||
|
tests/regression/apparmor/mkdir
|
||||||
|
tests/regression/apparmor/mmap
|
||||||
|
tests/regression/apparmor/mount
|
||||||
|
tests/regression/apparmor/named_pipe
|
||||||
|
tests/regression/apparmor/net_raw
|
||||||
|
tests/regression/apparmor/open
|
||||||
|
tests/regression/apparmor/openat
|
||||||
|
tests/regression/apparmor/pipe
|
||||||
|
tests/regression/apparmor/ptrace
|
||||||
|
tests/regression/apparmor/ptrace_helper
|
||||||
|
tests/regression/apparmor/pwrite
|
||||||
|
tests/regression/apparmor/readdir
|
||||||
|
tests/regression/apparmor/rename
|
||||||
|
tests/regression/apparmor/rw
|
||||||
|
tests/regression/apparmor/swap
|
||||||
|
tests/regression/apparmor/symlink
|
||||||
|
tests/regression/apparmor/syscall_chroot
|
||||||
|
tests/regression/apparmor/syscall_mknod
|
||||||
|
tests/regression/apparmor/syscall_mlockall
|
||||||
|
tests/regression/apparmor/syscall_ptrace
|
||||||
|
tests/regression/apparmor/syscall_reboot
|
||||||
|
tests/regression/apparmor/syscall_setdomainname
|
||||||
|
tests/regression/apparmor/syscall_sethostname
|
||||||
|
tests/regression/apparmor/syscall_setpriority
|
||||||
|
tests/regression/apparmor/syscall_setscheduler
|
||||||
|
tests/regression/apparmor/syscall_sysctl
|
||||||
|
tests/regression/apparmor/sysctl_proc
|
||||||
|
tests/regression/apparmor/tcp
|
||||||
|
tests/regression/apparmor/unix_fd_client
|
||||||
|
tests/regression/apparmor/unix_fd_server
|
||||||
|
tests/regression/apparmor/unlink
|
||||||
|
tests/regression/apparmor/xattrs
|
||||||
|
tests/regression/apparmor/coredump
|
||||||
|
./utils/apparmor/__pycache__
|
68
Makefile
68
Makefile
@@ -1,5 +1,4 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
|
||||||
#
|
#
|
||||||
OVERRIDE_TARBALL=yes
|
OVERRIDE_TARBALL=yes
|
||||||
|
|
||||||
@@ -8,31 +7,64 @@ include common/Make.rules
|
|||||||
DIRS=parser \
|
DIRS=parser \
|
||||||
profiles \
|
profiles \
|
||||||
utils \
|
utils \
|
||||||
changehat/libapparmor \
|
libraries/libapparmor \
|
||||||
changehat/mod_apparmor \
|
changehat/mod_apparmor \
|
||||||
changehat/pam_apparmor \
|
changehat/pam_apparmor \
|
||||||
management/apparmor-dbus \
|
|
||||||
management/applets/apparmorapplet-gnome \
|
|
||||||
management/yastui \
|
|
||||||
common \
|
|
||||||
tests
|
tests
|
||||||
|
|
||||||
RELEASE_DIR=apparmor-${VERSION}-${REPO_VERSION}
|
#REPO_URL?=lp:apparmor
|
||||||
|
# --per-file-timestamps is failing over SSH, https://bugs.launchpad.net/bzr/+bug/1257078
|
||||||
|
REPO_URL?=https://code.launchpad.net/~apparmor-dev/apparmor/2.9
|
||||||
|
# alternate possibilities to export from
|
||||||
|
#REPO_URL=.
|
||||||
|
#REPO_URL="bzr+ssh://bazaar.launchpad.net/~sbeattie/+junk/apparmor-dev/"
|
||||||
|
|
||||||
|
RELEASE_DIR=apparmor-${VERSION}
|
||||||
|
__SETUP_DIR?=.
|
||||||
|
|
||||||
|
# We create a separate version for tags because git can't handle tags
|
||||||
|
# with embedded ~s in them. No spaces around '-' or they'll get
|
||||||
|
# embedded in ${VERSION}
|
||||||
|
TAG_VERSION=$(subst ~,-,${VERSION})
|
||||||
|
|
||||||
|
# Add exclusion entries arguments for tar here, of the form:
|
||||||
|
# --exclude dir_to_exclude --exclude other_dir
|
||||||
|
TAR_EXCLUSIONS=
|
||||||
|
|
||||||
.PHONY: tarball
|
.PHONY: tarball
|
||||||
tarball: _dist
|
tarball: clean
|
||||||
tar cvzf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR}
|
REPO_VERSION=`$(value REPO_VERSION_CMD)` ; \
|
||||||
|
make export_dir __EXPORT_DIR=${RELEASE_DIR} __REPO_VERSION=$${REPO_VERSION} ; \
|
||||||
|
make setup __SETUP_DIR=${RELEASE_DIR} ; \
|
||||||
|
tar ${TAR_EXCLUSIONS} -cvzf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR}
|
||||||
|
|
||||||
${RELEASE_DIR}:
|
.PHONY: snapshot
|
||||||
mkdir ${RELEASE_DIR}
|
snapshot: clean
|
||||||
|
REPO_VERSION=`$(value REPO_VERSION_CMD)` ; \
|
||||||
|
SNAPSHOT_DIR=apparmor-${VERSION}~$${REPO_VERSION} ;\
|
||||||
|
make export_dir __EXPORT_DIR=$${SNAPSHOT_DIR} __REPO_VERSION=$${REPO_VERSION} ; \
|
||||||
|
make setup __SETUP_DIR=$${SNAPSHOT_DIR} ; \
|
||||||
|
tar ${TAR_EXCLUSIONS} -cvzf $${SNAPSHOT_DIR}.tar.gz $${SNAPSHOT_DIR} ;
|
||||||
|
|
||||||
.PHONY: _dist
|
|
||||||
.PHONY: ${DIRS}
|
|
||||||
|
|
||||||
_dist: clean ${DIRS}
|
.PHONY: export_dir
|
||||||
|
export_dir:
|
||||||
${DIRS}: ${RELEASE_DIR}
|
mkdir $(__EXPORT_DIR)
|
||||||
svn export -r $(REPO_VERSION) $(REPO_URL)/$@ $(RELEASE_DIR)/$@ ; \
|
/usr/bin/bzr export --per-file-timestamps -r $(__REPO_VERSION) $(__EXPORT_DIR) $(REPO_URL)
|
||||||
|
echo "$(REPO_URL) $(__REPO_VERSION)" > $(__EXPORT_DIR)/common/.stamp_rev
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
-rm -rf ${RELEASE_DIR}
|
-rm -rf ${RELEASE_DIR} ./apparmor-${VERSION}~*
|
||||||
|
for dir in $(DIRS); do \
|
||||||
|
make -C $$dir clean; \
|
||||||
|
done
|
||||||
|
|
||||||
|
.PHONY: setup
|
||||||
|
setup:
|
||||||
|
cd $(__SETUP_DIR)/libraries/libapparmor && ./autogen.sh
|
||||||
|
|
||||||
|
.PHONY: tag
|
||||||
|
tag:
|
||||||
|
bzr tag apparmor_${TAG_VERSION}
|
||||||
|
|
||||||
|
211
README
Normal file
211
README
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
------------
|
||||||
|
Introduction
|
||||||
|
------------
|
||||||
|
AppArmor protects systems from insecure or untrusted processes by
|
||||||
|
running them in restricted confinement, while still allowing processes
|
||||||
|
to share files, exercise privilege and communicate with other processes.
|
||||||
|
AppArmor is a Mandatory Access Control (MAC) mechanism which uses the
|
||||||
|
Linux Security Module (LSM) framework. The confinement's restrictions
|
||||||
|
are mandatory and are not bound to identity, group membership, or object
|
||||||
|
ownership. The protections provided are in addition to the kernel's
|
||||||
|
regular access control mechanisms (including DAC) and can be used to
|
||||||
|
restrict the superuser.
|
||||||
|
|
||||||
|
The AppArmor kernel module and accompanying user-space tools are
|
||||||
|
available under the GPL license (the exception is the libapparmor
|
||||||
|
library, available under the LGPL license, which allows change_hat(2)
|
||||||
|
and change_profile(2) to be used by non-GPL binaries).
|
||||||
|
|
||||||
|
For more information, you can read the techdoc.pdf (available after
|
||||||
|
building the parser) and by visiting the http://apparmor.net/ web
|
||||||
|
site.
|
||||||
|
|
||||||
|
|
||||||
|
-------------
|
||||||
|
Source Layout
|
||||||
|
-------------
|
||||||
|
|
||||||
|
AppArmor consists of several different parts:
|
||||||
|
|
||||||
|
changehat/ source for using changehat with Apache, PAM and Tomcat
|
||||||
|
common/ common makefile rules
|
||||||
|
desktop/ empty
|
||||||
|
kernel-patches/ compatibility patches for various kernel versions
|
||||||
|
libraries/ libapparmor source and language bindings
|
||||||
|
parser/ source for parser/loader and corresponding documentation
|
||||||
|
profiles/ configuration files, reference profiles and abstractions
|
||||||
|
tests/ regression and stress testsuites
|
||||||
|
utils/ high-level utilities for working with AppArmor
|
||||||
|
|
||||||
|
--------------------------------------
|
||||||
|
Important note on AppArmor kernel code
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
While most of the kernel AppArmor code has been accepted in the
|
||||||
|
upstream Linux kernel, a few important pieces were not included. These
|
||||||
|
missing pieces unfortunately are important bits for AppArmor userspace
|
||||||
|
and kernel interaction; therefore we have included compatibility
|
||||||
|
patches in the kernel-patches/ subdirectory, versioned by upstream
|
||||||
|
kernel (2.6.37 patches should apply cleanly to 2.6.38 source).
|
||||||
|
|
||||||
|
Without these patches applied to the kernel, the AppArmor userspace
|
||||||
|
will not function correctly.
|
||||||
|
|
||||||
|
------------------------------------------
|
||||||
|
Building and Installing AppArmor Userspace
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
To build and install AppArmor userspace on your system, build and install in
|
||||||
|
the following order.
|
||||||
|
|
||||||
|
|
||||||
|
libapparmor:
|
||||||
|
$ cd ./libraries/libapparmor
|
||||||
|
$ sh ./autogen.sh
|
||||||
|
$ sh ./configure --prefix=/usr --with-perl --with-python # see below
|
||||||
|
$ make
|
||||||
|
$ make check
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
[an additional optional argument to libapparmor's configure is --with-ruby, to
|
||||||
|
generate Ruby bindings to libapparmor.]
|
||||||
|
|
||||||
|
|
||||||
|
Utilities:
|
||||||
|
$ cd utils
|
||||||
|
$ make
|
||||||
|
$ make check
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
|
parser:
|
||||||
|
$ cd parser
|
||||||
|
$ make # depends on libapparmor having been built first
|
||||||
|
$ make check
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
|
Apache mod_apparmor:
|
||||||
|
$ cd changehat/mod_apparmor
|
||||||
|
$ make # depends on libapparmor having been built first
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
|
PAM AppArmor:
|
||||||
|
$ cd changehat/pam_apparmor
|
||||||
|
$ make # depends on libapparmor having been built first
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
|
Profiles:
|
||||||
|
$ cd profiles
|
||||||
|
$ make
|
||||||
|
$ make check # depends on the parser having been built first
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
|
[Note that for the parser and the utils, if you only with to build/use
|
||||||
|
some of the locale languages, you can override the default by passing
|
||||||
|
the LANGS arguments to make; e.g. make all install "LANGS=en_US fr".]
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
AppArmor Testsuites
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
A number of testsuites are in the AppArmor sources. Most have documentation on
|
||||||
|
usage and how to update and add tests. Below is a quick overview of their
|
||||||
|
location and how to run them.
|
||||||
|
|
||||||
|
|
||||||
|
Regression tests
|
||||||
|
----------------
|
||||||
|
For details on structure and adding tests, see
|
||||||
|
tests/regression/apparmor/README.
|
||||||
|
|
||||||
|
To run:
|
||||||
|
$ cd tests/regression/apparmor (requires root)
|
||||||
|
$ make
|
||||||
|
$ sudo make tests
|
||||||
|
$ sudo bash open.sh -r # runs and saves the last testcase from open.sh
|
||||||
|
|
||||||
|
|
||||||
|
Parser tests
|
||||||
|
------------
|
||||||
|
For details on structure and adding tests, see parser/tst/README.
|
||||||
|
|
||||||
|
To run:
|
||||||
|
$ cd parser/tst
|
||||||
|
$ make
|
||||||
|
$ make tests
|
||||||
|
|
||||||
|
|
||||||
|
Libapparmor
|
||||||
|
-----------
|
||||||
|
For details on structure and adding tests, see libraries/libapparmor/README.
|
||||||
|
$ cd libraries/libapparmor
|
||||||
|
$ make check
|
||||||
|
|
||||||
|
Utils
|
||||||
|
-----
|
||||||
|
Tests for the Python utilities exist in the test/ subdirectory.
|
||||||
|
$ cd utils
|
||||||
|
$ make check
|
||||||
|
|
||||||
|
The aa-decode utility to be tested can be overridden by
|
||||||
|
setting up environment variable APPARMOR_DECODE; e.g.:
|
||||||
|
|
||||||
|
$ APPARMOR_DECODE=/usr/bin/aa-decode make check
|
||||||
|
|
||||||
|
Profile checks
|
||||||
|
--------------
|
||||||
|
A basic consistency check to ensure that the parser and aa-logprof parse
|
||||||
|
successfully the current set of shipped profiles. The system or other
|
||||||
|
parser and logprof can be passed in by overriding the PARSER and LOGPROF
|
||||||
|
variables.
|
||||||
|
$ cd profiles
|
||||||
|
$ make && make check
|
||||||
|
|
||||||
|
Stress Tests
|
||||||
|
------------
|
||||||
|
To run AppArmor stress tests:
|
||||||
|
$ make all
|
||||||
|
|
||||||
|
Use these:
|
||||||
|
$ ./change_hat
|
||||||
|
$ ./child
|
||||||
|
$ ./kill.sh
|
||||||
|
$ ./open
|
||||||
|
$ ./s.sh
|
||||||
|
|
||||||
|
Or run all at once:
|
||||||
|
$ ./stress.sh
|
||||||
|
|
||||||
|
Please note that the above will stress the system so much it may end up
|
||||||
|
invoking the OOM killer.
|
||||||
|
|
||||||
|
To run parser stress tests (requires /usr/bin/ruby):
|
||||||
|
$ ./stress.sh
|
||||||
|
|
||||||
|
(see stress.sh -h for options)
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
Building and Installing AppArmor Kernel Patches
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
|
||||||
|
-----------------
|
||||||
|
Required versions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
The AppArmor userspace utilities are written with some assumptions about
|
||||||
|
installed and available versions of other tools. This is a (possibly
|
||||||
|
incomplete) list of known version dependencies:
|
||||||
|
|
||||||
|
The Python utilities require a minimum of Python 2.7 or Python 3.3.
|
||||||
|
|
||||||
|
Some utilities (aa-exec, aa-notify and aa-decode) require Perl 5.10.1 or newer.
|
||||||
|
|
||||||
|
Most shell scripts are written for POSIX-compatible sh. aa-decode expects
|
||||||
|
bash, probably version 3.2 and higher.
|
@@ -1,4 +1,3 @@
|
|||||||
# $Id$
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
|
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
|
||||||
#
|
#
|
||||||
@@ -42,16 +41,48 @@ APXS:=$(shell if [ -x "/usr/sbin/apxs2" ] ; then \
|
|||||||
fi )
|
fi )
|
||||||
APXS_INSTALL_DIR=$(shell ${APXS} -q LIBEXECDIR)
|
APXS_INSTALL_DIR=$(shell ${APXS} -q LIBEXECDIR)
|
||||||
DESTDIR=
|
DESTDIR=
|
||||||
LIBAPPARMOR_FLAGS=$(shell if [ -f /usr/lib/libapparmor.so -o -f /usr/lib64/libapparmor.so ] ; then \
|
ifdef USE_SYSTEM
|
||||||
echo -lapparmor ; \
|
LIBAPPARMOR = $(shell if pkg-config --exists libapparmor ; then \
|
||||||
else \
|
pkg-config --silence-errors --libs libapparmor ; \
|
||||||
echo -DUSE_COMPAT_IMMUNIX_H -limmunix ;\
|
elif ldconfig -p | grep -q libapparmor\.so$$ ; then \
|
||||||
fi)
|
echo -lapparmor ; \
|
||||||
|
fi )
|
||||||
|
ifeq ($(strip $(LIBAPPARMOR)),)
|
||||||
|
ERROR_MESSAGE = $(error ${nl}\
|
||||||
|
************************************************************************${nl}\
|
||||||
|
Unable to find libapparmor installed on this system; either${nl}\
|
||||||
|
install libapparmor devel packages, set the LIBAPPARMOR variable${nl}\
|
||||||
|
manually, or build against in-tree libapparmor.${nl}\
|
||||||
|
************************************************************************${nl})
|
||||||
|
endif # LIBAPPARMOR not set
|
||||||
|
LDLIBS += $(LIBAPPARMOR)
|
||||||
|
else
|
||||||
|
LIBAPPARMOR_SRC := ../../libraries/libapparmor/
|
||||||
|
LIBAPPARMOR_INCLUDE = $(LIBAPPARMOR_SRC)/include
|
||||||
|
LIBAPPARMOR_PATH := $(LIBAPPARMOR_SRC)/src/.libs/
|
||||||
|
ifeq ($(realpath $(LIBAPPARMOR_PATH)/libapparmor.a),)
|
||||||
|
ERROR_MESSAGE = $(error ${nl}\
|
||||||
|
************************************************************************${nl}\
|
||||||
|
$(LIBAPPARMOR_PATH)/libapparmor.a is missing; either build against${nl}\
|
||||||
|
the in-tree libapparmor by building it first and then trying again${nl}\
|
||||||
|
(see the top-level README for help) or build against the system${nl}\
|
||||||
|
libapparmor by adding USE_SYSTEM=1 to your make command.${nl}\
|
||||||
|
************************************************************************${nl})
|
||||||
|
endif
|
||||||
|
# Need to pass -Wl twice here to get past both apxs2 and libtool, as
|
||||||
|
# libtool will add the path to the RPATH of the library if passed -L/some/path
|
||||||
|
LIBAPPARMOR_FLAGS = -I$(LIBAPPARMOR_INCLUDE) -Wl,-Wl,-L$(LIBAPPARMOR_PATH)
|
||||||
|
LDLIBS = -lapparmor
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(TARGET) ${MANPAGES} ${HTMLMANPAGES}
|
.PHONY: libapparmor_check
|
||||||
|
.SILENT: libapparmor_check
|
||||||
|
libapparmor_check: ; $(ERROR_MESSAGE)
|
||||||
|
|
||||||
|
all: libapparmor_check $(TARGET) ${MANPAGES} ${HTMLMANPAGES}
|
||||||
|
|
||||||
%.so: %.c
|
%.so: %.c
|
||||||
${APXS} ${LIBAPPARMOR_FLAGS} -c $<
|
${APXS} ${LIBAPPARMOR_FLAGS} -c $< ${LDLIBS}
|
||||||
mv .libs/$@ .
|
mv .libs/$@ .
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
@@ -64,3 +95,6 @@ install: ${TARGET} ${MANPAGES}
|
|||||||
clean: _clean
|
clean: _clean
|
||||||
rm -rf .libs
|
rm -rf .libs
|
||||||
rm -f *.la *.lo *.so *.o *.slo Make.rules
|
rm -f *.la *.lo *.so *.o *.slo Make.rules
|
||||||
|
|
||||||
|
.PHONY: check
|
||||||
|
check: check_pod_files
|
||||||
|
@@ -1,216 +0,0 @@
|
|||||||
# $Id$
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# Copyright (c) 2004, 2005 NOVELL (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.
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# norootforbuild
|
|
||||||
|
|
||||||
# Check first to see if distro is already defined.
|
|
||||||
# I hate rpm macros
|
|
||||||
%if ! %{?distro:1}0
|
|
||||||
%if %{?suse_version:1}0
|
|
||||||
%define distro suse
|
|
||||||
%endif
|
|
||||||
%if %{?fedora_version:1}0
|
|
||||||
%define distro redhat
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
%if ! %{?distro:1}0
|
|
||||||
%define distro suse
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# this is required to be underscore
|
|
||||||
%define module_name mod_apparmor
|
|
||||||
|
|
||||||
Summary: AppArmor module for apache2.
|
|
||||||
Name: apache2-mod_apparmor
|
|
||||||
Version: @@immunix_version@@
|
|
||||||
Release: @@repo_version@@
|
|
||||||
Group: Applications/System
|
|
||||||
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
|
|
||||||
License: LGPL
|
|
||||||
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
|
|
||||||
Url: http://forge.novell.com/modules/xfmod/project/?apparmor
|
|
||||||
Obsoletes: mod_change_hat mod-change-hat mod-apparmor apache2-mod-apparmor
|
|
||||||
Provides: mod_change_hat mod-change-hat mod-apparmor apache2-mod-apparmor
|
|
||||||
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
%if 0%{?suse_version} < 1010
|
|
||||||
BuildRequires: libimmunix
|
|
||||||
%else
|
|
||||||
%if 0%{?suse_version} < 1030
|
|
||||||
BuildRequires: libapparmor
|
|
||||||
%else
|
|
||||||
BuildRequires: libapparmor-devel
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
%else
|
|
||||||
BuildRequires: libapparmor-devel
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
%define apxs /usr/sbin/apxs2
|
|
||||||
%define apache_mmn %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
|
|
||||||
Prereq: apache2-prefork
|
|
||||||
Prereq: apparmor-parser
|
|
||||||
BuildRequires: apache2-devel
|
|
||||||
Requires: apache2 %{apache_mmn}
|
|
||||||
%else
|
|
||||||
%if %{distro} == "redhat" || %{distro} == "rhel4"
|
|
||||||
%define apxs /usr/sbin/apxs
|
|
||||||
Prereq: httpd
|
|
||||||
BuildRequires: httpd-devel
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
%define module_path %(%{apxs} -q LIBEXECDIR)
|
|
||||||
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)
|
|
||||||
|
|
||||||
%description
|
|
||||||
apache2-mod_apparmor adds support to apache2 to provide AppArmor confinement
|
|
||||||
to individual cgi scripts handled by apache modules like mod_php and
|
|
||||||
mod_perl.
|
|
||||||
This package is part of a suite of tools that used to be named SubDomain.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%build
|
|
||||||
make APXS=%{apxs}
|
|
||||||
|
|
||||||
%install
|
|
||||||
make install DESTDIR=${RPM_BUILD_ROOT} DISTRO=%{distro} MANDIR=%{_mandir}
|
|
||||||
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/apache2-prefork/
|
|
||||||
ln -s %{module_path}/%{module_name}.so ${RPM_BUILD_ROOT}%{_libdir}/apache2-prefork/%{module_name}.so
|
|
||||||
%else
|
|
||||||
%if %{distro} == "redhat" || %{distro} == "rhel4"
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/%{apache_sysconfdir}.d/
|
|
||||||
install -m 644 %{module_name}.conf ${RPM_BUILD_ROOT}/%{apache_sysconfdir}.d/
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%clean
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%{module_path}
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
%{_libdir}/apache2-prefork/%{module_name}.so
|
|
||||||
%else
|
|
||||||
%if %{distro} == "redhat" || %{distro} == "rhel4"
|
|
||||||
%{apache_sysconfdir}.d/%{module_name}.conf
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
%doc COPYING.LGPL
|
|
||||||
%{_mandir}/man*/*
|
|
||||||
%doc *.[0-9].html
|
|
||||||
%doc common/apparmor.css
|
|
||||||
|
|
||||||
%post
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
/usr/sbin/a2enmod apparmor
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%preun
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
if [ $1 = 0 ] ; then
|
|
||||||
/usr/sbin/a2dismod apparmor
|
|
||||||
fi
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%triggerpostun -- mod_change_hat mod-change-hat
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
/usr/sbin/a2enmod apparmor
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Sun Jul 29 2007 - sbeattie@suse.de
|
|
||||||
- Convert builddep on libapparmor to libapparmor-devel
|
|
||||||
* Tue Apr 3 2007 - sbeattie@suse.de
|
|
||||||
- Add mod_apparmor manpage to package
|
|
||||||
* Wed Sep 06 2006 - poeml@suse.de
|
|
||||||
- rename to apache2-mod_apparmor
|
|
||||||
- use a2enmod instead of frob_sysconfig
|
|
||||||
- remove SuSEconfig calls
|
|
||||||
* Fri May 26 2006 - schwab@suse.de
|
|
||||||
- Don't strip binaries.
|
|
||||||
* Wed Apr 12 2006 - Steve Beattie <sbeattie@suse.de>
|
|
||||||
- Move to novell forge svn repo; fix build issue with new layout
|
|
||||||
* Thu Mar 30 2006 - Seth Arnold <seth.arnold@suse.de> 2.0-7.2
|
|
||||||
- Relicense to LGPL
|
|
||||||
* Mon Jan 30 2006 - Steve Beattie <sbeattie@suse.de> 2.0-7.1
|
|
||||||
- Renamed apache config options:
|
|
||||||
ImmhatName -> AAHatName
|
|
||||||
ImmDefaultHatName -> AADefaultHatName
|
|
||||||
* Mon Jan 30 2006 - poeml@suse.de
|
|
||||||
- removed libapr-util1-devel from BuildRequires (apache2-devel does
|
|
||||||
require it)
|
|
||||||
* Fri Jan 27 2006 Steve Beattie <sbeattie@suse.de> 2.0-6.1
|
|
||||||
- No more neededforbuild in STABLE
|
|
||||||
* Wed Jan 25 2006 Steve Beattie <sbeattie@suse.de> 2.0-6
|
|
||||||
- Fix linking against libapparmor.so
|
|
||||||
* Sun Jan 8 2006 Steve Beattie <sbeattie@suse.de> 2.0-5
|
|
||||||
- More SUSE autobuild fixups.
|
|
||||||
* Wed Jan 4 2006 Steve Beattie <sbeattie@suse.de> 2.0-4
|
|
||||||
- Fixup SUSE autobuild require on apache-devel-packages
|
|
||||||
- Add svn revision to the source tarball
|
|
||||||
* Sun Dec 18 2005 Steve Beattie <sbeattie@novell.com> 2.0-3
|
|
||||||
- Include symlink in %{_libdir}/apache2-prefork/
|
|
||||||
* Thu Dec 8 2005 Steve Beattie <sbeattie@novell.com> 2.0-2
|
|
||||||
- Rename to apache2-mod-apparmor for consistency w/SUSE packages
|
|
||||||
- Rename module to mod_apparmor.so
|
|
||||||
* Wed Dec 7 2005 Steve Beattie <sbeattie@novell.com> 2.0-1
|
|
||||||
- Reset version for inclusion in SUSE autobuild
|
|
||||||
* Mon Dec 5 2005 Steve Beattie <sbeattie@novell.com> 1.99-9
|
|
||||||
- Rename package to mod-apparmor
|
|
||||||
* Wed Nov 30 2005 Steve Beattie <sbeattie@novell.com> 1.99-8
|
|
||||||
- Minor packaging cleanups
|
|
||||||
* Wed Nov 30 2005 Steve Beattie <sbeattie@novell.com> 1.99-7_imnx
|
|
||||||
- Convert license to GPL
|
|
||||||
* Thu Jun 23 2005 Steve Beattie <sbeattie@novell.com> 1.99-6_imnx
|
|
||||||
- Add trigger for mod_change_hat => mod-change-hat upgrades
|
|
||||||
- Don't run SuSEconfig on SuSE 9.3 or newer
|
|
||||||
* Mon May 23 2005 Steve Beattie <sbeattie@novell.com> 1.99-5_imnx
|
|
||||||
- Fix package uninstall on RHEL4.
|
|
||||||
* Fri Mar 11 2005 Steve Beattie <steve@immunix.com> 1.99-4_imnx
|
|
||||||
- Rename to be consistent with other packages
|
|
||||||
* Fri Feb 18 2005 Steve Beattie <steve@immunix.com> 1.99-3_imnx
|
|
||||||
- Cleanup some non-64bit clean code, sigh.
|
|
||||||
- Fix install locations on 64-bit platform.
|
|
||||||
* Fri Feb 4 2005 Seth Arnold <sarnold@immunix.coM> 1.99-1_imnx
|
|
||||||
- Reversion to 1.99
|
|
||||||
* Fri Nov 12 2004 Steve Beattie <steve@immunix.com> 1.2-2_imnx
|
|
||||||
- Add configuration file for redhat build
|
|
||||||
* Tue Oct 12 2004 Steve Beattie <steve@immunix.com> 1.2-1_imnx
|
|
||||||
- Bump version after shass-1.1 branched off
|
|
||||||
* Mon Sep 20 2004 Dominic Reynolds <dominic@immunix.com> 1.0-7_imnx_(redhat|suse)
|
|
||||||
- Modified to build separate versions for suse/redhat (EL3).
|
|
||||||
- Note:RH version does not currently setup the module configuraiton
|
|
||||||
- in apache.
|
|
||||||
* Tue Aug 31 2004 Steve Beattie <steve@immunix.com> 1.0-6_imnx
|
|
||||||
- Got location and per server config directives working somewhat
|
|
||||||
correctly :-)
|
|
||||||
- copyright fixups.
|
|
||||||
* Fri Aug 20 2004 Steve Beattie <steve@immunix.com> 1.0-5_imnx
|
|
||||||
- added support for <Location> hatname </Location>
|
|
||||||
* Wed Jul 21 2004 Steve Beattie <steve@immunix.com> 1.0-4_imnx
|
|
||||||
- reduced loglevel of some debug messages
|
|
||||||
- add change_hat to list of apache modules
|
|
||||||
* Tue Jul 20 2004 Steve Beattie <steve@immunix.com> 1.0-2_imnx
|
|
||||||
- got module actually working, at least in simple cases.
|
|
||||||
* Thu Jul 15 2004 Steve Beattie <steve@immunix.com> 1.0-1_imnx
|
|
||||||
- Initial package creation.
|
|
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
#
|
#
|
||||||
# $Id: frob_sysconfig 5910 2005-12-09 03:41:29Z steve $
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
|
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
|
||||||
#
|
#
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* Copyright (c) 2004, 2005, 2006 NOVELL (All rights reserved)
|
* Copyright (c) 2004, 2005, 2006 NOVELL (All rights reserved)
|
||||||
|
* Copyright (c) 2014 Canonical, Ltd. (All rights reserved)
|
||||||
*
|
*
|
||||||
* The mod_apparmor module is licensed under the terms of the GNU
|
* The mod_apparmor module is licensed under the terms of the GNU
|
||||||
* Lesser General Public License, version 2.1. Please see the file
|
* Lesser General Public License, version 2.1. Please see the file
|
||||||
* COPYING.LGPL.
|
* COPYING.LGPL.
|
||||||
*
|
*
|
||||||
* mod_apparmor - (apache 2.0.x)
|
* mod_apparmor - (apache 2.0.x)
|
||||||
* Author: Steve Beattie <sbeattie@suse.de>
|
* Author: Steve Beattie <steve@nxnw.org>
|
||||||
*
|
*
|
||||||
* This currently only implements change_hat functionality, but could be
|
* This currently only implements change_hat functionality, but could be
|
||||||
* extended for other stuff we decide to do.
|
* extended for other stuff we decide to do.
|
||||||
@@ -18,187 +18,240 @@
|
|||||||
#include "http_config.h"
|
#include "http_config.h"
|
||||||
#include "http_request.h"
|
#include "http_request.h"
|
||||||
#include "http_log.h"
|
#include "http_log.h"
|
||||||
|
#include "http_main.h"
|
||||||
#include "http_protocol.h"
|
#include "http_protocol.h"
|
||||||
#include "util_filter.h"
|
#include "util_filter.h"
|
||||||
#include "apr.h"
|
#include "apr.h"
|
||||||
#include "apr_strings.h"
|
#include "apr_strings.h"
|
||||||
#include "apr_lib.h"
|
#include "apr_lib.h"
|
||||||
|
|
||||||
#ifndef USE_COMPAT_IMMUNIX_H
|
|
||||||
#include <sys/apparmor.h>
|
#include <sys/apparmor.h>
|
||||||
#else
|
|
||||||
#include <sys/immunix.h>
|
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/* #define DEBUG */
|
/* #define DEBUG */
|
||||||
#ifndef __unused
|
|
||||||
#define __unused __attribute__((unused))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* should the following be configurable? */
|
/* should the following be configurable? */
|
||||||
#define DEFAULT_HAT "HANDLING_UNTRUSTED_INPUT"
|
#define DEFAULT_HAT "HANDLING_UNTRUSTED_INPUT"
|
||||||
#define DEFAULT_URI_HAT "DEFAULT_URI"
|
#define DEFAULT_URI_HAT "DEFAULT_URI"
|
||||||
|
|
||||||
|
/* Compatibility with apache 2.2 */
|
||||||
|
#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 3
|
||||||
|
#define APLOG_TRACE1 APLOG_DEBUG
|
||||||
|
server_rec *ap_server_conf = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef APLOG_USE_MODULE
|
||||||
|
APLOG_USE_MODULE(apparmor);
|
||||||
|
#endif
|
||||||
module AP_MODULE_DECLARE_DATA apparmor_module;
|
module AP_MODULE_DECLARE_DATA apparmor_module;
|
||||||
|
|
||||||
static unsigned int magic_token = 0;
|
static unsigned long magic_token = 0;
|
||||||
static int inside_default_hat = 0;
|
static int inside_default_hat = 0;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char * hat_name;
|
const char *hat_name;
|
||||||
char * path;
|
char *path;
|
||||||
} immunix_dir_cfg;
|
} apparmor_dir_cfg;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char * hat_name;
|
const char *hat_name;
|
||||||
int is_initialized;
|
int is_initialized;
|
||||||
} immunix_srv_cfg;
|
} apparmor_srv_cfg;
|
||||||
|
|
||||||
/* immunix_init() gets invoked in the post_config stage of apache.
|
/* aa_init() gets invoked in the post_config stage of apache.
|
||||||
* Unfortunately, apache reads its config once when it starts up, then
|
* Unfortunately, apache reads its config once when it starts up, then
|
||||||
* it re-reads it when goes into its restart loop, where it starts it's
|
* it re-reads it when goes into its restart loop, where it starts it's
|
||||||
* children. This means we cannot call change_hat here, as the modules
|
* children. This means we cannot call change_hat here, as the modules
|
||||||
* memory will be wiped out, and the magic_token will be lost, so apache
|
* memory will be wiped out, and the magic_token will be lost, so apache
|
||||||
* wouldn't be able to change_hat back out. */
|
* wouldn't be able to change_hat back out. */
|
||||||
static int
|
static int
|
||||||
immunix_init (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
|
aa_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
|
||||||
{
|
{
|
||||||
apr_file_t * file;
|
apr_file_t *file;
|
||||||
apr_size_t size = sizeof (magic_token);
|
apr_size_t size = sizeof(magic_token);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = apr_file_open (&file, "/dev/urandom", APR_READ, APR_OS_DEFAULT, p);
|
ret = apr_file_open (&file, "/dev/urandom", APR_READ, APR_OS_DEFAULT, p);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
apr_file_read (file, (void *) &magic_token, &size);
|
apr_file_read(file, (void *) &magic_token, &size);
|
||||||
apr_file_close (file);
|
apr_file_close(file);
|
||||||
} else {
|
} else {
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Failed to open /dev/urandom");
|
ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
|
||||||
|
"Failed to open /dev/urandom");
|
||||||
}
|
}
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "Opened /dev/urandom successfully");
|
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
|
||||||
|
"Opened /dev/urandom successfully");
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* As each child starts up, we'll change_hat into a default hat, mostly
|
/* As each child starts up, we'll change_hat into a default hat, mostly
|
||||||
* to protect ourselves from bugs in parsing network input, but before
|
* to protect ourselves from bugs in parsing network input, but before
|
||||||
* we change_hat to the uri specific hat. */
|
* we change_hat to the uri specific hat. */
|
||||||
static void
|
static void
|
||||||
immunix_child_init (apr_pool_t *p, server_rec *s)
|
aa_child_init(apr_pool_t *p, server_rec *s)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "init: calling change_hat");
|
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
|
||||||
ret = change_hat (DEFAULT_HAT, magic_token);
|
"init: calling change_hat with '%s'", DEFAULT_HAT);
|
||||||
|
ret = aa_change_hat(DEFAULT_HAT, magic_token);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
change_hat (NULL, magic_token);
|
ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Failed to change_hat to '%s'",
|
"Failed to change_hat to '%s'", DEFAULT_HAT);
|
||||||
DEFAULT_HAT);
|
|
||||||
} else {
|
} else {
|
||||||
inside_default_hat = 1;
|
inside_default_hat = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
static void
|
static void
|
||||||
debug_dump_uri (apr_uri_t * uri)
|
debug_dump_uri(request_rec *r)
|
||||||
{
|
{
|
||||||
if (uri)
|
apr_uri_t *uri = &r->parsed_uri;
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Dumping uri info "
|
if (uri)
|
||||||
"scheme='%s' host='%s' path='%s' query='%s' fragment='%s'",
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "Dumping uri info "
|
||||||
uri->scheme, uri->hostname, uri->path, uri->query,
|
"scheme='%s' host='%s' path='%s' query='%s' fragment='%s'",
|
||||||
uri->fragment);
|
uri->scheme, uri->hostname, uri->path, uri->query,
|
||||||
|
uri->fragment);
|
||||||
else
|
else
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Asked to dump NULL uri");
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "Asked to dump NULL uri");
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static void
|
|
||||||
debug_dump_uri (apr_uri_t * __unused uri) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
immunix_enter_hat will attempt to change_hat in the following order:
|
|
||||||
(1) to a hatname in a location directive
|
|
||||||
(2) to the uri
|
|
||||||
(3) to a per-server default
|
|
||||||
(4) to DEFAULT_URI
|
|
||||||
(5) back to the parent profile
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
immunix_enter_hat (request_rec *r)
|
|
||||||
{
|
|
||||||
int sd_ret = -1;
|
|
||||||
immunix_dir_cfg * dcfg = (immunix_dir_cfg *)
|
|
||||||
ap_get_module_config (r->per_dir_config, &apparmor_module);
|
|
||||||
immunix_srv_cfg * scfg = (immunix_srv_cfg *)
|
|
||||||
ap_get_module_config (r->server->module_config, &apparmor_module);
|
|
||||||
|
|
||||||
debug_dump_uri (&r->parsed_uri);
|
/*
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "in immunix_enter_hat (%s) n:0x%lx p:0x%lx main:0x%lx",
|
aa_enter_hat will attempt to change_hat in the following order:
|
||||||
dcfg->path, (unsigned long) r->next, (unsigned long) r->prev,
|
(1) to a hatname in a location directive
|
||||||
(unsigned long) r->main);
|
(2) to the server name or a defined per-server default
|
||||||
|
(3) to the server name + "-" + uri
|
||||||
|
(4) to the uri
|
||||||
|
(5) to DEFAULT_URI
|
||||||
|
(6) back to the parent profile
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
aa_enter_hat(request_rec *r)
|
||||||
|
{
|
||||||
|
int aa_ret = -1;
|
||||||
|
apparmor_dir_cfg *dcfg = (apparmor_dir_cfg *)
|
||||||
|
ap_get_module_config(r->per_dir_config, &apparmor_module);
|
||||||
|
apparmor_srv_cfg *scfg = (apparmor_srv_cfg *)
|
||||||
|
ap_get_module_config(r->server->module_config, &apparmor_module);
|
||||||
|
const char *aa_hat_array[6] = { NULL, NULL, NULL, NULL, NULL, NULL };
|
||||||
|
int i = 0;
|
||||||
|
char *aa_con, *aa_mode, *aa_hat;
|
||||||
|
const char *vhost_uri;
|
||||||
|
|
||||||
|
debug_dump_uri(r);
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "aa_enter_hat (%s) n:0x%lx p:0x%lx main:0x%lx",
|
||||||
|
dcfg->path, (unsigned long) r->next, (unsigned long) r->prev,
|
||||||
|
(unsigned long) r->main);
|
||||||
|
|
||||||
/* We only call change_hat for the main request, not subrequests */
|
/* We only call change_hat for the main request, not subrequests */
|
||||||
if (r->main)
|
if (r->main)
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
if (inside_default_hat) {
|
if (inside_default_hat) {
|
||||||
change_hat (NULL, magic_token);
|
aa_change_hat(NULL, magic_token);
|
||||||
inside_default_hat = 0;
|
inside_default_hat = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dcfg != NULL && dcfg->hat_name != NULL) {
|
if (dcfg != NULL && dcfg->hat_name != NULL) {
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "calling change_hat [dcfg] %s", dcfg->hat_name);
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
sd_ret = change_hat (dcfg->hat_name, magic_token);
|
"[dcfg] adding hat '%s' to aa_change_hat vector", dcfg->hat_name);
|
||||||
if (sd_ret < 0) {
|
aa_hat_array[i++] = dcfg->hat_name;
|
||||||
change_hat (NULL, magic_token);
|
|
||||||
} else {
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "calling change_hat [uri] %s", r->uri);
|
if (scfg) {
|
||||||
sd_ret = change_hat (r->uri, magic_token);
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "Dumping scfg info: "
|
||||||
if (sd_ret < 0) {
|
"scfg='0x%lx' scfg->hat_name='%s'",
|
||||||
change_hat (NULL, magic_token);
|
(unsigned long) scfg, scfg->hat_name);
|
||||||
} else {
|
} else {
|
||||||
return OK;
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "scfg is null");
|
||||||
|
}
|
||||||
|
if (scfg != NULL) {
|
||||||
|
if (scfg->hat_name != NULL) {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
|
"[scfg] adding hat '%s' to aa_change_hat vector", scfg->hat_name);
|
||||||
|
aa_hat_array[i++] = scfg->hat_name;
|
||||||
|
} else {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
|
"[scfg] adding server_name '%s' to aa_change_hat vector",
|
||||||
|
r->server->server_hostname);
|
||||||
|
aa_hat_array[i++] = r->server->server_hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
vhost_uri = apr_pstrcat(r->pool, r->server->server_hostname, "-", r->uri, NULL);
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
|
"[vhost+uri] adding vhost+uri '%s' to aa_change_hat vector", vhost_uri);
|
||||||
|
aa_hat_array[i++] = vhost_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scfg != NULL && scfg->hat_name != NULL) {
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "calling change_hat [scfg] %s", scfg->hat_name);
|
"[uri] adding uri '%s' to aa_change_hat vector", r->uri);
|
||||||
sd_ret = change_hat (scfg->hat_name, magic_token);
|
aa_hat_array[i++] = r->uri;
|
||||||
if (sd_ret < 0) {
|
|
||||||
change_hat (NULL, magic_token);
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
} else {
|
"[default] adding '%s' to aa_change_hat vector", DEFAULT_URI_HAT);
|
||||||
return OK;
|
aa_hat_array[i++] = DEFAULT_URI_HAT;
|
||||||
}
|
|
||||||
|
aa_ret = aa_change_hatv(aa_hat_array, magic_token);
|
||||||
|
if (aa_ret < 0) {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_WARNING, errno, r, "aa_change_hatv call failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "calling change_hat DEFAULT_URI");
|
/* Check to see if a defined AAHatName or AADefaultHatName would
|
||||||
sd_ret = change_hat (DEFAULT_URI_HAT, magic_token);
|
* apply, but wasn't the hat we landed up in; report a warning if
|
||||||
if (sd_ret < 0) change_hat (NULL, magic_token);
|
* that's the case. */
|
||||||
|
aa_ret = aa_getcon(&aa_con, &aa_mode);
|
||||||
|
if (aa_ret < 0) {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_WARNING, errno, r, "aa_getcon call failed");
|
||||||
|
} else {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
|
||||||
|
"AA checks: aa_getcon result is '%s', mode '%s'", aa_con, aa_mode);
|
||||||
|
/* TODO: use libapparmor get hat_name fn here once it is implemented */
|
||||||
|
aa_hat = strstr(aa_con, "//");
|
||||||
|
if (aa_hat != NULL && strcmp(aa_mode, "enforce") == 0) {
|
||||||
|
aa_hat += 2; /* skip "//" */
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
|
||||||
|
"AA checks: apache is in hat '%s', mode '%s'", aa_hat, aa_mode);
|
||||||
|
if (dcfg != NULL && dcfg->hat_name != NULL) {
|
||||||
|
if (strcmp(aa_hat, dcfg->hat_name) != 0)
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
|
||||||
|
"AAHatName '%s' applies, but does not appear to be a hat in the apache apparmor policy",
|
||||||
|
dcfg->hat_name);
|
||||||
|
} else if (scfg != NULL && scfg->hat_name != NULL) {
|
||||||
|
if (strcmp(aa_hat, scfg->hat_name) != 0 &&
|
||||||
|
strcmp(aa_hat, r->uri) != 0)
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
|
||||||
|
"AADefaultHatName '%s' applies, but does not appear to be a hat in the apache apparmor policy",
|
||||||
|
scfg->hat_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(aa_con);
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
immunix_exit_hat (request_rec *r)
|
aa_exit_hat(request_rec *r)
|
||||||
{
|
{
|
||||||
int sd_ret;
|
int aa_ret;
|
||||||
immunix_dir_cfg * dcfg = (immunix_dir_cfg *)
|
apparmor_dir_cfg *dcfg = (apparmor_dir_cfg *)
|
||||||
ap_get_module_config (r->per_dir_config, &apparmor_module);
|
ap_get_module_config(r->per_dir_config, &apparmor_module);
|
||||||
/* immunix_srv_cfg * scfg = (immunix_srv_cfg *)
|
/* apparmor_srv_cfg *scfg = (apparmor_srv_cfg *)
|
||||||
ap_get_module_config (r->server->module_config, &apparmor_module); */
|
ap_get_module_config(r->server->module_config, &apparmor_module); */
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "exiting change_hat - dir hat %s path %s", dcfg->hat_name, dcfg->path);
|
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "exiting change_hat: dir hat %s dir path %s",
|
||||||
change_hat (NULL, magic_token);
|
dcfg->hat_name, dcfg->path);
|
||||||
|
|
||||||
sd_ret = change_hat (DEFAULT_HAT, magic_token);
|
/* can convert the following back to aa_change_hat() when the
|
||||||
if (sd_ret < 0) {
|
* aa_change_hat() bug addressed in trunk commit 2329 lands in most
|
||||||
change_hat (NULL, magic_token);
|
* system libapparmors */
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Failed to change_hat to '%s'",
|
aa_change_hatv(NULL, magic_token);
|
||||||
DEFAULT_HAT);
|
|
||||||
|
aa_ret = aa_change_hat(DEFAULT_HAT, magic_token);
|
||||||
|
if (aa_ret < 0) {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
|
"Failed to change_hat to '%s'", DEFAULT_HAT);
|
||||||
} else {
|
} else {
|
||||||
inside_default_hat = 1;
|
inside_default_hat = 1;
|
||||||
}
|
}
|
||||||
@@ -207,15 +260,15 @@ immunix_exit_hat (request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
aa_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
aa_cmd_ch_path(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "config change hat %s",
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, "directory config change hat %s",
|
||||||
parm1 ? parm1 : "DEFAULT");
|
parm1 ? parm1 : "DEFAULT");
|
||||||
immunix_dir_cfg * dcfg = mconfig;
|
apparmor_dir_cfg *dcfg = mconfig;
|
||||||
if (parm1 != NULL) {
|
if (parm1 != NULL) {
|
||||||
dcfg->hat_name = parm1;
|
dcfg->hat_name = parm1;
|
||||||
} else {
|
} else {
|
||||||
dcfg->hat_name = "DEFAULT";
|
dcfg->hat_name = "DEFAULT";
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -223,26 +276,27 @@ aa_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
|||||||
static int path_warn_once;
|
static int path_warn_once;
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
immunix_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
immunix_cmd_ch_path(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
if (path_warn_once == 0) {
|
if (path_warn_once == 0) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, "ImmHatName is "
|
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "ImmHatName is "
|
||||||
"deprecated, please use AAHatName instead");
|
"deprecated, please use AAHatName instead");
|
||||||
path_warn_once = 1;
|
path_warn_once = 1;
|
||||||
}
|
}
|
||||||
return aa_cmd_ch_path(cmd, mconfig, parm1);
|
return aa_cmd_ch_path(cmd, mconfig, parm1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
aa_cmd_ch_srv (cmd_parms * cmd, void * mconfig, const char * parm1)
|
aa_cmd_ch_srv(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "config change hat %s",
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, "server config change hat %s",
|
||||||
parm1 ? parm1 : "DEFAULT");
|
parm1 ? parm1 : "DEFAULT");
|
||||||
immunix_srv_cfg * scfg = mconfig;
|
apparmor_srv_cfg *scfg = (apparmor_srv_cfg *)
|
||||||
|
ap_get_module_config(cmd->server->module_config, &apparmor_module);
|
||||||
if (parm1 != NULL) {
|
if (parm1 != NULL) {
|
||||||
scfg->hat_name = parm1;
|
scfg->hat_name = parm1;
|
||||||
} else {
|
} else {
|
||||||
scfg->hat_name = "DEFAULT";
|
scfg->hat_name = "DEFAULT";
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -250,27 +304,29 @@ aa_cmd_ch_srv (cmd_parms * cmd, void * mconfig, const char * parm1)
|
|||||||
static int srv_warn_once;
|
static int srv_warn_once;
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
immunix_cmd_ch_srv (cmd_parms * cmd, void * mconfig, const char * parm1)
|
immunix_cmd_ch_srv(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
if (srv_warn_once == 0) {
|
if (srv_warn_once == 0) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, "ImmDefaultHatName is "
|
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "ImmDefaultHatName is "
|
||||||
"deprecated, please use AADefaultHatName instead");
|
"deprecated, please use AADefaultHatName instead");
|
||||||
srv_warn_once = 1;
|
srv_warn_once = 1;
|
||||||
}
|
}
|
||||||
return aa_cmd_ch_srv(cmd, mconfig, parm1);
|
return aa_cmd_ch_srv(cmd, mconfig, parm1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
immunix_create_dir_config (apr_pool_t * p, char * path)
|
aa_create_dir_config(apr_pool_t *p, char *path)
|
||||||
{
|
{
|
||||||
immunix_dir_cfg * newcfg = (immunix_dir_cfg *) apr_pcalloc(p, sizeof(* newcfg));
|
apparmor_dir_cfg *newcfg = (apparmor_dir_cfg *) apr_pcalloc(p, sizeof(*newcfg));
|
||||||
|
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "in immunix_create_dir (%s)", path ? path : ":no path:");
|
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
|
||||||
|
"aa_create_dir_cfg (%s)", path ? path : ":no path:");
|
||||||
if (newcfg == NULL) {
|
if (newcfg == NULL) {
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "immunix_create_dir: couldn't alloc dir config");
|
ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf,
|
||||||
return NULL;
|
"aa_create_dir_config: couldn't alloc dir config");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
newcfg->path = apr_pstrdup (p, path ? path : ":no path:");
|
newcfg->path = apr_pstrdup(p, path ? path : ":no path:");
|
||||||
|
|
||||||
return newcfg;
|
return newcfg;
|
||||||
}
|
}
|
||||||
@@ -278,83 +334,85 @@ immunix_create_dir_config (apr_pool_t * p, char * path)
|
|||||||
/* XXX: Should figure out an appropriate action to take here, if any
|
/* XXX: Should figure out an appropriate action to take here, if any
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
immunix_merge_dir_config (apr_pool_t * p, void * parent, void * child)
|
aa_merge_dir_config(apr_pool_t *p, void *parent, void *child)
|
||||||
{
|
{
|
||||||
immunix_dir_cfg * newcfg = (immunix_dir_cfg *) apr_pcalloc(p, sizeof(* newcfg));
|
apparmor_dir_cfg *newcfg = (apparmor_dir_cfg *) apr_pcalloc(p, sizeof(*newcfg));
|
||||||
|
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "in immunix_merge_dir ()");
|
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf, "in immunix_merge_dir ()");
|
||||||
if (newcfg == NULL)
|
if (newcfg == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return newcfg;
|
return newcfg;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
immunix_create_srv_config (apr_pool_t * p, server_rec * srv)
|
aa_create_srv_config(apr_pool_t *p, server_rec *srv)
|
||||||
{
|
{
|
||||||
immunix_srv_cfg * newcfg = (immunix_srv_cfg *) apr_pcalloc(p, sizeof(* newcfg));
|
apparmor_srv_cfg *newcfg = (apparmor_srv_cfg *) apr_pcalloc(p, sizeof(*newcfg));
|
||||||
|
|
||||||
ap_log_error (APLOG_MARK, APLOG_DEBUG, 0, NULL, "in immunix_create_srv");
|
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
|
||||||
|
"in aa_create_srv_config");
|
||||||
if (newcfg == NULL) {
|
if (newcfg == NULL) {
|
||||||
ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "immunix_create_srv: couldn't alloc srv config");
|
ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf,
|
||||||
return NULL;
|
"aa_create_srv_config: couldn't alloc srv config");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return newcfg;
|
return newcfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const command_rec immunix_cmds[] = {
|
static const command_rec mod_apparmor_cmds[] = {
|
||||||
|
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"ImmHatName",
|
"ImmHatName",
|
||||||
immunix_cmd_ch_path,
|
immunix_cmd_ch_path,
|
||||||
NULL,
|
NULL,
|
||||||
ACCESS_CONF,
|
ACCESS_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"ImmDefaultHatName",
|
"ImmDefaultHatName",
|
||||||
immunix_cmd_ch_srv,
|
immunix_cmd_ch_srv,
|
||||||
NULL,
|
NULL,
|
||||||
RSRC_CONF,
|
RSRC_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"AAHatName",
|
"AAHatName",
|
||||||
aa_cmd_ch_path,
|
aa_cmd_ch_path,
|
||||||
NULL,
|
NULL,
|
||||||
ACCESS_CONF,
|
ACCESS_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"AADefaultHatName",
|
"AADefaultHatName",
|
||||||
aa_cmd_ch_srv,
|
aa_cmd_ch_srv,
|
||||||
NULL,
|
NULL,
|
||||||
RSRC_CONF,
|
RSRC_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
register_hooks (apr_pool_t *p)
|
register_hooks(apr_pool_t *p)
|
||||||
{
|
{
|
||||||
ap_hook_post_config (immunix_init, NULL, NULL, APR_HOOK_MIDDLE);
|
ap_hook_post_config(aa_init, NULL, NULL, APR_HOOK_MIDDLE);
|
||||||
ap_hook_child_init (immunix_child_init, NULL, NULL, APR_HOOK_MIDDLE);
|
ap_hook_child_init(aa_child_init, NULL, NULL, APR_HOOK_MIDDLE);
|
||||||
ap_hook_access_checker(immunix_enter_hat, NULL, NULL, APR_HOOK_FIRST);
|
ap_hook_access_checker(aa_enter_hat, NULL, NULL, APR_HOOK_FIRST);
|
||||||
/* ap_hook_post_read_request(immunix_enter_hat, NULL, NULL, APR_HOOK_FIRST); */
|
/* ap_hook_post_read_request(aa_enter_hat, NULL, NULL, APR_HOOK_FIRST); */
|
||||||
ap_hook_log_transaction(immunix_exit_hat, NULL, NULL, APR_HOOK_LAST);
|
ap_hook_log_transaction(aa_exit_hat, NULL, NULL, APR_HOOK_LAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
module AP_MODULE_DECLARE_DATA apparmor_module = {
|
module AP_MODULE_DECLARE_DATA apparmor_module = {
|
||||||
STANDARD20_MODULE_STUFF,
|
STANDARD20_MODULE_STUFF,
|
||||||
immunix_create_dir_config, /* dir config creater */
|
aa_create_dir_config, /* dir config creater */
|
||||||
NULL, /* dir merger --- default is to override */
|
NULL, /* dir merger --- default is to override */
|
||||||
/* immunix_merge_dir_config, */ /* dir merger --- default is to override */
|
/* immunix_merge_dir_config, */ /* dir merger --- default is to override */
|
||||||
immunix_create_srv_config, /* server config */
|
aa_create_srv_config, /* server config */
|
||||||
NULL, /* merge server config */
|
NULL, /* merge server config */
|
||||||
immunix_cmds, /* command table */
|
mod_apparmor_cmds, /* command table */
|
||||||
register_hooks /* register hooks */
|
register_hooks /* register hooks */
|
||||||
};
|
};
|
||||||
|
@@ -1,96 +1,145 @@
|
|||||||
# $Id$
|
# This publication is intellectual property of Novell Inc. and Canonical
|
||||||
# This publication is intellectual property of Novell Inc. Its contents
|
# Ltd. Its contents can be duplicated, either in part or in whole, provided
|
||||||
# can be duplicated, either in part or in whole, provided that a copyright
|
# that a copyright label is visibly located on each copy.
|
||||||
# label is visibly located on each copy.
|
|
||||||
#
|
#
|
||||||
# All information found in this book has been compiled with utmost
|
# All information found in this book has been compiled with utmost
|
||||||
# attention to detail. However, this does not guarantee complete accuracy.
|
# attention to detail. However, this does not guarantee complete accuracy.
|
||||||
# Neither SUSE LINUX GmbH, the authors, nor the translators shall be held
|
# Neither SUSE LINUX GmbH, Canonical Ltd, the authors, nor the translators
|
||||||
# liable for possible errors or the consequences thereof.
|
# shall be held liable for possible errors or the consequences thereof.
|
||||||
#
|
#
|
||||||
# Many of the software and hardware descriptions cited in this book
|
# Many of the software and hardware descriptions cited in this book
|
||||||
# are registered trademarks. All trade names are subject to copyright
|
# are registered trademarks. All trade names are subject to copyright
|
||||||
# restrictions and may be registered trade marks. SUSE LINUX GmbH
|
# restrictions and may be registered trade marks. SUSE LINUX GmbH
|
||||||
# essentially adheres to the manufacturer's spelling.
|
# and Canonical Ltd. essentially adhere to the manufacturer's spelling.
|
||||||
#
|
#
|
||||||
# Names of products and trademarks appearing in this book (with or without
|
# Names of products and trademarks appearing in this book (with or without
|
||||||
# specific notation) are likewise subject to trademark and trade protection
|
# specific notation) are likewise subject to trademark and trade protection
|
||||||
# laws and may thus fall under copyright restrictions.
|
# laws and may thus fall under copyright restrictions.
|
||||||
#
|
#
|
||||||
# Please direct suggestions and comments to apparmor-general@forge.novell.com.
|
|
||||||
|
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
mod_apparmor - fine-grained AppArmor confinement for apache
|
mod_apparmor - fine-grained AppArmor confinement for Apache
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
An AppArmor profile applies to an executable program; if a portion of
|
An AppArmor profile applies to an executable program; if a portion of
|
||||||
the program needs different access permissions than other portions,
|
the program needs different access permissions than other portions,
|
||||||
the program can "change hats" via change_hat(2) to a different role,
|
the program can "change hats" via aa_change_hat(2) to a different role,
|
||||||
also known as a subprofile. The mod_apparmor apache module uses the
|
also known as a subprofile. The mod_apparmor Apache module uses the
|
||||||
change_hat(2) mechanism to offer more fine-grained confinement of dynamic
|
aa_change_hat(2) mechanism to offer more fine-grained confinement of dynamic
|
||||||
elements within apache such as individual php and perl scripts, while
|
elements within Apache such as individual php and perl scripts, while
|
||||||
still allowing the performance benefits of using mod_php and mod_perl.
|
still allowing the performance benefits of using mod_php and mod_perl.
|
||||||
|
|
||||||
To use mod_apparmor with apache, ensure that mod_apparmor is configured to
|
To use mod_apparmor with Apache, ensure that mod_apparmor is configured to
|
||||||
be loaded into apache, either via yast or manual editing of the httpd(8)
|
be loaded into Apache, either via a2enmod, yast or manual editing of the
|
||||||
configuration files, and restart apache. Make sure that apparmor is also
|
apache2(8)/httpd(8) configuration files, and restart Apache. Make sure that
|
||||||
functioning.
|
apparmor is also functioning.
|
||||||
|
|
||||||
Once mod_apparmor is loaded within apache, all requests to apache will
|
Once mod_apparmor is loaded within Apache, all requests to Apache will
|
||||||
cause mod_apparmor to attempt to change into a hat named by the URI
|
cause mod_apparmor to attempt to change into a hat that matches the
|
||||||
(e.g. /app/some.cgi). If no such hat is found, it will fall back to
|
ServerName for the server/vhost. If no such hat is found, it will
|
||||||
attempting to use the hat DEFAULT_URI; if that also does not exist,
|
first fall back by attempting to change into a hat composed of the
|
||||||
it will fall back to using the global apache profile. Most static web
|
ServerName-URI (e.g. "www.example.com-/app/some.cgi"). If that hat
|
||||||
pages can simply make use of the DEFAULT_URI hat.
|
is not found, it will fall back to attempting to use the hat named
|
||||||
|
by the URI (e.g. "/app/some.cgi"). If that hat is not found, it will
|
||||||
|
fall back to attempting to use the hat DEFAULT_URI; if that also does
|
||||||
|
not exist, it will fall back to using the global Apache profile. Most
|
||||||
|
static web pages can simply make use of the DEFAULT_URI hat.
|
||||||
|
|
||||||
However, defining hats for every URI/URL would become tedious, so there
|
Additionally, before any requests come in to Apache, mod_apparmor
|
||||||
are a couple of configuration options that mod_apparmor supports:
|
will attempt to change hat into the HANDLING_UNTRUSTED_INPUT hat.
|
||||||
|
mod_apparmor will attempt to use this hat while Apache is doing the
|
||||||
|
initial parsing of a given http request, before its given to a specific
|
||||||
|
handler (like mod_php) for processing.
|
||||||
|
|
||||||
|
Because defining hats for every URI/URL often becomes tedious, mod_apparmor
|
||||||
|
provides the AAHatName and AADefaultHatName Apache configuration options.
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
|
|
||||||
=item B<AAHatName>
|
=item B<AAHatName>
|
||||||
|
|
||||||
AAHatName allows you to specify a hat to be used for a given apache
|
AAHatName allows you to specify a hat to be used for a given Apache
|
||||||
directory or location directive (see the apache documenation for more
|
E<lt>DirectoryE<gt>, E<lt>DirectoryMatchE<gt>, E<lt>LocationE<gt> or
|
||||||
|
E<lt>LocationMatchE<gt> directive (see the Apache documenation for more
|
||||||
details). Note that mod_apparmor behavior can become confused if
|
details). Note that mod_apparmor behavior can become confused if
|
||||||
directory and location directives are intermingled; it's preferred to
|
E<lt>Directory*E<gt> and E<lt>Location*E<gt> directives are intermingled
|
||||||
stick to one type of directive. If the hat specified by AAHatName does
|
and it is recommended to use one type of directive. If the hat specified by
|
||||||
not exist in the apache profile, then it falls back to the behavior
|
AAHatName does not exist in the Apache profile, then it falls back to the
|
||||||
above.
|
behavior described above.
|
||||||
|
|
||||||
=item B<AADefaultHatName>
|
=item B<AADefaultHatName>
|
||||||
|
|
||||||
AADefaultHatName allows you to specify a default hat to be used for
|
AADefaultHatName allows you to specify a default hat to be used for
|
||||||
vhosts and other apache server directives, so that you can have
|
virtual hosts and other Apache server directives, so that you can have
|
||||||
different defaults for different virtual hosts. This can be overridden
|
different defaults for different virtual hosts. This can be overridden
|
||||||
by an AAHatName directive. If the AADefaultHatName hat does not exist,
|
by the AAHatName directive and is checked for only if there isn't
|
||||||
it falls back to the behavior described above.
|
a matching AAHatName. The default value of AADefaultHatName is the
|
||||||
|
ServerName for the server/vhost configuration. If the AADefaultHatName
|
||||||
|
hat does not exist, then it falls back to the behavior described above.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
Additionally, before any requests come in to apache, mod_apparmor
|
=head1 URI REQUEST SUMMARY
|
||||||
will attempt to change hat into the HANDLING_UNTRUSTED_INPUT hat.
|
|
||||||
mod_apparmor will attempt to use this hat while apache is doing the
|
When profiling with mod_apparmor, it is helpful to keep the following order
|
||||||
initial parsing of a given http request, before its given to a specific
|
of operations in mind:
|
||||||
handler (like mod_php) for processing.
|
|
||||||
|
On each URI request, mod_apparmor will first aa_change_hat(2) into
|
||||||
|
^HANDLING_UNTRUSTED_INPUT, if it exists.
|
||||||
|
|
||||||
|
Then, after performing the initial parsing of the request, mod_apparmor
|
||||||
|
will:
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item 1
|
||||||
|
|
||||||
|
try to aa_change_hat(2) into a matching AAHatName hat if it exists and
|
||||||
|
applies, otherwise it will
|
||||||
|
|
||||||
|
=item 2
|
||||||
|
|
||||||
|
try to aa_change_hat(2) into an AADefaultHatName hat, either the
|
||||||
|
ServerName (the default) or the configuration value specified by the
|
||||||
|
AADefaultHatName directive, for the server/vhost, otherwise it will
|
||||||
|
|
||||||
|
=item 3
|
||||||
|
|
||||||
|
try to aa_change_hat(2) into the ServerName-URI, otherwise it will
|
||||||
|
|
||||||
|
=item 4
|
||||||
|
|
||||||
|
try to aa_change_hat(2) into the URI itself, otherwise it will
|
||||||
|
|
||||||
|
=item 5
|
||||||
|
|
||||||
|
try to aa_change_hat(2) into the DEFAULT_URI hat, if it exists, otherwise it
|
||||||
|
will
|
||||||
|
|
||||||
|
=item 6
|
||||||
|
|
||||||
|
fall back to the global Apache policy
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=head1 BUGS
|
=head1 BUGS
|
||||||
|
|
||||||
mod_apparmor() currently only supports apache2, and has only been tested
|
mod_apparmor() currently only supports apache2, and has only been tested
|
||||||
with the prefork MPM configuration -- threaded configurations of apache
|
with the prefork MPM configuration -- threaded configurations of Apache
|
||||||
may not work correctly.
|
may not work correctly. For Apache 2.4 users, you should enable the mpm_prefork
|
||||||
|
module.
|
||||||
|
|
||||||
There are likely other bugs lurking about; if you find any, please report
|
There are likely other bugs lurking about; if you find any, please report
|
||||||
them to bugzilla at L<http://bugzilla.novell.com>.
|
them at L<https://bugs.launchpad.net/apparmor/+filebug>.
|
||||||
|
|
||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), subdomain.conf(5), apparmor_parser(8), and
|
apparmor(7), subdomain.conf(5), apparmor_parser(8), aa_change_hat(2) and
|
||||||
L<http://forge.novell.com/modules/xfmod/project/?apparmor>.
|
L<http://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
# $Id$
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 1999, 2004, 2005 NOVELL (All rights reserved)
|
# Copyright (c) 1999, 2004, 2005 NOVELL (All rights reserved)
|
||||||
#
|
#
|
||||||
@@ -27,12 +26,50 @@ common/Make.rules: $(COMMONDIR)/Make.rules
|
|||||||
ln -sf $(COMMONDIR) .
|
ln -sf $(COMMONDIR) .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_CFLAGS=$(CFLAGS) -fPIC -shared -Wall
|
ifdef USE_SYSTEM
|
||||||
LINK_FLAGS=-Xlinker -x
|
LIBAPPARMOR = $(shell if pkg-config --exists libapparmor ; then \
|
||||||
LIBS=-lpam -lapparmor
|
pkg-config --silence-errors --libs libapparmor ; \
|
||||||
|
elif ldconfig -p | grep -q libapparmor\.so$$ ; then \
|
||||||
|
echo -lapparmor ; \
|
||||||
|
fi )
|
||||||
|
ifeq ($(strip $(LIBAPPARMOR)),)
|
||||||
|
ERROR_MESSAGE = $(error ${nl}\
|
||||||
|
************************************************************************${nl}\
|
||||||
|
Unable to find libapparmor installed on this system; either${nl}\
|
||||||
|
install libapparmor devel packages, set the LIBAPPARMOR variable${nl}\
|
||||||
|
manually, or build against in-tree libapparmor.${nl}\
|
||||||
|
************************************************************************${nl})
|
||||||
|
endif
|
||||||
|
LIBAPPARMOR_INCLUDE =
|
||||||
|
AA_LDLIBS = $(LIBAPPARMOR)
|
||||||
|
AA_LINK_FLAGS =
|
||||||
|
else
|
||||||
|
LIBAPPARMOR_SRC := ../../libraries/libapparmor/
|
||||||
|
LIBAPPARMOR_INCLUDE_PATH = $(LIBAPPARMOR_SRC)/include
|
||||||
|
LIBAPPARMOR_PATH := $(LIBAPPARMOR_SRC)/src/.libs/
|
||||||
|
ifeq ($(realpath $(LIBAPPARMOR_PATH)/libapparmor.a),)
|
||||||
|
ERROR_MESSAGE = $(error ${nl}\
|
||||||
|
************************************************************************${nl}\
|
||||||
|
$(LIBAPPARMOR_PATH)/libapparmor.a is missing; either build against${nl}\
|
||||||
|
the in-tree libapparmor by building it first and then trying again${nl}\
|
||||||
|
(see the top-level README for help) or build against the system${nl}\
|
||||||
|
libapparmor by adding USE_SYSTEM=1 to your make command.${nl}\
|
||||||
|
************************************************************************${nl})
|
||||||
|
endif
|
||||||
|
LIBAPPARMOR_INCLUDE = -I$(LIBAPPARMOR_INCLUDE_PATH)
|
||||||
|
AA_LINK_FLAGS = -L$(LIBAPPARMOR_PATH)
|
||||||
|
AA_LDLIBS = -lapparmor
|
||||||
|
endif
|
||||||
|
EXTRA_CFLAGS=$(CFLAGS) $(CPPFLAGS) -fPIC -shared -Wall $(LIBAPPARMOR_INCLUDE)
|
||||||
|
LINK_FLAGS=-Xlinker -x $(AA_LINK_FLAGS)
|
||||||
|
LIBS=-lpam $(AA_LDLIBS)
|
||||||
OBJECTS=${NAME}.o get_options.o
|
OBJECTS=${NAME}.o get_options.o
|
||||||
|
|
||||||
all: $(NAME).so
|
.PHONY: libapparmor_check
|
||||||
|
.SILENT: libapparmor_check
|
||||||
|
libapparmor_check: ; $(ERROR_MESSAGE)
|
||||||
|
|
||||||
|
all: libapparmor_check $(NAME).so
|
||||||
|
|
||||||
$(NAME).so: ${OBJECTS}
|
$(NAME).so: ${OBJECTS}
|
||||||
$(CC) $(EXTRA_CFLAGS) $(LINK_FLAGS) -o $@ ${OBJECTS} $(LIBS)
|
$(CC) $(EXTRA_CFLAGS) $(LINK_FLAGS) -o $@ ${OBJECTS} $(LIBS)
|
||||||
@@ -42,7 +79,7 @@ $(NAME).so: ${OBJECTS}
|
|||||||
|
|
||||||
# need some better way of determining this
|
# need some better way of determining this
|
||||||
DESTDIR=/
|
DESTDIR=/
|
||||||
SECDIR=${DESTDIR}/lib/security
|
SECDIR ?= ${DESTDIR}/lib/security
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: $(NAME).so
|
install: $(NAME).so
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Written by Steve Beattie <sbeattie@suse.de> 2006/10/25
|
* Written by Steve Beattie <sbeattie@suse.de> 2006/10/25
|
||||||
*
|
*
|
||||||
* Modeled after the option parsing code in pam_unix2 by:
|
* Modeled after the option parsing code in pam_unix2 by:
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
/* pam_apparmor module */
|
/* pam_apparmor module */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id$
|
* Copyright (c) 2006
|
||||||
|
* NOVELL (All rights reserved)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010
|
||||||
|
* Canonical, Ltd. (All rights reserved)
|
||||||
*
|
*
|
||||||
* Written by Jesse Michael <jmichael@suse.de> 2006/08/24
|
* Written by Jesse Michael <jmichael@suse.de> 2006/08/24
|
||||||
* and Steve Beattie <sbeattie@suse.de> 2006/10/25
|
* and Steve Beattie <sbeattie@ubuntu.com> 2006/10/25
|
||||||
*
|
*
|
||||||
* Based off of pam_motd by:
|
* Based off of pam_motd by:
|
||||||
* Ben Collins <bcollins@debian.org> 2005/10/04
|
* Ben Collins <bcollins@debian.org> 2005/10/04
|
||||||
@@ -107,6 +111,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
|
|||||||
sizeof(magic_token));
|
sizeof(magic_token));
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
pam_syslog(pamh, LOG_ERR, "Can't read from /dev/urandom\n");
|
pam_syslog(pamh, LOG_ERR, "Can't read from /dev/urandom\n");
|
||||||
|
close(fd);
|
||||||
return PAM_PERM_DENIED;
|
return PAM_PERM_DENIED;
|
||||||
}
|
}
|
||||||
} while ((magic_token == 0) || (retval != sizeof(magic_token)));
|
} while ((magic_token == 0) || (retval != sizeof(magic_token)));
|
||||||
@@ -165,8 +170,8 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
|
|||||||
* stop attempting to use change_hat */
|
* stop attempting to use change_hat */
|
||||||
goto nodefault;
|
goto nodefault;
|
||||||
break;
|
break;
|
||||||
case EPERM: /* Disable when ECHILD patch gets accepted */
|
|
||||||
case EACCES:
|
case EACCES:
|
||||||
|
case ENOENT:
|
||||||
/* failed to change into attempted hat, so we'll
|
/* failed to change into attempted hat, so we'll
|
||||||
* jump back out and try the next one */
|
* jump back out and try the next one */
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
/* pam_apparmor module */
|
/* pam_apparmor module */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Written by Jesse Michael <jmichael@suse.de> 2006/08/24
|
* Written by Jesse Michael <jmichael@suse.de> 2006/08/24
|
||||||
* and Steve Beattie <sbeattie@suse.de> 2006/10/25
|
* and Steve Beattie <sbeattie@suse.de> 2006/10/25
|
||||||
*
|
*
|
||||||
|
@@ -1,83 +0,0 @@
|
|||||||
#
|
|
||||||
# spec file for package pam_apparmor (Version 2)
|
|
||||||
#
|
|
||||||
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
||||||
# This file and all modifications and additions to the pristine
|
|
||||||
# package are under the same license as the package itself.
|
|
||||||
#
|
|
||||||
# Please submit bugfixes or comments via http://www.suse.de/feedback/
|
|
||||||
#
|
|
||||||
|
|
||||||
# norootforbuild
|
|
||||||
|
|
||||||
Name: pam_apparmor
|
|
||||||
License: GPL
|
|
||||||
Group: Productivity/Security
|
|
||||||
Autoreqprov: on
|
|
||||||
Version: @@immunix_version@@
|
|
||||||
Release: @@repo_version@@
|
|
||||||
Summary: Pam module to add AppArmor change_hat functionality
|
|
||||||
URL: http://forge.novell.com/modules/xfmod/project/?apparmor
|
|
||||||
Source: pam_apparmor-%{version}-@@repo_version@@.tar.gz
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
||||||
BuildRequires: pam-devel
|
|
||||||
Requires: pam
|
|
||||||
Prereq: pam
|
|
||||||
|
|
||||||
%if %{?suse_version:1}0
|
|
||||||
%if 0%{?suse_version} < 1030
|
|
||||||
BuildRequires: libapparmor
|
|
||||||
%else
|
|
||||||
BuildRequires: libapparmor-devel
|
|
||||||
%endif
|
|
||||||
%else
|
|
||||||
BuildRequires: libapparmor-devel
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
|
||||||
The pam_apparmor module provides the means for any pam applications that
|
|
||||||
call pam_open_session() to automatically perform an AppArmor change_hat
|
|
||||||
operation in order to switch to a user-specific security policy.
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
|
||||||
--------
|
|
||||||
Jesse Michael jmichael@suse.de
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%build
|
|
||||||
make CFLAGS="${RPM_OPT_FLAGS}"
|
|
||||||
|
|
||||||
%install
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
||||||
make install DESTDIR=${RPM_BUILD_ROOT} SECDIR=${RPM_BUILD_ROOT}/%{_lib}/security
|
|
||||||
|
|
||||||
%clean
|
|
||||||
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(444,root,root,755)
|
|
||||||
%doc README COPYING
|
|
||||||
%attr(555,root,root) /%{_lib}/security/pam_apparmor.so
|
|
||||||
|
|
||||||
%changelog -n pam_apparmor
|
|
||||||
* Tue Oct 31 2006 Jesse Michael <jmichael@suse.de>
|
|
||||||
- Add debug option
|
|
||||||
* Tue Oct 31 2006 Steve Beattie <sbeattie@suse.de>
|
|
||||||
- Add configuration options to order attempted hat changes
|
|
||||||
* Wed Oct 25 2006 Steve Beattie <sbeattie@suse.de>
|
|
||||||
- remove auto-editing of pam's common-session
|
|
||||||
- honor RPM's CFLAGS when building
|
|
||||||
- add license (same as Linux PAM package).
|
|
||||||
* Thu Sep 14 2006 Jesse Michael <jmichael@suse.de>
|
|
||||||
- header comment was incorrect
|
|
||||||
- use pam_get_user() instead of pam_get_item()
|
|
||||||
- fix read from urandom if 0
|
|
||||||
* Fri Jan 13 2006 Steve Beattie <sbeattie@suse.de>
|
|
||||||
- Add svn repo number to tarball
|
|
||||||
* Fri Jan 13 2006 Jesse Michael <jmichael@suse.de>
|
|
||||||
- Make magic tokens harder to guess by pulling them from /dev/urandom
|
|
||||||
* Wed Dec 21 2005 - jmichael@suse.de
|
|
||||||
- initial
|
|
@@ -1,4 +1,3 @@
|
|||||||
# $Id: Makefile 10 2006-04-12 20:31:08Z steve-beattie $
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 1999, 2004, 2005, 2006 NOVELL (All rights reserved)
|
# Copyright (c) 1999, 2004, 2005, 2006 NOVELL (All rights reserved)
|
||||||
#
|
#
|
||||||
@@ -38,4 +37,4 @@ clean:
|
|||||||
rm -f tomcat_apparmor.spec ${NAME}-*.tar.gz Make.rules
|
rm -f tomcat_apparmor.spec ${NAME}-*.tar.gz Make.rules
|
||||||
|
|
||||||
install: $(SPECFILE)
|
install: $(SPECFILE)
|
||||||
ant -Dversion=$(VERSION) -Drelease=$(RELEASE) -Dcatalina_home=${CATALINA_HOME} -Dinstall_lib=${LIB} install_jar install_jni
|
ant -Dversion=$(VERSION) -Drelease=$(MAN_RELEASE) -Dcatalina_home=${CATALINA_HOME} -Dinstall_lib=${LIB} install_jar install_jni
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "sys/apparmor.h"
|
#include <sys/apparmor.h>
|
||||||
#include "com_novell_apparmor_JNIChangeHat.h"
|
#include "com_novell_apparmor_JNIChangeHat.h"
|
||||||
|
|
||||||
/* c intermediate lib call for Java -> JNI -> c library execution of the change_hat call */
|
/* c intermediate lib call for Java -> JNI -> c library execution of the change_hat call */
|
||||||
|
@@ -1,86 +0,0 @@
|
|||||||
# $Id:$
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# Copyright (c) 2006 NOVELL (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.
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# norootforbuild
|
|
||||||
|
|
||||||
# Check first to see if distro is already defined.
|
|
||||||
|
|
||||||
%if ! %{?distro:1}0
|
|
||||||
%define distro suse
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
%define CATALINA_HOME /usr/share/tomcat5
|
|
||||||
%endif
|
|
||||||
%define APPARMOR_DOC_DIR /usr/share/doc/packages/apparmor-docs/
|
|
||||||
%define JNI_SO libJNIChangeHat.so
|
|
||||||
%define JAR_FILE changeHatValve.jar
|
|
||||||
|
|
||||||
|
|
||||||
Summary: Tomcat 5 plugin for AppArmor change_hat
|
|
||||||
Name: tomcat_apparmor
|
|
||||||
Version: @@immunix_version@@
|
|
||||||
Release: @@repo_version@@
|
|
||||||
Group: System/Libraries
|
|
||||||
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
|
|
||||||
License: LGPL
|
|
||||||
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
|
|
||||||
Url: http://developer.novell.com/wiki/index.php/Novell_AppArmor
|
|
||||||
Prereq: tomcat5, servletapi5, libapparmor
|
|
||||||
BuildRequires: tomcat5, servletapi5 ant, java, libapparmor, java2-devel-packages, apparmor-docs
|
|
||||||
Provides: tomcat_apparmor
|
|
||||||
|
|
||||||
%description
|
|
||||||
tomcat_apparmor - is a plugin for Apache Tomcat version 5.x that provides
|
|
||||||
support for AppArmor change_hat for creating AppArmor containers that are
|
|
||||||
bound to discrete elements of processing within the Tomcat servlet
|
|
||||||
container. The AppArmor containers, or "hats", can be created for invidual
|
|
||||||
URL processing or per servlet.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%build
|
|
||||||
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
ant -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dtarget=1.4 jar jni_so
|
|
||||||
|
|
||||||
%install
|
|
||||||
ant -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dversion=%{version} -Drelease=%{release} -Dcatalina_home=%{CATALINA_HOME} -Dinstall_root=${RPM_BUILD_ROOT} -Dinstall_lib=%{_lib} install_jar install_jni
|
|
||||||
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
|
|
||||||
install ${RPM_BUILD_DIR}/%{name}-%{version}/README.tomcat_apparmor ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
|
|
||||||
|
|
||||||
%clean
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%{CATALINA_HOME}/server/lib/%{JAR_FILE}
|
|
||||||
/%{_lib}/lib*
|
|
||||||
/%{_libdir}/lib*
|
|
||||||
%{APPARMOR_DOC_DIR}/README.tomcat_apparmor
|
|
||||||
|
|
||||||
%post
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
%postun
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Mon Oct 9 2006 - dreynolds@suse.de
|
|
||||||
- Initial package creation.
|
|
@@ -1,4 +1,3 @@
|
|||||||
# $Id: Makefile 10 2006-04-12 20:31:08Z steve-beattie $
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 1999, 2004, 2005, 2006 NOVELL (All rights reserved)
|
# Copyright (c) 1999, 2004, 2005, 2006 NOVELL (All rights reserved)
|
||||||
#
|
#
|
||||||
@@ -38,4 +37,4 @@ clean:
|
|||||||
rm -f tomcat_apparmor.spec ${NAME}-*.tar.gz Make.rules
|
rm -f tomcat_apparmor.spec ${NAME}-*.tar.gz Make.rules
|
||||||
|
|
||||||
install: $(SPECFILE)
|
install: $(SPECFILE)
|
||||||
ant -Dversion=$(VERSION) -Drelease=$(RELEASE) -Dcatalina_home=${CATALINA_HOME} -Dinstall_lib=${LIB} install_jar install_jni
|
ant -Dversion=$(VERSION) -Drelease=$(MAN_RELEASE) -Dcatalina_home=${CATALINA_HOME} -Dinstall_lib=${LIB} install_jar install_jni
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<property name="jni_src" location="src/jni_src"/>
|
<property name="jni_src" location="src/jni_src"/>
|
||||||
<property name="build" location="build"/>
|
<property name="build" location="build"/>
|
||||||
<property name="install_root" location="/"/>
|
<property name="install_root" location="/"/>
|
||||||
<property name="catalina_home" location="/usr/share/tomcat5"/>
|
<property name="catalina_home" location="/usr/share/tomcat6"/>
|
||||||
<property name="lib" location="lib"/>
|
<property name="lib" location="/usr/share/tomcat6/bin"/>
|
||||||
<property name="install_lib" value="/lib"/>
|
<property name="install_lib" value="/lib"/>
|
||||||
<property name="dist" location="dist"/>
|
<property name="dist" location="dist"/>
|
||||||
<property name="jarfile" location="${dist}/${ant.project.name}.jar"/>
|
<property name="jarfile" location="${dist}/${ant.project.name}.jar"/>
|
||||||
@@ -18,10 +18,11 @@
|
|||||||
<include name="**/*.jar"/>
|
<include name="**/*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
<fileset id="tomcat.jars" dir="${catalina_home}/server/lib">
|
<fileset id="tomcat.jars" dir="${catalina_home}/lib">
|
||||||
<include name="**/*.jar"/>
|
<include name="**/*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset id="servlet.jars" dir="${catalina_home}/common/lib">
|
|
||||||
|
<fileset id="servlet.jars" dir="${catalina_home}/lib">
|
||||||
<include name="**/*.jar"/>
|
<include name="**/*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
@@ -80,9 +81,9 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install_jar" depends="jni_so" description="Install jar file">
|
<target name="install_jar" depends="jni_so" description="Install jar file">
|
||||||
<mkdir dir="${install_root}/${catalina_home}/server/lib/"/>
|
<mkdir dir="${install_root}/${catalina_home}/lib/"/>
|
||||||
<copy file="${jarfile}" tofile="${install_root}/${catalina_home}/server/lib/${ant.project.name}.jar"/>
|
<copy file="${jarfile}" tofile="${install_root}/${catalina_home}/lib/${ant.project.name}.jar"/>
|
||||||
<chmod perm="644" file="${install_root}/${catalina_home}/server/lib/${ant.project.name}.jar"/>
|
<chmod perm="644" file="${install_root}/${catalina_home}/lib/${ant.project.name}.jar"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean" description="Remove build and dist directories">
|
<target name="clean" description="Remove build and dist directories">
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "sys/apparmor.h"
|
#include <sys/apparmor.h>
|
||||||
#include "com_novell_apparmor_JNIChangeHat.h"
|
#include "com_novell_apparmor_JNIChangeHat.h"
|
||||||
|
|
||||||
/* c intermediate lib call for Java -> JNI -> c library execution of the change_hat call */
|
/* c intermediate lib call for Java -> JNI -> c library execution of the change_hat call */
|
||||||
|
@@ -4,7 +4,7 @@ LIB = lib/
|
|||||||
LIBDIR = /usr/${LIB}
|
LIBDIR = /usr/${LIB}
|
||||||
INCLUDE = ${LIBDIR}/jvm/java/include
|
INCLUDE = ${LIBDIR}/jvm/java/include
|
||||||
CFLAGS = -g -O2 -Wall -Wstrict-prototypes -Wl,-soname,$@.${SO_VERS} -pipe -fpic -D_REENTRANT
|
CFLAGS = -g -O2 -Wall -Wstrict-prototypes -Wl,-soname,$@.${SO_VERS} -pipe -fpic -D_REENTRANT
|
||||||
INCLUDES = -I$(INCLUDE) -I$(INCLUDE)/linux
|
INCLUDES = -I$(INCLUDE) -I$(INCLUDE)/linux -I$(TOP)/../../../libraries/libapparmor/src/
|
||||||
CLASSFILE = ${CLASSPATH}/com/novell/apparmor/${JAVA_CLASSNAME}.class
|
CLASSFILE = ${CLASSPATH}/com/novell/apparmor/${JAVA_CLASSNAME}.class
|
||||||
DESTDIR = ${TOP}/dist
|
DESTDIR = ${TOP}/dist
|
||||||
SO_VERS = 1
|
SO_VERS = 1
|
||||||
@@ -20,7 +20,7 @@ ${JAVA_CLASSNAME}.java com_novell_apparmor_${JAVA_CLASSNAME}.h: ${CLASSFILE}
|
|||||||
javah -jni -classpath ${CLASSPATH} com.novell.apparmor.${JAVA_CLASSNAME}
|
javah -jni -classpath ${CLASSPATH} com.novell.apparmor.${JAVA_CLASSNAME}
|
||||||
|
|
||||||
${TARGET}.so: ${JAVA_CLASSNAME}.c ${JAVA_CLASSNAME}.java com_novell_apparmor_${JAVA_CLASSNAME}.h
|
${TARGET}.so: ${JAVA_CLASSNAME}.c ${JAVA_CLASSNAME}.java com_novell_apparmor_${JAVA_CLASSNAME}.h
|
||||||
gcc ${INCLUDES} ${CFLAGS} -shared -o ${TARGET}.so ${JAVA_CLASSNAME}.c -lapparmor
|
gcc ${INCLUDES} ${CFLAGS} -shared -o ${TARGET}.so ${JAVA_CLASSNAME}.c -L$(TOP)/../../../libraries/libapparmor/src/.libs -lapparmor
|
||||||
|
|
||||||
install: ${TARGET}.so
|
install: ${TARGET}.so
|
||||||
install -d $(DESTDIR)/${LIB} $(DESTDIR)${LIBDIR}
|
install -d $(DESTDIR)/${LIB} $(DESTDIR)${LIBDIR}
|
||||||
|
@@ -1,87 +0,0 @@
|
|||||||
# $Id:$
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# Copyright (c) 2006 NOVELL (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.
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# norootforbuild
|
|
||||||
|
|
||||||
# Check first to see if distro is already defined.
|
|
||||||
|
|
||||||
%if ! %{?distro:1}0
|
|
||||||
%define distro suse
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{distro} == "suse"
|
|
||||||
%define CATALINA_HOME /usr/share/tomcat55
|
|
||||||
%endif
|
|
||||||
%define APPARMOR_DOC_DIR /usr/share/doc/packages/apparmor-docs/
|
|
||||||
%define JNI_SO libJNIChangeHat.so
|
|
||||||
%define JAR_FILE changeHatValve.jar
|
|
||||||
|
|
||||||
|
|
||||||
Summary: Tomcat 5 plugin for AppArmor change_hat
|
|
||||||
Name: tomcat_apparmor
|
|
||||||
Version: @@immunix_version@@
|
|
||||||
Release: @@repo_version@@
|
|
||||||
Group: System/Libraries
|
|
||||||
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
|
|
||||||
License: LGPL
|
|
||||||
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
|
|
||||||
Url: http://developer.novell.com/wiki/index.php/Novell_AppArmor
|
|
||||||
Prereq: tomcat55, servletapi5
|
|
||||||
BuildRequires: tomcat55, servletapi5, ant, java, libapparmor-devel, java2-devel-packages, apparmor-docs
|
|
||||||
|
|
||||||
%description
|
|
||||||
tomcat_apparmor - is a plugin for Apache Tomcat version 5.x that provides
|
|
||||||
support for AppArmor change_hat for creating AppArmor containers that are
|
|
||||||
bound to discrete elements of processing within the Tomcat servlet
|
|
||||||
container. The AppArmor containers, or "hats", can be created for invidual
|
|
||||||
URL processing or per servlet.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%build
|
|
||||||
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
ant -Dinstall_lib=%{_lib} -Dcatalina_home=%{CATALINA_HOME} -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dtarget=1.4 jar jni_so
|
|
||||||
|
|
||||||
%install
|
|
||||||
ant -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dversion=%{version} -Drelease=%{release} -Dcatalina_home=%{CATALINA_HOME} -Dinstall_root=${RPM_BUILD_ROOT} -Dinstall_lib=%{_lib} install_jar install_jni
|
|
||||||
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
|
|
||||||
install ${RPM_BUILD_DIR}/%{name}-%{version}/README.tomcat_apparmor ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
|
|
||||||
|
|
||||||
%clean
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%{CATALINA_HOME}/server/lib/%{JAR_FILE}
|
|
||||||
/%{_lib}/lib*
|
|
||||||
/%{_libdir}/lib*
|
|
||||||
doc %attr(0644,root,root) %{APPARMOR_DOC_DIR}/README.tomcat_apparmor
|
|
||||||
|
|
||||||
%post
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
%postun
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Mon Jul 20 2007 - sbeattie@suse.de
|
|
||||||
- Convert builddep on libapparmor to libapparmor-devel
|
|
||||||
* Mon Oct 9 2006 - dreynolds@suse.de
|
|
||||||
- Initial package creation.
|
|
@@ -1,12 +1,19 @@
|
|||||||
# $Id$
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (C) 2002-2005 Novell/SUSE
|
# Copyright (c) 1999-2008 NOVELL (All rights reserved)
|
||||||
|
# Copyright 2009-2010 Canonical Ltd.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of version 2 of the GNU General Public
|
# modify it under the terms of version 2 of the GNU General Public
|
||||||
# License published by the Free Software Foundation.
|
# 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 Lesser General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# The including makefile needs to define LANG, which lists the lang
|
# The including makefile needs to define LANG, which lists the lang
|
||||||
@@ -14,13 +21,14 @@
|
|||||||
# exist
|
# exist
|
||||||
LOCALEDIR=/usr/share/locale
|
LOCALEDIR=/usr/share/locale
|
||||||
|
|
||||||
XGETTEXT_ARGS=--copyright-holder="NOVELL, Inc." --msgid-bugs-address=apparmor-general@forge.novell.com -d ${NAME}
|
XGETTEXT_ARGS=--copyright-holder="NOVELL, Inc." --msgid-bugs-address=apparmor@lists.ubuntu.com -d ${NAME}
|
||||||
|
|
||||||
# When making the .pot file, it's expected that the parent Makefile will
|
# When making the .pot file, it's expected that the parent Makefile will
|
||||||
# pass in the list of sources in the SOURCES variable
|
# pass in the list of sources in the SOURCES variable
|
||||||
PARENT_SOURCES=$(foreach source, ${SOURCES}, ../${source})
|
PARENT_SOURCES=$(foreach source, ${SOURCES}, ../${source})
|
||||||
|
|
||||||
LANGS=$(patsubst %.po, %, $(wildcard *.po))
|
# Can override by passing LANGS=whatever here
|
||||||
|
LANGS?=$(patsubst %.po, %, $(wildcard *.po))
|
||||||
TARGET_MOS=$(foreach lang, $(filter-out $(DISABLED_LANGS),$(LANGS)), ${lang}.mo)
|
TARGET_MOS=$(foreach lang, $(filter-out $(DISABLED_LANGS),$(LANGS)), ${lang}.mo)
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# $Id$
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (C) 2002-2005 Novell/SUSE
|
# Copyright (C) 2002-2005 Novell/SUSE
|
||||||
|
# Copyright (C) 2010 Canonical, Ltd.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of version 2 of the GNU General Public
|
# modify it under the terms of version 2 of the GNU General Public
|
||||||
@@ -25,7 +25,21 @@
|
|||||||
# directories
|
# directories
|
||||||
|
|
||||||
DISTRIBUTION=AppArmor
|
DISTRIBUTION=AppArmor
|
||||||
VERSION=2.3
|
VERSION=$(shell cat common/Version)
|
||||||
|
|
||||||
|
# Convenience functions
|
||||||
|
pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))
|
||||||
|
map = $(foreach a,$(2),$(call $(1),$(a)))
|
||||||
|
|
||||||
|
AWK:=$(shell which awk)
|
||||||
|
ifndef AWK
|
||||||
|
$(error awk utility required for build but not available)
|
||||||
|
endif
|
||||||
|
|
||||||
|
define nl
|
||||||
|
|
||||||
|
|
||||||
|
endef
|
||||||
|
|
||||||
# OVERRIDABLE variables
|
# OVERRIDABLE variables
|
||||||
# Set these variables before including Make.rules to change its behavior
|
# Set these variables before including Make.rules to change its behavior
|
||||||
@@ -48,16 +62,21 @@ BUILDDIR=$(shell if [ -d "${TESTBUILDDIR}" ] ; then \
|
|||||||
echo "/tmp/${NAME}" ; \
|
echo "/tmp/${NAME}" ; \
|
||||||
fi ;)
|
fi ;)
|
||||||
endif
|
endif
|
||||||
RPMHOSTVENDOR=$(shell rpm --eval "%{_host_vendor}")
|
|
||||||
ifndef DISTRO
|
ifndef DISTRO
|
||||||
DISTRO=$(shell if [ -f /etc/slackware-version ] ; then \
|
DISTRO=$(shell if [ -f /etc/slackware-version ] ; then \
|
||||||
echo slackware ; \
|
echo slackware ; \
|
||||||
elif [ -f /etc/debian_version ] ; then \
|
elif [ -f /etc/debian_version ] ; then \
|
||||||
echo debian ;\
|
echo debian ;\
|
||||||
elif [ ${RPMHOSTVENDOR} = "suse" ] ; then \
|
elif which rpm > /dev/null ; then \
|
||||||
echo suse ;\
|
if [ "$(rpm --eval '0%{?suse_version}')" != "0" ] ; then \
|
||||||
elif [ ${RPMHOSTVENDOR} = "redhat" ] ; then \
|
echo suse ;\
|
||||||
echo rhel4 ;\
|
elif [ "$(rpm --eval '%{_host_vendor}')" = redhat ] ; then \
|
||||||
|
echo rhel4 ;\
|
||||||
|
elif [ "$(rpm --eval '0%{?fedora}')" != "0" ] ; then \
|
||||||
|
echo rhel4 ;\
|
||||||
|
else \
|
||||||
|
echo unknown ;\
|
||||||
|
fi ;\
|
||||||
else \
|
else \
|
||||||
echo unknown ;\
|
echo unknown ;\
|
||||||
fi)
|
fi)
|
||||||
@@ -70,20 +89,7 @@ RPMARG=--define "_topdir $(BUILDDIR:/=)" \
|
|||||||
$(shell [ -d ${BUILDDIR}/BUILDROOT ] && echo --define \"buildroot $(BUILDDIR:/=)/BUILDROOT\") \
|
$(shell [ -d ${BUILDDIR}/BUILDROOT ] && echo --define \"buildroot $(BUILDDIR:/=)/BUILDROOT\") \
|
||||||
$(shell [ -n "${DISTRO}" ] && echo --define \"distro ${DISTRO}\")
|
$(shell [ -n "${DISTRO}" ] && echo --define \"distro ${DISTRO}\")
|
||||||
|
|
||||||
#REPO_VERSION=$(shell if [ -x /usr/bin/svn ] ; then \
|
REPO_VERSION_CMD=([ -x /usr/bin/bzr ] && /usr/bin/bzr version-info . 2> /dev/null || awk '{ print "revno: "$2 }' common/.stamp_rev) | awk '/^revno:/ { print $2 }'
|
||||||
# if ! /usr/bin/svn info -r HEAD . 2> /dev/null | grep "^Last Changed Rev:" | sed "s/^Last Changed Rev: //" ; then \
|
|
||||||
# /usr/bin/svn info . 2> /dev/null | grep "^Last Changed Rev:" | sed "s/^Last Changed Rev: //" ; \
|
|
||||||
# fi ; \
|
|
||||||
# fi)
|
|
||||||
REPO_VERSION=$(shell if [ -x /usr/bin/svn ] ; then \
|
|
||||||
/usr/bin/svn info . 2> /dev/null | grep "^Last Changed Rev:" | sed "s/^Last Changed Rev: //" ; \
|
|
||||||
fi)
|
|
||||||
REPO_URL=$(shell if [ -x /usr/bin/svn ] ; then \
|
|
||||||
/usr/bin/svn info . 2> /dev/null | grep "^URL:" | sed "s/^URL: //" ; \
|
|
||||||
fi)
|
|
||||||
COMMON_REPO_URL=$(shell if [ -x /usr/bin/svn ] ; then \
|
|
||||||
/usr/bin/svn info $(COMMONDIR) 2> /dev/null | grep "^URL:" | sed "s/^URL: //" ; \
|
|
||||||
fi)
|
|
||||||
|
|
||||||
ifdef EXTERNAL_PACKAGE
|
ifdef EXTERNAL_PACKAGE
|
||||||
RPMARG+=--define "_sourcedir $(shell pwd)"
|
RPMARG+=--define "_sourcedir $(shell pwd)"
|
||||||
@@ -92,30 +98,14 @@ endif
|
|||||||
ifndef SPECFILE
|
ifndef SPECFILE
|
||||||
SPECFILE = $(NAME).spec
|
SPECFILE = $(NAME).spec
|
||||||
endif
|
endif
|
||||||
RELEASE = $(shell rpm -q --specfile --define "_sourcedir ." ${RPMARG} --qf "%{RELEASE}" ${SPECFILE})
|
|
||||||
RELEASE_DIR = $(NAME)-$(VERSION)
|
RELEASE_DIR = $(NAME)-$(VERSION)
|
||||||
TARBALL = $(NAME)-$(VERSION)-${REPO_VERSION}.tar.gz
|
TAR = /bin/tar czvp -h --exclude .svn --exclude .bzr --exclude .bzrignore --exclude ${RELEASE_DIR}/${RELEASE_DIR} $(shell test -f ${NAME}.exclude && echo "-X ${NAME}.exclude")
|
||||||
TAR = /bin/tar czvp -h --exclude .svn --exclude CVS --exclude .cvsignore --exclude ${TARBALL} --exclude ${RELEASE_DIR}/${RELEASE_DIR} $(shell test -f ${NAME}.exclude && echo "-X ${NAME}.exclude")
|
|
||||||
LDCONFIG = /sbin/ldconfig
|
LDCONFIG = /sbin/ldconfig
|
||||||
|
|
||||||
CVSPKG_VERSION=$(shell rpm -q --specfile --define "_sourcedir ." ${RPMARG} ${SPECFILE} | head -1 | tr "." "_")
|
|
||||||
|
|
||||||
RPMSUBDIRS=SOURCES SPECS BUILD BUILDROOT SRPMS RPMS/i386 RPMS/i586 \
|
RPMSUBDIRS=SOURCES SPECS BUILD BUILDROOT SRPMS RPMS/i386 RPMS/i586 \
|
||||||
RPMS/i686 RPMS/athlon RPMS/noarch RPMS/x86_64
|
RPMS/i686 RPMS/athlon RPMS/noarch RPMS/x86_64
|
||||||
BUILDRPMSUBDIRS=$(foreach subdir, $(RPMSUBDIRS), $(BUILDDIR:/=)/$(subdir))
|
BUILDRPMSUBDIRS=$(foreach subdir, $(RPMSUBDIRS), $(BUILDDIR:/=)/$(subdir))
|
||||||
|
|
||||||
.PHONY: cvs_tag
|
|
||||||
cvs_tag:
|
|
||||||
cvs tag IMMUNIX-${CVSPKG_VERSION}
|
|
||||||
|
|
||||||
.PHONY: checkin
|
|
||||||
checkin:
|
|
||||||
if cvs -q up -d | grep -q "^\?" ; then echo "Hey! You have" \
|
|
||||||
"files in the directory you have not added into cvs."; exit 1; \
|
|
||||||
fi
|
|
||||||
cvs ci
|
|
||||||
make cvs_tag
|
|
||||||
|
|
||||||
ifdef EXTERNAL_PACKAGE
|
ifdef EXTERNAL_PACKAGE
|
||||||
.PHONY: rpm
|
.PHONY: rpm
|
||||||
rpm: clean $(BUILDRPMSUBDIRS)
|
rpm: clean $(BUILDRPMSUBDIRS)
|
||||||
@@ -123,21 +113,25 @@ rpm: clean $(BUILDRPMSUBDIRS)
|
|||||||
|
|
||||||
else
|
else
|
||||||
.PHONY: rpm
|
.PHONY: rpm
|
||||||
rpm: clean $(TARBALL) $(BUILDRPMSUBDIRS)
|
rpm: clean $(BUILDRPMSUBDIRS)
|
||||||
cp $(TARBALL) $(BUILDDIR)/SOURCES/
|
__REPO_VERSION=`$(value REPO_VERSION_CMD)` ; \
|
||||||
|
__TARBALL=$(NAME)-$(VERSION)-$${__REPO_VERSION}.tar.gz ; \
|
||||||
|
make $${__TARBALL} ; \
|
||||||
|
cp $${__TARBALL} $(BUILDDIR)/SOURCES/
|
||||||
cp ${SPECFILE} $(BUILDDIR)/SPECS/
|
cp ${SPECFILE} $(BUILDDIR)/SPECS/
|
||||||
rpmbuild -ba ${RPMARG} ${SPECFILE}
|
rpmbuild -ba ${RPMARG} ${SPECFILE}
|
||||||
|
|
||||||
.PHONY: ${SPECFILE}
|
.PHONY: ${SPECFILE}
|
||||||
${SPECFILE}: ${SPECFILE}.in
|
${SPECFILE}: ${SPECFILE}.in
|
||||||
|
__REPO_VERSION=`$(value REPO_VERSION_CMD)` ; \
|
||||||
sed -e "s/@@immunix_version@@/${VERSION}/g" \
|
sed -e "s/@@immunix_version@@/${VERSION}/g" \
|
||||||
-e "s/@@repo_version@@/${REPO_VERSION}/g" $< > $@
|
-e "s/@@repo_version@@/$${__REPO_VERSION}/g" $< > $@
|
||||||
|
|
||||||
${TARBALL}: clean ${SPECFILE}
|
%.tar.gz: clean ${SPECFILE}
|
||||||
-rm -rf $(RELEASE_DIR)
|
-rm -rf $(RELEASE_DIR)
|
||||||
mkdir $(RELEASE_DIR)
|
mkdir $(RELEASE_DIR)
|
||||||
$(TAR) . | tar xz -C $(RELEASE_DIR)
|
$(TAR) --exclude $@ . | tar xz -C $(RELEASE_DIR)
|
||||||
$(TAR) -f $@ $(RELEASE_DIR)
|
$(TAR) --exclude $@ -f $@ $(RELEASE_DIR)
|
||||||
rm -rf $(RELEASE_DIR)
|
rm -rf $(RELEASE_DIR)
|
||||||
|
|
||||||
ifndef OVERRIDE_TARBALL
|
ifndef OVERRIDE_TARBALL
|
||||||
@@ -145,22 +139,30 @@ ifndef OVERRIDE_TARBALL
|
|||||||
tarball: clean $(TARBALL)
|
tarball: clean $(TARBALL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: dist
|
|
||||||
dist: clean $(SPECFILE)
|
|
||||||
-rm -rf $(RELEASE_DIR)
|
|
||||||
svn export -r $(REPO_VERSION) $(REPO_URL) $(RELEASE_DIR)
|
|
||||||
svn export $(COMMON_REPO_URL) $(RELEASE_DIR)/common
|
|
||||||
make -C $(RELEASE_DIR) $(SPECFILE) REPO_VERSION=${REPO_VERSION} COMMONDIR_EXISTS=false
|
|
||||||
$(TAR) -f $(TARBALL) $(RELEASE_DIR)
|
|
||||||
rm -rf $(RELEASE_DIR)
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef PYTHON_VERSIONS
|
||||||
|
PYTHON_VERSIONS = $(call map, pathsearch, python2 python3)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef PYTHON
|
||||||
|
PYTHON = $(firstword ${PYTHON_VERSIONS})
|
||||||
|
endif
|
||||||
|
|
||||||
|
#Helper function to be used with $(call pyalldo, run_test_with_all.py)
|
||||||
|
pyalldo=set -e; $(foreach py, $(PYTHON_VERSIONS), $(py) $(1);)
|
||||||
|
|
||||||
.PHONY: version
|
.PHONY: version
|
||||||
.SILENT: version
|
.SILENT: version
|
||||||
version:
|
version:
|
||||||
rpm -q --define "_sourcedir ." ${RPMARG} --specfile ${SPECFILE}
|
rpm -q --define "_sourcedir ." ${RPMARG} --specfile ${SPECFILE}
|
||||||
|
|
||||||
|
.PHONY: repo_version
|
||||||
|
.SILENT: repo_version
|
||||||
|
repo_version:
|
||||||
|
$(value REPO_VERSION_CMD)
|
||||||
|
|
||||||
|
|
||||||
.PHONY: build_dir
|
.PHONY: build_dir
|
||||||
build_dir: $(BUILDRPMSUBDIRS)
|
build_dir: $(BUILDRPMSUBDIRS)
|
||||||
|
|
||||||
@@ -170,9 +172,43 @@ $(BUILDRPMSUBDIRS):
|
|||||||
.PHONY: _clean
|
.PHONY: _clean
|
||||||
.SILENT: _clean
|
.SILENT: _clean
|
||||||
_clean:
|
_clean:
|
||||||
-rm -f ${NAME}-${VERSION}-*.tar.gz
|
-[ -z "${NAME}" ] || rm -f ${NAME}-${VERSION}-*.tar.gz
|
||||||
-rm -f ${MANPAGES} *.[0-9].gz ${HTMLMANPAGES} pod2htm*.tmp
|
-rm -f ${MANPAGES} *.[0-9].gz ${HTMLMANPAGES} pod2htm*.tmp
|
||||||
|
|
||||||
|
# =====================
|
||||||
|
# generate list of capabilities based on
|
||||||
|
# /usr/include/linux/capabilities.h for use in multiple locations in
|
||||||
|
# the source tree
|
||||||
|
# =====================
|
||||||
|
|
||||||
|
# emits defined capabilities in a simple list, e.g. "CAP_NAME CAP_NAME2"
|
||||||
|
CAPABILITIES=$(shell echo "\#include <linux/capability.h>" | cpp -dM | LC_ALL=C sed -n -e '/CAP_EMPTY_SET/d' -e 's/^\#define[ \t]\+CAP_\([A-Z0-9_]\+\)[ \t]\+\([0-9xa-f]\+\)\(.*\)$$/CAP_\1/p' | sort)
|
||||||
|
|
||||||
|
.PHONY: list_capabilities
|
||||||
|
list_capabilities: /usr/include/linux/capability.h
|
||||||
|
@echo "$(CAPABILITIES)"
|
||||||
|
|
||||||
|
# =====================
|
||||||
|
# generate list of network protocols based on
|
||||||
|
# sys/socket.h for use in multiple locations in
|
||||||
|
# the source tree
|
||||||
|
# =====================
|
||||||
|
|
||||||
|
# These are the families that it doesn't make sense for apparmor
|
||||||
|
# to mediate. We use PF_ here since that is what is required in
|
||||||
|
# bits/socket.h, but we will rewrite these as AF_.
|
||||||
|
|
||||||
|
FILTER_FAMILIES=PF_UNIX
|
||||||
|
|
||||||
|
__FILTER=$(shell echo $(strip $(FILTER_FAMILIES)) | sed -e 's/ /\\\|/g')
|
||||||
|
|
||||||
|
# emits the AF names in a "AF_NAME NUMBER," pattern
|
||||||
|
AF_NAMES=$(shell echo "\#include <sys/socket.h>" | cpp -dM | LC_ALL=C sed -n -e '/$(__FILTER)/d' -e 's/PF_LOCAL/PF_UNIX/' -e 's/^\#define[ \t]\+PF_\([A-Z0-9_]\+\)[ \t]\+\([0-9]\+\).*$$/AF_\1 \2,/p' | sort -n -k2)
|
||||||
|
|
||||||
|
.PHONY: list_af_names
|
||||||
|
list_af_names:
|
||||||
|
@echo "$(AF_NAMES)"
|
||||||
|
|
||||||
# =====================
|
# =====================
|
||||||
# manpages
|
# manpages
|
||||||
# =====================
|
# =====================
|
||||||
@@ -191,32 +227,12 @@ install_manpages: $(MANPAGES)
|
|||||||
$(foreach dir, ${MANDIRS}, \
|
$(foreach dir, ${MANDIRS}, \
|
||||||
install -d ${DESTDIR}/${MANDIR}/man${dir} ; \
|
install -d ${DESTDIR}/${MANDIR}/man${dir} ; \
|
||||||
install -m 644 $(filter %.${dir}, ${MANPAGES}) ${DESTDIR}/${MANDIR}/man${dir}; \
|
install -m 644 $(filter %.${dir}, ${MANPAGES}) ${DESTDIR}/${MANDIR}/man${dir}; \
|
||||||
$(foreach aa_page, $(filter %.${dir}, ${AA_MANPAGES}), \
|
)
|
||||||
ln -sf $(aa_page) ${DESTDIR}/${MANDIR}/man${dir}/${aa_page:%=aa-%};))
|
|
||||||
|
|
||||||
%.1: %.pod
|
MAN_RELEASE="AppArmor ${VERSION}"
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=1 > $@
|
|
||||||
|
|
||||||
%.2: %.pod
|
%.1 %.2 %.3 %.4 %.5 %.6 %.7 %.8: %.pod
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=2 > $@
|
$(POD2MAN) $< --release=$(MAN_RELEASE) --center=AppArmor --stderr --section=$(subst .,,$(suffix $@)) > $@
|
||||||
|
|
||||||
%.3: %.pod
|
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=3 > $@
|
|
||||||
|
|
||||||
%.4: %.pod
|
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=4 > $@
|
|
||||||
|
|
||||||
%.5: %.pod
|
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=5 > $@
|
|
||||||
|
|
||||||
%.6: %.pod
|
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=6 > $@
|
|
||||||
|
|
||||||
%.7: %.pod
|
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=7 > $@
|
|
||||||
|
|
||||||
%.8: %.pod
|
|
||||||
$(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=8 > $@
|
|
||||||
|
|
||||||
%.1.html: %.pod
|
%.1.html: %.pod
|
||||||
$(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@
|
$(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@
|
||||||
@@ -242,43 +258,6 @@ install_manpages: $(MANPAGES)
|
|||||||
%.8.html: %.pod
|
%.8.html: %.pod
|
||||||
$(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@
|
$(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@
|
||||||
|
|
||||||
# =====================
|
|
||||||
# Slackware poo
|
|
||||||
# =====================
|
|
||||||
.PHONY: slack
|
|
||||||
slack:
|
|
||||||
rm -rf ${BUILDDIR}
|
|
||||||
mkdir -p ${BUILDDIR}/install
|
|
||||||
make install DESTDIR=${BUILDDIR} DISTRO=slackware
|
|
||||||
# comment line is there so grep always has something to match
|
|
||||||
( echo "# install script pulled from ${SPECFILE}" ; rpm -q --specfile --define "_sourcedir ." ${RPMARG} --qf "%{POSTIN}\n" ${SPECFILE}) | grep -v "^(none)$$" >> ${BUILDDIR}/install/doinst.sh
|
|
||||||
( cd ${BUILDDIR} && makepkg -l y -c y -p ${PWD}/${NAME}-${VERSION}-${RELEASE}.tgz )
|
|
||||||
|
|
||||||
# =====================
|
|
||||||
# Debian poo
|
|
||||||
# =====================
|
|
||||||
.PHONY: deb
|
|
||||||
deb: ${TARBALL}
|
|
||||||
rm -rf ${BUILDDIR}
|
|
||||||
mkdir -p ${BUILDDIR}
|
|
||||||
tar -xvzf ${TARBALL} -C ${BUILDDIR}
|
|
||||||
( cd ${BUILDDIR}/${RELEASE_DIR} && sh -c "DEBFULLNAME='NOVELL, Inc' dh_make -e apparmor-general@forge.novell.com --library -f ~/svn/immunix/immunix/libimmunix/libimmunix-2.0.tar.gz << EOM \
|
|
||||||
\
|
|
||||||
EOM" )
|
|
||||||
make ${NAME}-deb -C ${BUILDDIR}/${RELEASE_DIR}
|
|
||||||
# ( cd ${BUILDDIR}/${RELEASE_DIR} && dpkg-buildpackage -b -sd -rfakeroot)
|
|
||||||
|
|
||||||
DEBIAN_DISTRO=stable
|
|
||||||
|
|
||||||
DEB_CHANGELOG_OUTPUT="${NAME} (${VERSION}-${RELEASE}) ${DEBIAN_DISTRO}; urgency=low\n\
|
|
||||||
\n * Automatically generated by the AppArmor Build System.\n\
|
|
||||||
\n -- AppArmor Development Team <apparmor-general@forge.novell.com> $(shell date -R)"
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: debian/changelog
|
|
||||||
debian/changelog:
|
|
||||||
echo -e ${DEB_CHANGELOG_OUTPUT} > $@
|
|
||||||
|
|
||||||
A2PS_ARGS=-Ec -g --line-numbers=1
|
A2PS_ARGS=-Ec -g --line-numbers=1
|
||||||
ENSCRIPT_ARGS=-C -2jGr -f Courier6 -E
|
ENSCRIPT_ARGS=-C -2jGr -f Courier6 -E
|
||||||
%.c.ps: %.c
|
%.c.ps: %.c
|
||||||
@@ -287,3 +266,7 @@ ENSCRIPT_ARGS=-C -2jGr -f Courier6 -E
|
|||||||
|
|
||||||
%.pm.ps: %.pm
|
%.pm.ps: %.pm
|
||||||
enscript ${ENSCRIPT_ARGS} -o $@ $<
|
enscript ${ENSCRIPT_ARGS} -o $@ $<
|
||||||
|
|
||||||
|
.PHONY: check_pod_files
|
||||||
|
check_pod_files:
|
||||||
|
LANG=C podchecker -warning -warning *.pod
|
||||||
|
1
common/Version
Normal file
1
common/Version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
2.9.5
|
@@ -1,7 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
|
||||||
# $Id: rc.aaeventd.suse 268 2006-12-12 10:54:44Z steve-beattie $
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||||
# NOVELL (All rights reserved)
|
# NOVELL (All rights reserved)
|
||||||
@@ -136,5 +133,5 @@ case "$1" in
|
|||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit $rc
|
exit $rc
|
@@ -1,7 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 1999, 2000, 2001, 2002, 2003 2004, 2005, 2006, 2007
|
# Copyright (c) 1999, 2000, 2001, 2002, 2003 2004, 2005, 2006, 2007
|
||||||
# NOVELL (All rights reserved)
|
# NOVELL (All rights reserved)
|
||||||
@@ -30,7 +27,7 @@
|
|||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: aaeventd
|
# Provides: aaeventd
|
||||||
# Required-Start: apparmor
|
# Required-Start: apparmor
|
||||||
# Required-Stop:
|
# Required-Stop: $null
|
||||||
# Default-Start: 2 3 5
|
# Default-Start: 2 3 5
|
||||||
# Default-Stop:
|
# Default-Stop:
|
||||||
# Short-Description: AppArmor Notification and Reporting
|
# Short-Description: AppArmor Notification and Reporting
|
||||||
@@ -81,9 +78,9 @@ usage() {
|
|||||||
|
|
||||||
start_aa_event() {
|
start_aa_event() {
|
||||||
if [ -x "$AA_EV_BIN" -a "${APPARMOR_ENABLE_AAEVENTD}" = "yes" ] ; then
|
if [ -x "$AA_EV_BIN" -a "${APPARMOR_ENABLE_AAEVENTD}" = "yes" ] ; then
|
||||||
sd_action "Starting AppArmor Event daemon" startproc -f -p $AA_EV_PIDFILE $AA_EV_BIN -p $AA_EV_PIDFILE
|
sd_action "Starting AppArmor Event daemon" startproc -p $AA_EV_PIDFILE $AA_EV_BIN -p $AA_EV_PIDFILE
|
||||||
elif [ -x "$SD_EV_BIN" -a "${APPARMOR_ENABLE_AAEVENTD}" = "yes" ] ; then
|
elif [ -x "$SD_EV_BIN" -a "${APPARMOR_ENABLE_AAEVENTD}" = "yes" ] ; then
|
||||||
sd_action "Starting AppArmor Event daemon" startproc -f -p $SD_EV_PIDFILE $SD_EV_BIN -p $SD_EV_PIDFILE
|
sd_action "Starting AppArmor Event daemon" startproc -p $SD_EV_PIDFILE $SD_EV_BIN -p $SD_EV_PIDFILE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,6 +128,6 @@ case "$1" in
|
|||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit $rc
|
exit $rc
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@@ -65,6 +65,13 @@ sub read_config {
|
|||||||
close(CONF);
|
close(CONF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# LP: #692406
|
||||||
|
# Explicitly disable the repository until there is an alternative, since
|
||||||
|
# the OpenSUSE site went away
|
||||||
|
if ($filename eq "repository.conf") {
|
||||||
|
$config->{repository}{enabled} = "no";
|
||||||
|
}
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
@@ -1,4 +1,3 @@
|
|||||||
# $Id$
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005-2006 Novell/SUSE
|
# Copyright (C) 2005-2006 Novell/SUSE
|
||||||
@@ -14,7 +13,7 @@ package Immunix::Reports;
|
|||||||
################################################################################
|
################################################################################
|
||||||
# /usr/lib/perl5/site_perl/Reports.pm
|
# /usr/lib/perl5/site_perl/Reports.pm
|
||||||
#
|
#
|
||||||
# - Parses /var/log/messages for SubDomain messages
|
# - Parses /var/log/messages for AppArmor messages
|
||||||
# - Writes results to .html or comma-delimited (.csv) files (Optional)
|
# - Writes results to .html or comma-delimited (.csv) files (Optional)
|
||||||
#
|
#
|
||||||
# Requires:
|
# Requires:
|
||||||
@@ -967,7 +966,7 @@ sub getEssStats {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ($@) {
|
if ($@) {
|
||||||
ycp::y2error(sprintf(gettext("DBI Execution failed: %s"), $DBI::errstr));
|
ycp::y2error(sprintf(gettext("DBI Execution failed: %s."), $DBI::errstr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -980,7 +979,7 @@ sub getEssStats {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ($@) {
|
if ($@) {
|
||||||
ycp::y2error(sprintf(gettext("DBI Execution failed: %s"), $DBI::errstr));
|
ycp::y2error(sprintf(gettext("DBI Execution failed: %s."), $DBI::errstr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -988,7 +987,7 @@ sub getEssStats {
|
|||||||
eval { $ret = $dbh->selectall_arrayref("$query"); };
|
eval { $ret = $dbh->selectall_arrayref("$query"); };
|
||||||
|
|
||||||
if ($@) {
|
if ($@) {
|
||||||
ycp::y2error(sprintf(gettext("DBI Execution failed: %s"), $DBI::errstr));
|
ycp::y2error(sprintf(gettext("DBI Execution failed: %s."), $DBI::errstr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@@ -289,6 +289,13 @@ sub fetch_usernames_from_uids ($) {
|
|||||||
}
|
}
|
||||||
if (@uids) {
|
if (@uids) {
|
||||||
my $repo_client = get_repo_client( $repo_url );
|
my $repo_client = get_repo_client( $repo_url );
|
||||||
|
#RPC::XML will serialize the array into XML with the is_utf8 flag set
|
||||||
|
#which causes, HTTP:Message to fail. Looping on the array elements
|
||||||
|
#stops this from happening, and since these are all numbers it
|
||||||
|
#will not cause problems.
|
||||||
|
for my $foo (@uids) {
|
||||||
|
Encode::_utf8_off($foo);
|
||||||
|
}
|
||||||
my $res = $repo_client->send_request('LoginNamesFromUserIds', [@uids]);
|
my $res = $repo_client->send_request('LoginNamesFromUserIds', [@uids]);
|
||||||
if (did_result_succeed($res)) {
|
if (did_result_succeed($res)) {
|
||||||
my @usernames = @{ $res->value };
|
my @usernames = @{ $res->value };
|
@@ -1,4 +1,3 @@
|
|||||||
# $Id$
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005-2006 Novell/SUSE
|
# Copyright (C) 2005-2006 Novell/SUSE
|
69
deprecated/utils/Makefile
Normal file
69
deprecated/utils/Makefile
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# Copyright (c) 1999, 2004-2009 NOVELL (All rights reserved)
|
||||||
|
# Copyright (c) 2010-2011, 2014 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# NOTE: this Makefile has been adjusted from the original to assist in
|
||||||
|
# the installation of the Immunix perl modules, if they're still needed
|
||||||
|
# by users. Because the utilities conflict with their replacments, make
|
||||||
|
# install *will* *not* install them.
|
||||||
|
|
||||||
|
NAME = apparmor-utils
|
||||||
|
all:
|
||||||
|
COMMONDIR=../../common/
|
||||||
|
|
||||||
|
include common/Make.rules
|
||||||
|
|
||||||
|
COMMONDIR_EXISTS=$(strip $(shell [ -d ${COMMONDIR} ] && echo true))
|
||||||
|
ifeq ($(COMMONDIR_EXISTS), true)
|
||||||
|
common/Make.rules: $(COMMONDIR)/Make.rules
|
||||||
|
ln -sf $(COMMONDIR) .
|
||||||
|
endif
|
||||||
|
|
||||||
|
MODDIR = Immunix
|
||||||
|
PERLTOOLS = aa-genprof aa-logprof aa-autodep aa-audit aa-complain aa-enforce \
|
||||||
|
aa-unconfined aa-disable
|
||||||
|
MODULES = ${MODDIR}/AppArmor.pm ${MODDIR}/Repository.pm \
|
||||||
|
${MODDIR}/Config.pm ${MODDIR}/Severity.pm
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
# need some better way of determining this
|
||||||
|
DESTDIR=/
|
||||||
|
BINDIR=${DESTDIR}/usr/sbin
|
||||||
|
CONFDIR=${DESTDIR}/etc/apparmor
|
||||||
|
VENDOR_PERL=$(shell perl -e 'use Config; print $$Config{"vendorlib"};')
|
||||||
|
PERLDIR=${DESTDIR}${VENDOR_PERL}/${MODDIR}
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install:
|
||||||
|
install -d ${PERLDIR}
|
||||||
|
install -m 644 ${MODULES} ${PERLDIR}
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
ifndef VERBOSE
|
||||||
|
.SILENT: clean
|
||||||
|
endif
|
||||||
|
clean: _clean
|
||||||
|
rm -f core core.* *.o *.s *.a *~
|
||||||
|
rm -f Make.rules
|
||||||
|
rm -rf staging/ build/
|
||||||
|
|
||||||
|
.PHONY: check
|
||||||
|
.SILENT: check
|
||||||
|
check:
|
||||||
|
for i in ${MODULES} ${PERLTOOLS} ; do \
|
||||||
|
perl -c $$i || exit 1; \
|
||||||
|
done
|
@@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
|
# Copyright (c) 2011 Canonical, Ltd.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of version 2 of the GNU General Public
|
# modify it under the terms of version 2 of the GNU General Public
|
||||||
@@ -25,7 +23,7 @@ use strict;
|
|||||||
use FindBin;
|
use FindBin;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ GetOptions(
|
|||||||
$profiledir = get_full_path($profiledir);
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
unless (-d $profiledir) {
|
unless (-d $profiledir) {
|
||||||
UI_Important("Can't find subdomain profiles in $profiledir.");
|
UI_Important("Can't find AppArmor profiles in $profiledir.");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +117,7 @@ for my $profiling (@profiling) {
|
|||||||
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
||||||
exit 1;
|
exit 1;
|
||||||
} else {
|
} else {
|
||||||
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.') . $profiling));
|
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.'), $profiling));
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
|
# Copyright (c) 2011 Canonical, Ltd.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of version 2 of the GNU General Public
|
# modify it under the terms of version 2 of the GNU General Public
|
||||||
@@ -25,7 +23,7 @@ use strict;
|
|||||||
use FindBin;
|
use FindBin;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
@@ -60,7 +58,7 @@ my $sd_mountpoint = check_for_subdomain();
|
|||||||
$profiledir = get_full_path($profiledir);
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
unless (-d $profiledir) {
|
unless (-d $profiledir) {
|
||||||
UI_Important(sprintf(gettext('Can\'t find subdomain profiles in %s.'), $profiledir));
|
UI_Important(sprintf(gettext('Can\'t find AppArmor profiles in %s.'), $profiledir));
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +107,7 @@ for my $profiling (@profiling) {
|
|||||||
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
||||||
exit 1;
|
exit 1;
|
||||||
} else {
|
} else {
|
||||||
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.') . $profiling));
|
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.'), $profiling));
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,7 +1,4 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -25,7 +22,7 @@ use strict;
|
|||||||
use FindBin;
|
use FindBin;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
@@ -53,7 +50,7 @@ GetOptions(
|
|||||||
$profiledir = get_full_path($profiledir);
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
unless (-d $profiledir) {
|
unless (-d $profiledir) {
|
||||||
UI_Important("Can't find subdomain profiles in $profiledir.");
|
UI_Important("Can't find AppArmor profiles in $profiledir.");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
152
deprecated/utils/aa-disable
Executable file
152
deprecated/utils/aa-disable
Executable file
@@ -0,0 +1,152 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2005-2010 Novell, Inc. All Rights Reserved.
|
||||||
|
# Copyright (c) 2011 Canonical, Inc. 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 as 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 Canonical, Inc.
|
||||||
|
#
|
||||||
|
# To contact Canonical about this file by physical or electronic mail,
|
||||||
|
# you may find current contact information at www.canonical.com.
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use FindBin;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
use Locale::gettext;
|
||||||
|
use POSIX;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
|
# initialize the local poo
|
||||||
|
setlocale(LC_MESSAGES, "");
|
||||||
|
textdomain("apparmor-utils");
|
||||||
|
|
||||||
|
$UI_Mode = "text";
|
||||||
|
|
||||||
|
# options variables
|
||||||
|
my $help = '';
|
||||||
|
|
||||||
|
GetOptions(
|
||||||
|
'dir|d=s' => \$profiledir,
|
||||||
|
'help|h' => \$help,
|
||||||
|
);
|
||||||
|
|
||||||
|
# tell 'em how to use it...
|
||||||
|
&usage && exit if $help;
|
||||||
|
|
||||||
|
# let's convert it to full path...
|
||||||
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
|
unless (-d $profiledir) {
|
||||||
|
UI_Important("Can't find AppArmor profiles in $profiledir.");
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $disabledir = "$profiledir/disable";
|
||||||
|
unless (-d $disabledir) {
|
||||||
|
UI_Important("Can't find AppArmor disable directory '$disabledir'.");
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# what are we profiling?
|
||||||
|
my @profiling = @ARGV;
|
||||||
|
|
||||||
|
unless (@profiling) {
|
||||||
|
@profiling = (UI_GetString(gettext("Please enter the program whose profile should be disabled: "), ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
for my $profiling (@profiling) {
|
||||||
|
|
||||||
|
next unless $profiling;
|
||||||
|
|
||||||
|
my $fqdbin;
|
||||||
|
if (-e $profiling) {
|
||||||
|
$fqdbin = get_full_path($profiling);
|
||||||
|
chomp($fqdbin);
|
||||||
|
} else {
|
||||||
|
if ($profiling !~ /\//) {
|
||||||
|
opendir(DIR,$profiledir);
|
||||||
|
my @tmp_fqdbin = grep ( /$profiling/, readdir(DIR));
|
||||||
|
closedir(DIR);
|
||||||
|
if (scalar @tmp_fqdbin eq 1) {
|
||||||
|
$fqdbin = "$profiledir/$tmp_fqdbin[0]";
|
||||||
|
} else {
|
||||||
|
my $which = which($profiling);
|
||||||
|
if ($which) {
|
||||||
|
$fqdbin = get_full_path($which);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-e $fqdbin) {
|
||||||
|
|
||||||
|
my $filename;
|
||||||
|
if ($fqdbin =~ /^$profiledir\//) {
|
||||||
|
$filename = $fqdbin;
|
||||||
|
} else {
|
||||||
|
$filename = getprofilefilename($fqdbin);
|
||||||
|
}
|
||||||
|
|
||||||
|
# argh, skip directories
|
||||||
|
next unless -f $filename;
|
||||||
|
|
||||||
|
# skip package manager backup files
|
||||||
|
next if isSkippableFile($filename);
|
||||||
|
|
||||||
|
my ($bname, $dname, $suffix) = File::Basename::fileparse($filename);
|
||||||
|
if ($bname eq "") {
|
||||||
|
UI_Info(sprintf(gettext('Could not find basename for %s.'), $filename));
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(gettext('Disabling %s.'), $fqdbin);
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
my $link = "$disabledir/$bname";
|
||||||
|
if (! -e $link) {
|
||||||
|
if (symlink($filename, $link) != 1) {
|
||||||
|
UI_Info(sprintf(gettext('Could not create %s symlink.'), $link));
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my $cmd_info = qx(cat $filename | $parser -I$profiledir -R 2>&1 1>/dev/null);
|
||||||
|
if ($? != 0) {
|
||||||
|
UI_Info($cmd_info);
|
||||||
|
exit $?;
|
||||||
|
}
|
||||||
|
|
||||||
|
# if check_for_subdomain();
|
||||||
|
} else {
|
||||||
|
if ($profiling =~ /^[^\/]+$/) {
|
||||||
|
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
||||||
|
exit 1;
|
||||||
|
} else {
|
||||||
|
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.'), $profiling));
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0;
|
||||||
|
|
||||||
|
sub usage {
|
||||||
|
UI_Info(sprintf(gettext("usage: \%s [ -d /path/to/profiles ] [ program to have profile disabled ]"), $0));
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
@@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
|
# Copyright (c) 2011 Canonical, Ltd.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of version 2 of the GNU General Public
|
# modify it under the terms of version 2 of the GNU General Public
|
||||||
@@ -25,7 +23,7 @@ use strict;
|
|||||||
use FindBin;
|
use FindBin;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ GetOptions(
|
|||||||
$profiledir = get_full_path($profiledir);
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
unless (-d $profiledir) {
|
unless (-d $profiledir) {
|
||||||
UI_Important("Can't find subdomain profiles in $profiledir.");
|
UI_Important("Can't find AppArmor profiles in $profiledir.");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +104,16 @@ for my $profiling (@profiling) {
|
|||||||
print "\n";
|
print "\n";
|
||||||
setprofileflags($filename, "");
|
setprofileflags($filename, "");
|
||||||
|
|
||||||
|
# remove symlink in $profiledir/force-complain as well
|
||||||
|
my $complainlink = $filename;
|
||||||
|
$complainlink =~ s/^$profiledir/$profiledir\/force-complain/;
|
||||||
|
-e $complainlink and unlink($complainlink);
|
||||||
|
|
||||||
|
# remove symlink in $profiledir/disable as well
|
||||||
|
my $disablelink = $filename;
|
||||||
|
$disablelink =~ s/^$profiledir/$profiledir\/disable/;
|
||||||
|
-e $disablelink and unlink($disablelink);
|
||||||
|
|
||||||
my $cmd_info = qx(cat $filename | $parser -I$profiledir -r 2>&1 1>/dev/null);
|
my $cmd_info = qx(cat $filename | $parser -I$profiledir -r 2>&1 1>/dev/null);
|
||||||
if ($? != 0) {
|
if ($? != 0) {
|
||||||
UI_Info($cmd_info);
|
UI_Info($cmd_info);
|
||||||
@@ -119,7 +127,7 @@ for my $profiling (@profiling) {
|
|||||||
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
UI_Info(sprintf(gettext('Can\'t find %s in the system path list. If the name of the application is correct, please run \'which %s\' as a user with the correct PATH environment set up in order to find the fully-qualified path.'), $profiling, $profiling));
|
||||||
exit 1;
|
exit 1;
|
||||||
} else {
|
} else {
|
||||||
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.') . $profiling));
|
UI_Info(sprintf(gettext('%s does not exist, please double-check the path.'), $profiling));
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
#
|
#
|
@@ -1,7 +1,4 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -24,13 +21,33 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
use Locale::gettext;
|
use Locale::gettext;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
|
|
||||||
|
sub sysctl_read($) {
|
||||||
|
my $path = shift;
|
||||||
|
my $value = undef;
|
||||||
|
if (open(SYSCTL, "<$path")) {
|
||||||
|
$value = int(<SYSCTL>);
|
||||||
|
}
|
||||||
|
close(SYSCTL);
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub sysctl_write($$) {
|
||||||
|
my $path = shift;
|
||||||
|
my $value = shift;
|
||||||
|
return if (!defined($value));
|
||||||
|
if (open(SYSCTL, ">$path")) {
|
||||||
|
print SYSCTL $value;
|
||||||
|
close(SYSCTl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# force $PATH to be sane
|
# force $PATH to be sane
|
||||||
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
|
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
|
||||||
|
|
||||||
@@ -52,14 +69,14 @@ GetOptions(
|
|||||||
|
|
||||||
my $sd_mountpoint = check_for_subdomain();
|
my $sd_mountpoint = check_for_subdomain();
|
||||||
unless ($sd_mountpoint) {
|
unless ($sd_mountpoint) {
|
||||||
fatal_error(gettext("SubDomain does not appear to be started. Please enable SubDomain and try again."));
|
fatal_error(gettext("AppArmor does not appear to be started. Please enable AppArmor and try again."));
|
||||||
}
|
}
|
||||||
|
|
||||||
# let's convert it to full path...
|
# let's convert it to full path...
|
||||||
$profiledir = get_full_path($profiledir);
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
unless (-d $profiledir) {
|
unless (-d $profiledir) {
|
||||||
fatal_error "Can't find subdomain profiles in $profiledir.";
|
fatal_error "Can't find AppArmor profiles in $profiledir.";
|
||||||
}
|
}
|
||||||
|
|
||||||
# what are we profiling?
|
# what are we profiling?
|
||||||
@@ -112,6 +129,17 @@ if ($helpers{$fqdbin} eq "enforce") {
|
|||||||
reload($fqdbin);
|
reload($fqdbin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# When reading from syslog, it is possible to hit the default kernel
|
||||||
|
# printk ratelimit. This will result in audit entries getting skipped,
|
||||||
|
# making profile generation inaccurate. When using genprof, disable
|
||||||
|
# the printk ratelimit, and restore it on exit.
|
||||||
|
my $ratelimit_sysctl = "/proc/sys/kernel/printk_ratelimit";
|
||||||
|
my $ratelimit_saved = sysctl_read($ratelimit_sysctl);
|
||||||
|
END { sysctl_write($ratelimit_sysctl, $ratelimit_saved); }
|
||||||
|
sysctl_write($ratelimit_sysctl, 0);
|
||||||
|
|
||||||
|
UI_Info(gettext("\nBefore you begin, you may wish to check if a\nprofile already exists for the application you\nwish to confine. See the following wiki page for\nmore information:\nhttp://wiki.apparmor.net/index.php/Profiles"));
|
||||||
|
|
||||||
UI_Important(gettext("Please start the application to be profiled in \nanother window and exercise its functionality now.\n\nOnce completed, select the \"Scan\" button below in \norder to scan the system logs for AppArmor events. \n\nFor each AppArmor event, you will be given the \nopportunity to choose whether the access should be \nallowed or denied."));
|
UI_Important(gettext("Please start the application to be profiled in \nanother window and exercise its functionality now.\n\nOnce completed, select the \"Scan\" button below in \norder to scan the system logs for AppArmor events. \n\nFor each AppArmor event, you will be given the \nopportunity to choose whether the access should be \nallowed or denied."));
|
||||||
|
|
||||||
my $syslog = 1;
|
my $syslog = 1;
|
||||||
@@ -166,7 +194,8 @@ for my $p (sort keys %helpers) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_Info(gettext("Reloaded SubDomain profiles in enforce mode."));
|
UI_Info(gettext("Reloaded AppArmor profiles in enforce mode."));
|
||||||
|
UI_Info(gettext("\nPlease consider contributing your new profile! See\nthe following wiki page for more information:\nhttp://wiki.apparmor.net/index.php/Profiles\n"));
|
||||||
UI_Info(sprintf(gettext('Finished generating profile for %s.'), $fqdbin));
|
UI_Info(sprintf(gettext('Finished generating profile for %s.'), $fqdbin));
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
@@ -1,7 +1,4 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -27,7 +24,7 @@ use Getopt::Long;
|
|||||||
use Locale::gettext;
|
use Locale::gettext;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
|
|
||||||
# force $PATH to be sane
|
# force $PATH to be sane
|
||||||
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
|
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
|
||||||
@@ -56,7 +53,7 @@ GetOptions(
|
|||||||
$profiledir = get_full_path($profiledir);
|
$profiledir = get_full_path($profiledir);
|
||||||
|
|
||||||
unless (-d $profiledir) {
|
unless (-d $profiledir) {
|
||||||
fatal_error "Can't find subdomain profiles in $profiledir.";
|
fatal_error "Can't find AppArmor profiles in $profiledir.";
|
||||||
}
|
}
|
||||||
|
|
||||||
# load all the include files
|
# load all the include files
|
@@ -1,7 +1,4 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
|
||||||
# $Id: $
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2008 Dominic Reynolds. All Rights Reserved.
|
# Copyright (c) 2008 Dominic Reynolds. All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -106,7 +103,7 @@ my $usage_bottom =
|
|||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
use Immunix::Repository;
|
use Immunix::Repository;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
# $Id$
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005-2006 Novell/SUSE
|
# Copyright (C) 2005-2006 Novell/SUSE
|
||||||
@@ -184,11 +183,11 @@ if ($count_complain) {
|
|||||||
if ($verbose) {
|
if ($verbose) {
|
||||||
print keys(%profiles) . " profiles are loaded.\n";
|
print keys(%profiles) . " profiles are loaded.\n";
|
||||||
print $#enforced_profiles + 1 . " profiles are in enforce mode.\n";
|
print $#enforced_profiles + 1 . " profiles are in enforce mode.\n";
|
||||||
for (@enforced_profiles) {
|
for (sort(@enforced_profiles)) {
|
||||||
print " " . $_ . "\n";
|
print " " . $_ . "\n";
|
||||||
}
|
}
|
||||||
print $#complain_profiles + 1 . " profiles are in complain mode.\n";
|
print $#complain_profiles + 1 . " profiles are in complain mode.\n";
|
||||||
for (@complain_profiles) {
|
for (sort(@complain_profiles)) {
|
||||||
print " " . $_ . "\n";
|
print " " . $_ . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,15 +202,15 @@ if ($verbose) {
|
|||||||
}
|
}
|
||||||
print keys(%processes) . " processes have profiles defined.\n";
|
print keys(%processes) . " processes have profiles defined.\n";
|
||||||
print keys(%enforced_processes) . " processes are in enforce mode :\n";
|
print keys(%enforced_processes) . " processes are in enforce mode :\n";
|
||||||
for (keys(%enforced_processes)) {
|
for (sort { $enforced_processes{$a}{'profile'} cmp $enforced_processes{$b}{'profile'} } keys(%enforced_processes)) {
|
||||||
print " " . $enforced_processes{$_}{'profile'} . " ($_) \n";
|
print " " . $enforced_processes{$_}{'profile'} . " ($_) \n";
|
||||||
}
|
}
|
||||||
print keys(%complain_processes) . " processes are in complain mode.\n";
|
print keys(%complain_processes) . " processes are in complain mode.\n";
|
||||||
for (keys(%complain_processes)) {
|
for (sort { $complain_processes{$a}{'profile'} cmp $complain_processes{$b}{'profile'} } keys(%complain_processes)) {
|
||||||
print " " . $complain_processes{$_}{'profile'} . " ($_) \n";
|
print " " . $complain_processes{$_}{'profile'} . " ($_) \n";
|
||||||
}
|
}
|
||||||
print keys(%unconfined_processes) . " processes are unconfined but have a profile defined.\n";
|
print keys(%unconfined_processes) . " processes are unconfined but have a profile defined.\n";
|
||||||
for (keys(%unconfined_processes)) {
|
for (sort { $unconfined_processes{$a}{'profile'} cmp $unconfined_processes{$b}{'profile'} } keys(%unconfined_processes)) {
|
||||||
print " " . $unconfined_processes{$_}{'profile'} . " ($_) \n";
|
print " " . $unconfined_processes{$_}{'profile'} . " ($_) \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,7 +1,4 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
# Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -25,9 +22,10 @@
|
|||||||
# audit local system for processes listening on network connections
|
# audit local system for processes listening on network connections
|
||||||
# that are not currently running with a profile.
|
# that are not currently running with a profile.
|
||||||
|
|
||||||
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
use Immunix::SubDomain;
|
use Immunix::AppArmor;
|
||||||
use Locale::gettext;
|
use Locale::gettext;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ sub usage {
|
|||||||
|
|
||||||
my $subdomainfs = check_for_subdomain();
|
my $subdomainfs = check_for_subdomain();
|
||||||
|
|
||||||
die gettext("SubDomain does not appear to be started. Please enable SubDomain and try again.") . "\n"
|
die gettext("AppArmor does not appear to be started. Please enable AppArmor and try again.") . "\n"
|
||||||
unless $subdomainfs;
|
unless $subdomainfs;
|
||||||
|
|
||||||
my @pids;
|
my @pids;
|
||||||
@@ -62,7 +60,7 @@ if ($paranoid) {
|
|||||||
@pids = grep { /^\d+$/ } readdir(PROC);
|
@pids = grep { /^\d+$/ } readdir(PROC);
|
||||||
closedir(PROC);
|
closedir(PROC);
|
||||||
} else {
|
} else {
|
||||||
if (open(NETSTAT, "/bin/netstat -nlp |")) {
|
if (open(NETSTAT, "LANG=C /bin/netstat -nlp |")) {
|
||||||
while (<NETSTAT>) {
|
while (<NETSTAT>) {
|
||||||
chomp;
|
chomp;
|
||||||
push @pids, $5
|
push @pids, $5
|
||||||
@@ -82,29 +80,34 @@ for my $pid (sort { $a <=> $b } @pids) {
|
|||||||
}
|
}
|
||||||
close(CURRENT);
|
close(CURRENT);
|
||||||
}
|
}
|
||||||
|
my $cmdline = `cat /proc/$pid/cmdline`;
|
||||||
|
my $pname = (split(/\0/, $cmdline))[0];
|
||||||
|
if ($pname =~ /\// && !($pname eq $prog)) {
|
||||||
|
$pname = "($pname) ";
|
||||||
|
} else {
|
||||||
|
$pname = "";
|
||||||
|
}
|
||||||
if (not $attr) {
|
if (not $attr) {
|
||||||
if ($prog =~ m/^(\/usr\/bin\/python|\/usr\/bin\/perl|\/bin\/bash)$/) {
|
if ($prog =~ m/^(\/usr\/bin\/python|\/usr\/bin\/perl|\/bin\/bash)$/) {
|
||||||
|
|
||||||
#my $scriptname = (split(/\0/, `cat /proc/$pid/cmdline`))[1];
|
#my $scriptname = (split(/\0/, `cat /proc/$pid/cmdline`))[1];
|
||||||
my $cmdline = `cat /proc/$pid/cmdline`;
|
|
||||||
$cmdline =~ s/\0/ /g;
|
$cmdline =~ s/\0/ /g;
|
||||||
$cmdline =~ s/\s+$//;
|
$cmdline =~ s/\s+$//;
|
||||||
chomp $cmdline;
|
chomp $cmdline;
|
||||||
print "$pid $prog ($cmdline) " . gettext("not confined\n");
|
print "$pid $prog ($cmdline) " . gettext("not confined\n");
|
||||||
} else {
|
} else {
|
||||||
print "$pid $prog " . gettext("not confined\n");
|
print "$pid $prog $pname" . gettext("not confined\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($prog =~ m/^(\/usr\/bin\/python|\/usr\/bin\/perl|\/bin\/bash)$/) {
|
if ($prog =~ m/^(\/usr\/bin\/python|\/usr\/bin\/perl|\/bin\/bash)$/) {
|
||||||
|
|
||||||
#my $scriptname = (split(/\0/, `cat /proc/$pid/cmdline`))[1];
|
#my $scriptname = (split(/\0/, `cat /proc/$pid/cmdline`))[1];
|
||||||
my $cmdline = `cat /proc/$pid/cmdline`;
|
|
||||||
$cmdline =~ s/\0/ /g;
|
$cmdline =~ s/\0/ /g;
|
||||||
$cmdline =~ s/\s+$//;
|
$cmdline =~ s/\s+$//;
|
||||||
chomp $cmdline;
|
chomp $cmdline;
|
||||||
print "$pid $prog ($cmdline) " . gettext("confined by") . " '$attr'\n";
|
print "$pid $prog ($cmdline) " . gettext("confined by") . " '$attr'\n";
|
||||||
} else {
|
} else {
|
||||||
print "$pid $prog " . gettext("confined by") . " '$attr'\n";
|
print "$pid $prog $pname" . gettext("confined by") . " '$attr'\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
documentation/AppArmor Developer 1 - Kernel Notes.odt
Normal file
BIN
documentation/AppArmor Developer 1 - Kernel Notes.odt
Normal file
Binary file not shown.
Binary file not shown.
BIN
documentation/AppArmor Developer 3 - HFA.odt
Normal file
BIN
documentation/AppArmor Developer 3 - HFA.odt
Normal file
Binary file not shown.
BIN
documentation/AppArmor Developer 4 - Policy compilation.odt
Normal file
BIN
documentation/AppArmor Developer 4 - Policy compilation.odt
Normal file
Binary file not shown.
Binary file not shown.
BIN
documentation/AppArmor Policy.odt
Normal file
BIN
documentation/AppArmor Policy.odt
Normal file
Binary file not shown.
BIN
documentation/Techdoc - eHFA.odt
Normal file
BIN
documentation/Techdoc - eHFA.odt
Normal file
Binary file not shown.
@@ -1,58 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export audit subsystem for use by modules
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Adds necessary export symbols for audit subsystem routines.
|
|
||||||
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
Index: linux-2.6.14/include/linux/audit.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.14.orig/include/linux/audit.h
|
|
||||||
+++ linux-2.6.14/include/linux/audit.h
|
|
||||||
@@ -73,6 +73,8 @@
|
|
||||||
#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
|
|
||||||
#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
|
|
||||||
|
|
||||||
+#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */
|
|
||||||
+
|
|
||||||
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
|
||||||
|
|
||||||
/* Rule flags */
|
|
||||||
@@ -265,6 +267,9 @@ extern void audit_log(struct audit_
|
|
||||||
__attribute__((format(printf,4,5)));
|
|
||||||
|
|
||||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
||||||
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
||||||
+ const char *fmt, va_list args)
|
|
||||||
+ __attribute__((format(printf,2,0)));
|
|
||||||
extern void audit_log_format(struct audit_buffer *ab,
|
|
||||||
const char *fmt, ...)
|
|
||||||
__attribute__((format(printf,2,3)));
|
|
||||||
Index: linux-2.6.14/kernel/audit.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.14.orig/kernel/audit.c
|
|
||||||
+++ linux-2.6.14/kernel/audit.c
|
|
||||||
@@ -733,8 +733,8 @@ static inline int audit_expand(struct au
|
|
||||||
* room in the audit buffer, more room will be allocated and vsnprint
|
|
||||||
* will be called a second time. Currently, we assume that a printk
|
|
||||||
* can't format message larger than 1024 bytes, so we don't either. */
|
|
||||||
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
- va_list args)
|
|
||||||
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
+ va_list args)
|
|
||||||
{
|
|
||||||
int len, avail;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
@@ -895,3 +895,11 @@ void audit_log(struct audit_context *ctx
|
|
||||||
audit_log_end(ab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_start);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_format);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_end);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log);
|
|
@@ -1,36 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export namespace semaphore
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Export global namespace_sem (this used to be a per namespace semaphore).
|
|
||||||
Alas, this isn't going to win _any_ points for style.
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
Index: linux-2.6.15/fs/namespace.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.15.orig/fs/namespace.c
|
|
||||||
+++ linux-2.6.15/fs/namespace.c
|
|
||||||
@@ -46,7 +46,8 @@ static int event;
|
|
||||||
static struct list_head *mount_hashtable;
|
|
||||||
static int hash_mask __read_mostly, hash_bits __read_mostly;
|
|
||||||
static kmem_cache_t *mnt_cache;
|
|
||||||
-static struct rw_semaphore namespace_sem;
|
|
||||||
+struct rw_semaphore namespace_sem;
|
|
||||||
+EXPORT_SYMBOL_GPL(namespace_sem);
|
|
||||||
|
|
||||||
/* /sys/fs */
|
|
||||||
decl_subsys(fs, NULL, NULL);
|
|
||||||
Index: linux-2.6.15/include/linux/namespace.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.15.orig/include/linux/namespace.h
|
|
||||||
+++ linux-2.6.15/include/linux/namespace.h
|
|
||||||
@@ -5,6 +5,9 @@
|
|
||||||
#include <linux/mount.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
|
|
||||||
+/* exported for AppArmor (SubDomain) */
|
|
||||||
+extern struct rw_semaphore namespace_sem;
|
|
||||||
+
|
|
||||||
struct namespace {
|
|
||||||
atomic_t count;
|
|
||||||
struct vfsmount * root;
|
|
@@ -1,24 +0,0 @@
|
|||||||
Index: b/security/Makefile
|
|
||||||
===================================================================
|
|
||||||
--- a/security/Makefile
|
|
||||||
+++ b/security/Makefile
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
|
|
||||||
obj-$(CONFIG_KEYS) += keys/
|
|
||||||
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
|
||||||
+obj-$(CONFIG_SECURITY_APPARMOR) += commoncap.o apparmor/
|
|
||||||
|
|
||||||
# if we don't select a security model, use the default capabilities
|
|
||||||
ifneq ($(CONFIG_SECURITY),y)
|
|
||||||
Index: b/security/Kconfig
|
|
||||||
===================================================================
|
|
||||||
--- a/security/Kconfig
|
|
||||||
+++ b/security/Kconfig
|
|
||||||
@@ -100,6 +100,7 @@ config SECURITY_SECLVL
|
|
||||||
If you are unsure how to answer this question, answer N.
|
|
||||||
|
|
||||||
source security/selinux/Kconfig
|
|
||||||
+source security/apparmor/Kconfig
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
apparmor_audit.patch
|
|
||||||
apparmor_namespacesem.patch
|
|
||||||
apparmor_security.patch
|
|
@@ -1 +0,0 @@
|
|||||||
undo_netlinkrecv.patch
|
|
@@ -1,14 +0,0 @@
|
|||||||
--- linux-2.6.18.orig/security/apparmor/lsm.c
|
|
||||||
+++ linux-2.6.18/security/apparmor/lsm.c
|
|
||||||
@@ -199,9 +199,9 @@
|
|
||||||
return cap_netlink_send(sk, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int subdomain_netlink_recv(struct sk_buff *skb, int cap)
|
|
||||||
+static int subdomain_netlink_recv(struct sk_buff *skb)
|
|
||||||
{
|
|
||||||
- return cap_netlink_recv(skb, cap);
|
|
||||||
+ return cap_netlink_recv(skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void subdomain_bprm_apply_creds(struct linux_binprm *bprm, int unsafe)
|
|
@@ -1,2 +0,0 @@
|
|||||||
undo_2.6.20_mnt_namespace.patch
|
|
||||||
undo_netlinkrecv.patch
|
|
@@ -1,37 +0,0 @@
|
|||||||
Index: linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/apparmor.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
@@ -210,7 +210,7 @@ typedef int (*aa_iter) (struct subdomain
|
|
||||||
*/
|
|
||||||
struct aa_path_data {
|
|
||||||
struct dentry *root, *dentry;
|
|
||||||
- struct mnt_namespace *mnt_namespace;
|
|
||||||
+ struct namespace *namespace;
|
|
||||||
struct list_head *head, *pos;
|
|
||||||
int errno;
|
|
||||||
};
|
|
||||||
Index: linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/inline.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
@@ -10,7 +10,7 @@
|
|
||||||
#ifndef __INLINE_H
|
|
||||||
#define __INLINE_H
|
|
||||||
|
|
||||||
-#include <linux/mnt_namespace.h>
|
|
||||||
+#include <linux/namespace.h>
|
|
||||||
|
|
||||||
static inline int __aa_is_confined(struct subdomain *sd)
|
|
||||||
{
|
|
||||||
@@ -323,8 +323,8 @@ static inline void __aa_path_begin(struc
|
|
||||||
{
|
|
||||||
data->dentry = dentry;
|
|
||||||
data->root = dget(rdentry->d_sb->s_root);
|
|
||||||
- data->mnt_namespace = current->nsproxy->mnt_ns;
|
|
||||||
- data->head = &data->mnt_namespace->list;
|
|
||||||
+ data->namespace = current->namespace;
|
|
||||||
+ data->head = &data->namespace->list;
|
|
||||||
data->pos = data->head->next;
|
|
||||||
prefetch(data->pos->next);
|
|
||||||
data->errno = 0;
|
|
@@ -1,16 +0,0 @@
|
|||||||
Index: linux-2.6.16.29/security/apparmor/lsm.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.16.29.orig/security/apparmor/lsm.c
|
|
||||||
+++ linux-2.6.16.29/security/apparmor/lsm.c
|
|
||||||
@@ -176,9 +176,9 @@ static int apparmor_netlink_send(struct
|
|
||||||
return cap_netlink_send(sk, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int apparmor_netlink_recv(struct sk_buff *skb, int cap)
|
|
||||||
+static int apparmor_netlink_recv(struct sk_buff *skb)
|
|
||||||
{
|
|
||||||
- return cap_netlink_recv(skb, cap);
|
|
||||||
+ return cap_netlink_recv(skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void apparmor_bprm_apply_creds(struct linux_binprm *bprm, int unsafe)
|
|
@@ -1,58 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export audit subsystem for use by modules
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Adds necessary export symbols for audit subsystem routines.
|
|
||||||
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
include/linux/audit.h | 5 +++++
|
|
||||||
kernel/audit.c | 6 ++++--
|
|
||||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
Index: linux-2.6.17.9/include/linux/audit.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.17.9.orig/include/linux/audit.h
|
|
||||||
+++ linux-2.6.17.9/include/linux/audit.h
|
|
||||||
@@ -96,6 +96,8 @@
|
|
||||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
|
||||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
|
||||||
|
|
||||||
+#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */
|
|
||||||
+
|
|
||||||
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
|
||||||
|
|
||||||
/* Rule flags */
|
|
||||||
@@ -357,6 +359,9 @@ extern void audit_log(struct audit_
|
|
||||||
__attribute__((format(printf,4,5)));
|
|
||||||
|
|
||||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
||||||
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
||||||
+ const char *fmt, va_list args)
|
|
||||||
+ __attribute__((format(printf,2,0)));
|
|
||||||
extern void audit_log_format(struct audit_buffer *ab,
|
|
||||||
const char *fmt, ...)
|
|
||||||
__attribute__((format(printf,2,3)));
|
|
||||||
Index: linux-2.6.17.9/kernel/audit.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.17.9.orig/kernel/audit.c
|
|
||||||
+++ linux-2.6.17.9/kernel/audit.c
|
|
||||||
@@ -893,8 +893,7 @@ static inline int audit_expand(struct au
|
|
||||||
* will be called a second time. Currently, we assume that a printk
|
|
||||||
* can't format message larger than 1024 bytes, so we don't either.
|
|
||||||
*/
|
|
||||||
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
- va_list args)
|
|
||||||
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
int len, avail;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
@@ -1096,3 +1095,6 @@ EXPORT_SYMBOL(audit_log_start);
|
|
||||||
EXPORT_SYMBOL(audit_log_end);
|
|
||||||
EXPORT_SYMBOL(audit_log_format);
|
|
||||||
EXPORT_SYMBOL(audit_log);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|
|
@@ -1,42 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export namespace semaphore
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Export global namespace_sem (this used to be a per namespace semaphore).
|
|
||||||
Alas, this isn't going to win _any_ points for style.
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/namespace.c | 3 ++-
|
|
||||||
include/linux/namespace.h | 3 +++
|
|
||||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
Index: linux-2.6.17.9/fs/namespace.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.17.9.orig/fs/namespace.c
|
|
||||||
+++ linux-2.6.17.9/fs/namespace.c
|
|
||||||
@@ -46,7 +46,8 @@ static int event;
|
|
||||||
static struct list_head *mount_hashtable __read_mostly;
|
|
||||||
static int hash_mask __read_mostly, hash_bits __read_mostly;
|
|
||||||
static kmem_cache_t *mnt_cache __read_mostly;
|
|
||||||
-static struct rw_semaphore namespace_sem;
|
|
||||||
+struct rw_semaphore namespace_sem;
|
|
||||||
+EXPORT_SYMBOL_GPL(namespace_sem);
|
|
||||||
|
|
||||||
/* /sys/fs */
|
|
||||||
decl_subsys(fs, NULL, NULL);
|
|
||||||
Index: linux-2.6.17.9/include/linux/namespace.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.17.9.orig/include/linux/namespace.h
|
|
||||||
+++ linux-2.6.17.9/include/linux/namespace.h
|
|
||||||
@@ -5,6 +5,9 @@
|
|
||||||
#include <linux/mount.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
|
|
||||||
+/* exported for AppArmor (SubDomain) */
|
|
||||||
+extern struct rw_semaphore namespace_sem;
|
|
||||||
+
|
|
||||||
struct namespace {
|
|
||||||
atomic_t count;
|
|
||||||
struct vfsmount * root;
|
|
@@ -1,24 +0,0 @@
|
|||||||
Index: linux-2.6.17.9/security/Makefile
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.17.9.orig/security/Makefile
|
|
||||||
+++ linux-2.6.17.9/security/Makefile
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
|
|
||||||
obj-$(CONFIG_KEYS) += keys/
|
|
||||||
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
|
||||||
+obj-$(CONFIG_SECURITY_APPARMOR) += commoncap.o apparmor/
|
|
||||||
|
|
||||||
# if we don't select a security model, use the default capabilities
|
|
||||||
ifneq ($(CONFIG_SECURITY),y)
|
|
||||||
Index: linux-2.6.17.9/security/Kconfig
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.17.9.orig/security/Kconfig
|
|
||||||
+++ linux-2.6.17.9/security/Kconfig
|
|
||||||
@@ -100,6 +100,7 @@ config SECURITY_SECLVL
|
|
||||||
If you are unsure how to answer this question, answer N.
|
|
||||||
|
|
||||||
source security/selinux/Kconfig
|
|
||||||
+source security/apparmor/Kconfig
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
apparmor_audit.patch
|
|
||||||
apparmor_namespacesem.patch
|
|
||||||
apparmor_security.patch
|
|
@@ -1 +0,0 @@
|
|||||||
undo_netlinkrecv.patch
|
|
@@ -1,14 +0,0 @@
|
|||||||
--- linux-2.6.18.orig/security/apparmor/lsm.c
|
|
||||||
+++ linux-2.6.18/security/apparmor/lsm.c
|
|
||||||
@@ -199,9 +199,9 @@
|
|
||||||
return cap_netlink_send(sk, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int subdomain_netlink_recv(struct sk_buff *skb, int cap)
|
|
||||||
+static int subdomain_netlink_recv(struct sk_buff *skb)
|
|
||||||
{
|
|
||||||
- return cap_netlink_recv(skb, cap);
|
|
||||||
+ return cap_netlink_recv(skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void subdomain_bprm_apply_creds(struct linux_binprm *bprm, int unsafe)
|
|
@@ -1,2 +0,0 @@
|
|||||||
undo_2.6.20_mnt_namespace.patch
|
|
||||||
undo_netlinkrecv.patch
|
|
@@ -1,37 +0,0 @@
|
|||||||
Index: linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/apparmor.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
@@ -210,7 +210,7 @@ typedef int (*aa_iter) (struct subdomain
|
|
||||||
*/
|
|
||||||
struct aa_path_data {
|
|
||||||
struct dentry *root, *dentry;
|
|
||||||
- struct mnt_namespace *mnt_namespace;
|
|
||||||
+ struct namespace *namespace;
|
|
||||||
struct list_head *head, *pos;
|
|
||||||
int errno;
|
|
||||||
};
|
|
||||||
Index: linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/inline.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
@@ -10,7 +10,7 @@
|
|
||||||
#ifndef __INLINE_H
|
|
||||||
#define __INLINE_H
|
|
||||||
|
|
||||||
-#include <linux/mnt_namespace.h>
|
|
||||||
+#include <linux/namespace.h>
|
|
||||||
|
|
||||||
static inline int __aa_is_confined(struct subdomain *sd)
|
|
||||||
{
|
|
||||||
@@ -323,8 +323,8 @@ static inline void __aa_path_begin(struc
|
|
||||||
{
|
|
||||||
data->dentry = dentry;
|
|
||||||
data->root = dget(rdentry->d_sb->s_root);
|
|
||||||
- data->mnt_namespace = current->nsproxy->mnt_ns;
|
|
||||||
- data->head = &data->mnt_namespace->list;
|
|
||||||
+ data->namespace = current->namespace;
|
|
||||||
+ data->head = &data->namespace->list;
|
|
||||||
data->pos = data->head->next;
|
|
||||||
prefetch(data->pos->next);
|
|
||||||
data->errno = 0;
|
|
@@ -1,16 +0,0 @@
|
|||||||
Index: linux-2.6.16.29/security/apparmor/lsm.c
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.16.29.orig/security/apparmor/lsm.c
|
|
||||||
+++ linux-2.6.16.29/security/apparmor/lsm.c
|
|
||||||
@@ -176,9 +176,9 @@ static int apparmor_netlink_send(struct
|
|
||||||
return cap_netlink_send(sk, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int apparmor_netlink_recv(struct sk_buff *skb, int cap)
|
|
||||||
+static int apparmor_netlink_recv(struct sk_buff *skb)
|
|
||||||
{
|
|
||||||
- return cap_netlink_recv(skb, cap);
|
|
||||||
+ return cap_netlink_recv(skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void apparmor_bprm_apply_creds(struct linux_binprm *bprm, int unsafe)
|
|
@@ -1,54 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export audit subsystem for use by modules
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Adds necessary export symbols for audit subsystem routines.
|
|
||||||
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
include/linux/audit.h | 5 +++++
|
|
||||||
kernel/audit.c | 6 ++++--
|
|
||||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- linux-2.6.18.orig/include/linux/audit.h
|
|
||||||
+++ linux-2.6.18/include/linux/audit.h
|
|
||||||
@@ -100,6 +100,8 @@
|
|
||||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
|
||||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
|
||||||
|
|
||||||
+#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */
|
|
||||||
+
|
|
||||||
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
|
||||||
|
|
||||||
/* Rule flags */
|
|
||||||
@@ -466,6 +468,9 @@ extern void audit_log(struct audit_
|
|
||||||
__attribute__((format(printf,4,5)));
|
|
||||||
|
|
||||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
||||||
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
||||||
+ const char *fmt, va_list args)
|
|
||||||
+ __attribute__((format(printf,2,0)));
|
|
||||||
extern void audit_log_format(struct audit_buffer *ab,
|
|
||||||
const char *fmt, ...)
|
|
||||||
__attribute__((format(printf,2,3)));
|
|
||||||
--- linux-2.6.18.orig/kernel/audit.c
|
|
||||||
+++ linux-2.6.18/kernel/audit.c
|
|
||||||
@@ -954,8 +954,7 @@ static inline int audit_expand(struct au
|
|
||||||
* will be called a second time. Currently, we assume that a printk
|
|
||||||
* can't format message larger than 1024 bytes, so we don't either.
|
|
||||||
*/
|
|
||||||
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
- va_list args)
|
|
||||||
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
int len, avail;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
@@ -1211,3 +1210,6 @@ EXPORT_SYMBOL(audit_log_start);
|
|
||||||
EXPORT_SYMBOL(audit_log_end);
|
|
||||||
EXPORT_SYMBOL(audit_log_format);
|
|
||||||
EXPORT_SYMBOL(audit_log);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|
|
@@ -1,38 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export namespace semaphore
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Export global namespace_sem (this used to be a per namespace semaphore).
|
|
||||||
Alas, this isn't going to win _any_ points for style.
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/namespace.c | 3 ++-
|
|
||||||
include/linux/namespace.h | 3 +++
|
|
||||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- linux-2.6.18.orig/fs/namespace.c
|
|
||||||
+++ linux-2.6.18/fs/namespace.c
|
|
||||||
@@ -45,7 +45,8 @@ static int event;
|
|
||||||
static struct list_head *mount_hashtable __read_mostly;
|
|
||||||
static int hash_mask __read_mostly, hash_bits __read_mostly;
|
|
||||||
static kmem_cache_t *mnt_cache __read_mostly;
|
|
||||||
-static struct rw_semaphore namespace_sem;
|
|
||||||
+struct rw_semaphore namespace_sem;
|
|
||||||
+EXPORT_SYMBOL_GPL(namespace_sem);
|
|
||||||
|
|
||||||
/* /sys/fs */
|
|
||||||
decl_subsys(fs, NULL, NULL);
|
|
||||||
--- linux-2.6.18.orig/include/linux/namespace.h
|
|
||||||
+++ linux-2.6.18/include/linux/namespace.h
|
|
||||||
@@ -5,6 +5,9 @@
|
|
||||||
#include <linux/mount.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
|
|
||||||
+/* exported for AppArmor (SubDomain) */
|
|
||||||
+extern struct rw_semaphore namespace_sem;
|
|
||||||
+
|
|
||||||
struct namespace {
|
|
||||||
atomic_t count;
|
|
||||||
struct vfsmount * root;
|
|
@@ -1,22 +0,0 @@
|
|||||||
Index: linux-2.6.18/security/Makefile
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.orig/security/Makefile
|
|
||||||
+++ linux-2.6.18/security/Makefile
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
|
|
||||||
obj-$(CONFIG_KEYS) += keys/
|
|
||||||
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
|
||||||
+obj-$(CONFIG_SECURITY_APPARMOR) += commoncap.o apparmor/
|
|
||||||
|
|
||||||
# if we don't select a security model, use the default capabilities
|
|
||||||
ifneq ($(CONFIG_SECURITY),y)
|
|
||||||
--- linux-2.6.17.orig/security/Kconfig
|
|
||||||
+++ linux-2.6.17/security/Kconfig
|
|
||||||
@@ -106,6 +106,7 @@ config SECURITY_SECLVL
|
|
||||||
If you are unsure how to answer this question, answer N.
|
|
||||||
|
|
||||||
source security/selinux/Kconfig
|
|
||||||
+source security/apparmor/Kconfig
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
apparmor_audit.patch
|
|
||||||
apparmor_namespacesem.patch
|
|
||||||
apparmor_security.patch
|
|
@@ -1 +0,0 @@
|
|||||||
undo_2.6.20_mnt_namespace.patch
|
|
@@ -1,37 +0,0 @@
|
|||||||
Index: linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/apparmor.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
@@ -210,7 +210,7 @@ typedef int (*aa_iter) (struct subdomain
|
|
||||||
*/
|
|
||||||
struct aa_path_data {
|
|
||||||
struct dentry *root, *dentry;
|
|
||||||
- struct mnt_namespace *mnt_namespace;
|
|
||||||
+ struct namespace *namespace;
|
|
||||||
struct list_head *head, *pos;
|
|
||||||
int errno;
|
|
||||||
};
|
|
||||||
Index: linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/inline.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
@@ -10,7 +10,7 @@
|
|
||||||
#ifndef __INLINE_H
|
|
||||||
#define __INLINE_H
|
|
||||||
|
|
||||||
-#include <linux/mnt_namespace.h>
|
|
||||||
+#include <linux/namespace.h>
|
|
||||||
|
|
||||||
static inline int __aa_is_confined(struct subdomain *sd)
|
|
||||||
{
|
|
||||||
@@ -323,8 +323,8 @@ static inline void __aa_path_begin(struc
|
|
||||||
{
|
|
||||||
data->dentry = dentry;
|
|
||||||
data->root = dget(rdentry->d_sb->s_root);
|
|
||||||
- data->mnt_namespace = current->nsproxy->mnt_ns;
|
|
||||||
- data->head = &data->mnt_namespace->list;
|
|
||||||
+ data->namespace = current->namespace;
|
|
||||||
+ data->head = &data->namespace->list;
|
|
||||||
data->pos = data->head->next;
|
|
||||||
prefetch(data->pos->next);
|
|
||||||
data->errno = 0;
|
|
@@ -1,54 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export audit subsystem for use by modules
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Adds necessary export symbols for audit subsystem routines.
|
|
||||||
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
include/linux/audit.h | 5 +++++
|
|
||||||
kernel/audit.c | 6 ++++--
|
|
||||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- linux-2.6.18.orig/include/linux/audit.h
|
|
||||||
+++ linux-2.6.18/include/linux/audit.h
|
|
||||||
@@ -100,6 +100,8 @@
|
|
||||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
|
||||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
|
||||||
|
|
||||||
+#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */
|
|
||||||
+
|
|
||||||
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
|
||||||
|
|
||||||
/* Rule flags */
|
|
||||||
@@ -466,6 +468,9 @@ extern void audit_log(struct audit_
|
|
||||||
__attribute__((format(printf,4,5)));
|
|
||||||
|
|
||||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
||||||
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
||||||
+ const char *fmt, va_list args)
|
|
||||||
+ __attribute__((format(printf,2,0)));
|
|
||||||
extern void audit_log_format(struct audit_buffer *ab,
|
|
||||||
const char *fmt, ...)
|
|
||||||
__attribute__((format(printf,2,3)));
|
|
||||||
--- linux-2.6.18.orig/kernel/audit.c
|
|
||||||
+++ linux-2.6.18/kernel/audit.c
|
|
||||||
@@ -954,8 +954,7 @@ static inline int audit_expand(struct au
|
|
||||||
* will be called a second time. Currently, we assume that a printk
|
|
||||||
* can't format message larger than 1024 bytes, so we don't either.
|
|
||||||
*/
|
|
||||||
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
- va_list args)
|
|
||||||
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
int len, avail;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
@@ -1211,3 +1210,6 @@ EXPORT_SYMBOL(audit_log_start);
|
|
||||||
EXPORT_SYMBOL(audit_log_end);
|
|
||||||
EXPORT_SYMBOL(audit_log_format);
|
|
||||||
EXPORT_SYMBOL(audit_log);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|
|
@@ -1,38 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export namespace semaphore
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Export global namespace_sem (this used to be a per namespace semaphore).
|
|
||||||
Alas, this isn't going to win _any_ points for style.
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/namespace.c | 3 ++-
|
|
||||||
include/linux/namespace.h | 3 +++
|
|
||||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- linux-2.6.18.orig/fs/namespace.c
|
|
||||||
+++ linux-2.6.18/fs/namespace.c
|
|
||||||
@@ -45,7 +45,8 @@ static int event;
|
|
||||||
static struct list_head *mount_hashtable __read_mostly;
|
|
||||||
static int hash_mask __read_mostly, hash_bits __read_mostly;
|
|
||||||
static kmem_cache_t *mnt_cache __read_mostly;
|
|
||||||
-static struct rw_semaphore namespace_sem;
|
|
||||||
+struct rw_semaphore namespace_sem;
|
|
||||||
+EXPORT_SYMBOL_GPL(namespace_sem);
|
|
||||||
|
|
||||||
/* /sys/fs */
|
|
||||||
decl_subsys(fs, NULL, NULL);
|
|
||||||
--- linux-2.6.18.orig/include/linux/namespace.h
|
|
||||||
+++ linux-2.6.18/include/linux/namespace.h
|
|
||||||
@@ -5,6 +5,9 @@
|
|
||||||
#include <linux/mount.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
|
|
||||||
+/* exported for AppArmor (SubDomain) */
|
|
||||||
+extern struct rw_semaphore namespace_sem;
|
|
||||||
+
|
|
||||||
struct namespace {
|
|
||||||
atomic_t count;
|
|
||||||
struct vfsmount * root;
|
|
@@ -1,22 +0,0 @@
|
|||||||
Index: linux-2.6.18/security/Makefile
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.orig/security/Makefile
|
|
||||||
+++ linux-2.6.18/security/Makefile
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
|
|
||||||
obj-$(CONFIG_KEYS) += keys/
|
|
||||||
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
|
||||||
+obj-$(CONFIG_SECURITY_APPARMOR) += commoncap.o apparmor/
|
|
||||||
|
|
||||||
# if we don't select a security model, use the default capabilities
|
|
||||||
ifneq ($(CONFIG_SECURITY),y)
|
|
||||||
--- linux-2.6.17.orig/security/Kconfig
|
|
||||||
+++ linux-2.6.17/security/Kconfig
|
|
||||||
@@ -106,6 +106,7 @@ config SECURITY_SECLVL
|
|
||||||
If you are unsure how to answer this question, answer N.
|
|
||||||
|
|
||||||
source security/selinux/Kconfig
|
|
||||||
+source security/apparmor/Kconfig
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
apparmor_audit.patch
|
|
||||||
apparmor_namespacesem.patch
|
|
||||||
apparmor_security.patch
|
|
@@ -1 +0,0 @@
|
|||||||
undo_2.6.20_mnt_namespace.patch
|
|
@@ -1,37 +0,0 @@
|
|||||||
Index: linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/apparmor.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/apparmor.h
|
|
||||||
@@ -210,7 +210,7 @@ typedef int (*aa_iter) (struct subdomain
|
|
||||||
*/
|
|
||||||
struct aa_path_data {
|
|
||||||
struct dentry *root, *dentry;
|
|
||||||
- struct mnt_namespace *mnt_namespace;
|
|
||||||
+ struct namespace *namespace;
|
|
||||||
struct list_head *head, *pos;
|
|
||||||
int errno;
|
|
||||||
};
|
|
||||||
Index: linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.6.orig/security/apparmor/inline.h
|
|
||||||
+++ linux-2.6.18.6/security/apparmor/inline.h
|
|
||||||
@@ -10,7 +10,7 @@
|
|
||||||
#ifndef __INLINE_H
|
|
||||||
#define __INLINE_H
|
|
||||||
|
|
||||||
-#include <linux/mnt_namespace.h>
|
|
||||||
+#include <linux/namespace.h>
|
|
||||||
|
|
||||||
static inline int __aa_is_confined(struct subdomain *sd)
|
|
||||||
{
|
|
||||||
@@ -323,8 +323,8 @@ static inline void __aa_path_begin(struc
|
|
||||||
{
|
|
||||||
data->dentry = dentry;
|
|
||||||
data->root = dget(rdentry->d_sb->s_root);
|
|
||||||
- data->mnt_namespace = current->nsproxy->mnt_ns;
|
|
||||||
- data->head = &data->mnt_namespace->list;
|
|
||||||
+ data->namespace = current->namespace;
|
|
||||||
+ data->head = &data->namespace->list;
|
|
||||||
data->pos = data->head->next;
|
|
||||||
prefetch(data->pos->next);
|
|
||||||
data->errno = 0;
|
|
@@ -1,54 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export audit subsystem for use by modules
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Adds necessary export symbols for audit subsystem routines.
|
|
||||||
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
include/linux/audit.h | 5 +++++
|
|
||||||
kernel/audit.c | 6 ++++--
|
|
||||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- linux-2.6.18.orig/include/linux/audit.h
|
|
||||||
+++ linux-2.6.18/include/linux/audit.h
|
|
||||||
@@ -100,6 +100,8 @@
|
|
||||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
|
||||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
|
||||||
|
|
||||||
+#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */
|
|
||||||
+
|
|
||||||
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
|
||||||
|
|
||||||
/* Rule flags */
|
|
||||||
@@ -466,6 +468,9 @@ extern void audit_log(struct audit_
|
|
||||||
__attribute__((format(printf,4,5)));
|
|
||||||
|
|
||||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
||||||
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
||||||
+ const char *fmt, va_list args)
|
|
||||||
+ __attribute__((format(printf,2,0)));
|
|
||||||
extern void audit_log_format(struct audit_buffer *ab,
|
|
||||||
const char *fmt, ...)
|
|
||||||
__attribute__((format(printf,2,3)));
|
|
||||||
--- linux-2.6.18.orig/kernel/audit.c
|
|
||||||
+++ linux-2.6.18/kernel/audit.c
|
|
||||||
@@ -954,8 +954,7 @@ static inline int audit_expand(struct au
|
|
||||||
* will be called a second time. Currently, we assume that a printk
|
|
||||||
* can't format message larger than 1024 bytes, so we don't either.
|
|
||||||
*/
|
|
||||||
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
- va_list args)
|
|
||||||
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
int len, avail;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
@@ -1211,3 +1210,6 @@ EXPORT_SYMBOL(audit_log_start);
|
|
||||||
EXPORT_SYMBOL(audit_log_end);
|
|
||||||
EXPORT_SYMBOL(audit_log_format);
|
|
||||||
EXPORT_SYMBOL(audit_log);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|
|
@@ -1,38 +0,0 @@
|
|||||||
From: tonyj@suse.de
|
|
||||||
Subject: Export namespace semaphore
|
|
||||||
Patch-mainline: no
|
|
||||||
|
|
||||||
Export global namespace_sem (this used to be a per namespace semaphore).
|
|
||||||
Alas, this isn't going to win _any_ points for style.
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/namespace.c | 3 ++-
|
|
||||||
include/linux/mnt_namespace.h | 3 +++
|
|
||||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- linux-2.6.19.orig/fs/namespace.c
|
|
||||||
+++ linux-2.6.19/fs/namespace.c
|
|
||||||
@@ -37,7 +37,8 @@ static int event;
|
|
||||||
static struct list_head *mount_hashtable __read_mostly;
|
|
||||||
static int hash_mask __read_mostly, hash_bits __read_mostly;
|
|
||||||
static struct kmem_cache *mnt_cache __read_mostly;
|
|
||||||
-static struct rw_semaphore namespace_sem;
|
|
||||||
+struct rw_semaphore namespace_sem;
|
|
||||||
+EXPORT_SYMBOL_GPL(namespace_sem);
|
|
||||||
|
|
||||||
/* /sys/fs */
|
|
||||||
decl_subsys(fs, NULL, NULL);
|
|
||||||
--- linux-2.6.19.orig/include/linux/mnt_namespace.h
|
|
||||||
+++ linux-2.6.19/include/linux/mnt_namespace.h
|
|
||||||
@@ -6,6 +6,9 @@
|
|
||||||
#include <linux/sched.h>
|
|
||||||
#include <linux/nsproxy.h>
|
|
||||||
|
|
||||||
+/* exported for AppArmor (SubDomain) */
|
|
||||||
+extern struct rw_semaphore namespace_sem;
|
|
||||||
+
|
|
||||||
struct mnt_namespace {
|
|
||||||
atomic_t count;
|
|
||||||
struct vfsmount * root;
|
|
@@ -1,22 +0,0 @@
|
|||||||
Index: linux-2.6.18/security/Makefile
|
|
||||||
===================================================================
|
|
||||||
--- linux-2.6.18.orig/security/Makefile
|
|
||||||
+++ linux-2.6.18/security/Makefile
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
|
|
||||||
obj-$(CONFIG_KEYS) += keys/
|
|
||||||
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
|
||||||
+obj-$(CONFIG_SECURITY_APPARMOR) += commoncap.o apparmor/
|
|
||||||
|
|
||||||
# if we don't select a security model, use the default capabilities
|
|
||||||
ifneq ($(CONFIG_SECURITY),y)
|
|
||||||
--- linux-2.6.17.orig/security/Kconfig
|
|
||||||
+++ linux-2.6.17/security/Kconfig
|
|
||||||
@@ -106,6 +106,7 @@ config SECURITY_SECLVL
|
|
||||||
If you are unsure how to answer this question, answer N.
|
|
||||||
|
|
||||||
source security/selinux/Kconfig
|
|
||||||
+source security/apparmor/Kconfig
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
apparmor_audit.patch
|
|
||||||
apparmor_namespacesem.patch
|
|
||||||
apparmor_security.patch
|
|
@@ -1,144 +0,0 @@
|
|||||||
From: John Johansen <jjohansen@suse.de>
|
|
||||||
Subject: Fix __d_path to allow for old and new behavior bnc#380763
|
|
||||||
|
|
||||||
Fix __d_path so that it can be told whether or not to connect
|
|
||||||
disconnect path to the root. This is easier and more efficient
|
|
||||||
than trying to reconnect these paths for d_path and get_cwd
|
|
||||||
after the fact.
|
|
||||||
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/dcache.c | 57 ++++++++++++++++++-------------------------------
|
|
||||||
fs/namespace.c | 2 -
|
|
||||||
include/linux/dcache.h | 2 -
|
|
||||||
3 files changed, 24 insertions(+), 37 deletions(-)
|
|
||||||
|
|
||||||
--- a/fs/dcache.c
|
|
||||||
+++ b/fs/dcache.c
|
|
||||||
@@ -1772,6 +1772,7 @@ shouldnt_be_hashed:
|
|
||||||
* @buffer: buffer to return value in
|
|
||||||
* @buflen: buffer length
|
|
||||||
* @fail_deleted: what to return for deleted files
|
|
||||||
+ * @disconnect: don't return a path starting with / when disconnected
|
|
||||||
*
|
|
||||||
* Convert a dentry into an ASCII path name. If the entry has been deleted,
|
|
||||||
* then if @fail_deleted is true, ERR_PTR(-ENOENT) is returned. Otherwise,
|
|
||||||
@@ -1784,9 +1785,10 @@ shouldnt_be_hashed:
|
|
||||||
*/
|
|
||||||
char *__d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
|
|
||||||
struct dentry *root, struct vfsmount *rootmnt,
|
|
||||||
- char *buffer, int buflen, int fail_deleted)
|
|
||||||
+ char *buffer, int buflen, int fail_deleted, int disconnect)
|
|
||||||
{
|
|
||||||
- int namelen, is_slash, vfsmount_locked = 0;
|
|
||||||
+ int namelen, vfsmount_locked = 0;
|
|
||||||
+ const unsigned char *name;
|
|
||||||
|
|
||||||
if (buflen < 2)
|
|
||||||
return ERR_PTR(-ENAMETOOLONG);
|
|
||||||
@@ -1847,27 +1849,26 @@ global_root:
|
|
||||||
* unconnected dentry, or the file is on a pseudo filesystem.
|
|
||||||
*/
|
|
||||||
namelen = dentry->d_name.len;
|
|
||||||
- is_slash = (namelen == 1 && *dentry->d_name.name == '/');
|
|
||||||
- if (is_slash || (dentry->d_sb->s_flags & MS_NOUSER)) {
|
|
||||||
- /*
|
|
||||||
- * Make sure we won't return a pathname starting with '/'.
|
|
||||||
- *
|
|
||||||
- * Historically, we also glue together the root dentry and
|
|
||||||
- * remaining name for pseudo filesystems like pipefs, which
|
|
||||||
- * have the MS_NOUSER flag set. This results in pathnames
|
|
||||||
- * like "pipe:[439336]".
|
|
||||||
- */
|
|
||||||
- if (*buffer == '/') {
|
|
||||||
- buffer++;
|
|
||||||
- buflen++;
|
|
||||||
- }
|
|
||||||
- if (is_slash)
|
|
||||||
- goto out;
|
|
||||||
+ name = dentry->d_name.name;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * If this is a root dentry, then overwrite the slash. This
|
|
||||||
+ * will also DTRT with pseudo filesystems which have root
|
|
||||||
+ * dentries named "foo:".
|
|
||||||
+ */
|
|
||||||
+ if (IS_ROOT(dentry)) {
|
|
||||||
+ buffer++;
|
|
||||||
+ buflen++;
|
|
||||||
+ }
|
|
||||||
+ if (disconnect && *name == '/') {
|
|
||||||
+ /* Make sure we won't return a pathname starting with '/' */
|
|
||||||
+ name++;
|
|
||||||
+ namelen--;
|
|
||||||
}
|
|
||||||
if (buflen < namelen)
|
|
||||||
goto Elong;
|
|
||||||
buffer -= namelen;
|
|
||||||
- memcpy(buffer, dentry->d_name.name, namelen);
|
|
||||||
+ memcpy(buffer, name, namelen);
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
Elong:
|
|
||||||
@@ -1875,18 +1876,6 @@ Elong:
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static char *__connect_d_path(char *path, char *buffer)
|
|
||||||
-{
|
|
||||||
- if (!IS_ERR(path) && *path != '/') {
|
|
||||||
- /* Pretend that disconnected paths are hanging off the root. */
|
|
||||||
- if (path == buffer)
|
|
||||||
- path = ERR_PTR(-ENAMETOOLONG);
|
|
||||||
- else
|
|
||||||
- *--path = '/';
|
|
||||||
- }
|
|
||||||
- return path;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
/* write full pathname into buffer and return start of pathname */
|
|
||||||
char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt, char *buf,
|
|
||||||
int buflen)
|
|
||||||
@@ -1909,8 +1898,7 @@ char *d_path(struct dentry *dentry, stru
|
|
||||||
rootmnt = mntget(current->fs->rootmnt);
|
|
||||||
root = dget(current->fs->root);
|
|
||||||
read_unlock(¤t->fs->lock);
|
|
||||||
- res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen, 0);
|
|
||||||
- res = __connect_d_path(res, buf);
|
|
||||||
+ res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen, 0, 0);
|
|
||||||
dput(root);
|
|
||||||
mntput(rootmnt);
|
|
||||||
return res;
|
|
||||||
@@ -1972,8 +1960,7 @@ asmlinkage long sys_getcwd(char __user *
|
|
||||||
root = dget(current->fs->root);
|
|
||||||
read_unlock(¤t->fs->lock);
|
|
||||||
|
|
||||||
- cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE, 1);
|
|
||||||
- cwd = __connect_d_path(cwd, page);
|
|
||||||
+ cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE, 1, 0);
|
|
||||||
error = PTR_ERR(cwd);
|
|
||||||
if (IS_ERR(cwd))
|
|
||||||
goto out;
|
|
||||||
--- a/fs/namespace.c
|
|
||||||
+++ b/fs/namespace.c
|
|
||||||
@@ -1901,7 +1901,7 @@ char *d_namespace_path(struct dentry *de
|
|
||||||
mntput(rootmnt);
|
|
||||||
if (nsrootmnt)
|
|
||||||
root = dget(nsrootmnt->mnt_root);
|
|
||||||
- res = __d_path(dentry, vfsmnt, root, nsrootmnt, buf, buflen, 1);
|
|
||||||
+ res = __d_path(dentry, vfsmnt, root, nsrootmnt, buf, buflen, 1, 1);
|
|
||||||
dput(root);
|
|
||||||
mntput(nsrootmnt);
|
|
||||||
/* Prevent empty path for lazily unmounted filesystems. */
|
|
||||||
--- a/include/linux/dcache.h
|
|
||||||
+++ b/include/linux/dcache.h
|
|
||||||
@@ -301,7 +301,7 @@ extern int d_validate(struct dentry *, s
|
|
||||||
extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
|
|
||||||
|
|
||||||
extern char *__d_path(struct dentry *, struct vfsmount *, struct dentry *,
|
|
||||||
- struct vfsmount *, char *, int, int);
|
|
||||||
+ struct vfsmount *, char *, int, int, int);
|
|
||||||
extern char * d_path(struct dentry *, struct vfsmount *, char *, int);
|
|
||||||
|
|
||||||
/* Allocation counts.. */
|
|
@@ -1,72 +0,0 @@
|
|||||||
From: Tony Jones <tonyj@suse.de>
|
|
||||||
Subject: Export audit subsystem for use by modules
|
|
||||||
|
|
||||||
Update kenel audit range comments to show AppArmor's registered range of
|
|
||||||
1500-1599. This range used to be reserved for LSPP but LSPP uses the
|
|
||||||
SE Linux range and the range was given to AppArmor.
|
|
||||||
Adds necessary export symbols for audit subsystem routines.
|
|
||||||
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
||||||
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
||||||
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
include/linux/audit.h | 12 +++++++++++-
|
|
||||||
kernel/audit.c | 6 ++++--
|
|
||||||
2 files changed, 15 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
--- a/include/linux/audit.h
|
|
||||||
+++ b/include/linux/audit.h
|
|
||||||
@@ -33,7 +33,7 @@
|
|
||||||
* 1200 - 1299 messages internal to the audit daemon
|
|
||||||
* 1300 - 1399 audit event messages
|
|
||||||
* 1400 - 1499 SE Linux use
|
|
||||||
- * 1500 - 1599 kernel LSPP events
|
|
||||||
+ * 1500 - 1599 AppArmor use
|
|
||||||
* 1600 - 1699 kernel crypto events
|
|
||||||
* 1700 - 1799 kernel anomaly records
|
|
||||||
* 1800 - 1999 future kernel use (maybe integrity labels and related events)
|
|
||||||
@@ -116,6 +116,13 @@
|
|
||||||
#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */
|
|
||||||
#define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */
|
|
||||||
|
|
||||||
+#define AUDIT_APPARMOR_AUDIT 1501 /* AppArmor audited grants */
|
|
||||||
+#define AUDIT_APPARMOR_ALLOWED 1502 /* Allowed Access for learning */
|
|
||||||
+#define AUDIT_APPARMOR_DENIED 1503
|
|
||||||
+#define AUDIT_APPARMOR_HINT 1504 /* Process Tracking information */
|
|
||||||
+#define AUDIT_APPARMOR_STATUS 1505 /* Changes in config */
|
|
||||||
+#define AUDIT_APPARMOR_ERROR 1506 /* Internal AppArmor Errors */
|
|
||||||
+
|
|
||||||
#define AUDIT_FIRST_KERN_ANOM_MSG 1700
|
|
||||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
|
||||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
|
||||||
@@ -513,6 +520,9 @@ extern void audit_log(struct audit_
|
|
||||||
__attribute__((format(printf,4,5)));
|
|
||||||
|
|
||||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
||||||
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
||||||
+ const char *fmt, va_list args)
|
|
||||||
+ __attribute__((format(printf,2,0)));
|
|
||||||
extern void audit_log_format(struct audit_buffer *ab,
|
|
||||||
const char *fmt, ...)
|
|
||||||
__attribute__((format(printf,2,3)));
|
|
||||||
--- a/kernel/audit.c
|
|
||||||
+++ b/kernel/audit.c
|
|
||||||
@@ -1215,8 +1215,7 @@ static inline int audit_expand(struct au
|
|
||||||
* will be called a second time. Currently, we assume that a printk
|
|
||||||
* can't format message larger than 1024 bytes, so we don't either.
|
|
||||||
*/
|
|
||||||
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
||||||
- va_list args)
|
|
||||||
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
int len, avail;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
@@ -1471,3 +1470,6 @@ EXPORT_SYMBOL(audit_log_start);
|
|
||||||
EXPORT_SYMBOL(audit_log_end);
|
|
||||||
EXPORT_SYMBOL(audit_log_format);
|
|
||||||
EXPORT_SYMBOL(audit_log);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
||||||
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|
|
@@ -1,30 +0,0 @@
|
|||||||
From: John Johansen <jjohansen@suse.de>
|
|
||||||
Subject: Add AppArmor LSM to security/Makefile
|
|
||||||
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
security/Kconfig | 1 +
|
|
||||||
security/Makefile | 1 +
|
|
||||||
2 files changed, 2 insertions(+)
|
|
||||||
|
|
||||||
--- a/security/Kconfig
|
|
||||||
+++ b/security/Kconfig
|
|
||||||
@@ -104,6 +104,7 @@ config SECURITY_ROOTPLUG
|
|
||||||
If you are unsure how to answer this question, answer N.
|
|
||||||
|
|
||||||
source security/selinux/Kconfig
|
|
||||||
+source security/apparmor/Kconfig
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
||||||
--- a/security/Makefile
|
|
||||||
+++ b/security/Makefile
|
|
||||||
@@ -14,5 +14,6 @@ endif
|
|
||||||
obj-$(CONFIG_SECURITY) += security.o dummy.o inode.o
|
|
||||||
# Must precede capability.o in order to stack properly.
|
|
||||||
obj-$(CONFIG_SECURITY_SELINUX) += selinux/built-in.o
|
|
||||||
+obj-$(CONFIG_SECURITY_APPARMOR) += commoncap.o apparmor/
|
|
||||||
obj-$(CONFIG_SECURITY_CAPABILITIES) += commoncap.o capability.o
|
|
||||||
obj-$(CONFIG_SECURITY_ROOTPLUG) += commoncap.o root_plug.o
|
|
@@ -1,904 +0,0 @@
|
|||||||
From: John Johansen <jjohansen@suse.de>
|
|
||||||
Subject: AppArmor: Module and LSM hooks
|
|
||||||
|
|
||||||
Module parameters, LSM hooks, initialization and teardown.
|
|
||||||
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
security/apparmor/lsm.c | 889 ++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
1 file changed, 889 insertions(+)
|
|
||||||
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/security/apparmor/lsm.c
|
|
||||||
@@ -0,0 +1,889 @@
|
|
||||||
+/*
|
|
||||||
+ * Copyright (C) 1998-2007 Novell/SUSE
|
|
||||||
+ *
|
|
||||||
+ * This program is free software; you can redistribute it and/or
|
|
||||||
+ * modify it under the terms of the GNU General Public License as
|
|
||||||
+ * published by the Free Software Foundation, version 2 of the
|
|
||||||
+ * License.
|
|
||||||
+ *
|
|
||||||
+ * AppArmor LSM interface
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#include <linux/security.h>
|
|
||||||
+#include <linux/module.h>
|
|
||||||
+#include <linux/mm.h>
|
|
||||||
+#include <linux/mman.h>
|
|
||||||
+#include <linux/mount.h>
|
|
||||||
+#include <linux/namei.h>
|
|
||||||
+#include <linux/ctype.h>
|
|
||||||
+#include <linux/sysctl.h>
|
|
||||||
+#include <linux/audit.h>
|
|
||||||
+
|
|
||||||
+#include "apparmor.h"
|
|
||||||
+#include "inline.h"
|
|
||||||
+
|
|
||||||
+/* Flag indicating whether initialization completed */
|
|
||||||
+int apparmor_initialized = 0;
|
|
||||||
+
|
|
||||||
+static int param_set_aabool(const char *val, struct kernel_param *kp);
|
|
||||||
+static int param_get_aabool(char *buffer, struct kernel_param *kp);
|
|
||||||
+#define param_check_aabool(name, p) __param_check(name, p, int)
|
|
||||||
+
|
|
||||||
+static int param_set_aauint(const char *val, struct kernel_param *kp);
|
|
||||||
+static int param_get_aauint(char *buffer, struct kernel_param *kp);
|
|
||||||
+#define param_check_aauint(name, p) __param_check(name, p, int)
|
|
||||||
+
|
|
||||||
+/* Flag values, also controllable via /sys/module/apparmor/parameters
|
|
||||||
+ * We define special types as we want to do additional mediation.
|
|
||||||
+ *
|
|
||||||
+ * Complain mode -- in complain mode access failures result in auditing only
|
|
||||||
+ * and task is allowed access. audit events are processed by userspace to
|
|
||||||
+ * generate policy. Default is 'enforce' (0).
|
|
||||||
+ * Value is also togglable per profile and referenced when global value is
|
|
||||||
+ * enforce.
|
|
||||||
+ */
|
|
||||||
+int apparmor_complain = 0;
|
|
||||||
+module_param_named(complain, apparmor_complain, aabool, S_IRUSR | S_IWUSR);
|
|
||||||
+MODULE_PARM_DESC(apparmor_complain, "Toggle AppArmor complain mode");
|
|
||||||
+
|
|
||||||
+/* Debug mode */
|
|
||||||
+int apparmor_debug = 0;
|
|
||||||
+module_param_named(debug, apparmor_debug, aabool, S_IRUSR | S_IWUSR);
|
|
||||||
+MODULE_PARM_DESC(apparmor_debug, "Toggle AppArmor debug mode");
|
|
||||||
+
|
|
||||||
+/* Audit mode */
|
|
||||||
+int apparmor_audit = 0;
|
|
||||||
+module_param_named(audit, apparmor_audit, aabool, S_IRUSR | S_IWUSR);
|
|
||||||
+MODULE_PARM_DESC(apparmor_audit, "Toggle AppArmor audit mode");
|
|
||||||
+
|
|
||||||
+/* Syscall logging mode */
|
|
||||||
+int apparmor_logsyscall = 0;
|
|
||||||
+module_param_named(logsyscall, apparmor_logsyscall, aabool, S_IRUSR | S_IWUSR);
|
|
||||||
+MODULE_PARM_DESC(apparmor_logsyscall, "Toggle AppArmor logsyscall mode");
|
|
||||||
+
|
|
||||||
+/* Maximum pathname length before accesses will start getting rejected */
|
|
||||||
+unsigned int apparmor_path_max = 2 * PATH_MAX;
|
|
||||||
+module_param_named(path_max, apparmor_path_max, aauint, S_IRUSR | S_IWUSR);
|
|
||||||
+MODULE_PARM_DESC(apparmor_path_max, "Maximum pathname length allowed");
|
|
||||||
+
|
|
||||||
+/* Boot time disable flag */
|
|
||||||
+#ifdef CONFIG_SECURITY_APPARMOR_DISABLE
|
|
||||||
+#define AA_ENABLED_PERMS 0600
|
|
||||||
+#else
|
|
||||||
+#define AA_ENABLED_PERMS 0400
|
|
||||||
+#endif
|
|
||||||
+static int param_set_aa_enabled(const char *val, struct kernel_param *kp);
|
|
||||||
+unsigned int apparmor_enabled = CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE;
|
|
||||||
+module_param_call(enabled, param_set_aa_enabled, param_get_aauint,
|
|
||||||
+ &apparmor_enabled, AA_ENABLED_PERMS);
|
|
||||||
+MODULE_PARM_DESC(apparmor_enabled, "Enable/Disable Apparmor on boot");
|
|
||||||
+
|
|
||||||
+static int __init apparmor_enabled_setup(char *str)
|
|
||||||
+{
|
|
||||||
+ apparmor_enabled = simple_strtol(str, NULL, 0);
|
|
||||||
+ return 1;
|
|
||||||
+}
|
|
||||||
+__setup("apparmor=", apparmor_enabled_setup);
|
|
||||||
+
|
|
||||||
+static int param_set_aabool(const char *val, struct kernel_param *kp)
|
|
||||||
+{
|
|
||||||
+ if (aa_task_context(current))
|
|
||||||
+ return -EPERM;
|
|
||||||
+ return param_set_bool(val, kp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int param_get_aabool(char *buffer, struct kernel_param *kp)
|
|
||||||
+{
|
|
||||||
+ if (aa_task_context(current))
|
|
||||||
+ return -EPERM;
|
|
||||||
+ return param_get_bool(buffer, kp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int param_set_aauint(const char *val, struct kernel_param *kp)
|
|
||||||
+{
|
|
||||||
+ if (aa_task_context(current))
|
|
||||||
+ return -EPERM;
|
|
||||||
+ return param_set_uint(val, kp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int param_get_aauint(char *buffer, struct kernel_param *kp)
|
|
||||||
+{
|
|
||||||
+ if (aa_task_context(current))
|
|
||||||
+ return -EPERM;
|
|
||||||
+ return param_get_uint(buffer, kp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* allow run time disabling of apparmor */
|
|
||||||
+static int param_set_aa_enabled(const char *val, struct kernel_param *kp)
|
|
||||||
+{
|
|
||||||
+ char *endp;
|
|
||||||
+ unsigned long l;
|
|
||||||
+
|
|
||||||
+ if (!apparmor_initialized) {
|
|
||||||
+ apparmor_enabled = 0;
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (aa_task_context(current))
|
|
||||||
+ return -EPERM;
|
|
||||||
+
|
|
||||||
+ if (!apparmor_enabled)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ if (!val)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ l = simple_strtoul(val, &endp, 0);
|
|
||||||
+ if (endp == val || l != 0)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ apparmor_enabled = 0;
|
|
||||||
+ apparmor_disable();
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int aa_reject_syscall(struct task_struct *task, gfp_t flags,
|
|
||||||
+ const char *name)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile = aa_get_profile(task);
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (profile) {
|
|
||||||
+ error = aa_audit_syscallreject(profile, flags, name);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_ptrace(struct task_struct *parent,
|
|
||||||
+ struct task_struct *child)
|
|
||||||
+{
|
|
||||||
+ struct aa_task_context *cxt;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * parent can ptrace child when
|
|
||||||
+ * - parent is unconfined
|
|
||||||
+ * - parent & child are in the same namespace &&
|
|
||||||
+ * - parent is in complain mode
|
|
||||||
+ * - parent and child are confined by the same profile
|
|
||||||
+ * - parent profile has CAP_SYS_PTRACE
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+ rcu_read_lock();
|
|
||||||
+ cxt = aa_task_context(parent);
|
|
||||||
+ if (cxt) {
|
|
||||||
+ if (parent->nsproxy != child->nsproxy) {
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = "ptrace";
|
|
||||||
+ sa.gfp_mask = GFP_ATOMIC;
|
|
||||||
+ sa.parent = parent->pid;
|
|
||||||
+ sa.task = child->pid;
|
|
||||||
+ sa.info = "different namespaces";
|
|
||||||
+ aa_audit_reject(cxt->profile, &sa);
|
|
||||||
+ error = -EPERM;
|
|
||||||
+ } else {
|
|
||||||
+ struct aa_task_context *child_cxt =
|
|
||||||
+ aa_task_context(child);
|
|
||||||
+
|
|
||||||
+ error = aa_may_ptrace(cxt, child_cxt ?
|
|
||||||
+ child_cxt->profile : NULL);
|
|
||||||
+ if (PROFILE_COMPLAIN(cxt->profile)) {
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = "ptrace";
|
|
||||||
+ sa.gfp_mask = GFP_ATOMIC;
|
|
||||||
+ sa.parent = parent->pid;
|
|
||||||
+ sa.task = child->pid;
|
|
||||||
+ aa_audit_hint(cxt->profile, &sa);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ rcu_read_unlock();
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_capable(struct task_struct *task, int cap)
|
|
||||||
+{
|
|
||||||
+ int error;
|
|
||||||
+ struct aa_task_context *cxt;
|
|
||||||
+
|
|
||||||
+ /* cap_capable returns 0 on success, else -EPERM */
|
|
||||||
+ error = cap_capable(task, cap);
|
|
||||||
+
|
|
||||||
+ rcu_read_lock();
|
|
||||||
+ cxt = aa_task_context(task);
|
|
||||||
+ if (cxt && (!error || cap_raised(cxt->profile->set_caps, cap)))
|
|
||||||
+ error = aa_capability(cxt, cap);
|
|
||||||
+ rcu_read_unlock();
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_sysctl(struct ctl_table *table, int op)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile = aa_get_profile(current);
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (profile) {
|
|
||||||
+ char *buffer, *name;
|
|
||||||
+ int mask;
|
|
||||||
+
|
|
||||||
+ mask = 0;
|
|
||||||
+ if (op & 4)
|
|
||||||
+ mask |= MAY_READ;
|
|
||||||
+ if (op & 2)
|
|
||||||
+ mask |= MAY_WRITE;
|
|
||||||
+
|
|
||||||
+ error = -ENOMEM;
|
|
||||||
+ buffer = (char*)__get_free_page(GFP_KERNEL);
|
|
||||||
+ if (!buffer)
|
|
||||||
+ goto out;
|
|
||||||
+ name = sysctl_pathname(table, buffer, PAGE_SIZE);
|
|
||||||
+ if (name && name - buffer >= 5) {
|
|
||||||
+ name -= 5;
|
|
||||||
+ memcpy(name, "/proc", 5);
|
|
||||||
+ error = aa_perm_path(profile, "sysctl", name, mask, 0);
|
|
||||||
+ }
|
|
||||||
+ free_page((unsigned long)buffer);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_bprm_set_security(struct linux_binprm *bprm)
|
|
||||||
+{
|
|
||||||
+ /* handle capability bits with setuid, etc */
|
|
||||||
+ cap_bprm_set_security(bprm);
|
|
||||||
+ /* already set based on script name */
|
|
||||||
+ if (bprm->sh_bang)
|
|
||||||
+ return 0;
|
|
||||||
+ return aa_register(bprm);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_bprm_secureexec(struct linux_binprm *bprm)
|
|
||||||
+{
|
|
||||||
+ int ret = cap_bprm_secureexec(bprm);
|
|
||||||
+
|
|
||||||
+ if (!ret && (unsigned long)bprm->security & AA_SECURE_EXEC_NEEDED) {
|
|
||||||
+ AA_DEBUG("%s: secureexec required for %s\n",
|
|
||||||
+ __FUNCTION__, bprm->filename);
|
|
||||||
+ ret = 1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_sb_mount(char *dev_name, struct nameidata *nd, char *type,
|
|
||||||
+ unsigned long flags, void *data)
|
|
||||||
+{
|
|
||||||
+ return aa_reject_syscall(current, GFP_KERNEL, "mount");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_umount(struct vfsmount *mnt, int flags)
|
|
||||||
+{
|
|
||||||
+ return aa_reject_syscall(current, GFP_KERNEL, "umount");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_mkdir(struct inode *dir, struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt, int mask)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (!mnt || !mediated_filesystem(dir))
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_perm_dir(profile, "inode_mkdir", dentry, mnt,
|
|
||||||
+ MAY_WRITE);
|
|
||||||
+
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_rmdir(struct inode *dir, struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (!mnt || !mediated_filesystem(dir))
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_perm_dir(profile, "inode_rmdir", dentry, mnt,
|
|
||||||
+ MAY_WRITE);
|
|
||||||
+
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int aa_permission(const char *operation, struct inode *inode,
|
|
||||||
+ struct dentry *dentry, struct vfsmount *mnt,
|
|
||||||
+ int mask, int check)
|
|
||||||
+{
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (mnt && mediated_filesystem(inode)) {
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_perm(profile, operation, dentry, mnt, mask,
|
|
||||||
+ check);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ }
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static inline int aa_mask_permissions(int mask)
|
|
||||||
+{
|
|
||||||
+ if (mask & MAY_APPEND)
|
|
||||||
+ mask &= (MAY_READ | MAY_APPEND | MAY_EXEC);
|
|
||||||
+ else
|
|
||||||
+ mask &= (MAY_READ | MAY_WRITE | MAY_EXEC);
|
|
||||||
+ return mask;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_create(struct inode *dir, struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt, int mask)
|
|
||||||
+{
|
|
||||||
+ return aa_permission("inode_create", dir, dentry, mnt, MAY_APPEND, 0);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_link(struct dentry *old_dentry,
|
|
||||||
+ struct vfsmount *old_mnt, struct inode *dir,
|
|
||||||
+ struct dentry *new_dentry,
|
|
||||||
+ struct vfsmount *new_mnt)
|
|
||||||
+{
|
|
||||||
+ int error = 0;
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+
|
|
||||||
+ if (!old_mnt || !new_mnt || !mediated_filesystem(dir))
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_link(profile, new_dentry, new_mnt,
|
|
||||||
+ old_dentry, old_mnt);
|
|
||||||
+
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_unlink(struct inode *dir, struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt)
|
|
||||||
+{
|
|
||||||
+ int check = 0;
|
|
||||||
+
|
|
||||||
+ if (S_ISDIR(dentry->d_inode->i_mode))
|
|
||||||
+ check |= AA_CHECK_DIR;
|
|
||||||
+ return aa_permission("inode_unlink", dir, dentry, mnt, MAY_WRITE,
|
|
||||||
+ check);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_symlink(struct inode *dir, struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt, const char *old_name)
|
|
||||||
+{
|
|
||||||
+ return aa_permission("inode_symlink", dir, dentry, mnt, MAY_WRITE, 0);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_mknod(struct inode *dir, struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt, int mode, dev_t dev)
|
|
||||||
+{
|
|
||||||
+ return aa_permission("inode_mknod", dir, dentry, mnt, MAY_WRITE, 0);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_rename(struct inode *old_dir,
|
|
||||||
+ struct dentry *old_dentry,
|
|
||||||
+ struct vfsmount *old_mnt,
|
|
||||||
+ struct inode *new_dir,
|
|
||||||
+ struct dentry *new_dentry,
|
|
||||||
+ struct vfsmount *new_mnt)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if ((!old_mnt && !new_mnt) || !mediated_filesystem(old_dir))
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+
|
|
||||||
+ if (profile) {
|
|
||||||
+ struct inode *inode = old_dentry->d_inode;
|
|
||||||
+ int check = 0;
|
|
||||||
+
|
|
||||||
+ if (inode && S_ISDIR(inode->i_mode))
|
|
||||||
+ check |= AA_CHECK_DIR;
|
|
||||||
+ if (old_mnt)
|
|
||||||
+ error = aa_perm(profile, "inode_rename", old_dentry,
|
|
||||||
+ old_mnt, MAY_READ | MAY_WRITE, check);
|
|
||||||
+
|
|
||||||
+ if (!error && new_mnt) {
|
|
||||||
+ error = aa_perm(profile, "inode_rename", new_dentry,
|
|
||||||
+ new_mnt, MAY_WRITE, check);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_permission(struct inode *inode, int mask,
|
|
||||||
+ struct nameidata *nd)
|
|
||||||
+{
|
|
||||||
+ int check = 0;
|
|
||||||
+
|
|
||||||
+ if (!nd || nd->flags & (LOOKUP_PARENT | LOOKUP_CONTINUE))
|
|
||||||
+ return 0;
|
|
||||||
+ mask = aa_mask_permissions(mask);
|
|
||||||
+ if (S_ISDIR(inode->i_mode)) {
|
|
||||||
+ check |= AA_CHECK_DIR;
|
|
||||||
+ /* allow traverse accesses to directories */
|
|
||||||
+ mask &= ~MAY_EXEC;
|
|
||||||
+ }
|
|
||||||
+ return aa_permission("inode_permission", inode, nd->dentry, nd->mnt,
|
|
||||||
+ mask, check);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_setattr(struct dentry *dentry, struct vfsmount *mnt,
|
|
||||||
+ struct iattr *iattr)
|
|
||||||
+{
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (!mnt)
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
+ if (mediated_filesystem(dentry->d_inode)) {
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ /*
|
|
||||||
+ * Mediate any attempt to change attributes of a file
|
|
||||||
+ * (chmod, chown, chgrp, etc)
|
|
||||||
+ */
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_attr(profile, dentry, mnt, iattr);
|
|
||||||
+
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int aa_xattr_permission(struct dentry *dentry, struct vfsmount *mnt,
|
|
||||||
+ const char *operation, int mask,
|
|
||||||
+ struct file *file)
|
|
||||||
+{
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (mnt && mediated_filesystem(dentry->d_inode)) {
|
|
||||||
+ struct aa_profile *profile = aa_get_profile(current);
|
|
||||||
+ int check = file ? AA_CHECK_FD : 0;
|
|
||||||
+
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_perm_xattr(profile, operation, dentry, mnt,
|
|
||||||
+ mask, check);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt,
|
|
||||||
+ char *name, void *value, size_t size,
|
|
||||||
+ int flags, struct file *file)
|
|
||||||
+{
|
|
||||||
+ return aa_xattr_permission(dentry, mnt, "xattr set", MAY_WRITE, file);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_getxattr(struct dentry *dentry, struct vfsmount *mnt,
|
|
||||||
+ char *name, struct file *file)
|
|
||||||
+{
|
|
||||||
+ return aa_xattr_permission(dentry, mnt, "xattr get", MAY_READ, file);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_listxattr(struct dentry *dentry, struct vfsmount *mnt,
|
|
||||||
+ struct file *file)
|
|
||||||
+{
|
|
||||||
+ return aa_xattr_permission(dentry, mnt, "xattr list", MAY_READ, file);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_inode_removexattr(struct dentry *dentry,
|
|
||||||
+ struct vfsmount *mnt, char *name,
|
|
||||||
+ struct file *file)
|
|
||||||
+{
|
|
||||||
+ return aa_xattr_permission(dentry, mnt, "xattr remove", MAY_WRITE,
|
|
||||||
+ file);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int aa_file_permission(const char *op, struct file *file, int mask)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ struct aa_profile *file_profile = (struct aa_profile*)file->f_security;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (!file_profile)
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * If this file was opened under a different profile, we
|
|
||||||
+ * revalidate the access against the current profile.
|
|
||||||
+ */
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile && (file_profile != profile || mask & AA_MAY_LOCK)) {
|
|
||||||
+ struct dentry *dentry = file->f_dentry;
|
|
||||||
+ struct vfsmount *mnt = file->f_vfsmnt;
|
|
||||||
+ struct inode *inode = dentry->d_inode;
|
|
||||||
+ int check = AA_CHECK_FD;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * FIXME: We should remember which profiles we revalidated
|
|
||||||
+ * against.
|
|
||||||
+ */
|
|
||||||
+ if (S_ISDIR(inode->i_mode))
|
|
||||||
+ check |= AA_CHECK_DIR;
|
|
||||||
+ error = aa_permission(op, inode, dentry, mnt, mask, check);
|
|
||||||
+ }
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+out:
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_file_permission(struct file *file, int mask)
|
|
||||||
+{
|
|
||||||
+ return aa_file_permission("file_permission", file,
|
|
||||||
+ aa_mask_permissions(mask));
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static inline int apparmor_file_lock (struct file *file, unsigned int cmd)
|
|
||||||
+{
|
|
||||||
+ int mask = AA_MAY_LOCK;
|
|
||||||
+ if (cmd == F_WRLCK)
|
|
||||||
+ mask |= MAY_WRITE;
|
|
||||||
+ return aa_file_permission("file_lock", file, mask);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_file_alloc_security(struct file *file)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile)
|
|
||||||
+ file->f_security = profile;
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void apparmor_file_free_security(struct file *file)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *file_profile = (struct aa_profile*)file->f_security;
|
|
||||||
+
|
|
||||||
+ aa_put_profile(file_profile);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static inline int aa_mmap(struct file *file, const char *operation,
|
|
||||||
+ unsigned long prot, unsigned long flags)
|
|
||||||
+{
|
|
||||||
+ struct dentry *dentry;
|
|
||||||
+ int mask = 0;
|
|
||||||
+
|
|
||||||
+ if (!file || !file->f_security)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ if (prot & PROT_READ)
|
|
||||||
+ mask |= MAY_READ;
|
|
||||||
+ /* Private mappings don't require write perms since they don't
|
|
||||||
+ * write back to the files */
|
|
||||||
+ if ((prot & PROT_WRITE) && !(flags & MAP_PRIVATE))
|
|
||||||
+ mask |= MAY_WRITE;
|
|
||||||
+ if (prot & PROT_EXEC)
|
|
||||||
+ mask |= AA_EXEC_MMAP;
|
|
||||||
+
|
|
||||||
+ dentry = file->f_dentry;
|
|
||||||
+ return aa_permission(operation, dentry->d_inode, dentry,
|
|
||||||
+ file->f_vfsmnt, mask, AA_CHECK_FD);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_file_mmap(struct file *file, unsigned long reqprot,
|
|
||||||
+ unsigned long prot, unsigned long flags,
|
|
||||||
+ unsigned long addr, unsigned long addr_only)
|
|
||||||
+{
|
|
||||||
+ if ((addr < mmap_min_addr) && !capable(CAP_SYS_RAWIO)) {
|
|
||||||
+ struct aa_profile *profile = aa_get_profile(current);
|
|
||||||
+ if (profile)
|
|
||||||
+ /* future control check here */
|
|
||||||
+ return -EACCES;
|
|
||||||
+ else
|
|
||||||
+ return -EACCES;
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return aa_mmap(file, "file_mmap", prot, flags);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_file_mprotect(struct vm_area_struct *vma,
|
|
||||||
+ unsigned long reqprot, unsigned long prot)
|
|
||||||
+{
|
|
||||||
+ return aa_mmap(vma->vm_file, "file_mprotect", prot,
|
|
||||||
+ !(vma->vm_flags & VM_SHARED) ? MAP_PRIVATE : 0);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_task_alloc_security(struct task_struct *task)
|
|
||||||
+{
|
|
||||||
+ return aa_clone(task);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ * Called from IRQ context from RCU callback.
|
|
||||||
+ */
|
|
||||||
+static void apparmor_task_free_security(struct task_struct *task)
|
|
||||||
+{
|
|
||||||
+ aa_release(task);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_getprocattr(struct task_struct *task, char *name,
|
|
||||||
+ char **value)
|
|
||||||
+{
|
|
||||||
+ unsigned len;
|
|
||||||
+ int error;
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+
|
|
||||||
+ /* AppArmor only supports the "current" process attribute */
|
|
||||||
+ if (strcmp(name, "current") != 0)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ /* must be task querying itself or admin */
|
|
||||||
+ if (current != task && !capable(CAP_SYS_ADMIN))
|
|
||||||
+ return -EPERM;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(task);
|
|
||||||
+ error = aa_getprocattr(profile, value, &len);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ if (!error)
|
|
||||||
+ error = len;
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_setprocattr(struct task_struct *task, char *name,
|
|
||||||
+ void *value, size_t size)
|
|
||||||
+{
|
|
||||||
+ char *command, *args;
|
|
||||||
+ int error;
|
|
||||||
+
|
|
||||||
+ if (strcmp(name, "current") != 0 || size == 0 || size >= PAGE_SIZE)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+ args = value;
|
|
||||||
+ args[size] = '\0';
|
|
||||||
+ args = strstrip(args);
|
|
||||||
+ command = strsep(&args, " ");
|
|
||||||
+ if (!args)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+ while (isspace(*args))
|
|
||||||
+ args++;
|
|
||||||
+ if (!*args)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ if (strcmp(command, "changehat") == 0) {
|
|
||||||
+ if (current != task)
|
|
||||||
+ return -EACCES;
|
|
||||||
+ error = aa_setprocattr_changehat(args);
|
|
||||||
+ } else if (strcmp(command, "changeprofile") == 0) {
|
|
||||||
+ if (current != task)
|
|
||||||
+ return -EACCES;
|
|
||||||
+ error = aa_setprocattr_changeprofile(args);
|
|
||||||
+ } else if (strcmp(command, "setprofile") == 0) {
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+
|
|
||||||
+ /* Only an unconfined process with admin capabilities
|
|
||||||
+ * may change the profile of another task.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+ if (!capable(CAP_SYS_ADMIN))
|
|
||||||
+ return -EACCES;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile) {
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = "profile_set";
|
|
||||||
+ sa.gfp_mask = GFP_KERNEL;
|
|
||||||
+ sa.task = task->pid;
|
|
||||||
+ sa.info = "from confined process";
|
|
||||||
+ aa_audit_reject(profile, &sa);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ return -EACCES;
|
|
||||||
+ }
|
|
||||||
+ error = aa_setprocattr_setprofile(task, args);
|
|
||||||
+ } else {
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = "setprocattr";
|
|
||||||
+ sa.gfp_mask = GFP_KERNEL;
|
|
||||||
+ sa.info = "invalid command";
|
|
||||||
+ sa.name = command;
|
|
||||||
+ sa.task = task->pid;
|
|
||||||
+ aa_audit_reject(NULL, &sa);
|
|
||||||
+ return -EINVAL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (!error)
|
|
||||||
+ error = size;
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+struct security_operations apparmor_ops = {
|
|
||||||
+ .ptrace = apparmor_ptrace,
|
|
||||||
+ .capget = cap_capget,
|
|
||||||
+ .capset_check = cap_capset_check,
|
|
||||||
+ .capset_set = cap_capset_set,
|
|
||||||
+ .sysctl = apparmor_sysctl,
|
|
||||||
+ .capable = apparmor_capable,
|
|
||||||
+ .syslog = cap_syslog,
|
|
||||||
+
|
|
||||||
+ .netlink_send = cap_netlink_send,
|
|
||||||
+ .netlink_recv = cap_netlink_recv,
|
|
||||||
+
|
|
||||||
+ .bprm_apply_creds = cap_bprm_apply_creds,
|
|
||||||
+ .bprm_set_security = apparmor_bprm_set_security,
|
|
||||||
+ .bprm_secureexec = apparmor_bprm_secureexec,
|
|
||||||
+
|
|
||||||
+ .sb_mount = apparmor_sb_mount,
|
|
||||||
+ .sb_umount = apparmor_umount,
|
|
||||||
+
|
|
||||||
+ .inode_mkdir = apparmor_inode_mkdir,
|
|
||||||
+ .inode_rmdir = apparmor_inode_rmdir,
|
|
||||||
+ .inode_create = apparmor_inode_create,
|
|
||||||
+ .inode_link = apparmor_inode_link,
|
|
||||||
+ .inode_unlink = apparmor_inode_unlink,
|
|
||||||
+ .inode_symlink = apparmor_inode_symlink,
|
|
||||||
+ .inode_mknod = apparmor_inode_mknod,
|
|
||||||
+ .inode_rename = apparmor_inode_rename,
|
|
||||||
+ .inode_permission = apparmor_inode_permission,
|
|
||||||
+ .inode_setattr = apparmor_inode_setattr,
|
|
||||||
+ .inode_setxattr = apparmor_inode_setxattr,
|
|
||||||
+ .inode_getxattr = apparmor_inode_getxattr,
|
|
||||||
+ .inode_listxattr = apparmor_inode_listxattr,
|
|
||||||
+ .inode_removexattr = apparmor_inode_removexattr,
|
|
||||||
+ .file_permission = apparmor_file_permission,
|
|
||||||
+ .file_alloc_security = apparmor_file_alloc_security,
|
|
||||||
+ .file_free_security = apparmor_file_free_security,
|
|
||||||
+ .file_mmap = apparmor_file_mmap,
|
|
||||||
+ .file_mprotect = apparmor_file_mprotect,
|
|
||||||
+ .file_lock = apparmor_file_lock,
|
|
||||||
+
|
|
||||||
+ .task_alloc_security = apparmor_task_alloc_security,
|
|
||||||
+ .task_free_security = apparmor_task_free_security,
|
|
||||||
+ .task_post_setuid = cap_task_post_setuid,
|
|
||||||
+ .task_reparent_to_init = cap_task_reparent_to_init,
|
|
||||||
+
|
|
||||||
+ .getprocattr = apparmor_getprocattr,
|
|
||||||
+ .setprocattr = apparmor_setprocattr,
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+void info_message(const char *str)
|
|
||||||
+{
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.gfp_mask = GFP_KERNEL;
|
|
||||||
+ sa.info = str;
|
|
||||||
+ printk(KERN_INFO "AppArmor: %s\n", str);
|
|
||||||
+ if (audit_enabled)
|
|
||||||
+ aa_audit_message(NULL, &sa, AUDIT_APPARMOR_STATUS);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int __init apparmor_init(void)
|
|
||||||
+{
|
|
||||||
+ int error;
|
|
||||||
+
|
|
||||||
+ if (!apparmor_enabled) {
|
|
||||||
+ info_message("AppArmor disabled by boottime parameter\n");
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((error = create_apparmorfs())) {
|
|
||||||
+ AA_ERROR("Unable to activate AppArmor filesystem\n");
|
|
||||||
+ goto createfs_out;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((error = alloc_default_namespace())){
|
|
||||||
+ AA_ERROR("Unable to allocate default profile namespace\n");
|
|
||||||
+ goto alloc_out;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((error = register_security(&apparmor_ops))) {
|
|
||||||
+ AA_ERROR("Unable to register AppArmor\n");
|
|
||||||
+ goto register_security_out;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Report that AppArmor successfully initialized */
|
|
||||||
+ apparmor_initialized = 1;
|
|
||||||
+ if (apparmor_complain)
|
|
||||||
+ info_message("AppArmor initialized: complainmode enabled");
|
|
||||||
+ else
|
|
||||||
+ info_message("AppArmor initialized");
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+
|
|
||||||
+register_security_out:
|
|
||||||
+ free_default_namespace();
|
|
||||||
+
|
|
||||||
+alloc_out:
|
|
||||||
+ destroy_apparmorfs();
|
|
||||||
+
|
|
||||||
+createfs_out:
|
|
||||||
+ return error;
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+security_initcall(apparmor_init);
|
|
||||||
+
|
|
||||||
+void apparmor_disable(void)
|
|
||||||
+{
|
|
||||||
+ /* Remove and release all the profiles on the profile list. */
|
|
||||||
+ mutex_lock(&aa_interface_lock);
|
|
||||||
+ aa_profile_ns_list_release();
|
|
||||||
+
|
|
||||||
+ /* FIXME: cleanup profiles references on files */
|
|
||||||
+ free_default_namespace();
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * Delay for an rcu cycle to make sure that all active task
|
|
||||||
+ * context readers have finished, and all profiles have been
|
|
||||||
+ * freed by their rcu callbacks.
|
|
||||||
+ */
|
|
||||||
+ synchronize_rcu();
|
|
||||||
+
|
|
||||||
+ destroy_apparmorfs();
|
|
||||||
+ mutex_unlock(&aa_interface_lock);
|
|
||||||
+
|
|
||||||
+ apparmor_initialized = 0;
|
|
||||||
+
|
|
||||||
+ info_message("AppArmor protection removed");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+MODULE_DESCRIPTION("AppArmor process confinement");
|
|
||||||
+MODULE_AUTHOR("Novell/Immunix, http://bugs.opensuse.org");
|
|
||||||
+MODULE_LICENSE("GPL");
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,408 +0,0 @@
|
|||||||
From: John Johansen <jjohansen@suse.de>
|
|
||||||
Subject: AppArmor: Simplified network controls for AppArmor
|
|
||||||
|
|
||||||
Simple network control determining which network families a confined
|
|
||||||
application has access to.
|
|
||||||
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
security/apparmor/Makefile | 7 +
|
|
||||||
security/apparmor/apparmor.h | 9 ++
|
|
||||||
security/apparmor/lsm.c | 129 ++++++++++++++++++++++++++++++++++-
|
|
||||||
security/apparmor/main.c | 107 ++++++++++++++++++++++++++++-
|
|
||||||
security/apparmor/module_interface.c | 26 ++++++-
|
|
||||||
5 files changed, 271 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
--- a/security/apparmor/Makefile
|
|
||||||
+++ b/security/apparmor/Makefile
|
|
||||||
@@ -8,6 +8,11 @@ apparmor-y := main.o list.o procattr.o l
|
|
||||||
quiet_cmd_make-caps = GEN $@
|
|
||||||
cmd_make-caps = sed -n -e "/CAP_FS_MASK/d" -e "s/^\#define[ \\t]\\+CAP_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\$$/[\\2] = \"\\1\",/p" $< | tr A-Z a-z > $@
|
|
||||||
|
|
||||||
-$(obj)/main.o : $(obj)/capability_names.h
|
|
||||||
+quiet_cmd_make-af = GEN $@
|
|
||||||
+cmd_make-af = sed -n -e "/AF_MAX/d" -e "/AF_LOCAL/d" -e "s/^\#define[ \\t]\\+AF_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/[\\2] = \"\\1\",/p" $< | tr A-Z a-z > $@
|
|
||||||
+
|
|
||||||
+$(obj)/main.o : $(obj)/capability_names.h $(obj)/af_names.h
|
|
||||||
$(obj)/capability_names.h : $(srctree)/include/linux/capability.h
|
|
||||||
$(call cmd,make-caps)
|
|
||||||
+$(obj)/af_names.h : $(srctree)/include/linux/socket.h
|
|
||||||
+ $(call cmd,make-af)
|
|
||||||
--- a/security/apparmor/apparmor.h
|
|
||||||
+++ b/security/apparmor/apparmor.h
|
|
||||||
@@ -16,6 +16,8 @@
|
|
||||||
#include <linux/fs.h>
|
|
||||||
#include <linux/binfmts.h>
|
|
||||||
#include <linux/rcupdate.h>
|
|
||||||
+#include <linux/socket.h>
|
|
||||||
+#include <net/sock.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We use MAY_READ, MAY_WRITE, MAY_EXEC, MAY_APPEND and the following flags
|
|
||||||
@@ -208,6 +210,9 @@ struct aa_profile {
|
|
||||||
struct list_head task_contexts;
|
|
||||||
spinlock_t lock;
|
|
||||||
unsigned long int_flags;
|
|
||||||
+ u16 network_families[AF_MAX];
|
|
||||||
+ u16 audit_network[AF_MAX];
|
|
||||||
+ u16 quiet_network[AF_MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct list_head profile_ns_list;
|
|
||||||
@@ -254,6 +259,7 @@ struct aa_audit {
|
|
||||||
int request_mask, denied_mask, audit_mask;
|
|
||||||
struct iattr *iattr;
|
|
||||||
pid_t task, parent;
|
|
||||||
+ int family, type, protocol;
|
|
||||||
int error_code;
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -315,6 +321,9 @@ extern void aa_change_task_context(struc
|
|
||||||
struct aa_profile *previous_profile);
|
|
||||||
extern int aa_may_ptrace(struct aa_task_context *cxt,
|
|
||||||
struct aa_profile *tracee);
|
|
||||||
+extern int aa_net_perm(struct aa_profile *profile, char *operation,
|
|
||||||
+ int family, int type, int protocol);
|
|
||||||
+extern int aa_revalidate_sk(struct sock *sk, char *operation);
|
|
||||||
|
|
||||||
/* lsm.c */
|
|
||||||
extern int apparmor_initialized;
|
|
||||||
--- a/security/apparmor/lsm.c
|
|
||||||
+++ b/security/apparmor/lsm.c
|
|
||||||
@@ -18,6 +18,7 @@
|
|
||||||
#include <linux/ctype.h>
|
|
||||||
#include <linux/sysctl.h>
|
|
||||||
#include <linux/audit.h>
|
|
||||||
+#include <net/sock.h>
|
|
||||||
|
|
||||||
#include "apparmor.h"
|
|
||||||
#include "inline.h"
|
|
||||||
@@ -663,6 +664,117 @@ static void apparmor_task_free_security(
|
|
||||||
aa_release(task);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int apparmor_socket_create(int family, int type, int protocol, int kern)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ if (kern)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_net_perm(profile, "socket_create", family,
|
|
||||||
+ type, protocol);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_post_create(struct socket *sock, int family,
|
|
||||||
+ int type, int protocol, int kern)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ if (kern)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_post_create");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_bind(struct socket *sock,
|
|
||||||
+ struct sockaddr *address, int addrlen)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_bind");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_connect(struct socket *sock,
|
|
||||||
+ struct sockaddr *address, int addrlen)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_connect");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_listen(struct socket *sock, int backlog)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_listen");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_accept(struct socket *sock, struct socket *newsock)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_accept");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_sendmsg(struct socket *sock,
|
|
||||||
+ struct msghdr *msg, int size)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_sendmsg");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_recvmsg(struct socket *sock,
|
|
||||||
+ struct msghdr *msg, int size, int flags)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_recvmsg");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_getsockname(struct socket *sock)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_getsockname");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_getpeername(struct socket *sock)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_getpeername");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_getsockopt(struct socket *sock, int level,
|
|
||||||
+ int optname)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_getsockopt");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_setsockopt(struct socket *sock, int level,
|
|
||||||
+ int optname)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_setsockopt");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int apparmor_socket_shutdown(struct socket *sock, int how)
|
|
||||||
+{
|
|
||||||
+ struct sock *sk = sock->sk;
|
|
||||||
+
|
|
||||||
+ return aa_revalidate_sk(sk, "socket_shutdown");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int apparmor_getprocattr(struct task_struct *task, char *name,
|
|
||||||
char **value)
|
|
||||||
{
|
|
||||||
@@ -763,9 +875,6 @@ struct security_operations apparmor_ops
|
|
||||||
.capable = apparmor_capable,
|
|
||||||
.syslog = cap_syslog,
|
|
||||||
|
|
||||||
- .netlink_send = cap_netlink_send,
|
|
||||||
- .netlink_recv = cap_netlink_recv,
|
|
||||||
-
|
|
||||||
.bprm_apply_creds = cap_bprm_apply_creds,
|
|
||||||
.bprm_set_security = apparmor_bprm_set_security,
|
|
||||||
.bprm_secureexec = apparmor_bprm_secureexec,
|
|
||||||
@@ -801,6 +910,20 @@ struct security_operations apparmor_ops
|
|
||||||
|
|
||||||
.getprocattr = apparmor_getprocattr,
|
|
||||||
.setprocattr = apparmor_setprocattr,
|
|
||||||
+
|
|
||||||
+ .socket_create = apparmor_socket_create,
|
|
||||||
+ .socket_post_create = apparmor_socket_post_create,
|
|
||||||
+ .socket_bind = apparmor_socket_bind,
|
|
||||||
+ .socket_connect = apparmor_socket_connect,
|
|
||||||
+ .socket_listen = apparmor_socket_listen,
|
|
||||||
+ .socket_accept = apparmor_socket_accept,
|
|
||||||
+ .socket_sendmsg = apparmor_socket_sendmsg,
|
|
||||||
+ .socket_recvmsg = apparmor_socket_recvmsg,
|
|
||||||
+ .socket_getsockname = apparmor_socket_getsockname,
|
|
||||||
+ .socket_getpeername = apparmor_socket_getpeername,
|
|
||||||
+ .socket_getsockopt = apparmor_socket_getsockopt,
|
|
||||||
+ .socket_setsockopt = apparmor_socket_setsockopt,
|
|
||||||
+ .socket_shutdown = apparmor_socket_shutdown,
|
|
||||||
};
|
|
||||||
|
|
||||||
void info_message(const char *str)
|
|
||||||
--- a/security/apparmor/main.c
|
|
||||||
+++ b/security/apparmor/main.c
|
|
||||||
@@ -14,6 +14,9 @@
|
|
||||||
#include <linux/audit.h>
|
|
||||||
#include <linux/mount.h>
|
|
||||||
#include <linux/ptrace.h>
|
|
||||||
+#include <linux/socket.h>
|
|
||||||
+#include <linux/net.h>
|
|
||||||
+#include <net/sock.h>
|
|
||||||
|
|
||||||
#include "apparmor.h"
|
|
||||||
|
|
||||||
@@ -116,6 +119,24 @@ static void aa_audit_file_mask(struct au
|
|
||||||
audit_log_format(ab, " %s=\"%s::%s\"", name, user, other);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static const char *address_families[] = {
|
|
||||||
+#include "af_names.h"
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static const char *sock_types[] = {
|
|
||||||
+ "unknown(0)",
|
|
||||||
+ "stream",
|
|
||||||
+ "dgram",
|
|
||||||
+ "raw",
|
|
||||||
+ "rdm",
|
|
||||||
+ "seqpacket",
|
|
||||||
+ "dccp",
|
|
||||||
+ "unknown(7)",
|
|
||||||
+ "unknown(8)",
|
|
||||||
+ "unknown(9)",
|
|
||||||
+ "packet",
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* aa_audit - Log an audit event to the audit subsystem
|
|
||||||
* @profile: profile to check against
|
|
||||||
@@ -187,7 +208,25 @@ static int aa_audit_base(struct aa_profi
|
|
||||||
audit_log_untrustedstring(ab, sa->name2);
|
|
||||||
}
|
|
||||||
|
|
||||||
- audit_log_format(ab, " pid=%d", current->pid);
|
|
||||||
+ if (sa->family || sa->type) {
|
|
||||||
+ if (address_families[sa->family])
|
|
||||||
+ audit_log_format(ab, " family=\"%s\"",
|
|
||||||
+ address_families[sa->family]);
|
|
||||||
+ else
|
|
||||||
+ audit_log_format(ab, " family=\"unknown(%d)\"",
|
|
||||||
+ sa->family);
|
|
||||||
+
|
|
||||||
+ if (sock_types[sa->type])
|
|
||||||
+ audit_log_format(ab, " sock_type=\"%s\"",
|
|
||||||
+ sock_types[sa->type]);
|
|
||||||
+ else
|
|
||||||
+ audit_log_format(ab, " sock_type=\"unknown(%d)\"",
|
|
||||||
+ sa->type);
|
|
||||||
+
|
|
||||||
+ audit_log_format(ab, " protocol=%d", sa->protocol);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ audit_log_format(ab, " pid=%d", current->pid);
|
|
||||||
|
|
||||||
if (profile) {
|
|
||||||
audit_log_format(ab, " profile=");
|
|
||||||
@@ -768,6 +807,72 @@ int aa_link(struct aa_profile *profile,
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
+int aa_net_perm(struct aa_profile *profile, char *operation,
|
|
||||||
+ int family, int type, int protocol)
|
|
||||||
+{
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ int error = 0;
|
|
||||||
+ u16 family_mask, audit_mask, quiet_mask;
|
|
||||||
+
|
|
||||||
+ if ((family < 0) || (family >= AF_MAX))
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ if ((type < 0) || (type >= SOCK_MAX))
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ /* unix domain and netlink sockets are handled by ipc */
|
|
||||||
+ if (family == AF_UNIX || family == AF_NETLINK)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ family_mask = profile->network_families[family];
|
|
||||||
+ audit_mask = profile->audit_network[family];
|
|
||||||
+ quiet_mask = profile->quiet_network[family];
|
|
||||||
+
|
|
||||||
+ error = (family_mask & (1 << type)) ? 0 : -EACCES;
|
|
||||||
+
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = operation;
|
|
||||||
+ sa.gfp_mask = GFP_KERNEL;
|
|
||||||
+ sa.family = family;
|
|
||||||
+ sa.type = type;
|
|
||||||
+ sa.protocol = protocol;
|
|
||||||
+ sa.error_code = error;
|
|
||||||
+
|
|
||||||
+ if (likely(!error)) {
|
|
||||||
+ if (!PROFILE_AUDIT(profile) && !(family_mask & audit_mask))
|
|
||||||
+ return 0;
|
|
||||||
+ } else if (!((1 << type) & ~quiet_mask)) {
|
|
||||||
+ return error;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ error = aa_audit(profile, &sa);
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int aa_revalidate_sk(struct sock *sk, char *operation)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ /* this is some debugging code to flush out the network hooks that
|
|
||||||
+ that are called in interrupt context */
|
|
||||||
+ if (in_interrupt()) {
|
|
||||||
+ printk("AppArmor Debug: Hook being called from interrupt context\n");
|
|
||||||
+ dump_stack();
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile)
|
|
||||||
+ error = aa_net_perm(profile, operation,
|
|
||||||
+ sk->sk_family, sk->sk_type,
|
|
||||||
+ sk->sk_protocol);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*******************************
|
|
||||||
* Global task related functions
|
|
||||||
*******************************/
|
|
||||||
--- a/security/apparmor/module_interface.c
|
|
||||||
+++ b/security/apparmor/module_interface.c
|
|
||||||
@@ -320,8 +320,8 @@ static struct aa_profile *aa_unpack_prof
|
|
||||||
struct aa_audit *sa)
|
|
||||||
{
|
|
||||||
struct aa_profile *profile = NULL;
|
|
||||||
-
|
|
||||||
- int error = -EPROTO;
|
|
||||||
+ size_t size = 0;
|
|
||||||
+ int i, error = -EPROTO;
|
|
||||||
|
|
||||||
profile = alloc_aa_profile();
|
|
||||||
if (!profile)
|
|
||||||
@@ -354,6 +354,28 @@ static struct aa_profile *aa_unpack_prof
|
|
||||||
if (!aa_is_u32(e, &(profile->set_caps), NULL))
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
+ size = aa_is_array(e, "net_allowed_af");
|
|
||||||
+ if (size) {
|
|
||||||
+ if (size > AF_MAX)
|
|
||||||
+ goto fail;
|
|
||||||
+
|
|
||||||
+ for (i = 0; i < size; i++) {
|
|
||||||
+ if (!aa_is_u16(e, &profile->network_families[i], NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ if (!aa_is_u16(e, &profile->audit_network[i], NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ if (!aa_is_u16(e, &profile->quiet_network[i], NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ }
|
|
||||||
+ if (!aa_is_nameX(e, AA_ARRAYEND, NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ /* allow unix domain and netlink sockets they are handled
|
|
||||||
+ * by IPC
|
|
||||||
+ */
|
|
||||||
+ }
|
|
||||||
+ profile->network_families[AF_UNIX] = 0xffff;
|
|
||||||
+ profile->network_families[AF_NETLINK] = 0xffff;
|
|
||||||
+
|
|
||||||
/* get file rules */
|
|
||||||
profile->file_rules = aa_unpack_dfa(e);
|
|
||||||
if (IS_ERR(profile->file_rules)) {
|
|
@@ -1,461 +0,0 @@
|
|||||||
From: John Johansen <jjohansen@suse.de>
|
|
||||||
Subject: AppArmor: per profile controls for system rlimits
|
|
||||||
|
|
||||||
Provide contol of rlimits on a per profile basis. Each profile provides
|
|
||||||
a per limit contol and corresponding hard limit value, such that when a
|
|
||||||
profile becomes attached to a task it sets the tasks limits to be <= to
|
|
||||||
the profiles specified limits. Note: the profile limit value will not
|
|
||||||
raise a tasks limit if it is already less than the profile mandates.
|
|
||||||
|
|
||||||
In addition to setting a tasks limits, the ability to set limits on
|
|
||||||
a confined task are controlled. AppArmor only controls the raising
|
|
||||||
of a tasks limits Tasks with CAP_SYS_RESOURCE can have their hard limits
|
|
||||||
raised up to the value specified by the profile. AppArmor does not
|
|
||||||
prevent a task for lowering its hard limits, nor does it provide
|
|
||||||
additional control on soft limits.
|
|
||||||
|
|
||||||
AppArmor only controls the limits specified in a profile so that
|
|
||||||
any limit not specified is free to be modified subject to standard
|
|
||||||
linux limitations.
|
|
||||||
|
|
||||||
---
|
|
||||||
security/apparmor/apparmor.h | 23 ++++++
|
|
||||||
security/apparmor/apparmorfs.c | 2
|
|
||||||
security/apparmor/lsm.c | 16 ++++
|
|
||||||
security/apparmor/main.c | 132 +++++++++++++++++++++++++++++++----
|
|
||||||
security/apparmor/module_interface.c | 56 ++++++++++++++
|
|
||||||
5 files changed, 215 insertions(+), 14 deletions(-)
|
|
||||||
|
|
||||||
--- a/security/apparmor/apparmor.h
|
|
||||||
+++ b/security/apparmor/apparmor.h
|
|
||||||
@@ -16,6 +16,7 @@
|
|
||||||
#include <linux/fs.h>
|
|
||||||
#include <linux/binfmts.h>
|
|
||||||
#include <linux/rcupdate.h>
|
|
||||||
+#include <linux/resource.h>
|
|
||||||
#include <linux/socket.h>
|
|
||||||
#include <net/sock.h>
|
|
||||||
|
|
||||||
@@ -136,6 +137,18 @@ extern unsigned int apparmor_path_max;
|
|
||||||
|
|
||||||
#define AA_ERROR(fmt, args...) printk(KERN_ERR "AppArmor: " fmt, ##args)
|
|
||||||
|
|
||||||
+/* struct aa_rlimit - rlimits settings for the profile
|
|
||||||
+ * @mask: which hard limits to set
|
|
||||||
+ * @limits: rlimit values that override task limits
|
|
||||||
+ *
|
|
||||||
+ * AppArmor rlimits are used to set confined task rlimits. Only the
|
|
||||||
+ * limits specified in @mask will be controlled by apparmor.
|
|
||||||
+ */
|
|
||||||
+struct aa_rlimit {
|
|
||||||
+ unsigned int mask;
|
|
||||||
+ struct rlimit limits[RLIM_NLIMITS];
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
struct aa_profile;
|
|
||||||
|
|
||||||
/* struct aa_namespace - namespace for a set of profiles
|
|
||||||
@@ -170,6 +183,8 @@ struct aa_namespace {
|
|
||||||
* @audit_caps: caps that are to be audited
|
|
||||||
* @quiet_caps: caps that should not be audited
|
|
||||||
* @capabilities: capabilities granted by the process
|
|
||||||
+ * @rlimits: rlimits for the profile
|
|
||||||
+ * @task_count: how many tasks the profile is attached to
|
|
||||||
* @count: reference count of the profile
|
|
||||||
* @task_contexts: list of tasks confined by profile
|
|
||||||
* @lock: lock for the task_contexts list
|
|
||||||
@@ -206,6 +221,9 @@ struct aa_profile {
|
|
||||||
kernel_cap_t audit_caps;
|
|
||||||
kernel_cap_t quiet_caps;
|
|
||||||
|
|
||||||
+ struct aa_rlimit rlimits;
|
|
||||||
+ unsigned int task_count;
|
|
||||||
+
|
|
||||||
struct kref count;
|
|
||||||
struct list_head task_contexts;
|
|
||||||
spinlock_t lock;
|
|
||||||
@@ -257,6 +275,7 @@ struct aa_audit {
|
|
||||||
const char *name2;
|
|
||||||
const char *name3;
|
|
||||||
int request_mask, denied_mask, audit_mask;
|
|
||||||
+ int rlimit;
|
|
||||||
struct iattr *iattr;
|
|
||||||
pid_t task, parent;
|
|
||||||
int family, type, protocol;
|
|
||||||
@@ -324,6 +343,10 @@ extern int aa_may_ptrace(struct aa_task_
|
|
||||||
extern int aa_net_perm(struct aa_profile *profile, char *operation,
|
|
||||||
int family, int type, int protocol);
|
|
||||||
extern int aa_revalidate_sk(struct sock *sk, char *operation);
|
|
||||||
+extern int aa_task_setrlimit(struct aa_profile *profile, unsigned int resource,
|
|
||||||
+ struct rlimit *new_rlim);
|
|
||||||
+extern void aa_set_rlimits(struct task_struct *task, struct aa_profile *profile);
|
|
||||||
+
|
|
||||||
|
|
||||||
/* lsm.c */
|
|
||||||
extern int apparmor_initialized;
|
|
||||||
--- a/security/apparmor/apparmorfs.c
|
|
||||||
+++ b/security/apparmor/apparmorfs.c
|
|
||||||
@@ -105,7 +105,7 @@ static ssize_t aa_features_read(struct f
|
|
||||||
{
|
|
||||||
const char *features = "file=3.0 capability=2.0 network=1.0 "
|
|
||||||
"change_hat=1.4 change_profile=1.0 "
|
|
||||||
- "aanamespaces=1.0";
|
|
||||||
+ "aanamespaces=1.0 rlimit=1.0";
|
|
||||||
|
|
||||||
return simple_read_from_buffer(buf, size, ppos, features,
|
|
||||||
strlen(features));
|
|
||||||
--- a/security/apparmor/lsm.c
|
|
||||||
+++ b/security/apparmor/lsm.c
|
|
||||||
@@ -866,6 +866,21 @@ static int apparmor_setprocattr(struct t
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int apparmor_task_setrlimit(unsigned int resource,
|
|
||||||
+ struct rlimit *new_rlim)
|
|
||||||
+{
|
|
||||||
+ struct aa_profile *profile;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ profile = aa_get_profile(current);
|
|
||||||
+ if (profile) {
|
|
||||||
+ error = aa_task_setrlimit(profile, resource, new_rlim);
|
|
||||||
+ }
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
struct security_operations apparmor_ops = {
|
|
||||||
.ptrace = apparmor_ptrace,
|
|
||||||
.capget = cap_capget,
|
|
||||||
@@ -907,6 +922,7 @@ struct security_operations apparmor_ops
|
|
||||||
.task_free_security = apparmor_task_free_security,
|
|
||||||
.task_post_setuid = cap_task_post_setuid,
|
|
||||||
.task_reparent_to_init = cap_task_reparent_to_init,
|
|
||||||
+ .task_setrlimit = apparmor_task_setrlimit,
|
|
||||||
|
|
||||||
.getprocattr = apparmor_getprocattr,
|
|
||||||
.setprocattr = apparmor_setprocattr,
|
|
||||||
--- a/security/apparmor/main.c
|
|
||||||
+++ b/security/apparmor/main.c
|
|
||||||
@@ -177,6 +177,9 @@ static int aa_audit_base(struct aa_profi
|
|
||||||
if (sa->request_mask)
|
|
||||||
audit_log_format(ab, " fsuid=%d", current->fsuid);
|
|
||||||
|
|
||||||
+ if (sa->rlimit)
|
|
||||||
+ audit_log_format(ab, " rlimit=%d", sa->rlimit - 1);
|
|
||||||
+
|
|
||||||
if (sa->iattr) {
|
|
||||||
struct iattr *iattr = sa->iattr;
|
|
||||||
|
|
||||||
@@ -872,6 +875,79 @@ int aa_revalidate_sk(struct sock *sk, ch
|
|
||||||
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
+/**
|
|
||||||
+ * aa_task_setrlimit - test permission to set an rlimit
|
|
||||||
+ * @profile - profile confining the task
|
|
||||||
+ * @resource - the resource being set
|
|
||||||
+ * @new_rlim - the new resource limit
|
|
||||||
+ *
|
|
||||||
+ * Control raising the processes hard limit.
|
|
||||||
+ */
|
|
||||||
+int aa_task_setrlimit(struct aa_profile *profile, unsigned int resource,
|
|
||||||
+ struct rlimit *new_rlim)
|
|
||||||
+{
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
+ int error = 0;
|
|
||||||
+
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = "setrlimit";
|
|
||||||
+ sa.gfp_mask = GFP_KERNEL;
|
|
||||||
+ sa.rlimit = resource + 1;
|
|
||||||
+
|
|
||||||
+ if (profile->rlimits.mask & (1 << resource) &&
|
|
||||||
+ new_rlim->rlim_max > profile->rlimits.limits[resource].rlim_max) {
|
|
||||||
+ sa.error_code = -EACCES;
|
|
||||||
+
|
|
||||||
+ error = aa_audit(profile, &sa);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return error;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int aa_rlimit_nproc(struct aa_profile *profile) {
|
|
||||||
+ if (profile && (profile->rlimits.mask & (1 << RLIMIT_NPROC)) &&
|
|
||||||
+ profile->task_count >= profile->rlimits.limits[RLIMIT_NPROC].rlim_max)
|
|
||||||
+ return -EAGAIN;
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void aa_set_rlimits(struct task_struct *task, struct aa_profile *profile)
|
|
||||||
+{
|
|
||||||
+ int i, mask;
|
|
||||||
+
|
|
||||||
+ if (!profile)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ if (!profile->rlimits.mask)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ task_lock(task->group_leader);
|
|
||||||
+ mask = 1;
|
|
||||||
+ for (i = 0; i < RLIM_NLIMITS; i++, mask <<= 1) {
|
|
||||||
+ struct rlimit new_rlim, *old_rlim;
|
|
||||||
+
|
|
||||||
+ /* check to see if NPROC which is per profile and handled
|
|
||||||
+ * in clone/exec or whether this is a limit to be set
|
|
||||||
+ * can't set cpu limit either right now
|
|
||||||
+ */
|
|
||||||
+ if (i == RLIMIT_NPROC || i == RLIMIT_CPU)
|
|
||||||
+ continue;
|
|
||||||
+
|
|
||||||
+ old_rlim = task->signal->rlim + i;
|
|
||||||
+ new_rlim = *old_rlim;
|
|
||||||
+
|
|
||||||
+ if (mask & profile->rlimits.mask &&
|
|
||||||
+ profile->rlimits.limits[i].rlim_max < new_rlim.rlim_max) {
|
|
||||||
+ new_rlim.rlim_max = profile->rlimits.limits[i].rlim_max;
|
|
||||||
+ /* soft limit should not exceed hard limit */
|
|
||||||
+ if (new_rlim.rlim_cur > new_rlim.rlim_max)
|
|
||||||
+ new_rlim.rlim_cur = new_rlim.rlim_max;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ *old_rlim = new_rlim;
|
|
||||||
+ }
|
|
||||||
+ task_unlock(task->group_leader);
|
|
||||||
+}
|
|
||||||
|
|
||||||
/*******************************
|
|
||||||
* Global task related functions
|
|
||||||
@@ -885,6 +961,7 @@ int aa_revalidate_sk(struct sock *sk, ch
|
|
||||||
*/
|
|
||||||
int aa_clone(struct task_struct *child)
|
|
||||||
{
|
|
||||||
+ struct aa_audit sa;
|
|
||||||
struct aa_task_context *cxt, *child_cxt;
|
|
||||||
struct aa_profile *profile;
|
|
||||||
|
|
||||||
@@ -894,6 +971,11 @@ int aa_clone(struct task_struct *child)
|
|
||||||
if (!child_cxt)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
+ memset(&sa, 0, sizeof(sa));
|
|
||||||
+ sa.operation = "clone";
|
|
||||||
+ sa.task = child->pid;
|
|
||||||
+ sa.gfp_mask = GFP_KERNEL;
|
|
||||||
+
|
|
||||||
repeat:
|
|
||||||
profile = aa_get_profile(current);
|
|
||||||
if (profile) {
|
|
||||||
@@ -910,18 +992,22 @@ repeat:
|
|
||||||
goto repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (aa_rlimit_nproc(profile)) {
|
|
||||||
+ sa.info = "rlimit nproc limit exceeded";
|
|
||||||
+ unlock_profile(profile);
|
|
||||||
+ aa_audit_reject(profile, &sa);
|
|
||||||
+ aa_put_profile(profile);
|
|
||||||
+ return -EAGAIN;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/* No need to grab the child's task lock here. */
|
|
||||||
aa_change_task_context(child, child_cxt, profile,
|
|
||||||
cxt->cookie, cxt->previous_profile);
|
|
||||||
+
|
|
||||||
unlock_profile(profile);
|
|
||||||
|
|
||||||
if (APPARMOR_COMPLAIN(child_cxt) &&
|
|
||||||
profile == profile->ns->null_complain_profile) {
|
|
||||||
- struct aa_audit sa;
|
|
||||||
- memset(&sa, 0, sizeof(sa));
|
|
||||||
- sa.operation = "clone";
|
|
||||||
- sa.gfp_mask = GFP_KERNEL;
|
|
||||||
- sa.task = child->pid;
|
|
||||||
aa_audit_hint(profile, &sa);
|
|
||||||
}
|
|
||||||
aa_put_profile(profile);
|
|
||||||
@@ -1156,6 +1242,10 @@ repeat:
|
|
||||||
sa.task = current->parent->pid;
|
|
||||||
aa_audit_reject(profile, &sa);
|
|
||||||
}
|
|
||||||
+ if (PTR_ERR(old_profile) == -EAGAIN) {
|
|
||||||
+ sa.info = "rlimit nproc limit exceeded";
|
|
||||||
+ aa_audit_reject(profile, &sa);
|
|
||||||
+ }
|
|
||||||
new_profile = old_profile;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
@@ -1296,6 +1386,12 @@ static int do_change_profile(struct aa_p
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if ((error = aa_rlimit_nproc(new_profile))) {
|
|
||||||
+ sa->info = "rlimit nproc limit exceeded";
|
|
||||||
+ aa_audit_reject(cxt->profile, sa);
|
|
||||||
+ goto out;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (new_profile == ns->null_complain_profile)
|
|
||||||
aa_audit_hint(cxt->profile, sa);
|
|
||||||
|
|
||||||
@@ -1482,17 +1578,18 @@ struct aa_profile *__aa_replace_profile(
|
|
||||||
|
|
||||||
cxt = lock_task_and_profiles(task, profile);
|
|
||||||
if (unlikely(profile && profile->isstale)) {
|
|
||||||
- task_unlock(task);
|
|
||||||
- unlock_both_profiles(profile, cxt ? cxt->profile : NULL);
|
|
||||||
- aa_free_task_context(new_cxt);
|
|
||||||
- return ERR_PTR(-ESTALE);
|
|
||||||
+ old_profile = ERR_PTR(-ESTALE);
|
|
||||||
+ goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((current->ptrace & PT_PTRACED) && aa_may_ptrace(cxt, profile)) {
|
|
||||||
- task_unlock(task);
|
|
||||||
- unlock_both_profiles(profile, cxt ? cxt->profile : NULL);
|
|
||||||
- aa_free_task_context(new_cxt);
|
|
||||||
- return ERR_PTR(-EPERM);
|
|
||||||
+ old_profile = ERR_PTR(-EPERM);
|
|
||||||
+ goto error;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (aa_rlimit_nproc(profile)) {
|
|
||||||
+ old_profile = ERR_PTR(-EAGAIN);
|
|
||||||
+ goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cxt)
|
|
||||||
@@ -1500,8 +1597,15 @@ struct aa_profile *__aa_replace_profile(
|
|
||||||
aa_change_task_context(task, new_cxt, profile, 0, NULL);
|
|
||||||
|
|
||||||
task_unlock(task);
|
|
||||||
+ aa_set_rlimits(task, profile);
|
|
||||||
unlock_both_profiles(profile, old_profile);
|
|
||||||
return old_profile;
|
|
||||||
+
|
|
||||||
+error:
|
|
||||||
+ task_unlock(task);
|
|
||||||
+ unlock_both_profiles(profile, cxt ? cxt->profile : NULL);
|
|
||||||
+ aa_free_task_context(new_cxt);
|
|
||||||
+ return old_profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -1566,6 +1670,7 @@ void aa_change_task_context(struct task_
|
|
||||||
|
|
||||||
if (old_cxt) {
|
|
||||||
list_del_init(&old_cxt->list);
|
|
||||||
+ old_cxt->profile->task_count--;
|
|
||||||
call_rcu(&old_cxt->rcu, free_aa_task_context_rcu_callback);
|
|
||||||
}
|
|
||||||
if (new_cxt) {
|
|
||||||
@@ -1577,6 +1682,7 @@ void aa_change_task_context(struct task_
|
|
||||||
new_cxt->cookie = cookie;
|
|
||||||
new_cxt->task = task;
|
|
||||||
new_cxt->profile = aa_dup_profile(profile);
|
|
||||||
+ profile->task_count++;
|
|
||||||
new_cxt->previous_profile = aa_dup_profile(previous_profile);
|
|
||||||
list_move(&new_cxt->list, &profile->task_contexts);
|
|
||||||
}
|
|
||||||
--- a/security/apparmor/module_interface.c
|
|
||||||
+++ b/security/apparmor/module_interface.c
|
|
||||||
@@ -177,6 +177,22 @@ fail:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int aa_is_u64(struct aa_ext *e, u64 *data, const char *name)
|
|
||||||
+{
|
|
||||||
+ void *pos = e->pos;
|
|
||||||
+ if (aa_is_nameX(e, AA_U64, name)) {
|
|
||||||
+ if (!aa_inbounds(e, sizeof(u64)))
|
|
||||||
+ goto fail;
|
|
||||||
+ if (data)
|
|
||||||
+ *data = le64_to_cpu(get_unaligned((u64 *)e->pos));
|
|
||||||
+ e->pos += sizeof(u64);
|
|
||||||
+ return 1;
|
|
||||||
+ }
|
|
||||||
+fail:
|
|
||||||
+ e->pos = pos;
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static size_t aa_is_array(struct aa_ext *e, const char *name)
|
|
||||||
{
|
|
||||||
void *pos = e->pos;
|
|
||||||
@@ -311,6 +327,39 @@ fail:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+int aa_unpack_rlimits(struct aa_ext *e, struct aa_profile *profile)
|
|
||||||
+{
|
|
||||||
+ void *pos = e->pos;
|
|
||||||
+
|
|
||||||
+ /* rlimits are optional */
|
|
||||||
+ if (aa_is_nameX(e, AA_STRUCT, "rlimits")) {
|
|
||||||
+ int i, size;
|
|
||||||
+ u32 tmp = 0;
|
|
||||||
+ if (!aa_is_u32(e, &tmp, NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ profile->rlimits.mask = tmp;
|
|
||||||
+
|
|
||||||
+ size = aa_is_array(e, NULL);
|
|
||||||
+ if (size != RLIM_NLIMITS)
|
|
||||||
+ goto fail;
|
|
||||||
+ for (i = 0; i < size; i++) {
|
|
||||||
+ u64 tmp = 0;
|
|
||||||
+ if (!aa_is_u64(e, &tmp, NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ profile->rlimits.limits[i].rlim_max = tmp;
|
|
||||||
+ }
|
|
||||||
+ if (!aa_is_nameX(e, AA_ARRAYEND, NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ if (!aa_is_nameX(e, AA_STRUCTEND, NULL))
|
|
||||||
+ goto fail;
|
|
||||||
+ }
|
|
||||||
+ return 1;
|
|
||||||
+
|
|
||||||
+fail:
|
|
||||||
+ e->pos = pos;
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* aa_unpack_profile - unpack a serialized profile
|
|
||||||
* @e: serialized data extent information
|
|
||||||
@@ -354,6 +403,9 @@ static struct aa_profile *aa_unpack_prof
|
|
||||||
if (!aa_is_u32(e, &(profile->set_caps), NULL))
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
+ if (!aa_unpack_rlimits(e, profile))
|
|
||||||
+ goto fail;
|
|
||||||
+
|
|
||||||
size = aa_is_array(e, "net_allowed_af");
|
|
||||||
if (size) {
|
|
||||||
if (size > AF_MAX)
|
|
||||||
@@ -613,6 +665,8 @@ ssize_t aa_replace_profile(void *udata,
|
|
||||||
sa.operation = "profile_load";
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
+ /* do not fail replacement based off of profile's NPROC rlimit */
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* Replacement needs to allocate a new aa_task_context for each
|
|
||||||
* task confined by old_profile. To do this the profile locks
|
|
||||||
@@ -633,6 +687,7 @@ ssize_t aa_replace_profile(void *udata,
|
|
||||||
task_lock(task);
|
|
||||||
task_replace(task, new_cxt, new_profile);
|
|
||||||
task_unlock(task);
|
|
||||||
+ aa_set_rlimits(task, new_profile);
|
|
||||||
new_cxt = NULL;
|
|
||||||
}
|
|
||||||
unlock_both_profiles(old_profile, new_profile);
|
|
||||||
@@ -655,6 +710,7 @@ out:
|
|
||||||
*
|
|
||||||
* remove a profile from the profile list and all aa_task_context references
|
|
||||||
* to said profile.
|
|
||||||
+ * NOTE: removing confinement does not restore rlimits to preconfinemnet values
|
|
||||||
*/
|
|
||||||
ssize_t aa_remove_profile(char *name, size_t size)
|
|
||||||
{
|
|
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
security/apparmor/main.c | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/security/apparmor/main.c
|
|
||||||
+++ b/security/apparmor/main.c
|
|
||||||
@@ -159,8 +159,10 @@ static int aa_audit_base(struct aa_profi
|
|
||||||
return type == AUDIT_APPARMOR_ALLOWED ? 0 : -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ audit_log_format(ab, " type=%d", type);
|
|
||||||
+
|
|
||||||
if (sa->operation)
|
|
||||||
- audit_log_format(ab, "operation=\"%s\"", sa->operation);
|
|
||||||
+ audit_log_format(ab, " operation=\"%s\"", sa->operation);
|
|
||||||
|
|
||||||
if (sa->info) {
|
|
||||||
audit_log_format(ab, " info=\"%s\"", sa->info);
|
|
@@ -1,86 +0,0 @@
|
|||||||
From: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Subject: Add d_namespace_path() to compute namespace relative pathnames
|
|
||||||
|
|
||||||
In AppArmor, we are interested in pathnames relative to the namespace root.
|
|
||||||
This is the same as d_path() except for the root where the search ends. Add
|
|
||||||
a function for computing the namespace-relative path.
|
|
||||||
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/dcache.c | 6 +++---
|
|
||||||
fs/namespace.c | 27 +++++++++++++++++++++++++++
|
|
||||||
include/linux/dcache.h | 2 ++
|
|
||||||
include/linux/mount.h | 2 ++
|
|
||||||
4 files changed, 34 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
--- a/fs/dcache.c
|
|
||||||
+++ b/fs/dcache.c
|
|
||||||
@@ -1782,9 +1782,9 @@ shouldnt_be_hashed:
|
|
||||||
*
|
|
||||||
* Returns the buffer or an error code.
|
|
||||||
*/
|
|
||||||
-static char *__d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
|
|
||||||
- struct dentry *root, struct vfsmount *rootmnt,
|
|
||||||
- char *buffer, int buflen, int fail_deleted)
|
|
||||||
+char *__d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
|
|
||||||
+ struct dentry *root, struct vfsmount *rootmnt,
|
|
||||||
+ char *buffer, int buflen, int fail_deleted)
|
|
||||||
{
|
|
||||||
int namelen, is_slash, vfsmount_locked = 0;
|
|
||||||
|
|
||||||
--- a/fs/namespace.c
|
|
||||||
+++ b/fs/namespace.c
|
|
||||||
@@ -1883,3 +1883,30 @@ void __put_mnt_ns(struct mnt_namespace *
|
|
||||||
release_mounts(&umount_list);
|
|
||||||
kfree(ns);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+char *d_namespace_path(struct dentry *dentry, struct vfsmount *vfsmnt,
|
|
||||||
+ char *buf, int buflen)
|
|
||||||
+{
|
|
||||||
+ struct vfsmount *rootmnt, *nsrootmnt = NULL;
|
|
||||||
+ struct dentry *root = NULL;
|
|
||||||
+ char *res;
|
|
||||||
+
|
|
||||||
+ read_lock(¤t->fs->lock);
|
|
||||||
+ rootmnt = mntget(current->fs->rootmnt);
|
|
||||||
+ read_unlock(¤t->fs->lock);
|
|
||||||
+ spin_lock(&vfsmount_lock);
|
|
||||||
+ if (rootmnt->mnt_ns)
|
|
||||||
+ nsrootmnt = mntget(rootmnt->mnt_ns->root);
|
|
||||||
+ spin_unlock(&vfsmount_lock);
|
|
||||||
+ mntput(rootmnt);
|
|
||||||
+ if (nsrootmnt)
|
|
||||||
+ root = dget(nsrootmnt->mnt_root);
|
|
||||||
+ res = __d_path(dentry, vfsmnt, root, nsrootmnt, buf, buflen, 1);
|
|
||||||
+ dput(root);
|
|
||||||
+ mntput(nsrootmnt);
|
|
||||||
+ /* Prevent empty path for lazily unmounted filesystems. */
|
|
||||||
+ if (!IS_ERR(res) && *res == '\0')
|
|
||||||
+ *--res = '.';
|
|
||||||
+ return res;
|
|
||||||
+}
|
|
||||||
+EXPORT_SYMBOL(d_namespace_path);
|
|
||||||
--- a/include/linux/dcache.h
|
|
||||||
+++ b/include/linux/dcache.h
|
|
||||||
@@ -300,6 +300,8 @@ extern int d_validate(struct dentry *, s
|
|
||||||
*/
|
|
||||||
extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
|
|
||||||
|
|
||||||
+extern char *__d_path(struct dentry *, struct vfsmount *, struct dentry *,
|
|
||||||
+ struct vfsmount *, char *, int, int);
|
|
||||||
extern char * d_path(struct dentry *, struct vfsmount *, char *, int);
|
|
||||||
|
|
||||||
/* Allocation counts.. */
|
|
||||||
--- a/include/linux/mount.h
|
|
||||||
+++ b/include/linux/mount.h
|
|
||||||
@@ -103,5 +103,7 @@ extern void shrink_submounts(struct vfsm
|
|
||||||
extern spinlock_t vfsmount_lock;
|
|
||||||
extern dev_t name_to_dev_t(char *name);
|
|
||||||
|
|
||||||
+extern char *d_namespace_path(struct dentry *, struct vfsmount *, char *, int);
|
|
||||||
+
|
|
||||||
#endif
|
|
||||||
#endif /* _LINUX_MOUNT_H */
|
|
@@ -1,47 +0,0 @@
|
|||||||
From: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Subject: Switch to vfs_permission() in do_path_lookup()
|
|
||||||
|
|
||||||
Switch from file_permission() to vfs_permission() in do_path_lookup():
|
|
||||||
this avoids calling permission() with a NULL nameidata here.
|
|
||||||
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/namei.c | 13 ++++++-------
|
|
||||||
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
--- a/fs/namei.c
|
|
||||||
+++ b/fs/namei.c
|
|
||||||
@@ -1147,25 +1147,24 @@ static int fastcall do_path_lookup(int d
|
|
||||||
nd->dentry = dget(fs->pwd);
|
|
||||||
read_unlock(&fs->lock);
|
|
||||||
} else {
|
|
||||||
- struct dentry *dentry;
|
|
||||||
-
|
|
||||||
file = fget_light(dfd, &fput_needed);
|
|
||||||
retval = -EBADF;
|
|
||||||
if (!file)
|
|
||||||
goto out_fail;
|
|
||||||
|
|
||||||
- dentry = file->f_path.dentry;
|
|
||||||
+ nd->dentry = file->f_path.dentry;
|
|
||||||
+ nd->mnt = file->f_path.mnt;
|
|
||||||
|
|
||||||
retval = -ENOTDIR;
|
|
||||||
- if (!S_ISDIR(dentry->d_inode->i_mode))
|
|
||||||
+ if (!S_ISDIR(nd->dentry->d_inode->i_mode))
|
|
||||||
goto fput_fail;
|
|
||||||
|
|
||||||
- retval = file_permission(file, MAY_EXEC);
|
|
||||||
+ retval = vfs_permission(nd, MAY_EXEC);
|
|
||||||
if (retval)
|
|
||||||
goto fput_fail;
|
|
||||||
|
|
||||||
- nd->mnt = mntget(file->f_path.mnt);
|
|
||||||
- nd->dentry = dget(dentry);
|
|
||||||
+ mntget(nd->mnt);
|
|
||||||
+ dget(nd->dentry);
|
|
||||||
|
|
||||||
fput_light(file, fput_needed);
|
|
||||||
}
|
|
@@ -1,83 +0,0 @@
|
|||||||
From: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Subject: Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames
|
|
||||||
|
|
||||||
Struct iattr already contains ia_file since commit cc4e69de from
|
|
||||||
Miklos (which is related to commit befc649c). Use this to pass
|
|
||||||
struct file down the setattr hooks. This allows LSMs to distinguish
|
|
||||||
operations on file descriptors from operations on paths.
|
|
||||||
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
Cc: Miklos Szeredi <mszeredi@suse.cz>
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/nfsd/vfs.c | 12 +++++++-----
|
|
||||||
fs/open.c | 4 +++-
|
|
||||||
2 files changed, 10 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
--- a/fs/nfsd/vfs.c
|
|
||||||
+++ b/fs/nfsd/vfs.c
|
|
||||||
@@ -413,7 +413,7 @@ static ssize_t nfsd_getxattr(struct dent
|
|
||||||
{
|
|
||||||
ssize_t buflen;
|
|
||||||
|
|
||||||
- buflen = vfs_getxattr(dentry, mnt, key, NULL, 0);
|
|
||||||
+ buflen = vfs_getxattr(dentry, mnt, key, NULL, 0, NULL);
|
|
||||||
if (buflen <= 0)
|
|
||||||
return buflen;
|
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ static ssize_t nfsd_getxattr(struct dent
|
|
||||||
if (!*buf)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
- return vfs_getxattr(dentry, mnt, key, *buf, buflen);
|
|
||||||
+ return vfs_getxattr(dentry, mnt, key, *buf, buflen, NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ set_nfsv4_acl_one(struct dentry *dentry,
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- error = vfs_setxattr(dentry, mnt, key, buf, len, 0);
|
|
||||||
+ error = vfs_setxattr(dentry, mnt, key, buf, len, 0, NULL);
|
|
||||||
out:
|
|
||||||
kfree(buf);
|
|
||||||
return error;
|
|
||||||
@@ -2051,12 +2051,14 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
|
|
||||||
|
|
||||||
mnt = fhp->fh_export->ex_mnt;
|
|
||||||
if (size)
|
|
||||||
- error = vfs_setxattr(fhp->fh_dentry, mnt, name, value, size,0);
|
|
||||||
+ error = vfs_setxattr(fhp->fh_dentry, mnt, name, value, size, 0,
|
|
||||||
+ NULL);
|
|
||||||
else {
|
|
||||||
if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
|
|
||||||
error = 0;
|
|
||||||
else {
|
|
||||||
- error = vfs_removexattr(fhp->fh_dentry, mnt, name);
|
|
||||||
+ error = vfs_removexattr(fhp->fh_dentry, mnt, name,
|
|
||||||
+ NULL);
|
|
||||||
if (error == -ENODATA)
|
|
||||||
error = 0;
|
|
||||||
}
|
|
||||||
--- a/fs/open.c
|
|
||||||
+++ b/fs/open.c
|
|
||||||
@@ -581,7 +581,7 @@ asmlinkage long sys_fchmod(unsigned int
|
|
||||||
if (mode == (mode_t) -1)
|
|
||||||
mode = inode->i_mode;
|
|
||||||
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
|
|
||||||
- newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
|
|
||||||
+ newattrs.ia_valid = ATTR_MODE | ATTR_CTIME | ATTR_FILE;
|
|
||||||
err = fnotify_change(dentry, file->f_path.mnt, &newattrs, file);
|
|
||||||
mutex_unlock(&inode->i_mutex);
|
|
||||||
|
|
||||||
@@ -661,6 +661,8 @@ static int chown_common(struct dentry *
|
|
||||||
if (!S_ISDIR(inode->i_mode))
|
|
||||||
newattrs.ia_valid |=
|
|
||||||
ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
|
|
||||||
+ if (file)
|
|
||||||
+ newattrs.ia_valid |= ATTR_FILE;
|
|
||||||
mutex_lock(&inode->i_mutex);
|
|
||||||
error = fnotify_change(dentry, mnt, &newattrs, file);
|
|
||||||
mutex_unlock(&inode->i_mutex);
|
|
@@ -1,31 +0,0 @@
|
|||||||
From: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Subject: Fix file_permission()
|
|
||||||
|
|
||||||
We cannot easily switch from file_permission() to vfs_permission()
|
|
||||||
everywhere, so fix file_permission() to not use a NULL nameidata
|
|
||||||
for the remaining users.
|
|
||||||
|
|
||||||
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
||||||
Signed-off-by: John Johansen <jjohansen@suse.de>
|
|
||||||
|
|
||||||
---
|
|
||||||
fs/namei.c | 8 +++++++-
|
|
||||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/fs/namei.c
|
|
||||||
+++ b/fs/namei.c
|
|
||||||
@@ -313,7 +313,13 @@ int vfs_permission(struct nameidata *nd,
|
|
||||||
*/
|
|
||||||
int file_permission(struct file *file, int mask)
|
|
||||||
{
|
|
||||||
- return permission(file->f_path.dentry->d_inode, mask, NULL);
|
|
||||||
+ struct nameidata nd;
|
|
||||||
+
|
|
||||||
+ nd.dentry = file->f_path.dentry;
|
|
||||||
+ nd.mnt = file->f_path.mnt;
|
|
||||||
+ nd.flags = LOOKUP_ACCESS;
|
|
||||||
+
|
|
||||||
+ return permission(nd.dentry->d_inode, mask, &nd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user