WL#11544: Current password required for SET PASSWORD

Affects: Server-8.0   —   Status: Complete

At present an user can change his password without needing to know the current
password. Consider the case when a malicious user gets access to the benign
user's terminal for a very brief period and changes the password. This might
have two implications -
1. Benign user will be unable to access the terminal unless his password is
   reset by administrator.
2. During this period, the malicious user can connect to the server through the
   benign user's changed credentials.

Hence, there is a scope to enhance the security by authorizing the users to
change their password only if they could provide the current password.

However, there could be exceptions to this policy. We must have to design
the feature such that it could be easy to enforce or exempt the current
password requirement at the time of changing it. Keeping these requirements
in mind, this workflow aims to :

1. Change the SQL syntax of CREATE USER and ALTER USER, SET PASSWORD commands
   to enable the user to specify the current password.

2. Introduce a global system variable on the server through which current
   password policy could be enforced to the users. current password will be
   required at the time of changing password in case the system variable is ON
   otherwise it will not be required.