Bug 334083

Summary: passwords with " are not accepted
Product: [Applications] kdesu Reporter: Marcus Meissner <marcus>
Component: kdesudAssignee: kdesu bugs tracker <kdesu-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, cfeck, hrvoje.senjan
Priority: NOR    
Version: 1.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.13.1
Sentry Crash Report:

Description Marcus Meissner 2014-04-29 13:48:19 UTC
If the root password contains a " it is not understood by kdesud.

kdelibs/kdesu/client.cpp escapes it correctly

so    foobar"      turns into    "foobar\""
but the lexer.cpp in kdesud then chokes on that (returns Tok_none instead of Tok_string).


Reproducible: Always

Steps to Reproduce:
1. use rootpassword with " in it
2. try kdesu xterm 
3. fail
Actual Results:  
does not do anything

kdesud(22412) ConnectionHandler::doCommand: Parse error 

in .xession-errors

Expected Results:  
should open root xterm

https://bugzilla.novell.com/show_bug.cgi?id=837959
Comment 1 Christoph Feck 2014-04-29 22:09:54 UTC
Proposed patch:

diff --git a/kdesu/kdesud/lexer.cpp b/kdesu/kdesud/lexer.cpp
index f2c5db8..fecbb57 100644
--- a/kdesu/kdesud/lexer.cpp
+++ b/kdesu/kdesud/lexer.cpp
@@ -75,7 +75,7 @@ int Lexer::lex()
                // handle escaped characters
                if (c == '\\') {
                    c = m_Input[in++];
-                   if ((c == '"') || iscntrl(c))
+                   if (iscntrl(c))
                        return Tok_none;
                    if (c == '^') {
                        c = m_Input[in++];
Comment 2 Christoph Feck 2014-05-08 21:32:38 UTC
https://git.reviewboard.kde.org/r/118058/
Comment 3 Christoph Feck 2014-05-12 22:09:59 UTC
Git commit b013884675e8b21546466919a6a73df6a36a3555 by Christoph Feck.
Committed on 12/05/2014 at 22:07.
Pushed by cfeck into branch 'KDE/4.13'.

Allow quotation marks in passwords
FIXED-IN: 4.13.2
REVIEW: 118058

M  +1    -1    kdesu/kdesud/lexer.cpp

http://commits.kde.org/kde-runtime/b013884675e8b21546466919a6a73df6a36a3555