summaryrefslogtreecommitdiff
path: root/src/file/homefile/userhomefile.cil
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-08-20 18:15:24 -0400
committerJohn Turner <jturner.usa@gmail.com>2025-08-20 22:08:42 -0400
commitbb228574d78232d407b78f90faf39fff28cb6c5b (patch)
tree8221331e8f837d6d4eafa9b55f2b471f0d442f06 /src/file/homefile/userhomefile.cil
parentd423f2bca3f9161c3c9abd58898e8cc3744a0832 (diff)
downloadselinux-policy-bb228574d78232d407b78f90faf39fff28cb6c5b.tar.gz
rework how user files work
Instead of assuming all user files exist under $HOME, we create a .file.user module and typeattribute. This allows user files to exist in places outside of $HOME. Also we changed filecon so that $HOME itself is user.home.file rather than home.file.
Diffstat (limited to 'src/file/homefile/userhomefile.cil')
-rw-r--r--src/file/homefile/userhomefile.cil30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/file/homefile/userhomefile.cil b/src/file/homefile/userhomefile.cil
new file mode 100644
index 0000000..de8a882
--- /dev/null
+++ b/src/file/homefile/userhomefile.cil
@@ -0,0 +1,30 @@
+(in file.unconfined
+ (call .user.home.home_file_type_transition_file (typeattr dir "*")))
+
+(in file.home
+ (block user
+ (macro type ((type ARG1))
+ (typeattributeset typeattr type))
+
+ (typeattribute typeattr)
+
+ (call file.home.type (typeattr))
+ (call file.user.type (typeattr))
+
+ (block base_template
+ (blockabstract base_template)
+ (blockinherit .file.user.base_template)
+ (call .file.home.user.type (file)))
+
+ (block template
+ (blockabstract template)
+ (blockinherit .file.user.template))))
+
+(in user
+ (block home
+ (macro home_file_type_transition_file ((type ARG1) (class ARG2) (name ARG3))
+ (call .home.file_type_transition (ARG1 file ARG2 ARG3)))
+
+ (blockinherit file.home.user.template)
+ (filecon "HOME_DIR" dir file_context)
+ (filecon "HOME_DIR/.*" any file_context)))