From 69665fdcef017963a641c0bb650409fbae474eca Mon Sep 17 00:00:00 2001 From: yo Date: Thu, 9 Nov 2023 19:16:53 +0100 Subject: [PATCH] BUGFIX: fstab comments made invalid format error --- cmd/utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/utils.go b/cmd/utils.go index 4d4896f..6b5746e 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -917,7 +917,8 @@ func getFstab(path string) ([]Mount, error) { scan := bufio.NewScanner(f) for scan.Scan() { res := strings.Fields(scan.Text()) - if len(res) != 6 { + // iocage create lines like that : "/iocage/releases/13.2-RELEASE/root/bin /iocage/jails/smtp-router-02/root/bin nullfs ro 0 0 # Added by iocage on 2023-10-10 17:20:51" + if (len(res) > 6 && !strings.EqualFold(res[6], "#")) || len(res) < 6 { return mounts, fmt.Errorf("Incorrect format for fstab line %s", scan.Text()) } freq, err := strconv.Atoi(res[4])