From 84e56f2345f52092d5ed5e1d6c6764b16a75b079 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 23 Sep 2024 15:56:55 +0900 Subject: [PATCH] XENIA: sandboxing prefix --- functions/prepare_component.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index e2198463..f53c073c 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -896,7 +896,18 @@ prepare_component() { log i "Prepearing Xenia" log i "----------------------" - rm -rf "/var/data/xenia-canary-pfx" + local xenia_prefix="/var/data/xenia-canary-pfx" + create_dir -d "$xenia_prefix" + + # sandboxing prefix to avoid writing on real user home folder + # TODO: multi user needs to carew about this as we're using the linux username + unlink "$xenia_prefix/drive_c/users/$(whoami)/Desktop" && create_dir "$xenia_prefix/drive_c/users/$(whoami)/Desktop" + unlink "$xenia_prefix/drive_c/users/$(whoami)/Documents" && create_dir "$xenia_prefix/drive_c/users/$(whoami)/Documents" + unlink "$xenia_prefix/drive_c/users/$(whoami)/Downloads" && create_dir "$xenia_prefix/drive_c/users/$(whoami)/Downloads" + unlink "$xenia_prefix/drive_c/users/$(whoami)/Music" && create_dir "$xenia_prefix/drive_c/users/$(whoami)/Music" + unlink "$xenia_prefix/drive_c/users/$(whoami)/Pictures" && create_dir "$xenia_prefix/drive_c/users/$(whoami)/Pictures" + unlink "$xenia_prefix/drive_c/users/$(whoami)/Videos" && create_dir "$xenia_prefix/drive_c/users/$(whoami)/Videos" + # TODO: fill this fi