[X2Go-Commits] [x2goclient] 223/239: src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section.
git-admin at x2go.org
git-admin at x2go.org
Mon Oct 24 23:28:01 CEST 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch bugfix/osx
in repository x2goclient.
commit 09fad0a4039b66e83b44fef33b8298a944c751bf
Author: Mihai Moldovan <ionic at ionic.de>
Date: Fri Sep 23 03:12:43 2016 +0200
src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section.
---
debian/changelog | 2 ++
src/onmainwindow.cpp | 30 +++++++++++++++++++++++++++++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 38528b0..056e273 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -392,6 +392,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
value.) Change all locations referencing generateKey () to use the
return value (if necessary) and remove dead code that was used to
generate a user key manually previously.
+ - src/onmainwindow.cpp: add more error handling to generateKey () and fix
+ up a broken error-handling section.
[ Bernard Cafarelli ]
* New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 2481194..f3ea01a 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10347,6 +10347,7 @@ QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_ke
tr ("Unable to create SSH key base directory '%1'.").arg (base_dir)
+ "\n"
+ tr ("Terminating application."));
+ close ();
}
}
@@ -10410,7 +10411,34 @@ QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_ke
<< comment
<< "-f"
<< private_key_file;
- QProcess::execute ("ssh-keygen", args);
+
+ const int keygen_ret = QProcess::execute ("ssh-keygen", args);
+
+ if (-2 == keygen_ret) {
+ QMessageBox::critical (this, tr ("ssh-keygen launching error"),
+ tr ("Unable to start the ssh-keygen binary.")
+ + "\n"
+ + tr ("Terminating application."));
+ close ();
+ }
+
+ if (-1 == keygen_ret) {
+ QMessageBox::critical (this, tr ("ssh-keygen crashed"),
+ tr ("The ssh-keygen binary crashed.")
+ + "\n"
+ + tr ("Terminating application."));
+ close ();
+ }
+
+ if (0 != keygen_ret) {
+ QMessageBox::critical (this, tr ("ssh-keygen program error"),
+ tr ("The ssh-keygen binary did not exit cleanly.")
+ + " "
+ + tr ("It was probably called with unknown arguments.")
+ + "\n"
+ + tr ("Terminating application."));
+ close ();
+ }
}
return (ret);
--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list