From b442626d57971903f3acdb46d2461b1fe39253fd Mon Sep 17 00:00:00 2001 From: Raamsri Kumar Date: Mon, 3 Feb 2025 11:47:09 +0530 Subject: [PATCH] Remove regex validation for quota The quota regex doesn't provide comprehensive validation; let ZFS handle it. Signed-off-by: Raamsri Kumar --- pkg/zfs/api/middleware.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pkg/zfs/api/middleware.go b/pkg/zfs/api/middleware.go index 3c6b378..c713352 100644 --- a/pkg/zfs/api/middleware.go +++ b/pkg/zfs/api/middleware.go @@ -406,14 +406,6 @@ func ValidatePropertyValue() gin.HandlerFunc { return } - // Special handling for quota values - if property := c.Param("property"); property == "quota" || property == "refquota" { - if !quotaRegex.MatchString(req.Value) { - APIError(c, errors.New(errors.ZFSQuotaInvalid, "Invalid quota format")) - return - } - } - c.Next() } } @@ -563,13 +555,6 @@ func ValidateZFSProperties() gin.HandlerFunc { return } - // Special handling for quota values - if k == "quota" || k == "refquota" { - if !quotaRegex.MatchString(v) { - APIError(c, errors.New(errors.ZFSQuotaInvalid, "Invalid quota format")) - return - } - } } c.Next() }