Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
Improve the regex that handles absolute paths.
Browse files Browse the repository at this point in the history
This should not choke on small directory names, like "pg".

Thanks to @elyscape for pointing out a better way of doing this.
  • Loading branch information
Ari authored and gaylatea committed Dec 17, 2014
1 parent cccdecb commit 976462a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/type/mountpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
validate do |value|
raise Puppet::Error, "name is not allowed to contain whitespace" if value =~ /\s/
raise Puppet::Error, "name is not allowed to have trailing slashes" if value =~ %r{/$}
raise Puppet::Error, "name must be an absolute path" if value =~ %r{^[^/]} or value =~ %r{/../}
raise Puppet::Error, "name must be an absolute path" if value =~ %r{^[^/]} or value =~ %r{/\.\./}
end
end

Expand Down

0 comments on commit 976462a

Please sign in to comment.