Closed Jip-Hop closed 1 month ago
While I see the issue, I cannot reproduce the bug as the jlmkr name validation fails me before I can get to jail creation.
Tried both interactive and via jlmkr.py create test jail
, jlmkr.py create "test jail"
while I have a dataset jailmaker/jails/test jail
.
I've written a small patch, just need to figure out how to reproduce the issue first to test it.
Thanks for looking into it. It's not the jail name which contains spaces but a parent dataset which contains the jailmaker dataset. The reproduction steps are in the issue.
You're right, totally didn't think of that. Update the code in the PR with tested working code, test on 23.10.2 and 24.04-RC1. Should be fixed now
In #118 we introduced a bug in this line:
https://github.com/Jip-Hop/jailmaker/blob/9661f4ff19b44470319b7e258f562c8076405dda/jlmkr.py#L930
It does not compare as intended in case one of the parent datasets (and possible the pool name) contain spaces: The contents of
/proc/mounts
contain the paths with spaces encoded as discussed in https://github.com/openzfs/zfs/issues/11182.Which results in us doing this comparison:
The comparison fails and we end up not creating datasets, but plain directories for new jails.
@templehasfallen FYI
Reproduction steps
Prepare dataset with spaces
Copy the
jlmkr.py
file in thejailmaker
dir and runjlmkr.py create test
.Check in the TrueNAS GUI under Datasets that there's no child dataset created under the
jailmaker
dataset.Impact
The impact is relatively low as TrueNAS GUI doesn't allow creating datasets with spaces in their name. However datasets created with spaces by using the cli will show up fine in the TrueNAS GUI. So jailmaker needs to support this too.