Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5800

Filenames in recursive directories appear to be shell expanded

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 7.13.0
    • None
    • Bug Fix
    • Puppet can now manage files whose names start with tilde "~" characters

    Description

      When a file in a directory used as a source for a recursive file resource starts with a ~, then it's evaluated as a username. I didn't check to see if other patterns expand. This is a real edge case, except that some editors save backup files with a prepended ~.

      root@ip-172-31-8-159:~ # puppet apply test.pp
      Notice: Compiled catalog for puppetfactory.puppetlabs.vm in environment production in 0.03 seconds
      Notice: /Stage[main]/Main/File[/tmp/test]/ensure: created
      Error: Could not set 'file' on ensure: user bar.txt20160201-23101-1o0dulq doesn't exist
      Error: Could not set 'file' on ensure: user bar.txt20160201-23101-1o0dulq doesn't exist
      Wrapped exception:
      user bar.txt20160201-23101-1o0dulq doesn't exist
      Error: /Stage[main]/Main/File[/tmp/test/~bar.txt]/ensure: change from absent to file failed: Could not set 'file' on ensure: user bar.txt20160201-23101-1o0dulq doesn't exist
      Notice: Applied catalog in 0.28 seconds
      root@ip-172-31-8-159:~ # cat test.pp
      file { '/tmp/test':
        ensure  => directory,
        recurse => true,
        source  => '/root/foo',
      }
       
      root@ip-172-31-8-159:~ # ls foo/
      ~bar.txt
      

      Attachments

        Issue Links

          Activity

            People

              josh Josh Cooper
              ben.ford Ben Ford
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support