Menu

#454 (ok 3.2) Detect mcrypt initialization failure

closed-accepted
nobody
PHP errors (22)
1
2009-06-15
2009-03-05
No

Based on a question from flyingparchment via IRC I implemented an extra check to see if mcrypt is not only present but also can be initialized.
He presumably had compiled mcrypt without the --enable-dynamic-loading option.

Unfortunately I currently don't have a setup where I can test this.
I would therefore welcome any feedback on security and performance.

When committed, a specific error message might be in place.

Discussion

  • Marc Delisle

    Marc Delisle - 2009-03-17

    Please post only one patch related to this issue.

     
  • Herman van Rink

    Herman van Rink - 2009-03-18

    I was not aware of another patch for this... could you include the tracker number?

     
  • Marc Delisle

    Marc Delisle - 2009-03-19

    What I mean is that the patch you posted here contains many things.

     
  • Herman van Rink

    Herman van Rink - 2009-03-19

    the patch

     
  • Herman van Rink

    Herman van Rink - 2009-03-19

    Sorry, I see now that I uploaded the wrong file.

     
  • Marc Delisle

    Marc Delisle - 2009-04-10

    Herman,
    I also don't have a setup to test the failing case but you could merge this anyway. I don't think we need a specific error message but you could add a FAQ entry about this case.

    I suggest replacing
    if ($td == false) {
    with
    if ($td === false) {

     
  • Herman van Rink

    Herman van Rink - 2009-05-07
    • priority: 5 --> 1
    • summary: Detect mcrypt initialization failure --> (ok 3.2) Detect mcrypt initialization failure
    • status: open --> open-accepted
     
  • Herman van Rink

    Herman van Rink - 2009-05-07

    Committed

    How about this for a faq?

    Q: I get the error "Cannot load mcrypt extension.", but I do have mcrypt installed.

    A: Is php capable to do dynamic loading?
    This can be influenced by the compile-time option "--enable-dynamic-loading" and the php.ini option "enable_dl"

     
  • Marc Delisle

    Marc Delisle - 2009-06-15
    • status: open-accepted --> closed-accepted
     
MongoDB Logo MongoDB