Issue #19056 has been updated by Andrew Parker.

Target version changed from 3.4.0 to 3.3.0

Contrary to Adrien's assertion, it looks like this was merged into stable. It 
will be part of 3.3.0

----------------------------------------
Bug #19056: AIX user provider  do handle well trailling space after the 
password hash in local file file /etc/security/password
https://projects.puppetlabs.com/issues/19056#change-97304

* Author: Stéphane Nsakala
* Status: Merged - Pending Release
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 3.3.0
* Affected Puppet version: 3.0.2
* Keywords: aix user password space
* Branch: https://github.com/puppetlabs/puppet/pull/1763
----------------------------------------
! I found on my system trailing space after the hashed password.

[root@test3]/root# head /etc/security/passwd

root:
        password = 8V.f3zDkRGa7A
        lastupdate = 1360050752

[root@test3]/root# grep  "password = 8" /etc/security/passwd | od -c
0000000   \t   p   a   s   s   w   o   r   d       =       8   V   .   f
0000020    3   z   D   k   R   G   a   7   A
0000040                   \n
0000045

! Each time i run puppet it will update the password (i did not change it 
between invocation. 


[root@test3]/root# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for test3.svr.luxair
Info: Applying configuration version '1359997672'
Notice: /Stage[main]/User::Root/User[root]/password: changed password
Notice: Finished catalog run in 2.39 seconds
[root@test3]/root# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for test3.svr.luxair
Info: Applying configuration version '1359997672'

! The problem comf form the file lib/puppet/provider/user/aix.rb

        # If the password= entry is found, return it
        if l  =~ /^\s*password\s*=\s*(.*)$/
          password = $1; break;
        end

! i just printed the password

    f.close()
    print "#" + password + "#"
    return password

! We can see that the reg exp will not discard space after the password. So the 
comparison fail !

[root@test3]/root# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for test3.svr.luxair
Info: Applying configuration version '1359997672'
#8V.f3zDkRGa7A           #Notice: /Stage[main]/User::Root/User[root]/password: 
changed password
Notice: Finished catalog run in 2.39 seconds

! changing the reg exp will solve the problem

*** 
/opt/freeware/lib/ruby/gems/1.9.1/gems/puppet-3.0.2/lib/puppet/provider/user/aix.rb
 Tue Feb  5 09:07:11 2013
--- /tmp/aix.rb.new     Tue Feb  5 09:06:48 2013
***************
*** 235,241 ****
          # If there is a new user stanza, stop
          break if l  =~ /^\S*:\s*$/
          # If the password= entry is found, return it
!         if l  =~ /^\s*password\s*=\s*(.*)$/
            password = $1; break;
          end
        }
--- 235,241 ----
          # If there is a new user stanza, stop
          break if l  =~ /^\S*:\s*$/
          # If the password= entry is found, return it
!         if l  =~ /^\s*password\s*=\s*(\S*)\s*$/
            password = $1; break;
          end
        }




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to