Jira (PUP-10241) Ensure XML plist data has UTF-8 encoding before parsing

9 views
Skip to first unread message

Gabriel Nagy (JIRA)

unread,
Jan 20, 2020, 8:31:04 AM1/20/20
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Puppet / Improvement PUP-10241
Ensure XML plist data has UTF-8 encoding before parsing
Issue Type: Improvement Improvement
Assignee: Gabriel Nagy
Created: 2020/01/20 5:30 AM
Priority: Normal Normal
Reporter: Gabriel Nagy

When creating a user/group resource on macOS Catalina, the directoryservice provider would fail with the following:

Debug: Failed with ArgumentError on : #<ArgumentError: invalid byte sequence in US-ASCII>
Error: Could not prefetch user provider 'directoryservice': undefined method `each' for nil:NilClass

This issue is caused by the Puppet::Util::Plist.parse_plist method receiving XML plist_data in ASCII instead of UTF-8 encoding (see https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/user/directoryservice.rb#L95 for an example).

XML plists begin with <?xml version="1.0" encoding="UTF-8"?>. Based on this, we can force the encoding of the plist data to be UTF-8. We do this conditionally, since the parse_plist method can also be called with plist data in binary format.

This issue seems to have been present from the beginning, but luckily no non-ASCII plist data snuck through until now.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Mihai Buzgau (JIRA)

unread,
Jan 22, 2020, 4:39:11 AM1/22/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-01-22 , NW - 2020-02-05

Josh Cooper (JIRA)

unread,
Jan 23, 2020, 4:09:03 PM1/23/20
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jan 23, 2020, 4:09:03 PM1/23/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: PUP 6.4.6
Fix Version/s: PUP 5.5.19
Fix Version/s: PUP 6.13.0

Gabriel Nagy (JIRA)

unread,
Jan 27, 2020, 4:37:04 AM1/27/20
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
Change By: Gabriel Nagy
Release Notes Summary: Fixed an issue where Puppet would try to parse an XML property list file as ASCII instead of UTF-8.
Release Notes: Bug Fix

Kate Medred (JIRA)

unread,
Feb 18, 2020, 12:14:07 PM2/18/20
to puppe...@googlegroups.com
Kate Medred updated an issue
Change By: Kate Medred
Labels: resolved-issue-added
Reply all
Reply to author
Forward
0 new messages