[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5rc1-120-g2247c80
Daniel Pittman
daniel at rimspace.net
Mon Feb 7 06:41:51 UTC 2011
The following commit has been merged in the upstream branch:
commit 878f266fbf8979bcfeab9faef308816fd4a54c50
Author: James Turnbull <james at lovedthanlost.net>
Date: Tue Feb 1 04:55:26 2011 +1100
Fixed #6091 - Changed POSIX path matching to allow multiple leading slashes
According to
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_266:
"Multiple successive slashes are considered to be the same as one
slash.", so '//tmp/xxx' is a valid POSIX pathname.
Thomas Bellman adds:
You should probably read section 3.2 then as well:
3.2 Absolute Pathname
A pathname beginning with a single or more than two slashes;
see also Pathname.
Note that a pathname starting with exactly two slashes is *not*
an absolute pathname according to Posix. And 4.11 (Pathname
Resolution) says:
A pathname that begins with two successive slashes may be
interpreted in an implementation-defined manner, although
more than two leading slashes shall be treated as a single
slash.
Posix has this rule to accomodate DomainOS, which was a Unix-
like OS from Apollo, where paths on the form "//foo/bar/gazonk"
meant the file "/bar/gazonk" on the machine named "foo". You may
recognize this format from URLs, or MS Windows SMB paths (with
backslashes instead of forward slashes).
This ignores that complication, since none of our supported platforms treat
the '//' form as significant.
Signed-off-by: James Turnbull <james at lovedthanlost.net>
Signed-off-by: Daniel Pittman <daniel at puppetlabs.com>
Signed-off-by: Rick Bradley <rick at rickbradley.com>
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 0d69446..a91e7a5 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -34,7 +34,7 @@ Puppet::Type.newtype(:file) do
validate do |value|
# accept various path syntaxes: lone slash, posix, win32, unc
- unless (Puppet.features.posix? and (value =~ /^\/$/ or value =~ /^\/[^\/]/)) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
+ unless (Puppet.features.posix? and value =~ /^\//) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
fail Puppet::Error, "File paths must be fully qualified, not '#{value}'"
end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list