Skip to content

Commit

Permalink
Remove regex validation for quota
Browse files Browse the repository at this point in the history
The quota regex doesn't provide comprehensive validation; let ZFS handle
it.

Signed-off-by: Raamsri Kumar <[email protected]>
  • Loading branch information
raamsri committed Feb 3, 2025
1 parent 377b714 commit b442626
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pkg/zfs/api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit b442626

Please sign in to comment.