Affects Version/s: PUP 4.8.0
Fix Version/s: None
Component/s: Types and Providers
$ uname -a
Linux cwl 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
$ cat /etc/debian_version
$ puppet --version
$ /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]
This to reproduce:
I can't by any stretch call myself a programmer, but it turns out people on stackoverflow are having related behaviour (huzzah googling for "ruby tilde filename", no quotes).
From the ruby docs, expand_path says that a ~user filename expands to that user's home directory. It doesn't seem to be quite what's going on here but it's still bringing in the username.
Sure enough, the file type uses expand_path to sort out where the :path is.
The bug part appears to be where the file type is implicitly presuming that the file path is not literal from the file resource, if I'm reading this right. (Not a programmer.)