This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from c1debb3 Upgrade bundled VcXsrv to 1.20.0.0 new 8cf06d8 copy-deps-win32.bat: update to 20160121-4 Cygwin bundle, shipping with chgrp. new e4de760 src/onmainwindow.cpp: fix user-facing error messages in Windows X.Org Server startup functions. new c416343 src/pulsemanager.cpp: use QByteArray's constData () instead of data (), since we'll never modify the data anyway. new f22fd19 src/onmainwindow.cpp: hook-in chgrp for ~/.x2go/etc on Windows platforms to work around a Cygwin permissions bug. Fixes: #1156. 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: copy-deps-win32.bat | 2 +- debian/changelog | 8 ++++ src/onmainwindow.cpp | 132 ++++++++++++++++++++++++++++++++++++++++++++++++--- src/onmainwindow.h | 1 + src/pulsemanager.cpp | 6 +-- 5 files changed, 139 insertions(+), 10 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/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 master in repository x2goclient. commit 8cf06d8da38ba7e0c0acb8447f43eaa6fd26bbe1 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 7 09:09:12 2018 +0200 copy-deps-win32.bat: update to 20160121-4 Cygwin bundle, shipping with chgrp. --- copy-deps-win32.bat | 2 +- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/copy-deps-win32.bat b/copy-deps-win32.bat index 412e425..d47be84 100755 --- a/copy-deps-win32.bat +++ b/copy-deps-win32.bat @@ -2,7 +2,7 @@ if "%~3"=="" ( echo "Usage: copy-deps-win32.bat path-to-x2goclient-contrib path-to-OpenSSL-Win32 destination" goto :a ) -xcopy /E /Y %1\cygwin\20160121-3_bin %3\ || exit /b %errorlevel% +xcopy /E /Y %1\cygwin\20160121-4_bin %3\ || exit /b %errorlevel% del %3\nxproxy.exe.unstripped %3\libXcomp.a %3\libXcomp.dll.a || exit /b %errorlevel% xcopy /E /Y %1\libssh\0.7.4-x2go1-mingw482_bin\bin\libssh.dll %3\ || exit /b %errorlevel% xcopy /E /Y %1\libssh\0.7.4-x2go1-mingw482_bin\bin\libssh_threads.dll %3\ || exit /b %errorlevel% diff --git a/debian/changelog b/debian/changelog index b569faa..5fca3a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -80,6 +80,8 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: re-add periodic xmodmap keyboard sync for OS X/macOS platforms. Was dropped some time ago by accident. - src/onmainwindow.cpp: fix compile error on OS X/macOS. + - copy-deps-win32.bat: update to 20160121-4 Cygwin bundle, shipping with + chgrp. * x2goclient.spec: - Remove plugin references. * debian/rules: -- Alioth's /home/x2go-admin/maintenancescripts/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 master in repository x2goclient. commit e4de760c1739a8e7343fc5918a8684905f583e59 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 14 01:55:17 2018 +0200 src/onmainwindow.cpp: fix user-facing error messages in Windows X.Org Server startup functions. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5fca3a7..a64afa5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -82,6 +82,8 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: fix compile error on OS X/macOS. - copy-deps-win32.bat: update to 20160121-4 Cygwin bundle, shipping with chgrp. + - src/onmainwindow.cpp: fix user-facing error messages in Windows X.Org + Server startup functions. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index fd4951b..fa39cd8 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10117,8 +10117,9 @@ void ONMainWindow::startXOrg (std::size_t start_offset) { QMessageBox::critical ( 0,QString::null, - tr ( "Can't start X.Org Server.\n" - "Please check your installation." ) ); + tr ( "Can't start X.Org Server." ) + + "\n" + + tr ( "Please check your installation." ) ); close(); } // #ifdef CFGCLIENT @@ -10147,8 +10148,9 @@ void ONMainWindow::slotCheckXOrgConnection() x2goDebug << "Unable to start X.Org Server for " << x_start_limit_ << " times, terminating."; QMessageBox::critical (NULL, QString::null, - tr ("X.Org Server did not launch correctly after three tries.\n" - "Please check your installation.")); + tr ("X.Org Server did not launch correctly after %n tries.", "%n will be substituted with the current number of tries", x_start_tries_) + + "\n" + + tr ("Please check your installation.")); close (); @@ -10198,8 +10200,9 @@ void ONMainWindow::slotCheckXOrgConnection() } else { QMessageBox::critical (NULL, QString::null, - tr ("Can't start X.Org Server.\n" - "Please check your installation.")); + tr ("Can't start X.Org Server.") + + "\n" + + tr ("Please check your installation.")); close(); return; -- Alioth's /home/x2go-admin/maintenancescripts/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 master in repository x2goclient. commit c416343c0f618d045ce4634b36033d05dc4b02ef Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 14 03:36:22 2018 +0200 src/pulsemanager.cpp: use QByteArray's constData () instead of data (), since we'll never modify the data anyway. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a64afa5..da8f2c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -84,6 +84,8 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium chgrp. - src/onmainwindow.cpp: fix user-facing error messages in Windows X.Org Server startup functions. + - src/pulsemanager.cpp: use QByteArray's constData () instead of data (), + since we'll never modify the data anyway. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 342579d..90d0ac3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -363,7 +363,7 @@ void PulseManager::fetch_pulseaudio_version () { if (tmp_server.waitForFinished ()) { /* Read stdout and split it up on newlines. */ QByteArray ba (tmp_server.readAllStandardOutput ()); - QString stdout_data (ba.data ()); + QString stdout_data (ba.constData ()); QStringList stdout_list (stdout_data.split ("\n")); x2goDebug << "pulseaudio --version returned:" << stdout_data << endl; @@ -784,10 +784,10 @@ void PulseManager::slot_on_pulse_finished (int exit_code) { shutdown_state_ = false; x2goDebug << "Pulseaudio finished with code:"<<exit_code; QByteArray ba (pulse_server_->readAllStandardOutput ()); - char *data = ba.data (); + const char *data = ba.constData (); x2goDebug << data; ba = pulse_server_->readAllStandardError (); - data = ba.data (); + data = ba.constData (); x2goDebug << data; // Clean up -- Alioth's /home/x2go-admin/maintenancescripts/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 master in repository x2goclient. commit f22fd1957a8b16a80588451cc3e0dab26c2d5c8b Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 14 04:11:15 2018 +0200 src/onmainwindow.cpp: hook-in chgrp for ~/.x2go/etc on Windows platforms to work around a Cygwin permissions bug. Fixes: #1156. --- debian/changelog | 2 + src/onmainwindow.cpp | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/onmainwindow.h | 1 + 3 files changed, 120 insertions(+) diff --git a/debian/changelog b/debian/changelog index da8f2c1..fe06805 100644 --- a/debian/changelog +++ b/debian/changelog @@ -86,6 +86,8 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium Server startup functions. - src/pulsemanager.cpp: use QByteArray's constData () instead of data (), since we'll never modify the data anyway. + - src/onmainwindow.cpp: hook-in chgrp for ~/.x2go/etc on Windows platforms + to work around a Cygwin permissions bug. Fixes: #1156. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index fa39cd8..712bd4c 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10397,6 +10397,118 @@ void ONMainWindow::slotSetWinServersReady() restoreCygnusSettings(); } +void ONMainWindow::workaround_cygwin_permissions_issue () { + /* + * Traditionally, user home directories were owned by a group called "None" + * (or usually also translated into the system locale, because it's + * Windows...). + * + * Newer versions, at least Windows 10 and higher, set the group to the + * user's group, quite like on Linux. + * + * This has interesting consequences for older Cygwin versions (up to + * 1.7.34 probably - we currently use 1.7.33). + * Windows has a general concept of users and groups, but keeps a database + * of both in a combined way, with actually unique IDs. Hence, if a + * directory is owned by an ID that corresponds to the user both in the + * owner and group ACLs, then Cygwin gets confused with owner and group + * permissions. + * Even though the effective group permissions might be "---", it somehow + * manages to map the effective owner permissions, that typically are + * "rwx", to the UNIX group permissions as well. + * Consequently, OpenSSH will error out complaining about the permissions + * of the host keys being too open, even though they really are not. + * + * To work around this problem, we will reset the group ID of + * ~/.x2go/etc to the None group ID, which conveniently has a reserved and + * fixed value of 513 (RID) or 197121 (Cygwin) across all systems. + * + * Note that we don't have to do that for ~/x2go/ssh/gen, since we disable + * file permission checks for user keys. + */ + QString etc_dir = cygwinPath (wapiShortFileName (homeDir + "/.x2go/etc")); + + QStringList args; + args << "-R" << "-v" << etc_dir; + + QProcess chgrp; + chgrp.setStandardInputFile (nullDevice ()); + chgrp.start ("chgrp", args); + + bool fail = false; + while (!(chgrp.waitForStarted (10))) { + /* + * If the process state is still "Starting", it means that the timer in + * waitForStarted () ran out. Continue normal execution, otherwise + * handle the startup error. + */ + if (QProcess::Starting != chgrp.state ()) { + fail = true; + + break; + } + + QCoreApplication::processEvents (QEventLoop::AllEvents, 10); + } + + if (fail) { + show_RichText_WarningMsgBox (tr ("Unable to start chgrp helper."), + tr ("Changing the group permissions of the X2Go Client-specific " + "OpenSSH server configuration will not take place.") + + "\n" + + tr ("The OpenSSH server might fail to start on newer Windows " + "versions (10 and higher)."), + false); + + x2goDebug << "Failed to start chgrp: " << chgrp.error () + << " with exit status " << chgrp.exitStatus () + << " and exit code " << chgrp.exitCode () + << " (invalid unless exit status was QProcess::NormalExit)" + << "; continuing without directory regrouping. sshd might " + << "fail to start up."; + + return; + } + + fail = false; + while (!(chgrp.waitForFinished (10))) { + /* + * Pretty much the same logic as above, only slightly adaptated: + * a timeout only makes sense if the process is still "Running". + * Otherwise it must have died. + */ + if (QProcess::Running != chgrp.state ()) { + fail = true; + + break; + } + + QCoreApplication::processEvents (QEventLoop::AllEvents, 10); + } + + fail = ((fail) || (QProcess::NormalExit != chgrp.exitStatus ())); + + if (fail) { + show_RichText_WarningMsgBox (tr ("Execution failure of chgrp helper."), + tr ("Changing the group permissions of the X2Go Client-specific " + "OpenSSH server configuration will not take place.") + + "\n" + + tr ("The OpenSSH server might fail to start on newer Windows " + "versions (10 and higher)."), + false); + + x2goDebug << "chgrp failed during execution: " << chgrp.error () + << " with exit status " << chgrp.exitStatus () + << " and exit code " << chgrp.exitCode () + << " (invalid unless exit status was QProcess::NormalExit)" + << "; continuing without directory regrouping. sshd might " + << "fail to start up."; + } + + x2goDebug << "chgrp stdout: " << chgrp.readAllStandardOutput () + << endl << "chgrp stderr: " << chgrp.readAllStandardError (); +} + #include <windows.h> #include<sstream> #endif @@ -10822,8 +10934,13 @@ bool ONMainWindow::startSshd(ONMainWindow::key_types key_type) */ generateEtcFiles (); +#ifdef Q_OS_WIN + workaround_cygwin_permissions_issue (); +#endif + clientSshPort = "7022"; QString etcDir=homeDir+"/.x2go/etc"; + int port=clientSshPort.toInt(); //clientSshPort have initvalue while ( isServerRunning ( port ) ) diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 47eaa5e..2b78261 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1187,6 +1187,7 @@ private: #ifdef Q_OS_WIN void saveCygnusSettings(); void restoreCygnusSettings(); + void workaround_cygwin_permissions_issue (); #endif #if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) QString getXDisplay(); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git