From 94f1da7fbf762b03320218aac175585adc7a3cb0 Mon Sep 17 00:00:00 2001 From: Chris Punches Date: Wed, 7 Feb 2024 02:00:50 -0500 Subject: [PATCH] updated user/group execution context flow based on new features in rex --- project_config.sh | 5 ++-- .../x86_64/components/stage1/welcome.bash | 5 ++++ rex.project/x86_64/units/stage1.units | 28 +++++++++---------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/project_config.sh b/project_config.sh index aaf0bfb..51827e2 100755 --- a/project_config.sh +++ b/project_config.sh @@ -58,8 +58,9 @@ dir_rex=${project_root}/rex.project # the sysroot being created dir_sysroot=${dir_artifacts}/T_SYSROOT -user="phanes" -group="phanes" +# set this manually because rex runs as root for its setgid/setuid +build_user="bagira" +build_group="bagira" # if we're being supplied parameters we assume it's being called by make # and need to recall make with all appropriate vars set diff --git a/rex.project/x86_64/components/stage1/welcome.bash b/rex.project/x86_64/components/stage1/welcome.bash index a282c0b..cd8fded 100755 --- a/rex.project/x86_64/components/stage1/welcome.bash +++ b/rex.project/x86_64/components/stage1/welcome.bash @@ -44,3 +44,8 @@ echo -e "\e[31m$HORSE\e[0m" echo echo "Welcome to Pyrois, the build system for Dark Horse Linux." echo + +echo running as: $build_user:$build_group +echo +echo +echo diff --git a/rex.project/x86_64/units/stage1.units b/rex.project/x86_64/units/stage1.units index ceb652d..96ac93f 100644 --- a/rex.project/x86_64/units/stage1.units +++ b/rex.project/x86_64/units/stage1.units @@ -13,8 +13,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }, @@ -49,8 +49,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }, @@ -67,8 +67,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }, @@ -85,8 +85,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }, @@ -103,8 +103,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }, @@ -121,8 +121,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }, @@ -139,8 +139,8 @@ "active": true, "required": true, "set_user_context": true, - "user": "phanes", - "group": "phanes", + "user": "$build_user", + "group": "$build_group", "supply_environment": true, "environment": "environments/stage1.env.bash" }