[ 
https://issues.apache.org/jira/browse/DIRSERVER-2292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15984164#comment-15984164
 ] 

Emmanuel Lécharny edited comment on DIRSERVER-2292 at 8/13/22 3:24 AM:
-----------------------------------------------------------------------

Hi ,
As i had explained earlier ChangePasswordResult does not decode user Data 
properly for active directory password change. But i found that the returned 
byte array represents all the policies that are configured in the Active 
directory. When password changed fails it sends those values as showing that 
some of them might have violated. It is like this.

{noformat}
this.zeroBytes = userData.getShort();
if (this.zeroBytes != 0)

{ return; }

/* Read in the rest of structure */
int min_password_length = userData.getInt();
int password_history = userData.getInt();
int password_properties = userData.getInt();
long expire = userData.getLong();
long min_passwordage = userData.getLong() /AD_POLICY_TIME_TO_DAYS;
if (password_properties > 0)

{ this.passwordProperties = password_properties; }

if (min_password_length > 0)

{ this.minPasswordLength = min_password_length; }

if (password_history > 0)

{ this.passwordHistory = password_history; }

if (min_passwordage >= 0 )

{ this.minPasswordAge = min_passwordage; }

}

{noformat}

So i have fix that and now it shows correct user data. Here with i have 
attached the patch for that. Ifi need to do a pull request let me know.


was (Author: jayamali):
Hi ,
As i had explained earlier ChangePasswordResult does not decode user Data 
properly for active directory password change. But i found that the returned 
byte array represents all the policies that are configured in the Active 
directory. When password changed fails it sends those values as showing that 
some of them might have violated. It is like this.
this.zeroBytes = userData.getShort();
                if (this.zeroBytes != 0) {
                                return;
                }
                /* Read in the rest of structure */
                int min_password_length = userData.getInt();
                int password_history = userData.getInt();
                int password_properties = userData.getInt();
                long expire = userData.getLong();
                long min_passwordage = userData.getLong() 
/AD_POLICY_TIME_TO_DAYS;
                if (password_properties > 0) {
                        this.passwordProperties = password_properties;
                }
                if (min_password_length > 0) {
                        this.minPasswordLength = min_password_length;
                }
                if (password_history > 0) {
                        this.passwordHistory = password_history;
                }
                
                if (min_passwordage >= 0 ) {
                        this.minPasswordAge = min_passwordage;
                }

        }

So i have fix that and now it shows correct user data. Here with i have 
attached the patch for that. Ifi need to do a pull request let me know.

> org.apache.directory.api.asn1.DecoderException: 
> ERR_00001_BAD_TRANSITION_FROM_STATE Bad transition from state START_STATE, 
> tag 0x6F 
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-2292
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2292
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: changepw
>    Affects Versions: 2.0.0-M23
>            Reporter: Jayamali Chathurika Jayawardhana
>            Priority: Major
>             Fix For: 2.0.0-M23
>
>         Attachments: thirdPartyPatch-master.zip
>
>
> When i try to change the password it gives above exception and then returns 
> ChangePasswordResult with error code 4.But message returned by 
> ChangePasswordResult  is not a readable string 
> I need to see a meaningful error message



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to