Subject Re: md5 function
Author Adam
Hi Michal,

I am not sure what the rfunc lib is, I presume it is some dll you
have found with an exported function md5sum(password) that returns a
hashed password.

Can you please clarify what you mean by "doesn't work." Do you mean
that you get an error message? (if so what does it say) Or do you
mean that it seems to run but nothing seems to happen?

A couple of things to check:

1) The dll will need to be inside the folder c:\Program
Files\Firebird\Firebird_1_5\UDF\

2) You need to declare the external function so Firebird knows what
dll and function you are talking about. Lookup DECLARE EXTERNAL
FUNCTION in langref.pdf (from www.ibphoenix.com) for the complete
syntax. I personally always get myself mixed up whether I am passing
by value or description.

If it does not give an error, then make sure you have checked the
obvious (userid=24 actually exists).

A good trick is to run the command separately first to see what it
returns. If you test using inserts or updates, then it may not behave
as expected because maybe you have a trigger that is setting that
field to blank etc.

select md5sum('mynewpass')
from RDB$Database;


Good luck
Adam



--- In firebird-support@yahoogroups.com, Michal ®eravík
<michalz@o...> wrote:
> Hi to all,
>
> I found md5sum() function in rfunc lib,
> but I don't know how to use it.
> I need to hash new password with smthing like:
>
> UPDATE users SET pass=md5sum('mynewpass') WHERE userid=24;
>
> But it doesn't work.
>
> Michal