Jira (PUP-10778) User resource is not idempotent on AIX

17 views
Skip to first unread message

Jarret Lavallee (Jira)

unread,
Nov 11, 2020, 11:39:03 AM11/11/20
to puppe...@googlegroups.com
Jarret Lavallee created an issue
 
Puppet / Bug PUP-10778
User resource is not idempotent on AIX
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/11/11 8:38 AM
Priority: Normal Normal
Reporter: Jarret Lavallee

Puppet Version: 6.17
Puppet Server Version: 6.12.1
OS Name/Version: AIX 7.2

When using a user resource on AIX and setting the password, the password is updated every agent run. This happens when a user stanza contains a tab in the password line.

This is because the regex in https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/user/aix.rb#L181 does not account for tabs or multiple spaces.

Reproduction:

1. In an AIX 7.2 node add a user resource.

user{'testing':
  ensure => present,
  password => 'test',
}

2. Edit the /etc/security/passwd file to add a tab to the password line.

testing:
        password        = test
        lastupdate = 1605112051

3. Apply the user resource multiple times and confirm that the password it changed b every run.

[0] [AIX] root@aix72-9:~ # puppet apply user.pp 
Notice: Compiled catalog for aix72-9.delivery.puppetlabs.net in environment production in 0.02 seconds
Notice: /Stage[main]/Main/User[testing]/password: changed [redacted] to [redacted]
Notice: Applied catalog in 0.22 seconds
[0] [AIX] root@aix72-9:~ # puppet apply user.pp 
Notice: Compiled catalog for aix72-9.delivery.puppetlabs.net in environment production in 0.02 seconds
Notice: /Stage[main]/Main/User[testing]/password: changed [redacted] to [redacted]
Notice: Applied catalog in 0.22 seconds
[0] [AIX] root@aix72-9:~ # puppet apply user.pp 
Notice: Compiled catalog for aix72-9.delivery.puppetlabs.net in environment production in 0.02 seconds
Notice: /Stage[main]/Main/User[testing]/password: changed [redacted] to [redacted]
Notice: Applied catalog in 0.22 seconds

Desired Behavior:
The password should be set once unless the password changed.

Actual Behavior:

The detection of the current password has an incorrect regex and updates the password every agent run.

Proposed Fix
Change the regex in https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/user/aix.rb#L181 to be /password\s+=\s+(\S+)/

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

zendesk.jira (Jira)

unread,
Nov 11, 2020, 11:40:03 AM11/11/20
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Labels: jira_escalated

zendesk.jira (Jira)

unread,
Nov 11, 2020, 11:41:03 AM11/11/20
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 41908

Jarret Lavallee (Jira)

unread,
Nov 12, 2020, 11:26:03 AM11/12/20
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Nov 16, 2020, 8:47:03 AM11/16/20
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Nov 19, 2020, 5:06:04 AM11/19/20
to puppe...@googlegroups.com
Gabriel Nagy commented on Bug PUP-10778

Jarret Lavallee can you please add release notes to the ticket?

Jarret Lavallee (Jira)

unread,
Nov 20, 2020, 10:07:01 AM11/20/20
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
 
Change By: Jarret Lavallee
Release Notes: Bug Fix
Release Notes Summary: The AIX user resource now allows for `password` lines with arbitrary whitespace in the `passwd` file.

Mihai Buzgau (Jira)

unread,
Dec 9, 2020, 7:07:03 AM12/9/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Fix Version/s: PUP 7.1.0

Claire Cadman (Jira)

unread,
Dec 9, 2020, 11:35:04 AM12/9/20
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc_reviewed jira_escalated

Gheorghe Popescu (Jira)

unread,
Jan 13, 2021, 9:10:03 AM1/13/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Fix Version/s: PUP 6.20.0
Reply all
Reply to author
Forward
0 new messages