kiss-chroot: Add /etc directory check
kyx0r opened this issue · 0 comments
It's probably just a user problem but sometimes I find myself by accident specifying the wrong chroot directory path, and when it happens it can create junk in directory at least, basically it does not error cleanly.
I propose to add the /etc directory check to prevent erroneous misuse. I don't think we can expect anything you try to chroot into to not have /etc directory. Is that a good idea? Also I don't think this will create much limitation for any user, even if you somehow happen to have tarball that has no /etc directory, simple mkdir is all that's needed, so it's not like this creates a hard to go about limitation for the user. Well /etc is also good to check because we are trying to copy /etc/resolv.conf so that basic assumption is there too.
Just add this here:
https://github.com/kiss-community/kiss/blob/master/contrib/kiss-chroot#L48
[ -d "$1/etc" ] || die Given path does not contain /etc