This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. from 76d422d src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance. new 80ae90f src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. new 69f58e2 src/pulsemanager.cpp: refactor PA binary searching code. new 6907623 src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. new 582c00a src/pulsemanager.cpp: fix PA binary searching logic. 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 | 10 +++++++ src/onmainwindow.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++++---- src/pulsemanager.cpp | 51 ++++++++++++++------------------ src/x2goutils.cpp | 4 ++- src/x2goutils.h | 4 ++- 5 files changed, 110 insertions(+), 38 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 80ae90fd84314d1c2626f53a261b2cb1ccc07b56 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 16:33:38 2016 +0100 src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. We will need it for sftp-server discovery. --- debian/changelog | 3 +++ src/x2goutils.cpp | 4 +++- src/x2goutils.h | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8b692ef..9bc2f99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -466,6 +466,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance. + - src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available + on all UNIX-based operating systems. We will need it for sftp-server + discovery. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 9612b12..5850cca 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -202,7 +202,9 @@ void show_XQuartz_generic_error (const QString &main_error, const QString &addit "or\n" "<center><b>/Applications/Utilities/XQuartz.app</b></center>")); } +#endif /* defined (Q_OS_DARWIN) */ +#ifdef Q_OS_UNIX QString add_to_path (const QString &orig_path, const QStringList &add, const bool back) { QString ret = orig_path; std::vector<bool> found; @@ -330,4 +332,4 @@ QString find_binary (const QString &path, const QString &binary_name) { return (ret); } -#endif /* defined (Q_OS_DARWIN) */ +#endif /* defined (Q_OS_UNIX) */ diff --git a/src/x2goutils.h b/src/x2goutils.h index dd7613c..f489439 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -45,7 +45,9 @@ bool font_is_monospaced (const QFont &font); void show_XQuartz_not_found_error (); void show_XQuartz_start_error (); void show_XQuartz_generic_error (const QString &main_error, const QString &additional_info); +#endif /* defined (Q_OS_DARWIN) */ +#ifdef Q_OS_UNIX /* * Add a list of strings to a PATH value. * @@ -65,6 +67,6 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo * Iff path is empty, (only) the current working dir is searched. */ QString find_binary (const QString &path, const QString &binary_name); -#endif /* defined (Q_OS_DARWIN) */ +#endif /* defined (Q_OS_UNIX) */ #endif /* !defined (X2GOUTILS_H) */ -- 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 69f58e20a18e9f86986876908fbe762586d78fed Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 17:33:36 2016 +0100 src/pulsemanager.cpp: refactor PA binary searching code. Less duplication now. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 48 ++++++++++++++---------------------------------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9bc2f99..ca7a96a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -469,6 +469,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. We will need it for sftp-server discovery. + - src/pulsemanager.cpp: refactor PA binary searching code. Less + duplication now. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 93c83b3..d7b6d72 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -79,21 +79,6 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), if (server_binary_.isEmpty ()) { server_binary_ = find_binary (path_val, "pulseaudio"); - - if (server_binary_.isEmpty ()) { - x2goErrorf (29) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; - show_RichText_ErrorMsgBox (tr ("Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), - tr ("If you downloaded the bundled, pre-compiled version from the official home page, " - "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"), - true); - abort (); - } - else { - system_pulse_ = true; - } } #else /* QT_VERSION < 0x050000 */ QStringList search_paths; @@ -117,30 +102,25 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), search_paths << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); - - if (server_binary_.isEmpty ()) { - x2goErrorf (28) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; - show_RichText_ErrorMsgBox (tr ("Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), - tr ("If you downloaded the bundled, pre-compiled version from the official home page, " - "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"), - true); - abort (); - } } } + } +#endif /* QT_VERSION < 0x050000 */ - /* - * The detection above either failed or succeeded. - * Failure means that the program already stopped, - * success means that all code reaches this point. - * Be careful when refactoring this code. - */ + if (server_binary_.isEmpty ()) { + x2goErrorf (29) << "Unable to find the PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; + show_RichText_ErrorMsgBox (tr ("Unable to find the PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), + tr ("If you downloaded the bundled, pre-compiled version from the official home page, " + "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"), + true); + abort (); + } + else { system_pulse_ = true; } -#endif /* QT_VERSION < 0x050000 */ QFileInfo tmp_file_info = QFileInfo (server_binary_); server_working_dir_ = tmp_file_info.canonicalPath (); -- 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 69076234b68f6b42c9c3bc84a13d485211eff7f1 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 17:38:57 2016 +0100 src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 75 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index ca7a96a..15d1682 100644 --- a/debian/changelog +++ b/debian/changelog @@ -471,6 +471,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium discovery. - src/pulsemanager.cpp: refactor PA binary searching code. Less duplication now. + - src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching + for the real sftp-server binary path. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 670872d..8748d21 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10150,14 +10150,81 @@ void ONMainWindow::generateEtcFiles() out<<"StrictModes no\n"<< "UsePrivilegeSeparation no\n"<< "PidFile \"" + varDir + "/sshd.pid\"\n" << - "AuthorizedKeysFile \"" << authKeyPath << "\"\n" << + "AuthorizedKeysFile \"" << authKeyPath << "\"\n"; #ifdef Q_OS_WIN - "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< - "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"; + out << "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< + "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"; #else - "Subsystem sftp " - /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ - <<appDir<<"/sftp-server\n"; + /* + * We need to find the sftp-server binary. + * This turns out to be surprisingly difficult, because there is no standard place + * for this binary. Instead, every distribution installs it where they see fit. + * Needless to say, we're screwed... + */ + + QString sftp_binary; + +#if QT_VERSION < 0x050000 + QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); + QString path_val = tmp_env.value ("PATH"); + + QStringList to_back; + to_back << "/usr/lib/openssh" /* Debian and Ubuntu */ + << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ + << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ + << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ + << "/usr/lib/misc" /* Gentoo */ + << "/usr/libexec"; /* Slackware, OS X */ + + add_to_path (path_val, to_back); + + /* Just in case we bundle sftp-server ourselves. */ + sftp_binary = find_binary (appDir, "sftp-server"); + + if (sftp_binary.isEmpty ()) { + sftp_binary = find_binary (path_val, "sftp-server"); + } +#else /* QT_VERSION < 0x050000 */ + QStringList search_paths; + search_paths << appDir; + + sftp_binary = QStandardPaths::findExecutable ("sftp-binary", search_paths); + + if (sftp_binary.isEmpty ()) { + search_paths = QStringList (); + + sftp_binary = QStandardPaths::findExecutable ("sftp-binary", search_paths); + + if (sftp_binary.isEmpty ()) { + search_paths = QStringList (); + search_paths << "/usr/lib/openssh" /* Debian and Ubuntu */ + << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ + << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ + << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ + << "/usr/lib/misc" /* Gentoo */ + << "/usr/libexec"; /* Slackware, OS X */ + + sftp_binary = QStandardPaths::findExecutable ("sftp-server", search_paths); + } + } +#endif /* QT_VERSION < 0x050000 */ + + if (sftp_binary.isEmpty ()) { + x2goErrorf (31) << "Unable to find the sftp-server binary. Neither bundled, nor found in $PATH nor additional directories."; + show_RichText_ErrorMsgBox (tr ("Unable to find the sftp-server binary. Neither bundled, nor found in $PATH nor additional directories."), + tr ("If you are using a Linux-based operating system, please ask your system administrator " + "to install the package containing the sftp-server binary. Common names are <b>openssh</b>, " + "<b>openssh-server</b> or <b>openssh-sftp-server</b> depending upon distribution.\n\n" + "If the sftp-server binary is installed on your system, please report a bug " + "mentioning its path on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); + abort (); + } + + out << "Subsystem sftp " << sftp_binary << "\n"; #endif /* The log file in startSshd() is specific to Windows. */ -- 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 582c00a07e3b14ab64552950082fdc9473f91556 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 18:09:53 2016 +0100 src/pulsemanager.cpp: fix PA binary searching logic. We don't want to unconditionally set system_pulse_ to true if we found a binary... it might as well be the bundled one... --- debian/changelog | 3 +++ src/pulsemanager.cpp | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 15d1682..d99cb6a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -473,6 +473,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium duplication now. - src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. + - src/pulsemanager.cpp: fix PA binary searching logic. We don't want to + unconditionally set system_pulse_ to true if we found a binary... it + might as well be the bundled one... [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d7b6d72..a956054 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -79,6 +79,10 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), if (server_binary_.isEmpty ()) { server_binary_ = find_binary (path_val, "pulseaudio"); + + if (!(server_binary_.isEmpty ())) { + system_pulse_ = true; + } } #else /* QT_VERSION < 0x050000 */ QStringList search_paths; @@ -102,8 +106,18 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), search_paths << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); + + if (!(server_binary_.isEmpty ())) { + system_pulse_ = true; + } + } + else { + system_pulse_ = true; } } + else { + system_pulse_ = true; + } } #endif /* QT_VERSION < 0x050000 */ @@ -118,9 +132,6 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), true); abort (); } - else { - system_pulse_ = true; - } QFileInfo tmp_file_info = QFileInfo (server_binary_); server_working_dir_ = tmp_file_info.canonicalPath (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git