Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password doesn't work. #42

Closed
CamilleScholtz opened this issue Jul 28, 2017 · 16 comments
Closed

Password doesn't work. #42

CamilleScholtz opened this issue Jul 28, 2017 · 16 comments

Comments

@CamilleScholtz
Copy link

CamilleScholtz commented Jul 28, 2017

Since the last release (when the password switched from md5 to plain) my password no longer works (and yes, I'm using a plain password now :)).

I thing the fact that I use symbols such as [@>:-&... in my password causes this.

@hrkfdn
Copy link
Owner

hrkfdn commented Jul 31, 2017

https://github.com/hrkfdn/mpdas/blob/master/config.cpp#L13

Looks like I added colons to the token separator list, causing incorrect parsing. I'll have a look at it soon, unfortunately I'm a little busy at the moment due to exams.

Thanks for the report!

@hrkfdn
Copy link
Owner

hrkfdn commented Jul 31, 2017

Actually, can you build the master branch and test if the latest commit fixes it for you?

@CamilleScholtz
Copy link
Author

This is what I get now:

(14:58:40) [ERROR] Code: 13
(14:58:40) [ERROR] Invalid method signature.

@gsnewmark
Copy link

Password with whitespace doesn't work too in the latest release (didn't check master):

[ERROR] Code: 4
[ERROR] Authentication failed. Please check your login data.

@hrkfdn
Copy link
Owner

hrkfdn commented Aug 1, 2017 via email

gsnewmark added a commit to gsnewmark/mpdas that referenced this issue Aug 1, 2017
Split config tokens only on first entry of the delimiter to fix issue hrkfdn#42.

Colon delimiter support is also returned.
gsnewmark added a commit to gsnewmark/mpdas that referenced this issue Aug 1, 2017
Split config tokens only on first entry of the delimiter to fix issue hrkfdn#42.

Colon delimiter support is also returned.
@hrkfdn
Copy link
Owner

hrkfdn commented Aug 25, 2017

There is a new branch (wip) that contains a revamped config system. If you guys could give it a try and see if it fixes your password parsing problems it would help me a lot.

@CamilleScholtz
Copy link
Author

Getting a SIGSEGV (Address boundary error) here.

@gsnewmark
Copy link

@hrkfdn I get a segmentation fault on new branch (gcc version 7.1.1 20170630 (GCC)), tried running with both explicit config file (-c option) and implicit one (stored in home dir):

gsnewmark@asgard:~/Projects/open-source/mpdas|wip⚡ 
⇒  make clean
rm -rf main.o md5.o utils.o mpd.o audioscrobbler.o cache.o config.o inih/ini.o mpdas
gsnewmark@asgard:~/Projects/open-source/mpdas|wip 
⇒  make all
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o main.o main.cpp
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o md5.o md5.cpp
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o utils.o utils.cpp
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o mpd.o mpd.cpp
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o audioscrobbler.o audioscrobbler.cpp
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o cache.o cache.cpp
g++ `pkg-config --cflags libmpdclient libcurl` -DCONFDIR="\"/usr/local/etc\"" -DVERSION="\"0.4.4\"" -c -o config.o config.cpp
cc    -c -o inih/ini.o inih/ini.c
g++  main.o md5.o utils.o mpd.o audioscrobbler.o cache.o config.o inih/ini.o `pkg-config --libs libmpdclient libcurl` -o mpdas
gsnewmark@asgard:~/Projects/open-source/mpdas|wip⚡ 
⇒  ./mpdas 
[1]    13769 segmentation fault (core dumped)  ./mpdas

Backtrace:

gsnewmark@asgard:~/Projects/open-source/mpdas|wip⚡ 
⇒  gdb mpdas /tmp/coredump-mpdas.13769 
GNU gdb (GDB) 8.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from mpdas...(no debugging symbols found)...done.
[New LWP 13769]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `./mpdas'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000fc2215ba1a in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_begin() ()
(gdb) bt
#0  0x000000fc2215ba1a in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_begin() ()
#1  0x000000fc22164970 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::lower_bound(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#2  0x000000fc2216462f in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::lower_bound(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#3  0x000000fc2216444f in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#4  0x000000fc22164397 in CConfig::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()
#5  0x000000fc221639b1 in IniHandler(void*, char const*, char const*, char const*) ()
#6  0x000000fc22165e9a in ini_parse_stream ()
#7  0x000000fc22165f40 in ini_parse_file ()
#8  0x000000fc22165f92 in ini_parse ()
#9  0x000000fc22163a83 in CConfig::LoadConfig(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()
#10 0x000000fc22164119 in CConfig::CConfig(char*) ()
#11 0x000000fc2215b07a in main ()

Config file:

username = gsnewmark
password = <password>
runas = mpd
debug = 1

Maybe some additional steps are required during compilation? I've only checked out new submodule and run make all.

@CamilleScholtz
Copy link
Author

I tried building mpdas with -g -O0 and running it in gdb, but didn't get any info.

@hrkfdn
Copy link
Owner

hrkfdn commented Aug 25, 2017

Could you guys pull and build again? I can't reproduce it, yet, but this time it should print the configuration value it fails on.

@CamilleScholtz
Copy link
Author

CamilleScholtz commented Aug 25, 2017

Config:

#
# /etc/mpdas.conf: mpdas configuration
#

# Last.fm username and password
username = onodera-punpun
password = <password>

# The user mpdas runs as
user "mpd"

# End of file

Output:

[] username: onodera-punpun
fish: './mpdas -c /etc/mpdas.conf' terminated by signal SIGSEGV (Address boundary error)

@hrkfdn
Copy link
Owner

hrkfdn commented Aug 25, 2017

Could you try one more time?

@CamilleScholtz
Copy link
Author

CamilleScholtz commented Aug 25, 2017

[] username: onodera-punpun
[] password: <password>
(15:51:57) [ERROR] Code: 13
(15:51:57) [ERROR] Invalid method signature.

Seems to work now. I don't exactly know why Code: 13 happens though, I got this before: #42 (comment)

@hrkfdn
Copy link
Owner

hrkfdn commented Aug 25, 2017

Thanks for testing! I hope to fix that in the coming days :)

@gsnewmark
Copy link

latest version works for me too

@hrkfdn hrkfdn closed this as completed in 7c0d266 Aug 26, 2017
@hrkfdn
Copy link
Owner

hrkfdn commented Aug 26, 2017

@onodera-punpun Could you open a separate issue for the code 13 problem and give me some details (config, ..) on when (authentication, etc.) it occurs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants