MyBB Community Forums

Full Version: getmypid() warning after upgrade
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just upgraded to 1.4.12 and I get the following when posting a new thread and when logged into AdminCP:

--------------------------------------
The following warnings occurred:
Warning [2] getmypid() has been disabled for security reasons - Line: 5619 - File: inc/functions.php PHP 5.2.12 (Linux)

File Line Function
[PHP] errorHandler->error
/inc/functions.php 5619 getmypid
/inc/functions.php 5648 secure_seed_rng
/inc/functions.php 2174 my_rand
/newthread.php 735 random_str

----------------------------------------

Is there anything I can do to resolve this or should I contact my host?
replace the getmypid() call with some random number or string or remove it entirely
Here's what I did on line 5619 of inc/functions.php

I edited the original line:
$unique_state = microtime().getmypid();

to this:
$unique_state = microtime(); //.getmypid();

It seems to have stopped that warning from popping up. I hope doing that doesn't goof up something else. Wink

Thanks
This should disable the warning if your host doesn't support it:
$unique_state = microtime().@getmypid(); 
Is there anything wrong with what I did (making it a remark)?
(2010-04-15, 04:21 PM)dcaduser Wrote: [ -> ]Is there anything wrong with what I did (making it a remark)?

Dennis' code uses getmypid() if it's available, whereas yours always ignores the pid (process id). I don't see anything wrong per say with commenting that out.
Fair enough. I believe it has been resolved with-in the package since. The files in the current download/update (1.4.12) have been modified to eliminate this and other issues.

I have been advised to re-download the changed file package and replace inc/functions.php file in that updated package.

FYI -- All others that installed/updated prior to April 16, 2010 should do the same. as per...

Important Update: April 16, 2010

If you applied the MyBB 1.4.12 update before April 16, 2010 7:00 UTC we recommend you redownload the changed file package and reupdate the inc/functions.php file to your forum. The change fixes an issue identified in the previous hot patch relating to the random number generator. We are sincerely sorry for the inconvenience caused by this.

Thank you for your cooperation.