baiwyc119 / lxmppd

Automatically exported from code.google.com/p/lxmppd
0 stars 0 forks source link

Using an upper-case letter in domain name breaks 'prosodyctl adduser' #430

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce -----------------------------------

1.  From command-line run: 'prosodyctl adduser foo@BAR'

Expected behavior: -----------------------------------

$ sudo prosodyctl adduser foo@bar

The host 'bar' is not listed in the configuration file (or is not enabled).
The user will not be able to log in until this is changed.
Enter new password:

Unexpected behavior: ---------------------------------

$ sudo prosodyctl adduser foo@BAR
The host 'BAR' is not listed in the configuration file (or is not enabled).
The user will not be able to log in until this is changed.
lua5.1: /usr/lib/prosody/core/storagemanager.lua:36: attempt to index local 
'host_session' (a nil value)
stack traceback:
    /usr/lib/prosody/core/storagemanager.lua:36: in function 'initialize_host'
    /usr/lib/prosody/util/prosodyctl.lua:160: in function 'user_exists'
    /usr/bin/prosodyctl:299: in function '?'
    /usr/bin/prosodyctl:854: in main chunk
    [C]: ?

Versions -------------------------------------

$ apt-cache showpkg prosody

Package: prosody
Versions: 0.9.1-1 
(/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-am
d64_Packages)

OS -------------------------------------------

$ uname -a

Linux [localhost] 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 
x86_64 x86_64 x86_64 GNU/Linux

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

Mostly just annoying.  But for the last two hours—until I figured out the 
work-around of *not* using upper-case letters—it was VERY annoying.

Original issue reported on code.google.com by mike.freeman.3832 on 31 Jul 2014 at 3:48

GoogleCodeExporter commented 9 years ago
Hi, thanks for the report, and sorry this issue caused you so much trouble!

I'm struggling to reproduce it though (well I get the warning, but not the 
error) so I might need some more info. For example, what authentication and 
storage plugins are you using? (the 'authentication' and 'storage' options in 
the config).

Also could you let me know the output of this command?: ldd 
/usr/lib/prosody/util/encodings.so

Finally, the weird thing is that in the code we are normalizing the hostname on 
the line just before your error, which includes lower-casing it. Would you be 
up to adding some debug logging in the code if necessary?

Original comment by MWild1 on 31 Jul 2014 at 5:34

GoogleCodeExporter commented 9 years ago
Aha! Forget everything I said, I just figured it out.

For some reason you can use uppercase in the config, and it works. And you can 
use uppercase when adding a user, and it works. But not when you have both 
uppercase at the same time. Strange!

I'll investigate and get back to you.

Original comment by MWild1 on 31 Jul 2014 at 5:38

GoogleCodeExporter commented 9 years ago
I've pushed fixes to the 0.9 branch:

  - https://hg.prosody.im/0.9/rev/5926f01e5cd2
  - https://hg.prosody.im/0.9/rev/c9730926002b

This improves the handling of uppercase domains in the config file and in 
prosodyctl. They will be included in the next stable release, 0.9.5.

Original comment by MWild1 on 31 Jul 2014 at 6:03

GoogleCodeExporter commented 9 years ago
Thanks for fixing this!

BTW – I've got Prosody up and running now.  Outside of this annoyance (and me 
forgetting to actually enable the Prosody profile for ufw that I created), it 
was amazingly easy.  Keep up the good work!

Original comment by mike.freeman.3832 on 31 Jul 2014 at 3:24