passwd: handle LDAP auto-bind use case as well

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
Alexander Bokovoy 2024-05-02 08:45:58 +03:00 committed by Antonio Torres
parent e386e22046
commit 902c8b0bae
No known key found for this signature in database
GPG Key ID: 359FAF777296F653

View File

@ -141,7 +141,7 @@ class passwd(Command):
DN(api.env.container_user, api.env.basedn)
)
if principal == getattr(context, 'principal') and \
if principal == getattr(context, 'principal', None) and \
current_password == MAGIC_VALUE:
# No cheating
logger.warning('User attempted to change password using magic '