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

if ((! supw.isEmpty()) && supw.isEmpty()) qFatal("Superuser password can not be empty"); #1778

Closed
ghost opened this issue Aug 6, 2015 · 1 comment

Comments

@ghost
Copy link

commented Aug 6, 2015

src/murmur/main.cpp line 408-413:

if (! supw.isEmpty()) {
    if (supw.isEmpty())
        qFatal("Superuser password can not be empty");
    ServerDB::setSUPW(sunum, supw);
    qFatal("Superuser password set on server %d", sunum);
}

I don't know what you meant to do here but

qFatal("Superuser password can not be empty");

is most likely never executed.

Maybe you meant

if (! supw.isEmpty()) {
    ServerDB::setSUPW(sunum, supw);
    qFatal("Superuser password set on server %d", sunum);
}
else
    qFatal("Superuser password can not be empty");
@hacst hacst self-assigned this Aug 6, 2015
@hacst hacst closed this in d39e773 Aug 6, 2015
@hacst

This comment has been minimized.

Copy link
Member

commented Aug 6, 2015

Thanks a lot for reporting this. Seems like the original intent was to check if anything had been assigned to the string which is done with !supw.isNull(). Luckily this only resulted in the request to set the password being ignored instead of actually setting an empty password. Should be fixed now.

unascribed added a commit to unascribed/mumble that referenced this issue Apr 7, 2016
Mistakenly checked string for empty instead of null resulting
in a set but empty string not causing the correct error message.
Instead the request to set a password was ignored and the server
started normally. This patch resolves this issue. If the password
is set but empty an error is emitted and the server isn't started.

Fixes mumble-voip#1778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.