Problem with generateSSHAPassword function

1 view
Skip to first unread message

Steeve

unread,
Apr 24, 2010, 9:30:15 AM4/24/10
to Mozilla Labs Weave Server Users
Hello

I have updated my weave server to the last revision (using hg).

The generateSSHAPassword function contains the following code :

if (setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8") == false)
throw new Exception("Database Unavailable", 503);

I think it works only on macos.
On my linux system (debian testing) the locale code is : xx_XX.utf8
and I don't use the en_US locale.
So the error is triggered. I just set the fr_FR.utf8 locale and it's
working again.

I try to find a way to correct the problem but i don't understand why
the setlocale is needed. Maybe a setlocal(LC_TYPE, 'C') is working.

Regards,
Steeve


--
Subscription settings: http://groups.google.com/group/mozilla-labs-weave-server-users/subscribe?hl=en

l.m.orchard

unread,
Apr 27, 2010, 8:37:34 PM4/27/10
to Mozilla Labs Weave Server Users
On Apr 24, 6:30 am, Steeve <steeve.e...@gmail.com> wrote:

> I try to find a way to correct the problem but i don't understand why
> the setlocale is needed. Maybe a setlocal(LC_TYPE, 'C') is working.

It looks like setlocale() is *not* actually needed any more, since we
moved away from using exec() to generate the passwords via a shell
command. I just pushed a change to hg that removes those lines, so
you can try updating your server again and see if it works.

http://hg.mozilla.org/labs/weaveserver-registration/rev/e4d24642ec26

Steeve

unread,
Apr 28, 2010, 4:44:55 AM4/28/10
to Mozilla Labs Weave Server Users
No problem with the updated version. (we have to update 1.0/weave_user/
mysql.php in weaveserver-sync too)

Thanks,
Steeve
Reply all
Reply to author
Forward
0 new messages