[PHP] strange problem, seems to be related to the character '$'

2005-03-31 Thread Chris Francy
Hello all,

I am hoping someone can point me in the right direction to resolving an odd 
bug.  I tried searching the bugs database and groups, but I can't think of 
the terms to use while searching for my problem that the search system will 
accept.

I have a script like the below, copied from the crypt manual page
---
?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf', 
'$1$rasmusle$')); } ?
---

On my main web server, which is running php 4.3.10 with apache this script 
produces the following when I view the page on the web
---
 string(13) $1Hat1hn6A1pw
---

When I run the script from the command line [php test.php] on the exact same 
server I get
---
string(34) $1$rasmusle$rISCgZzpwk3UhDidwXvin0
---

I have also occasionaly seen some odd behavior where strings with dollar 
symbols $ in them won't print out correctly, but they have never seen that 
important..  Does anyone have any guesses, or hints about what the next step 
is to search for what is causing this odd behavior?  Any suggestions about a 
better place to ask?

Thanks for any help

Chris Francy
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strange problem, seems to be related to the character '$'

2005-03-31 Thread Zareef Ahmed
Hi Chris, 

 I tried to reproduce the problem with vertsoin 4.3.3 and 5, and its
working fine(producing same string).
If you have not find a bug in bug database why not submit  a new bug?

anyway changing single quotes to double may help ;)


zareef ahmed 
 
?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf',
 '$1$rasmusle$')); } ?
On Apr 1, 2005 2:36 AM, Chris Francy [EMAIL PROTECTED] wrote:
 Hello all,
 
 I am hoping someone can point me in the right direction to resolving an odd
 bug.  I tried searching the bugs database and groups, but I can't think of
 the terms to use while searching for my problem that the search system will
 accept.
 
 I have a script like the below, copied from the crypt manual page
 ---
 ?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf',
 '$1$rasmusle$')); } ?
 ---
 
 On my main web server, which is running php 4.3.10 with apache this script
 produces the following when I view the page on the web
 ---
  string(13) $1Hat1hn6A1pw
 ---
 
 When I run the script from the command line [php test.php] on the exact same
 server I get
 ---
 string(34) $1$rasmusle$rISCgZzpwk3UhDidwXvin0
 ---
 
 I have also occasionaly seen some odd behavior where strings with dollar
 symbols $ in them won't print out correctly, but they have never seen that
 important..  Does anyone have any guesses, or hints about what the next step
 is to search for what is causing this odd behavior?  Any suggestions about a
 better place to ask?
 
 Thanks for any help
 
 Chris Francy
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strange problem, seems to be related to the character '$'

2005-03-31 Thread Richard Lynch
On Thu, March 31, 2005 1:06 pm, Chris Francy said:
 I am hoping someone can point me in the right direction to resolving an
 odd
 bug.  I tried searching the bugs database and groups, but I can't think of
 the terms to use while searching for my problem that the search system
 will
 accept.

 I have a script like the below, copied from the crypt manual page
 ---
 ?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf',
 '$1$rasmusle$')); } ?
 ---

 On my main web server, which is running php 4.3.10 with apache this script
 produces the following when I view the page on the web
 ---
  string(13) $1Hat1hn6A1pw
 ---

 When I run the script from the command line [php test.php] on the exact
 same
 server I get
 ---
 string(34) $1$rasmusle$rISCgZzpwk3UhDidwXvin0
 ---

Here's what's happening:

When your Apache user runs this script, it is using whatsit encryption
(DES?) that uses the 2-character salt.  Which is why it starts with '$1',
the first two characters of the salt you wanted to use.

When *YOU* run it, you're getting the whatsit encryption (Blowfish?) that
you actually wanted.

This has *NOTHING* to do with dollar signs, single quotes, or double quotes.

If you 'su' to the web user (if you have root and can do that) you'd
probably find the same behaviour from the command line.

Somehow, the Apache User is not able to find, or read, or execute,
whatever it takes to use Blowfish (or whatever it is you want) but it
*CAN* find, read, and execute the thingie to do DES (2-char salt).

So what you gotta look for is something that isn't $path-ed or chmod-ed
right for the Apache User to be able to find ($path) and read/execute
(chmod) permissions.

I don't really understand how the OS find/decides what encryption
algorithms and makes them available to applications/users, but that's
definitely the broken bit, for what that's worth.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php