33a6d30f4c
- Fix the missing capture of the prompt line without the space letter at the end of line (boo#1100871): lxqt-sudo-prompt-fix.patch OBS-URL: https://build.opensuse.org/request/show/622313 OBS-URL: https://build.opensuse.org/package/show/X11:LXQt/lxqt-sudo?expand=0&rev=11
27 lines
942 B
Diff
27 lines
942 B
Diff
---
|
|
sudo.cpp | 6 ++++--
|
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
--- a/sudo.cpp
|
|
+++ b/sudo.cpp
|
|
@@ -52,7 +52,8 @@ namespace
|
|
|
|
const QString su_prog{QStringLiteral(LXQTSUDO_SU)};
|
|
const QString sudo_prog{QStringLiteral(LXQTSUDO_SUDO)};
|
|
- const QString pwd_prompt_end{QStringLiteral(": ")};
|
|
+ const QString pwd_prompt_end{QStringLiteral(":")};
|
|
+ const QString pwd_prompt_end_with_space{QStringLiteral(": ")};
|
|
const QChar nl{QLatin1Char('\n')};
|
|
|
|
void usage(QString const & err = QString())
|
|
@@ -277,7 +278,8 @@ int Sudo::parent()
|
|
lxqtApp->quit();
|
|
} else
|
|
{
|
|
- if (line.endsWith(pwd_prompt_end))
|
|
+ if (line.endsWith(pwd_prompt_end) ||
|
|
+ line.endsWith(pwd_prompt_end_with_space))
|
|
{
|
|
//if now echo is turned off, su/sudo requests password
|
|
struct termios tios;
|