Jira (PUP-7505) *nix forcelocal group management cannot handle varying encodings

0 views
Skip to first unread message

Moses Mendoza (JIRA)

unread,
May 8, 2017, 7:55:02 PM5/8/17
to puppe...@googlegroups.com
Moses Mendoza created an issue
 
Puppet / Bug PUP-7505
*nix forcelocal group management cannot handle varying encodings
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2017/05/08 4:54 PM
Priority: Normal Normal
Reporter: Moses Mendoza

See this code: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/group/groupadd.rb#L30-L44

We open the file without specifying encoding which will default to default_external. If the file has entries in different encodings or non-UTF-8 encodings, this will fail.

A better solution would be to open the file in BINARY, and then attempt to handle each entry with respect to encoding, ie overriding to UTF-8.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (JIRA)

unread,
May 16, 2017, 7:19:03 PM5/16/17
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 5, 2020, 2:38:03 AM3/5/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity Night's Watch
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 5, 2020, 2:38:04 AM3/5/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-7505
 
Re: *nix forcelocal group management cannot handle varying encodings

This may have been overtaken by recent events?

Josh Cooper (Jira)

unread,
Jun 6, 2020, 7:15:03 PM6/6/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
See this code: [ https://github.com/puppetlabs/puppet/blob/ master f3265237264de95d59807ad9333182b5e405f9b9 /lib/puppet/provider/group/groupadd.rb# L30-L44 L136]

We open the file without specifying encoding which will default to default_external. If the file has entries in different encodings or non-UTF-8 encodings, this will fail.

A better solution would be to open the file in BINARY, and then attempt to handle each entry with respect to encoding, ie overriding to UTF-8.

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 3:51:05 AM11/5/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 3:52:04 AM11/5/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 11, 2021, 5:40:02 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Priority: Normal Low
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 11, 2021, 5:41:02 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-7505
 
Re: *nix forcelocal group management cannot handle varying encodings

Yep still a problem, Puppet::FileSystem.each_line doesn't pass an encoding into File.open.

Ciprian Badescu (Jira)

unread,
Oct 29, 2021, 5:19:02 AM10/29/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages