bastille icon indicating copy to clipboard operation
bastille copied to clipboard

[ENHANCEMENT] Validate -L parameter for release {focal,bionic}

Open hackacad opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. Bastille create won't validate if -L option is added when creating focal/bionic release:

bastille create focaljail focal 192.168.20.4
Valid: (192.168.20.4).

sed: etc/crontab: No such file or directory
[focaljail]:
focaljail: created
jail: focaljail: getpwnam: No such file or directory
jail: focaljail: /bin/sh /etc/rc: failed
focaljail: removed

[focaljail]: Not started. See 'bastille start focaljail'.
[focaljail]: Not started. See 'bastille start focaljail'.
[focaljail]:
focaljail: created
jail: focaljail: getpwnam: No such file or directory
jail: focaljail: /bin/sh /etc/rc: failed
focaljail: removed

Describe the solution you'd like Option A: autodetect Linux OS in create.sh (if release=[focal,bionic] than create_linux_jail) Option B: if release=[focal,bionic] and jail_type!=linux than err "Linux releases require -L option"

hackacad avatar Jul 15 '21 14:07 hackacad

Hi hackacad, is this related to the options parsing or the create_linux_jail loop itself?

Be aware that bastille create will require -L|--linux option, otherwise it will be treated as a regular FreeBSD jail which is bastille's default.

So the user should explicitly tell if a Linux jail is wanted, I will make some extra validation to ensure this option should be parsed. Regards

JRGTH avatar Jul 15 '21 19:07 JRGTH

Hey Jose, exactly. This is about handling the arguments correctly. Prevent using focal/bionic as the release when not using the -L option. (-L requires focal/bionic; !-L must not use focal/bionic)

It's not a bug, it's a simple feature to prevent creating a non-Linux jail with Linux bootstrap.

hackacad avatar Jul 15 '21 19:07 hackacad

Agree, I will add the validation for the Linux jails to prevent the above issue.

JRGTH avatar Jul 15 '21 19:07 JRGTH

This small changes in create command address the above issue: c90fea3

JRGTH avatar Jul 15 '21 20:07 JRGTH

@JRGTH was this fix merged previously per your comment? If so, can I close this one as done??

bmac2 avatar Oct 19 '23 00:10 bmac2

upon investigation, this fix was merged to master 2 years ago. Closing as finished. @JRGTH thank you for fixing this.

CLOSED

bmac2 avatar Oct 19 '23 00:10 bmac2