This file is indexed.

/usr/share/perl5/Lemonldap/NG/Portal/PasswordDBAD.pm is in liblemonldap-ng-portal-perl 1.9.16-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##@file
# AD password backend file

##@class
# AD password backend class
package Lemonldap::NG::Portal::PasswordDBAD;

use strict;
use Lemonldap::NG::Portal::Simple;

#inherits Lemonldap::NG::Portal::_SMTP

our $VERSION = '1.9.1';

use base qw(Lemonldap::NG::Portal::PasswordDBLDAP);

*_formateFilter = *Lemonldap::NG::Portal::UserDBAD::formateFilter;
*_search        = *Lemonldap::NG::Portal::UserDBAD::search;

## @apmethod int modifyPassword()
# Modify the password by LDAP mechanism.
# Use AD specific method
# @return Lemonldap::NG::Portal constant
sub modifyPassword {
    my $self = shift;

    # Exit method if no password change requested
    return PE_OK unless ( $self->{newpassword} );

    unless ( $self->ldap ) {
        return PE_LDAPCONNECTFAILED;
    }

    # Set the dn unless done before
    unless ( $self->{dn} ) {
        my $tmp = $self->_subProcess(qw(_formateFilter _search));
        return $tmp if ($tmp);
    }

    $self->lmLog( "Modify password request for " . $self->{dn}, 'debug' );

    # Call the modify password method for AD
    my $code =
      $self->ldap->userModifyPassword( $self->{dn}, $self->{newpassword},
        $self->{confirmpassword},
        $self->{oldpassword}, 1 );

    return $code unless ( $code == PE_PASSWORD_OK );

    # If force reset, set reset flag
    if ( $self->{forceReset} ) {
        my $result =
          $self->ldap->modify( $self->{dn},
            replace => { 'pwdLastSet' => '0' } );

        unless ( $result->code == 0 ) {
            $self->lmLog( "LDAP modify pwdLastSet error: " . $result->code,
                'error' );
            $code = PE_LDAPERROR;
        }

        $self->lmLog( "pwdLastSet set to 0", 'debug' );
    }

    return $code;
}

1;