This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. discards 35240f5 src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). discards d292ca6 src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. discards c143fe6 src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. discards fe3eae7 src/unixhelper.cpp: code cleanup. discards 84993c7 src/pulsemanager.cpp: remove unused variables. discards 13e5448 src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper around real_kill_pgroup (). discards f430fe7 src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). discards e248705 src/unixhelper.h: style and general fixes within comments. discards 43b6598 src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. discards ee9fecf src/pulsemanager.cpp: fix PA version fetching on OS X again. discards b8ae623 src/pulsemanager.cpp: make sure that wherever we interface with non-Qt functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) discards baf71aa src/pulsemanager.cpp: make PA version parsing function more generic and don't expect that a number is always terminated with a period or dash. discards b21fba2 src/pulsemanager.h: include accidentally omitted wapi.h header file. discards 475971a src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. discards 6287c94 src/onmainwindow.cpp: fix compile error on Windows after moving some code around. discards ddfbd7e src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. discards 327fefe src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. new da89dcf src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. new 45225c1 src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. new fac1c7c src/onmainwindow.cpp: fix compile error on Windows after moving some code around. new c98ef8d src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. new c3ac174 src/pulsemanager.h: include accidentally omitted wapi.h header file. new d0d5900 src/pulsemanager.cpp: make PA version parsing function more generic and don't expect that a number is always terminated with a period or dash. new 297841e src/pulsemanager.cpp: make sure that wherever we interface with non-Qt functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) new edc8601 src/pulsemanager.cpp: fix PA version fetching on OS X again. new de25e2a src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. new 04d902f src/unixhelper.h: style and general fixes within comments. new caa6ddd src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). new db58903 src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper around real_kill_pgroup (). new bc3e0c7 src/pulsemanager.cpp: remove unused variables. new 8fc340e src/unixhelper.cpp: code cleanup. new b5084f4 src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. new 7dc2aef src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. new 3c2a90f src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (35240f5) \ N -- N -- N refs/heads/bugfix/osx (3c2a90f) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 17 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: -- 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 da89dcf17fe26ca4b54dbdd4495b4bf922687370 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:35:11 2016 +0200 src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index de84166..f7dfcf5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -340,6 +340,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium now.) - src/onmainwindow.cpp: drop obsolete pulseVersionTest variable initialization in Windows-only code. + - src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable + initialization in Windows-only code. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 426f1aa..3ff49ac 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -435,7 +435,6 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN winServersReady=false; saveCygnusSettings(); - pulseVersionIsLegacy=false; #endif initPassDlg(); initSelectSessDlg(); -- 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 45225c13a3e0663cb300089a8f67ee64d1b98e64 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:40:33 2016 +0200 src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f7dfcf5..b9daaf5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -342,6 +342,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium initialization in Windows-only code. - src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. + - src/onmainwindow.cpp: add another pair of braces to in_addr-type + variable initialization on Windows to silence compiler warning. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 3ff49ac..741f8cd 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9802,7 +9802,7 @@ bool ONMainWindow::isServerRunning ( int port ) int iResult; WSADATA wsaData; - struct in_addr addr = { 0 }; + struct in_addr addr = {{ 0 }}; iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); if (iResult != 0) -- 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 fac1c7c8fb234efa22d4ab910c54ce69f3495025 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 23:03:57 2016 +0200 src/onmainwindow.cpp: fix compile error on Windows after moving some code around. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b9daaf5..a2cdd46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -344,6 +344,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium initialization in Windows-only code. - src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. + - src/onmainwindow.cpp: fix compile error on Windows after moving some + code around. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 741f8cd..d6900e9 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10239,7 +10239,7 @@ void ONMainWindow::generateEtcFiles() "AuthorizedKeysFile \"" << authKeyPath << "\"\n" << #ifdef Q_OS_WIN "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< - "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"<< + "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"; #else "Subsystem sftp " /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ -- 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 c98ef8dc5d578441064f78f73127d8ee34af408d Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 23:16:59 2016 +0200 src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a2cdd46..99cd289 100644 --- a/debian/changelog +++ b/debian/changelog @@ -346,6 +346,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium variable initialization on Windows to silence compiler warning. - src/onmainwindow.cpp: fix compile error on Windows after moving some code around. + - src/onmainwindow.cpp: use correct C++ universal initializer for + initializing in_addr-type variable, the C-style universal zero + initializer won't cut it here. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index d6900e9..67a2259 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9802,7 +9802,7 @@ bool ONMainWindow::isServerRunning ( int port ) int iResult; WSADATA wsaData; - struct in_addr addr = {{ 0 }}; + struct in_addr addr = {{ }}; iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); if (iResult != 0) -- 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 c3ac1745743bb6849e74433816407596b2c4a86b Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 23:19:13 2016 +0200 src/pulsemanager.h: include accidentally omitted wapi.h header file. --- debian/changelog | 1 + src/pulsemanager.h | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 99cd289..1ca61d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -349,6 +349,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. + - src/pulsemanager.h: include accidentally omitted wapi.h header file. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/pulsemanager.h b/src/pulsemanager.h index ff541cb..0b1ae3c 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -38,6 +38,7 @@ #endif /* defined (Q_OS_WIN) */ #include "x2gosettings.h" +#include "wapi.h" class PulseManager: public QObject { Q_OBJECT; -- 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 297841e3b853987c7ab9b244c2a97e01d657b50c Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 11 05:34:22 2016 +0200 src/pulsemanager.cpp: make sure that wherever we interface with non-Qt functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) Should fix a PA startup issue on Windows. --- debian/changelog | 4 ++++ src/pulsemanager.cpp | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1b9eb4c..d28cc6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -356,6 +356,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium errors. OS X was fine with its "8.0.0-something" version number, but the optional part at the end or even the micro version number could be missing any time. + - src/pulsemanager.cpp: make sure that wherever we interface with non-Qt + functions, paths are in native form (i.e., containing empty separators, + instead of the "generic" slash UNIX-style separator.) Should fix a PA + startup issue on Windows. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1da7ea4..6170634 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -51,10 +51,10 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), pulse_dir_.cd (pulse_X2Go_.mid (1)); env_ = QProcessEnvironment::systemEnvironment (); - env_.insert ("HOME", pulse_dir_.absolutePath ()); - env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); + env_.insert ("HOME", QDir::toNativeSeparators (pulse_dir_.absolutePath ())); + env_.insert ("TEMP", QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/tmp")); #ifdef Q_OS_WIN - env_.insert ("USERPROFILE", pulse_dir_.absolutePath ()); + env_.insert ("USERPROFILE", QDir::toNativeSeparators (pulse_dir_.absolutePath ())); env_.insert ("USERNAME", "pulseuser"); #endif // defined (Q_OS_WIN) @@ -277,16 +277,16 @@ void PulseManager::start_generic () { void PulseManager::start_osx () { server_args_ = QStringList (); server_args_ << "--exit-idle-time=-1" << "-n" - << "-F" << pulse_dir_.absolutePath () + "/config.pa"; + << "-F" << QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/config.pa"); if (!system_pulse_) { server_args_ << "-p" - << QDir (app_dir_ - + "/../Frameworks/pulse-" - + QString::number (pulse_version_major_) - + "." - + QString::number (pulse_version_minor_) - + "/modules").absolutePath (); + << QDir::toNativeSeparators (QDir (app_dir_ + + "/../Frameworks/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules").absolutePath ()); } server_args_ << "--high-priority"; @@ -294,7 +294,7 @@ void PulseManager::start_osx () { if (debug_) { server_args_ << "--log-level=debug" << "--verbose" - << "--log-target=file:" + pulse_dir_.absolutePath () + "/pulse.log"; + << "--log-target=file:" + QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/pulse.log"); } if (generate_server_config () && generate_client_config ()) { @@ -322,7 +322,7 @@ void PulseManager::start_win () { if (debug_) { server_args_ << "--log-level=debug" << "--verbose" - << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; + << "--log-target=file:" + QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/pulse.log"); } /* -- 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 d0d5900df0f882e1ff5c0823d3b1fd9540c2c3ea Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 11 05:22:09 2016 +0200 src/pulsemanager.cpp: make PA version parsing function more generic and don't expect that a number is always terminated with a period or dash. Especially on Windows, with a PA version number of "6.0", this lead to errors. OS X was fine with its "8.0.0-something" version number, but the optional part at the end or even the micro version number could be missing any time. --- debian/changelog | 6 ++ src/pulsemanager.cpp | 165 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 105 insertions(+), 66 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1ca61d8..1b9eb4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -350,6 +350,12 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. - src/pulsemanager.h: include accidentally omitted wapi.h header file. + - src/pulsemanager.cpp: make PA version parsing function more generic and + don't expect that a number is always terminated with a period or dash. + Especially on Windows, with a PA version number of "6.0", this lead to + errors. OS X was fine with its "8.0.0-something" version number, but the + optional part at the end or even the micro version number could be + missing any time. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1fff171..1da7ea4 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -383,28 +383,32 @@ void PulseManager::fetch_pulseaudio_version () { tmp_str = tmp_str.mid (needle.size ()); /* We should be at a digit now. */ - bool numbers_found[3] = { false, false, false }; - QString tmp_ret_str = QString (""); + bool numbers_started[3] = { false, false, false }; + bool numbers_finished[3] = { false, false, false }; + bool numbers_skip[3] = { false, false, false }; + QString tmp_remaining_str = QString (""); + QString numbers[3] = { }; for (QString::const_iterator cit = tmp_str.begin (); cit != tmp_str.end (); ++cit) { - if (!(numbers_found[0])) { + if (!(numbers_finished[0])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_ret_str.append (*cit); + numbers[0].append (*cit); + numbers_started[0] = true; } else if ((*cit) == '.') { - /* First number part complete, let's convert the string and skip the period. */ - numbers_found[0] = true; - bool convert_success = false; - pulse_version_major_ = tmp_ret_str.toUInt (&convert_success, 10); - - if (!convert_success) { - x2goErrorf (20) << "Unable to convert major version number string to integer."; - show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), - tr ("Unable to convert major version number string to integer."), - true); - abort (); - } - - tmp_ret_str = QString (""); + /* First number part complete and more to come, mark as done. */ + numbers_finished[0] = true; + } + else if ((*cit) == '-') { + /* First number part complete and no more numbers, mark as done, and... */ + numbers_finished[0] = true; + + /* + * Skip all the other numbers (i.e., assume the default value.) + * This doesn't make a huge lot of sense for the first number, + * but let's make this robust... + */ + numbers_skip[1] = true; + numbers_skip[2] = true; } else { x2goErrorf (21) << "Unexpected character found when parsing version string for major version number: '" << QString (*cit) << "'."; @@ -415,36 +419,21 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_found[1])) { + else if (!(numbers_finished[1])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_ret_str.append (*cit); + numbers[1].append (*cit); + numbers_started[1] = true; } - else if (((*cit) == '.') || ((*cit) == '-')) { - /* - * Second number part complete, let's convert the string and then check whether - * we stopped at a period or a dash character. - */ - numbers_found[1] = true; - bool convert_success = false; - pulse_version_minor_ = tmp_ret_str.toUInt (&convert_success, 10); - - if (!convert_success) { - x2goErrorf (22) << "Unable to convert minor version number string to integer."; - show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), - tr ("Unable to convert minor version number string to integer."), - true); - abort (); - } - - tmp_ret_str = QString (""); - - if ((*cit) == '-') { - /* - * There will be no micro version, skip it entirely and assume the default - * value of zero. - */ - numbers_found[2] = true; - } + else if ((*cit) == '.') { + /* Second number part complete and more to come, mark as done. */ + numbers_finished[1] = true; + } + else if ((*cit) == '-') { + /* Second number part complete and no more numbers, mark as done, and... */ + numbers_finished[1] = true; + + /* Skip all the other numbers (i.e., assume the default value.) */ + numbers_skip[2] = true; } else { x2goErrorf (23) << "Unexpected character found when parsing version string for minor version number: '" << QString (*cit) << "'."; @@ -455,25 +444,14 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_found[2])) { + else if (!(numbers_finished[2])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_ret_str.append (*cit); + numbers[2].append (*cit); + numbers_started[2] = true; } else if ((*cit) == '-') { - /* Third number part complete, let's convert the string and skip the period. */ - numbers_found[2] = true; - bool convert_success = false; - pulse_version_micro_ = tmp_ret_str.toUInt (&convert_success, 10); - - if (!convert_success) { - x2goErrorf (24) << "Unable to convert micro version number string to integer."; - show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), - tr ("Unable to convert micro version number string to integer."), - true); - abort (); - } - - tmp_ret_str = QString (""); + /* Third number part complete and no more numbers, mark as done. */ + numbers_finished[2] = true; } else { x2goErrorf (25) << "Unexpected character found when parsing version string for micro version number: '" << QString (*cit) << "'."; @@ -486,15 +464,70 @@ void PulseManager::fetch_pulseaudio_version () { } else { /* Numbers should be good by now, let's fetch everything else. */ - tmp_ret_str.append (*cit); + tmp_remaining_str.append (*cit); + } + } + + bool numbers_done[3] = { false, false, false }; + + if (numbers_skip[0]) { + x2goErrorf (30) << "Supposed to skip major version number. Something is wrong."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Supposed to skip major version number. " + "Something is wrong."), + true); + abort (); + } + + /* not skipping and ((met period or dash) or (have something to convert and met EOL)) */ + if ((!numbers_skip[0]) && ((numbers_finished[0]) || (numbers_started[0]))) { + bool convert_success = false; + pulse_version_major_ = numbers[0].toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (20) << "Unable to convert major version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert major version number string to integer."), + true); + abort (); + } + else { + /* First number is enough to satisfy the "found" criterion. */ + found = true; + } + } + + /* not skipping and ((met period or dash) or (have something to convert and met EOL)) */ + if ((!numbers_skip[1]) && ((numbers_finished[1]) || (numbers_started[1]))) { + bool convert_success = false; + pulse_version_minor_ = numbers[1].toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (22) << "Unable to convert minor version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert minor version number string to integer."), + true); + abort (); } } - found = ((numbers_found[0]) && (numbers_found[1]) && (numbers_found[2])); + /* not skipping and ((met period or dash) or (have something to convert and met EOL)) */ + if ((!numbers_skip[2]) && ((numbers_finished[2]) || (numbers_started[2]))) { + bool convert_success = false; + pulse_version_micro_ = numbers[2].toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (24) << "Unable to convert micro version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert micro version number string to integer."), + true); + abort (); + } + } + /* Misc version part will be set to the trailing string. */ if (found) { - /* Misc version part will be set to the trailing string. */ - pulse_version_misc_ = tmp_ret_str; + pulse_version_misc_ = tmp_remaining_str; break; } } -- 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 edc860102e82a0c9ca329cbcb927e270e0a26b35 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 08:55:34 2016 +0200 src/pulsemanager.cpp: fix PA version fetching on OS X again. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d28cc6f..c6f04ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -360,6 +360,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) Should fix a PA startup issue on Windows. + - src/pulsemanager.cpp: fix PA version fetching on OS X again. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6170634..01677dd 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -419,7 +419,7 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_finished[1])) { + else if ((!(numbers_finished[1])) && (!(numbers_skip[1]))) { if (((*cit) >= '0') && ((*cit) <= '9')) { numbers[1].append (*cit); numbers_started[1] = true; @@ -444,7 +444,7 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_finished[2])) { + else if ((!(numbers_finished[2])) && (!(numbers_skip[2]))) { if (((*cit) >= '0') && ((*cit) <= '9')) { numbers[2].append (*cit); numbers_started[2] = true; -- 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 de25e2ab70957ead0a60941d0fe2fe00698d42f6 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:04:42 2016 +0200 src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. --- debian/changelog | 1 + src/unixhelper.cpp | 2 +- src/unixhelper.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c6f04ea..fd0fd66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -361,6 +361,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium instead of the "generic" slash UNIX-style separator.) Should fix a PA startup issue on Windows. - src/pulsemanager.cpp: fix PA version fetching on OS X again. + - src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d5aa67d..4488786 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -34,7 +34,7 @@ /* For documentation please see unixhelper.h. */ namespace unixhelper { - void kill_pgroup (int signal) { + void kill_pgroup (const int signal) { if (SIGHUP == signal) { /* Try to kill via SIGTERM first. */ if (0 != killpg (getpgrp (), SIGTERM)) { diff --git a/src/unixhelper.h b/src/unixhelper.h index a34456e..3c2798f 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -61,7 +61,7 @@ namespace unixhelper { * (we cannot rely that this always happens, though, * so a polling solution is needed, see unix_cleanup().) */ - void kill_pgroup (int signal); + void kill_pgroup (const int signal); } #endif /* defined (Q_OS_UNIX) */ -- 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 04d902f907e92ad11c96bcf67f578831c56ccf7b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:06:32 2016 +0200 src/unixhelper.h: style and general fixes within comments. --- debian/changelog | 1 + src/unixhelper.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fd0fd66..4dd3eb8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -362,6 +362,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium startup issue on Windows. - src/pulsemanager.cpp: fix PA version fetching on OS X again. - src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. + - src/unixhelper.h: style and general fixes within comments. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/unixhelper.h b/src/unixhelper.h index 3c2798f..d67f3ed 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -29,7 +29,7 @@ namespace unixhelper { /* * Unblocks all signals and installs a signal handler for SIGHUP, - * which calls kill_pgroup(). + * which calls kill_pgroup (). * * Should signal unblocking or installing the signal handler fail, * an emergency exit is performed and @@ -42,7 +42,7 @@ namespace unixhelper { * * In this loop, the current parent PID is polled and compared against * the original value passed via parameter parent. - * Should they mismatch, the parent died and kill_pgroup() is called. + * Should they mismatch, the parent died and kill_pgroup () is called. */ int unix_cleanup (const pid_t parent); @@ -60,6 +60,7 @@ namespace unixhelper { * group leader dies under specific circumstances * (we cannot rely that this always happens, though, * so a polling solution is needed, see unix_cleanup().) + * Other values are not handled. */ void kill_pgroup (const int signal); } -- 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 caa6ddd327a80728cca3fb41c79abe1c6da66dd7 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:00:41 2016 +0200 src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). --- debian/changelog | 2 ++ src/unixhelper.cpp | 37 +++++++++++++++++++++++++++---------- src/unixhelper.h | 12 ++++++++++++ 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4dd3eb8..5dbc0b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -363,6 +363,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix PA version fetching on OS X again. - src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. - src/unixhelper.h: style and general fixes within comments. + - src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () + into a new function called real_kill_pgroup (). -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 4488786..4d9c56f 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,25 +30,42 @@ #include <cerrno> #include <vector> #include <cstdlib> +#include <stdio.h> +#include <string.h> /* For documentation please see unixhelper.h. */ namespace unixhelper { void kill_pgroup (const int signal) { - if (SIGHUP == signal) { - /* Try to kill via SIGTERM first. */ - if (0 != killpg (getpgrp (), SIGTERM)) { - std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; - } + } + + void real_kill_pgroup (const pid_t pgid) { + /* Try to kill via SIGTERM first. */ + if (0 != killpg (pgid, SIGTERM)) { + std::cerr << "WARNING: unable to send SIGTERM to process group '" << pgid << "': " << std::strerror (errno) << std::endl; + } + + /* Grant a grace period of (at least) 10 seconds. */ + sleep (10); - /* Grant a grace period of (at least) 10 seconds. */ - sleep (10); + int kill_ret = killpg (pgid, SIGKILL); - /* Don't handle any errors here, because we die anyway. */ - killpg (getpgrp (), SIGKILL); + /* + * Might be unreachable. + * Depending upon which pgroup we just killed, this + * code is either unreachable (because killpg () killed + * itself already), or being executed. + * Let's handle errors and exit, if necessary. + */ + if (0 != kill_ret) { + char err_str[512] = { }; + snprintf (err_str, 512, "WARNING: failed to kill process group '%d'", pgid); + + perror (err_str); } - } + exit (EXIT_SUCCESS); + } int unix_cleanup (const pid_t parent) { /* diff --git a/src/unixhelper.h b/src/unixhelper.h index d67f3ed..662b3be 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -63,6 +63,18 @@ namespace unixhelper { * Other values are not handled. */ void kill_pgroup (const int signal); + + /* + * Kills the whole process group. + * First, SIGTERM is sent to the group. + * A 10 seconds grace period is granted to make sure + * processes exit cleanly on their own. + * Lastly, SIGKILL is sent to the group -- which also + * implies the demise of this program. + * + * pgid is the process group ID to be killed. + */ + void real_kill_pgroup (const pid_t pgid); } #endif /* defined (Q_OS_UNIX) */ -- 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 db589032d65c8275ab99a0329651008e72817df3 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:11:16 2016 +0200 src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper around real_kill_pgroup (). Adjust comment. We need to do this so the cleanup process doesn't kill itself before all other processes in the process group are killed. --- debian/changelog | 4 ++++ src/unixhelper.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/unixhelper.h | 12 ++++++------ 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5dbc0b2..2e63e7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -365,6 +365,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/unixhelper.h: style and general fixes within comments. - src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). + - src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper + around real_kill_pgroup (). Adjust comment. We need to do this so the + cleanup process doesn't kill itself before all other processes in the + process group are killed. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 4d9c56f..82e4374 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -37,6 +37,44 @@ namespace unixhelper { void kill_pgroup (const int signal) { + pid_t pgid_to_kill = getpgrp (); + + if ((SIGHUP == signal) || (-1 == signal)) { + /* + * In order to not kill ourselves, we need to run this + * code in a new process group. + */ + pid_t tmp_pid = fork (); + + /* Child. */ + if (0 == tmp_pid) { + /* Create new pgid. */ + int err = setpgid (0, 0); + + if (0 != err) { + std::perror ("WARNING: unable to change PGID"); + std::cerr << "Continuing with normal operation, but process might kill itself before tree vanishes." << std::endl; + } + + real_kill_pgroup (pgid_to_kill); + } + /* Error. */ + else if (-1 == tmp_pid) { + perror ("WARNING: unable to fork off another process to kill original process group"); + std::cerr << "Proceeding with normal operation, but process might kill itself before tree vanishes." << std::endl; + + real_kill_pgroup (pgid_to_kill); + } + /* Parent. */ + else { + /* + * No need to do anything, just exit here in order to not + * spawn a bunch of new processes due to subsequent calls + * to kill_pgroup () from unix_cleanup (). + */ + exit (EXIT_SUCCESS); + } + } } void real_kill_pgroup (const pid_t pgid) { diff --git a/src/unixhelper.h b/src/unixhelper.h index 662b3be..7d30bcf 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -47,12 +47,12 @@ namespace unixhelper { int unix_cleanup (const pid_t parent); /* - * Kills the whole process group. - * First, SIGTERM is sent to the group. - * A 10 seconds grace period is granted to make sure - * processes exit cleanly on their own. - * Lastly, SIGKILL is sent to the group -- which also - * implies the demise of this program. + * Wrapper for killing a whole process group. + * The "real" killing work is done by real_kill_pgroup (). + * This function tries to fork off another process and change + * the new function's process group ID. + * If any of these operations fail, killing the original process + * group ID will still continue, albeit with warning messages. * * signal may be any of: * * -1 to indicate an error leading to emergency termination -- 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 bc3e0c7f8776bc3de9ab28c650f6ca7457224821 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Aug 13 23:27:42 2016 +0200 src/pulsemanager.cpp: remove unused variables. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2e63e7c..3d1e696 100644 --- a/debian/changelog +++ b/debian/changelog @@ -369,6 +369,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium around real_kill_pgroup (). Adjust comment. We need to do this so the cleanup process doesn't kill itself before all other processes in the process group are killed. + - src/pulsemanager.cpp: remove unused variables. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 01677dd..93c83b3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -468,8 +468,6 @@ void PulseManager::fetch_pulseaudio_version () { } } - bool numbers_done[3] = { false, false, false }; - if (numbers_skip[0]) { x2goErrorf (30) << "Supposed to skip major version number. Something is wrong."; show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), -- 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 8fc340eb59ad3d5decf834a34a1eb5d701aaabaf Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Aug 13 23:33:15 2016 +0200 src/unixhelper.cpp: code cleanup. --- debian/changelog | 1 + src/unixhelper.cpp | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3d1e696..0a97c9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -370,6 +370,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium cleanup process doesn't kill itself before all other processes in the process group are killed. - src/pulsemanager.cpp: remove unused variables. + - src/unixhelper.cpp: code cleanup. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 82e4374..d6b4993 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -31,7 +31,6 @@ #include <vector> #include <cstdlib> #include <stdio.h> -#include <string.h> /* For documentation please see unixhelper.h. */ @@ -60,8 +59,8 @@ namespace unixhelper { } /* Error. */ else if (-1 == tmp_pid) { - perror ("WARNING: unable to fork off another process to kill original process group"); - std::cerr << "Proceeding with normal operation, but process might kill itself before tree vanishes." << std::endl; + std::perror ("WARNING: unable to fork off another process to kill original process group"); + std::cerr << "Proceeding with normal operation, but process might kill itself before tree vanishes." << std::endl; real_kill_pgroup (pgid_to_kill); } @@ -72,7 +71,7 @@ namespace unixhelper { * spawn a bunch of new processes due to subsequent calls * to kill_pgroup () from unix_cleanup (). */ - exit (EXIT_SUCCESS); + std::exit (EXIT_SUCCESS); } } } @@ -96,13 +95,10 @@ namespace unixhelper { * Let's handle errors and exit, if necessary. */ if (0 != kill_ret) { - char err_str[512] = { }; - snprintf (err_str, 512, "WARNING: failed to kill process group '%d'", pgid); - - perror (err_str); + std::cerr << "WARNING: failed to kill process group '" << pgid << "': " << std::strerror (err_str) << std::endl; } - exit (EXIT_SUCCESS); + std::exit (EXIT_SUCCESS); } int unix_cleanup (const pid_t parent) { -- 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 b5084f49c077d30e8643d9a6a5e0fdbbbbdb8d7c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Aug 13 23:42:53 2016 +0200 src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. --- debian/changelog | 1 + src/unixhelper.cpp | 18 ++++++++++++------ src/x2goclient.cpp | 9 ++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0a97c9a..5c39aaa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -371,6 +371,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium process group are killed. - src/pulsemanager.cpp: remove unused variables. - src/unixhelper.cpp: code cleanup. + - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d6b4993..406cdda 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -79,7 +79,8 @@ namespace unixhelper { void real_kill_pgroup (const pid_t pgid) { /* Try to kill via SIGTERM first. */ if (0 != killpg (pgid, SIGTERM)) { - std::cerr << "WARNING: unable to send SIGTERM to process group '" << pgid << "': " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "WARNING: unable to send SIGTERM to process group '" << pgid << "': " << std::strerror (saved_errno) << std::endl; } /* Grant a grace period of (at least) 10 seconds. */ @@ -95,7 +96,8 @@ namespace unixhelper { * Let's handle errors and exit, if necessary. */ if (0 != kill_ret) { - std::cerr << "WARNING: failed to kill process group '" << pgid << "': " << std::strerror (err_str) << std::endl; + const int saved_errno = errno; + std::cerr << "WARNING: failed to kill process group '" << pgid << "': " << std::strerror (saved_errno) << std::endl; } std::exit (EXIT_SUCCESS); @@ -108,14 +110,16 @@ namespace unixhelper { */ sigset_t empty_set; if (0 != sigemptyset (&empty_set)) { - std::cerr << "Unable to fetch empty signal set: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to fetch empty signal set: " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ } if (0 != sigprocmask (SIG_SETMASK, &empty_set, NULL)) { - std::cerr << "Unable to set empty signal set: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to set empty signal set: " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ @@ -137,7 +141,8 @@ namespace unixhelper { /* Set up signal handler to ignore the current signal. */ if (0 != sigaction (*it, &sig_action, NULL)) { - std::cerr << "Unable to ignore signal " << strsignal (*it) << ": " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to ignore signal " << strsignal (*it) << ": " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ @@ -151,7 +156,8 @@ namespace unixhelper { sig_action.sa_flags = SA_RESTART; if (0 != sigaction (SIGHUP, &sig_action, NULL)) { - std::cerr << "Unable to set up signal handler for SIGHUP: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to set up signal handler for SIGHUP: " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index b201a4e..431a01e 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -58,13 +58,15 @@ int fork_helper (int argc, char **argv) { new_argv_c_str->push_back (0); if (0 != execv (new_argv_c_str->front (), &(new_argv_c_str->front ()))) { - std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (errno) << "\n" + const int saved_errno = errno; + std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (saved_errno) << "\n" << "Terminating and killing parent." << "\n" << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; pid_t parent_pid = getppid (); if (0 != kill (parent_pid, SIGTERM)) { - std::cerr << "Failed to kill parent process: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Failed to kill parent process: " << std::strerror (saved_errno) << std::endl; } std::exit (EXIT_FAILURE); @@ -75,7 +77,8 @@ int fork_helper (int argc, char **argv) { } /* Error. */ else if (-1 == tmp_pid) { - std::cerr << "Unable to create a new process for the UNIX cleanup watchdog: " << std::strerror (errno) << "\n"; + const int saved_errno = errno; + std::cerr << "Unable to create a new process for the UNIX cleanup watchdog: " << std::strerror (saved_errno) << "\n"; std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; std::exit (EXIT_FAILURE); -- 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 7dc2aef31eca474299f82e07a35009101262bf46 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 22 04:05:53 2016 +0200 src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5c39aaa..65dc858 100644 --- a/debian/changelog +++ b/debian/changelog @@ -372,6 +372,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: remove unused variables. - src/unixhelper.cpp: code cleanup. - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. + - src/onmainwindow.cpp: document createRSAKey () because what it does is + completely non-obvious. -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 67a2259..f6a4075 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8056,6 +8056,33 @@ void ONMainWindow::exportDefaultDirs() QString ONMainWindow::createRSAKey() { + /* + * I spent multiple hours on trying to understand this function + * and directory exporting in general, so I'd better document + * this. + * + * This function first generates a new RSA private-public key + * pair as ~/.x2go/ssh/gen/key.XXXXX{,.pub}. + * + * Then, the SSH daemon's public host key is read and appended + * to the *private* SSH key file after a marker looking like + * this: "----BEGIN RSA IDENTITY----" + * + * Later on, this *private* SSH key file is transferred to the + * remote server, which parses it in the "x2gomountdirs" perl + * script and extracts the public key (used for logging in + * to the client machine) and the public *host* key, used to + * circumvent the "untrusted host" message by SSH by + * explicitly giving the aforementioned public *host* key as + * the only element in a fake "authorized_keys" file. Again, + * this is all happening server-side. + * + * The *public* key part generated here is then taken and + * later added to the "authorized_keys" file on the client + * side, to allow auto-logins via the generated and transferred + * private SSH key. + */ + QDir dr; QString keyPath=homeDir +"/.x2go/ssh/gen"; dr.mkpath ( keyPath ); @@ -8071,6 +8098,9 @@ QString ONMainWindow::createRSAKey() QStringList args; + /* + * Generating new key material here. + */ args<<"-t"<<"rsa"<<"-b"<<"1024"<<"-N"<<""<<"-f"<<keyName<<"-q"; x2goDebug<<"ssh-keygen " + args.join(" "); @@ -8083,6 +8113,9 @@ QString ONMainWindow::createRSAKey() x2goDebug<<"ssh-keygen succeeded."; + /* + * Now taking the *host* pub key here... + */ QFile rsa ( "/etc/ssh/ssh_host_rsa_key.pub" ); #ifdef Q_OS_WIN rsa.setFileName ( -- 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 3c2a90fdb2db781364ef1fbd5370427daeabee9a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 22 04:08:45 2016 +0200 src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). --- debian/changelog | 3 +++ src/onmainwindow.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 65dc858..b476d39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -374,6 +374,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. - src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. + - src/onmainwindow.cpp: add support for explicitly setting the private key + bit size based on type and use values (currently) regarded as secure to + generateHostKey (). -- X2Go Release Manager <git-admin@x2go.org> Mon, 19 Sep 2016 09:07:07 +0200 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index f6a4075..951b485 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10293,26 +10293,33 @@ void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; QString stringified_key_type = ""; + std::size_t key_bits = 0; switch (key_type) { case RSA_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "rsa"; + key_bits = 4096; break; case DSA_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "dsa"; + key_bits = 1024; break; case ECDSA_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "ecdsa"; + key_bits = 384; break; case ED25519_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "ed25519"; + /* Fixed key length, flag will be unused. */ + key_bits = 0; break; default: sanitized_key_type = UNKNOWN_KEY_TYPE; stringified_key_type = "unknown"; + key_bits = 0; } if (sanitized_key_type == UNKNOWN_KEY_TYPE) { @@ -10339,6 +10346,8 @@ void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type) QStringList args; args << "-t" << stringified_key_type + << "-b" + << QString::number (key_bits) << "-N" << "" << "-C" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git