Skip to content

Commit 0c5c1ab

Browse files
dianpopaioanachirca
authored andcommitted
devtool: support for new parameter
Add a new parameter to devtool that fixes permissions for the build directory (the one that can get modified by the container). This way unprivileged users can regain rights (i.e delete build session) when devtool dies in the middle of a privileged session. Signed-off-by: Diana Popa <[email protected]>
1 parent 39ac598 commit 0c5c1ab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/devtool

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ ensure_build_dir() {
236236
# owned by root. This fixes that by recursively changing the ownership of build/
237237
# to the current user.
238238
#
239-
fix_build_dir_perms() {
239+
cmd_fix_perms() {
240240
# Yes, running Docker to get elevated privileges, just to chown some files
241241
# is a dirty hack.
242242
run_devctr \
@@ -412,6 +412,8 @@ cmd_help() {
412412
echo ""
413413
echo " checkenv"
414414
echo " Performs prerequisites checks needed to execute firecracker."
415+
echo " fix_perms"
416+
echo " Fixes permissions when devtool dies in the middle of a privileged session."
415417
echo ""
416418
}
417419

@@ -541,7 +543,7 @@ cmd_test() {
541543

542544
# Running as root would have created some root-owned files under the build
543545
# dir. Let's fix that.
544-
fix_build_dir_perms
546+
cmd_fix_perms
545547

546548
return $ret
547549
}
@@ -588,7 +590,7 @@ cmd_shell() {
588590
# Running as root may have created some root-owned files under the build
589591
# dir. Let's fix that.
590592
#
591-
fix_build_dir_perms
593+
cmd_fix_perms
592594
else
593595
say "Dropping to shell prompt as user $(whoami) ..."
594596
say "Note: $FC_ROOT_DIR is bind-mounted under $CTR_FC_ROOT_DIR"

0 commit comments

Comments
 (0)