Commit fb71f0d introduced to possibility to add options behind permissions

in fstab. Unfortunately it breaks scenarios where no options are provided
as the current regex expects the comma with the options always to be present.

This patch fixes the regex to handle the options as group.
This commit is contained in:
Matthias Petermann
2025-01-17 09:58:23 +01:00
parent fb876b4074
commit ce0ab9d364

View File

@@ -92,7 +92,7 @@ elif [ ! -e "${_hostpath}" ] || [ "${_type}" != "nullfs" ]; then
fi fi
# Mount permissions,options need to start with "ro" or "rw" # Mount permissions,options need to start with "ro" or "rw"
if ! echo "${_perms}" | grep -Eq 'r[w|o],.*$'; then if ! echo "${_perms}" | grep -Eq 'r[w|o](,.*)?$'; then
error_notify "Detected invalid mount permissions in FSTAB." error_notify "Detected invalid mount permissions in FSTAB."
warn "Format: /host/path /jail/path nullfs ro 0 0" warn "Format: /host/path /jail/path nullfs ro 0 0"
warn "Read: ${_fstab}" warn "Read: ${_fstab}"