summaryrefslogtreecommitdiff
path: root/src/subj/common.cil
blob: 7ebe003a9f2ca0f853a0090e2f82ab84dc5edf4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
;; Copyright (C) 2025 John Turner

;; 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, either version 3 of the License, or
;; (at your option) any later version.

;; 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, see <https://www.gnu.org/licenses/>.

(in subj
    
    (block common

        (macro type ((type ARG1))
            (typeattributeset typeattr ARG1))

        (typeattribute typeattr)

        (call subj.type (typeattr))

        (blockinherit all_macro_template)

        (allow typeattr self (process (fork sigchld sigkill signal signull sigstop)))
        (allow typeattr self list_dir)
        (allow typeattr self read_lnk_file)
        (allow typeattr self readwrite_fifo_file)
        (allow typeattr self read_file)

        ;; traverse /
        (call .root.search_file_dirs (typeattr))

        ;; procfs
        (call .proc.read_fs_lnk_files (typeattr))
        (call .proc.search_fs_dirs (typeattr))

        ;; sysfs
        (call .sys.search_fs_dirs (typeattr))
        (call .sys.read_fs_files (typeattr))

        ;; loader
        (call .loader.conf.read_file_files (typeattr))
        (call .loader.exec.mapexecute_file_files (typeattr))
        (call .loader.cache.search_file_dirs (typeattr))
        (call .loader.cache.read_file_files (typeattr))

        ;; use libraries
        (call .lib.mapexecute_file_files (typeattr))
        (call .lib.read_file_files (typeattr))
        (call .lib.search_file_dirs (typeattr))
        (call .lib.list_file_dirs (typeattr))
        (call .lib.read_file_lnk_files (typeattr))
        
        (block base_template

    	    (blockabstract base_template)

    	    (blockinherit .subj.base_template)

    	    (call .subj.common.type (subj)))

        (block template
            (blockabstract template)

            (blockinherit .subj.common.base_template)
            (blockinherit .subj.macro_template))))