Hello, I have reported this bug upstream (https://github.com/iocage/iocage/issues/1298) but given that the latest iocage commit happened two years ago, I'm reporting it here as well. iocage 1.2 from the latest port tree, FreeBSD 14.0-p2 iocage console <existing jail>/ crashes (if / is appended after the name of the existing jail).
Created attachment 248789 [details] fix for the crash The attached patch is not a proper fix but fixes the crash. Now iocage console <existing jail>/ will do the same as iocage console <existing jail> instead of crashing.
Hi Alexey, Thank you for opening this. I wonder if a more correct fix would be to fail with jail not found in case of using "myjail/" instead of "myjail" (seems cleaner to me, as iocage otherwise does partial matches, but, e.g., myjailX will not match myjail). Especially since this does not only affect the console command, but all commands. What do you think? Best
It will be cleaner but it is not trivial. The point here is that iocage tries some directory check to determine if jail exists, so both .../myjail and .../myjail/ give positive results. I'll think about what to do.
I have an idea and will commit a fix soon.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=65eb9ca8f37ffb5888cce55d0d2cdeec3f2f8a24 commit 65eb9ca8f37ffb5888cce55d0d2cdeec3f2f8a24 Author: Michael Gmelin <grembo@FreeBSD.org> AuthorDate: 2024-02-27 17:39:39 +0000 Commit: Michael Gmelin <grembo@FreeBSD.org> CommitDate: 2024-02-27 17:52:07 +0000 sysutils/iocage: Fix handling of slashes in jail param PR: 275738 Reported by: alexey@ocaml.nl sysutils/iocage/Makefile | 11 +++++++++-- sysutils/iocage/distinfo | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-)
@Alexey I think this solves the issue in a clean enough way. Please re-open in case you disagree.