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

launchd service provider crashes if a non-text or binary plist file in {System,}/Library/Launch{Daemons,Agents} directory exists

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.5.2
    • Fix Version/s: PUP 4.8.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      OS X 10.11.6
      Puppet 4.5.2

    • Template:
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Puppet now provides a reasonable error message if it finds unexpected binary files when processing launchd service entries

      Description

      If a file in the LaunchAgents or LaunchDaemons paths is encountered that's not:

      • a plain text file (plist or not)
      • a binary plist file (magic 'bplist00')

      then Puppet will crash with an error.

      To reproduce:

      # cp /bin/ls /Library/LaunchDaemons
      # puppet resource service
      Error: Could not run: invalid byte sequence in UTF-8
      

      In plist.rb line 34 there's a check if it’s a binary plist or not.

      In the case of a binary blob that's on a binary plist, this will fail, and fall through to parse_plist on line 55, which tries to check the file's contents against the {{bad_xml_doctype]} regex.

      This fails because of the encoding.

      I expect the correct course of action is to handle the ArgumentError and return nil

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                qa qa
                Reporter:
                ccaviness Clay Caviness
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: