def adc_change_password(salt, username, users, attr, priv_admin=False):
    "パスワード変更。管理者は他人のパスワードも変更できる。"
    if ('password_old' in attr and
        'password_new1' in attr and
        'password_new2' in attr):
        if not priv_admin: # 管理者でないときは、現在のパスワードをチェック
            u = adc_login(salt, username, attr['password_old'], users)
            if u is None:
                return False, "password mismatched"
        if attr['password_new1'] != attr['password_new2']:
            return False, "new password is not same"
        if change_password(username, attr['password_new1'].encode('utf-8'), salt):
            return True, "password changed"
        else:
            return False, "password change failed"
    else:
        return False, "error"