def test_change_sysaccount_password_issue7561(self): sysuser = '******' original_passwd = 'Secret123' new_passwd = 'userPasswd123' master = self.master base_dn = str(master.domain.basedn) entry_ldif = textwrap.dedent(""" dn: uid={sysuser},cn=sysaccounts,cn=etc,{base_dn} changetype: add objectclass: account objectclass: simplesecurityobject uid: {sysuser} userPassword: {original_passwd} passwordExpirationTime: 20380119031407Z nsIdleTimeout: 0 """).format( base_dn=base_dn, original_passwd=original_passwd, sysuser=sysuser) tasks.ldapmodify_dm(master, entry_ldif) tasks.ldappasswd_sysaccount_change(sysuser, original_passwd, new_passwd, master)
def test_change_sysaccount_password_issue7561(self): sysuser = '******' original_passwd = 'Secret123' new_passwd = 'userPasswd123' master = self.master base_dn = str(master.domain.basedn) # pylint: disable=no-member tf = NamedTemporaryFile() ldif_file = tf.name entry_ldif = textwrap.dedent(""" dn: uid=system,cn=sysaccounts,cn=etc,{base_dn} changetype: add objectclass: account objectclass: simplesecurityobject uid: system userPassword: {original_passwd} passwordExpirationTime: 20380119031407Z nsIdleTimeout: 0 """).format( base_dn=base_dn, original_passwd=original_passwd) master.put_file_contents(ldif_file, entry_ldif) arg = ['ldapmodify', '-h', master.hostname, '-p', '389', '-D', str(master.config.dirman_dn), # pylint: disable=no-member '-w', master.config.dirman_password, '-f', ldif_file] master.run_command(arg) tasks.ldappasswd_sysaccount_change(sysuser, original_passwd, new_passwd, master)
def test_change_sysaccount_password_issue7561(self): sysuser = '******' original_passwd = 'Secret123' new_passwd = 'userPasswd123' master = self.master base_dn = str(master.domain.basedn) # pylint: disable=no-member entry_ldif = textwrap.dedent(""" dn: uid=system,cn=sysaccounts,cn=etc,{base_dn} changetype: add objectclass: account objectclass: simplesecurityobject uid: system userPassword: {original_passwd} passwordExpirationTime: 20380119031407Z nsIdleTimeout: 0 """).format( base_dn=base_dn, original_passwd=original_passwd) tasks.ldapmodify_dm(master, entry_ldif) tasks.ldappasswd_sysaccount_change(sysuser, original_passwd, new_passwd, master)
def test_change_sysaccount_pwd_history_issue7181(self, pwpolicy_global): """ Test that a sysacount user maintains no password history because they do not have a Kerberos identity. """ sysuser = '******' original_passwd = 'Secret123' new_passwd = 'userPasswd123' master = self.master # Add a system account and add it to a group managed by the policy base_dn = str(master.domain.basedn) # pylint: disable=no-member entry_ldif = textwrap.dedent(""" dn: uid={account_name},cn=sysaccounts,cn=etc,{base_dn} changetype: add objectclass: account objectclass: simplesecurityobject uid: {account_name} userPassword: {original_passwd} passwordExpirationTime: 20380119031407Z nsIdleTimeout: 0 """).format( account_name=sysuser, base_dn=base_dn, original_passwd=original_passwd) tasks.ldapmodify_dm(master, entry_ldif) # Now change the password. It should succeed since password # policy doesn't apply to non-Kerberos users. tasks.ldappasswd_sysaccount_change(sysuser, original_passwd, new_passwd, master) tasks.ldappasswd_sysaccount_change(sysuser, new_passwd, original_passwd, master) tasks.ldappasswd_sysaccount_change(sysuser, original_passwd, new_passwd, master)