d85ef49 Ticket #47723 - winsync sets AccountUserControl in AD to 544

Authored and Committed by nhosoi 8 years ago
    Ticket #47723 - winsync sets AccountUserControl in AD to 544
    
    Description: Active Directory sets 0x20 (PASSWD_NOTREQD) to userAccountControl
    if a password (attribute UnicodePWD) is not found in the entry to be added.
    WindowsSync first sends an entry without a password to AD to add since it is
    not allowed on AD:
      http://support.microsoft.com/en-us/kb/269190
      The unicodePWD attribute cannot be added on object creation or queried
      by a search.
    Then, it updates the password followed by resetting userAccountControl.
    
    This patch checks the userAccountControl set by AD.  If a password is already
    set (pwdLastSet > 0), then update userAccountControl with the PASSWD_NOTREQD
    bit unset.
    
    Sample userAccountControl of an entry created on DS:
      dn: CN=DS User,CN=users,DC=test,DC=example,DC=com
      userAccountControl: 512
      pwdLastSet: 130729092637082979
    
    https://fedorahosted.org/389/ticket/47723
    
    Reviewed by rmeggins@redhat.com (Thank you, Rich!!)