From 22be3bc7594ad268240af7a960a5eb6ba501feb2 Mon Sep 17 00:00:00 2001 From: timoxa0 Date: Sat, 2 Nov 2024 23:13:01 +0500 Subject: [PATCH] mklni: Fix unsafe remove_chroot --- mklni | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mklni b/mklni index a0553c9..22ab630 100755 --- a/mklni +++ b/mklni @@ -281,8 +281,13 @@ remove_chroot() log "Failed to umount chroot" error exit 1 } + { + rm -rf "${CHROOTDIR:?}/" && log "Done!" - rm -rf "${CHROOTDIR:?}/" + } || { + log "Failed to remove chroot" error + exit 1 + } } chroot_into()