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

puppet 5/ruby 2.4 can't handle invalid plists

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 5.3.6, PUP 5.5.0, PUP 6.0.0
    • None
    • None
    • Platform Core
    • Platform Core KANBAN
    • Needs Assessment
    • Bug Fix
    • When processing malformed plist files, we used to use /dev/stdout which can cause Ruby to complain. We now use '-' instead which means to use stdout when processing the plist file with plutil.
    • Manual

    Description

      Puppet Version: 5.4.0
      Puppet Server Version: n/a
      OS Name/Version: macOS 10.13.3

      Puppet 5.4.0 using ruby 2.4.3 can't handle invalid plists.

      If a plist contains and invalid comment (e.g., a comment with '–' in the text), CFPropertyList will fail to parse it, passing it on to a shell out to `plutil -convert xml1 -o /dev/stdout`. However, it seems some subsystem (I believe it may be ruby 2.4) doesn't allow operations on `/dev/stdout`

      Warning: Cannot read file /Library/LaunchDaemons/badcomment.plist; Puppet is skipping it.\nDetails: Execution of '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/badcomment.plist' returned 1: <?xml version="1.0" encoding="UTF-8"?>Warning: Cannot read file /Library/LaunchDaemons/badcomment.plist; Puppet is skipping it.\n

      [...]

      /dev/stdout: Operation not supported

      To reproduce, add a comment containing '–' to any plist in /Library/LaunchDaemons, then run puppet.

      Desired Behavior:

      Puppet should handle the malformed plist and successfully call plutil.

      Actual Behavior:

      After CFPropertyList fails, the plutil call also fails.

       

      Attachments

        Activity

          People

            eric.delaney Eric Delaney
            ccaviness Clay Caviness
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support