This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. from c99b741 onmainwindow.cpp: prettify non-available host key error message. new 5fc3301 onmainwindow.cpp: fix typos and augment sshd startup failure message. new fdbe9e0 onmainwindow.cpp: also use usermode sshd on OS X, if no global daemon is running. new 42f2045 onmainwindow.cpp: on OS X, specify sshd's PID file location in its server config. new ef033df onmainwindow.cpp: wait 3 seconds before checking sshd startup state to allow it to come up. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 6 ++ src/onmainwindow.cpp | 150 ++++++++++++++++++++++++++++++++++---------------- src/onmainwindow.h | 2 +- 3 files changed, 109 insertions(+), 49 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5fc3301f0acc7e5e8fdd33ae3a7783a7dd4806ca Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 12 23:13:17 2015 +0100 onmainwindow.cpp: fix typos and augment sshd startup failure message. --- src/onmainwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 16c6d80..5617fdc 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -11377,6 +11377,8 @@ void ONMainWindow::printSshDError_startupFailure() QString detailed_error_message = tr ("You have enabled Remote Printing or File Sharing.\n" "These features require a running and functioning SSH server on your computer.\n" "<b>Printing and File Sharing will be disabled for this session.</b>\n\n" + + "Please also check the <b>Clientside SSH port</b> in the general settings.\n\n" #ifdef Q_OS_WIN "Normally, this should not happen as X2Go Client for Windows " "ships its own internal SSH server.\n\n" @@ -11389,7 +11391,7 @@ void ONMainWindow::printSshDError_startupFailure() "The SSH server is currently not started.\n\n" #ifdef Q_OS_DARWIN "On OS X, please follow the following steps to enable " - "SSH service:\n" + "SSH service:" "<ul>" "<li>Open <b>System Preferences</b> (Applications -> System Preferences)</li>" "<li>Go to <b>Sharing</b></li>" @@ -11401,7 +11403,7 @@ void ONMainWindow::printSshDError_startupFailure() "</ul>" "<li>Optionally, add your user name to the allowed list " "via the <b>Plus Button</b></li>" - "</ul>\n" + "</ul>" "<b>Warning: enabling SSH access will allow any user on the network to connect " "to your machine. It is your responsibility to set a strong password for every " "user that is allowed to log in via SSH.</b>\n\n" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit fdbe9e045fcd90fe5d9986dc35ba5703a9f8771d Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Mar 13 00:28:31 2015 +0100 onmainwindow.cpp: also use usermode sshd on OS X, if no global daemon is running. --- debian/changelog | 2 + src/onmainwindow.cpp | 141 ++++++++++++++++++++++++++++++++------------------ src/onmainwindow.h | 2 +- 3 files changed, 95 insertions(+), 50 deletions(-) diff --git a/debian/changelog b/debian/changelog index edc1053..0554cd5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -229,6 +229,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low if requested) conversion to rich text. - onmainwindow.cpp: prettify non-running sshd error message. - onmainwindow.cpp: prettify non-available host key error message. + - onmainwindow.cpp: also use usermode sshd on OS X, if no global daemon is + running. -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 5617fdc..7036c3e 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -7768,11 +7768,14 @@ QString ONMainWindow::createRSAKey() #endif if ( !rsa.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { -#ifdef Q_OS_LINUX - generateHostDsaKey(); - generateEtcFiles(); - startSshd(); - /* FIXME: test successful SSH daemon startup */ +#if defined (Q_OS_LINUX) || defined (Q_OS_DARWIN) + generateHostDsaKey (); + generateEtcFiles (); + + if (!startSshd ()) { + return (QString::null); + } + rsa.setFileName ( homeDir+"/.x2go/etc/ssh_host_dsa_key.pub" ); rsa.open ( QIODevice::ReadOnly | QIODevice::Text ); #else @@ -9929,15 +9932,23 @@ void ONMainWindow::generateHostDsaKey() } } -void ONMainWindow::startSshd() +bool ONMainWindow::startSshd() { if ( embedMode && config.confFS && !config.useFs ) { - return; + return false; } #ifdef Q_OS_LINUX - clientSshPort="7022"; -#endif + clientSshPort = "7022"; +#else // defined (Q_OS_LINUX) +#ifdef Q_OS_DARWIN + // Should also automatically create keys if Remote Login is enabled + // under Sharing in System Preferences. + if (!isServerRunning (clientSshPort.toInt ())) { + clientSshPort = "7022"; + } +#endif // defined (Q_OS_DARWIN) +#endif // defined (Q_OS_LINUX) QString etcDir=homeDir+"/.x2go/etc"; int port=clientSshPort.toInt(); //clientSshPort have initvalue @@ -9992,17 +10003,32 @@ void ONMainWindow::startSshd() /* FIXME: test successful SSH daemon startup */ delete []desktop; winSshdStarted=true; -#else +#else // defined (Q_OS_WIN) userSshd=true; + sshd=new QProcess ( this ); + + QString binary = appDir + "/sshd"; +#ifdef Q_OS_DARWIN + binary = "/usr/sbin/sshd"; +#endif // defined (Q_OS_DARWIN) + QStringList arguments; 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 + sshd->start (binary, arguments); +#endif // defined (Q_OS_WIN) + + if (!isServerRunning (clientSshPort.toInt ())) { + printSshDError_startupFailure (); + x2goDebug << "Failed to start usermode sshd."; + return (false); + } + else { + x2goDebug << "Usermode sshd started successfully."; + return (true); + } } void ONMainWindow::setProxyWinTitle() @@ -11366,54 +11392,71 @@ void ONMainWindow::printSshDError_startupFailure() { if ( closeEventSent ) return; - QString error_message = tr ( + QString error_message; + #ifdef Q_OS_WIN - "SSH daemon could not be started.\n\n" -#else - "SSH daemon is not running.\n\n" + error_message = tr ("SSH daemon could not be started.\n\n"); +#else // defined (Q_OS_WIN) + if (userSshd) { + error_message = tr ("SSH daemon could not be started.\n\n"); + } + else { + error_message = tr ("SSH daemon is not running.\n\n"); + } #endif // defined (Q_OS_WIN) - ); QString detailed_error_message = tr ("You have enabled Remote Printing or File Sharing.\n" "These features require a running and functioning SSH server on your computer.\n" "<b>Printing and File Sharing will be disabled for this session.</b>\n\n" - "Please also check the <b>Clientside SSH port</b> in the general settings.\n\n" + "Please also check the <b>Clientside SSH port</b> in the general settings.\n\n"); #ifdef Q_OS_WIN - "Normally, this should not happen as X2Go Client for Windows " - "ships its own internal SSH server.\n\n" + detailed_error_message += tr ("Normally, this should not happen as X2Go Client for Windows " + "ships its own internal SSH server.\n\n" - "If you see this message, please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" - "</a></center>\n" + "If you see this message, please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"); #else // defined (Q_OS_WIN) - "The SSH server is currently not started.\n\n" + if (userSshd) { + detailed_error_message += tr ("The SSH server failed to start.\n\n"); + detailed_error_message += tr ("X2Go Client did not detect a globally running SSH server " + "on your machine and was unable to start its own.\n\n" + + "Please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"); + } + else { + detailed_error_message += tr ("The SSH server is currently not started.\n\n"); #ifdef Q_OS_DARWIN - "On OS X, please follow the following steps to enable " - "SSH service:" - "<ul>" - "<li>Open <b>System Preferences</b> (Applications -> System Preferences)</li>" - "<li>Go to <b>Sharing</b></li>" - "<li>Tick the checkbox besides <b>Remote Login</b></li>" - "<li>Check that <b>Allow access for:</b> is set to either:" - "<ul>" - "<li>All users: <b>no further steps necessary</b></li>" - "<li>Only these users <b>and your user name is included in the list</b></li>" - "</ul>" - "<li>Optionally, add your user name to the allowed list " - "via the <b>Plus Button</b></li>" - "</ul>" - "<b>Warning: enabling SSH access will allow any user on the network to connect " - "to your machine. It is your responsibility to set a strong password for every " - "user that is allowed to log in via SSH.</b>\n\n" + detailed_error_message += tr ("On OS X, please follow the following steps to enable " + "SSH service:" + "<ul>" + "<li>Open <b>System Preferences</b> (Applications -> System Preferences)</li>" + "<li>Go to <b>Sharing</b></li>" + "<li>Tick the checkbox besides <b>Remote Login</b></li>" + "<li>Check that <b>Allow access for:</b> is set to either:" + "<ul>" + "<li>All users: <b>no further steps necessary</b></li>" + "<li>Only these users <b>and your user name is included in the list</b></li>" + "</ul>" + "<li>Optionally, add your user name to the allowed list " + "via the <b>Plus Button</b></li>" + "</ul>" + "<b>Warning: enabling SSH access will allow any user on the network to connect " + "to your machine. It is your responsibility to set a strong password for every " + "user that is allowed to log in via SSH.</b>\n\n"); #else // defined (Q_OS_DARWIN) - "Please ask your system administrator to provide the SSH " - "service on your computer.\n\n" + detailed_error_message += tr ("Please ask your system administrator to provide the SSH " + "service on your computer.\n\n"); #endif // defined (Q_OS_DARWIN) + } #endif // defined (Q_OS_WIN) - "Disabling Remote Printing or File Sharing support " - "in the session settings will get rid of this message."); + detailed_error_message += tr ("Disabling Remote Printing or File Sharing support " + "in the session settings will get rid of this message."); Non_Modal_MessageBox::critical (0l, "X2Go Client", error_message, detailed_error_message, true, @@ -11427,7 +11470,7 @@ void ONMainWindow::printSshDError_noHostPubKey() X2goSettings st ("settings"); - int port = st.setting ()->value ("clientport", (QVariant) 22).toInt (); + int port = clientSshPort.toInt (); Non_Modal_MessageBox::critical (0l, "X2Go Client", tr ("SSH daemon failed to open its public host key."), diff --git a/src/onmainwindow.h b/src/onmainwindow.h index dcc938c..c54d549 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -562,7 +562,7 @@ public: QString internAppName ( const QString& transAppName, bool* found=0l ); void setEmbedSessionActionsEnabled ( bool enable ); - void startSshd(); + bool startSshd(); QSize getEmbedAreaSize(); #ifdef Q_OS_WIN static QString cygwinPath ( const QString& winPath ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 42f20456d2ddec6b81507ea3749295b411fda69f Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Mar 13 01:05:03 2015 +0100 onmainwindow.cpp: on OS X, specify sshd's PID file location in its server config. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0554cd5..12490a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -231,6 +231,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - onmainwindow.cpp: prettify non-available host key error message. - onmainwindow.cpp: also use usermode sshd on OS X, if no global daemon is running. + - onmainwindow.cpp: on OS X, specify sshd's PID file location in its + server config. -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 7036c3e..7fc8480 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9884,8 +9884,10 @@ void ONMainWindow::slotSetWinServersReady() void ONMainWindow::generateEtcFiles() { QString etcDir=homeDir+"/.x2go/etc"; + QString varDir = homeDir + "/.x2go/var"; QDir dr ( homeDir ); dr.mkpath ( etcDir ); + dr.mkpath (varDir); QFile file ( etcDir +"/sshd_config" ); if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) ) return; @@ -9896,6 +9898,7 @@ void ONMainWindow::generateEtcFiles() QTextStream out ( &file ); out<<"StrictModes no\n"<< "UsePrivilegeSeparation no\n"<< + "PidFile " + varDir + "/sshd.pid\n" << #ifdef Q_OS_WIN "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"<< -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ef033df55e18545e72fe17e27b62ed9f97cdb8c7 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Mar 13 01:08:27 2015 +0100 onmainwindow.cpp: wait 3 seconds before checking sshd startup state to allow it to come up. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 12490a6..7d34be6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -233,6 +233,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low running. - onmainwindow.cpp: on OS X, specify sshd's PID file location in its server config. + - onmainwindow.cpp: wait 3 seconds before checking sshd startup state to + allow it to come up. -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 7fc8480..d1f3076 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10023,6 +10023,12 @@ bool ONMainWindow::startSshd() sshd->start (binary, arguments); #endif // defined (Q_OS_WIN) + // Allow sshd a grace time of 3 seconds to come up. + QTime sleepTime = QTime::currentTime ().addSecs (3); + while (QTime::currentTime () < sleepTime) { + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); + } + if (!isServerRunning (clientSshPort.toInt ())) { printSshDError_startupFailure (); x2goDebug << "Failed to start usermode sshd."; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git