This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.2.x in repository x2goclient. commit 2d3d8ba3bae1eb4f0cec31d5498123f5dcd83a16 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Jun 28 22:38:48 2014 +0200 Provide more meaningful messages on SSH errors (host pub key not found, export pub key not found, authorized_keys file not found). For SSHd startup failures provide different messages on Windows and non-Windows machines. (Fixes: #235). FIXME: add detection code to report SSH daemon startup failures. --- debian/changelog | 5 ++++ onmainwindow.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 69 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad7a2ef..ce5d7a2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,11 @@ x2goclient (4.0.2.1-0x2go1) UNRELEASED; urgency=low we force X2Go client to only use the default "accelerated X" as system tray icon (and prohibit usage of the session's icon as tray icon). (Fixes: #365). + - Provide more meaningful messages on SSH errors (host pub key not + found, export pub key not found, authorized_keys file not found). + For SSHd startup failures provide different messages on Windows + and non-Windows machines. (Fixes: #235). + FIXME: add detection code to report SSH daemon startup failures. * debian/control: + Add dbg:package x2goplugin-dbg. diff --git a/onmainwindow.cpp b/onmainwindow.cpp index 8dbd5b8..edfe63a 100644 --- a/onmainwindow.cpp +++ b/onmainwindow.cpp @@ -7798,10 +7798,11 @@ QString ONMainWindow::createRSAKey() generateHostDsaKey(); generateEtcFiles(); startSshd(); + /* FIXME: test successful SSH daemon startup */ rsa.setFileName ( homeDir+"/.x2go/etc/ssh_host_dsa_key.pub" ); rsa.open ( QIODevice::ReadOnly | QIODevice::Text ); #else - printSshDError(); + printSshDError_noHostPubKey(); return QString::null; #endif } @@ -7920,7 +7921,7 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, QFile file ( key+".pub" ); if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { - printSshDError(); + printSshDError_noExportPubKey(); QFile::remove ( key+".pub" ); return; @@ -7941,7 +7942,7 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, file.setFileName ( authofname ); if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { - printSshDError(); + printSshDError_noAuthorizedKeysFile(); QFile::remove ( key+".pub" ); return; @@ -9980,6 +9981,7 @@ void ONMainWindow::startSshd() clientdir.c_str(), // Starting directory &si, // Pointer to STARTUPINFO structure &sshd );// Pointer to PROCESS_INFORMATION structure + /* FIXME: test successful SSH daemon startup */ delete []desktop; winSshdStarted=true; #else @@ -9989,6 +9991,7 @@ void ONMainWindow::startSshd() arguments<<"-f"<<etcDir +"/sshd_config"<< "-h" << etcDir+"/ssh_host_dsa_key"<<"-D"<<"-p"<<clientSshPort; sshd->start ( appDir+"/sshd",arguments ); + /* FIXME: test successful SSH daemon startup */ x2goDebug<<"Usermode sshd started."; #endif @@ -11345,17 +11348,67 @@ void ONMainWindow::initSelectSessDlg() -void ONMainWindow::printSshDError() +void ONMainWindow::printSshDError_startupFailure() +{ +#ifdef Q_OS_WIN + if ( closeEventSent ) + return; + QMessageBox::critical ( 0l,tr ( "SSH Error" ), + tr ( "SSH daemon could not be started.\n\n" + + "You'll need SSH daemon for printing and file sharing.\n\n" + + "Normally, this should not happen as X2Go Client for \n" + "Windows ships its internal sshd.exe.\n\n" + + "If you see this message, please report a bug against\n" + "the X2Go bugtracker." + ), + QMessageBox::Ok,QMessageBox::NoButton ); +#else + if ( closeEventSent ) + return; + QMessageBox::critical ( 0l,tr ( "SSH Error" ), + tr ( "SSH daemon is not running.\n\n" + + "You'll need SSH daemon for printing and file sharing\n\n" + + "Please ask your system administrator to provide the SSH\n" + "service on your computer." + ), + QMessageBox::Ok,QMessageBox::NoButton ); +#endif +} + +void ONMainWindow::printSshDError_noHostPubKey() +{ + if ( closeEventSent ) + return; + QMessageBox::critical ( 0l,tr ( "SSH Error" ), + tr ( "SSH daemon failed to open the application's public host key." + ), + QMessageBox::Ok,QMessageBox::NoButton ); +} + +void ONMainWindow::printSshDError_noExportPubKey() +{ + if ( closeEventSent ) + return; + QMessageBox::critical ( 0l,tr ( "SSH Error" ), + tr ( "SSH daemon failed to open the application's public key\n" + "used for exporting folders and printers." + ), + QMessageBox::Ok,QMessageBox::NoButton ); +} + +void ONMainWindow::printSshDError_noAuthorizedKeysFile() { if ( closeEventSent ) return; - QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "sshd not started, " - "you'll need sshd for printing " - "and file sharing\n" - "you can install sshd with\n" - "<b>sudo apt-get install " - "openssh-server</b>" ), + QMessageBox::critical ( 0l,tr ( "SSH Error" ), + tr ( "SSH daemon failed to open the application's\n" + "authoized_keys file." + ), QMessageBox::Ok,QMessageBox::NoButton ); } -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git