Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 12:08:16 PM

Pages: [1]   Go Down
  Print  
Author Topic: phpass warning with shared hosting.  (Read 3275 times)
jin28
Newbie
*
Offline Offline

Posts: 2


« on: March 09, 2011, 11:19:51 AM »

New to posting long time lurker.

First off to get an idea of what I'm talking about go here http://www.openwall.com/phpass/.
I'm using version 0.3 which you can download here http://www.openwall.com/phpass/phpass-article-3.zip

It's used in a number of projects, from wordpress to oscommerce, and I just recently implemented it with my project. It was working fine on my local development machine no problems.

I did testing on my lunarpages shared host website and phpass is throwing a read directory warning.

Code:
Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s): ('.:/proc/uptime:/tmp:/home:/usr/local/lib/php:/nfs/home:/usr/home:/usr/local/bin/') in /home/reveur2/public_html/medicationforall/framework/framework/PasswordHash.php on line 51

Screenshot of the warning http://www.medicationforall.com/image/phpass.png

The code still works and generates a hashed password. I did do some searching and found this post http://forums.oscommerce.com/index.php?app=tracker&showissue=128 but all he is doing is error suppression. Whats the mechanics thats making this code throw a warning in the first place? And is there a better alternative than just suppressing the warning?

Logged
scanman20
Senior Moderator
Über Jedi
*****
Offline Offline

Posts: 1524



WWW
« Reply #1 on: March 10, 2011, 06:34:28 AM »

It means your script is trying to access a file or folder outside the list of folders that you have access to.
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
jin28
Newbie
*
Offline Offline

Posts: 2


« Reply #2 on: March 10, 2011, 10:02:13 AM »

It means your script is trying to access a file or folder outside the list of folders that you have access to.

So by even checking if the folder is readable warrants throwing a warning? The code doesn't require the directory be readable to work, it goes to a fallback if it's not. How else should the permissions be checked?

Edit:
Did some more searching, and it's a known problem.
http://drupal.org/node/965302
http://core.trac.wordpress.org/changeset/13429

Specifically for the open_basedir problem see http://stackoverflow.com/questions/1486918/php-is-readable-trouble-with-open-basedir


Ideally the proper solution should check if the directory in question is in the list of open_basedir paths.
I could alter the code, but I think I'll just do error suppression.  =/
« Last Edit: March 10, 2011, 10:44:59 AM by jin28 » Logged
Pages: [1]   Go Up
  Print  
 
Jump to: