Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
phpldapadmin: incompatibility with php7.1+
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
msst
Apprentice
Apprentice


Joined: 07 Jun 2011
Posts: 214

PostPosted: Wed Dec 27, 2017 3:19 pm    Post subject: phpldapadmin: incompatibility with php7.1+ Reply with quote

Since updating php to 7.1 it fails due to an incompatible change:

Function mcrypt_module_open() is deprecated
lib/functions.php (184)
Funktion error (a:5:{i:0;s:74:"Unbekannte Fehlernummer: 8192: Function mcrypt_module_open() is deprecated)

this gets called from the login so the whole package is unusable with the newer php versions as all login attempts give a backtrace.

Do someone know an easy fix or a better replacement (as the package seems to be very weakly maintained also)?
Back to top
View user's profile Send private message
msst
Apprentice
Apprentice


Joined: 07 Jun 2011
Posts: 214

PostPosted: Wed Dec 27, 2017 8:23 pm    Post subject: Reply with quote

Workaround:

The coder of this function was actually nice and is trying to query and use mcrypt only if available. This however fails now as the function is still present, but apparently disabled in php7.1+

It can be commented out without bad side-effects however, as phpldapadmin will then use its own blowfish implementation. See for example:

Code:

/*
        if (function_exists('mcrypt_module_open') && ! empty($data)) {
                $td = mcrypt_module_open(MCRYPT_BLOWFISH,'',MCRYPT_MODE_ECB,'');
                $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),MCRYPT_DEV_URANDOM);
                mcrypt_generic_init($td,substr($secret,0,mcrypt_enc_get_key_size($td)),$iv);
                $encrypted_data = base64_encode(mcrypt_generic($td,$data));
                mcrypt_generic_deinit($td);

                return $encrypted_data;
        }
*/

        if (file_exists(LIBDIR.'blowfish.php'))
                require_once LIBDIR.'blowfish.php';
        else


The comment parantheses /* */ added by me. This needs to be done twice as the them query is done a few lines further down as well. With this code block commented out blowfish.php is used instead then (see the lines below, LIBDIR.'blowfish.php' exists in the standard phpldapadmin tarball).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum