puppetlabs-mysql icon indicating copy to clipboard operation
puppetlabs-mysql copied to clipboard

Path validation of sql parameter in mysql::db too restrictive.

Open rwf14f opened this issue 3 years ago • 0 comments

Describe the Bug

The regex that is used by mysql::db to validate the sql parameter refuses to accept perfectly valid pathnames, eg it only accepts a single dot to separate the filename from the extensions, but not anywhere else in the path. In our case it's the powerdns mysql schema path that it's choking on: /usr/share/doc/pdns-backend-mysql-4.1.14/schema.mysql.sql.

Is there a reason why the module doesn't use the types from stdlib (Optional[Array[Stdlib::Unixpath]] $sql = undef,)? The module has a dependency on it already. Are you worried about whitespaces in paths ?

Expected Behavior

The module should allow all valid paths.

Steps to Reproduce

Use paths with a multiple dots in sql parameter.

Environment

  • Version [13.0.0]
  • Platform [CentOS 7]

Additional Context

rwf14f avatar Oct 10 '22 09:10 rwf14f