This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. discards 1ae582a macbuild.sh: add work-in-progress PulseAudio bundling. discards 5128e08 macbuild.sh: add phase output for bundling nxproxy. discards c4bec1a macbuild.sh: copy PulseAudio libraries and binaries. discards fdba300 macbuild.sh: define PulseAudio libraries and binaries to be later copied. discards e6f478e macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. discards 156d7a4 macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. discards 08a5335 macbuild.sh: add new repeat_str() helper function. discards 5110835 macbuild.sh: add new get_nesting_level() helper function. discards 10e5cea macbuild.sh: add new lazy_canonical_path() helper function. discards 0e5b323 macbuild.sh: add new dependency_error() helper function. discards 45fd5b8 macbuild.sh: add new MACPORTS_PREFIX detection/variable. discards 03475d0 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. discards 7143d19 pulsemanager.{cpp,h}: new class for PulseAudio management. discards 4bd36d4 compat.h: include QtCore/qglobal.h for Q_OS_... macros. discards 80e1920 compat.{cpp,h}: remove inline keyword, because function is not defined in header file. discards 521040b compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. discards 66ee6e3 onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. discards 4fba94a appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. discards f9d207a {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. discards d304b93 x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. discards 229b0f1 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. discards 684b0fc {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. discards 75b7276 unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. discards f3a2e64 x2goclient.cpp: create new argv array on the heap instead of on the stack. discards ade558f x2goclient.cpp: fix string comparison. discards 6f85425 x2goclient.cpp: fix compile problems introduced with the last commit. discards 34fc0ce x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. discards 2a818a0 x2goclient.cpp: clean up. discards cf70475 unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. discards e7494a7 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. discards a61c944 unixhelper.cpp: kill process group on error. discards a6acc24 x2goclient.cpp: return return value of unixhelper::unix_cleanup(). discards 3ebef1f unixhelper.{cpp,h}: add documentation/comments. discards e70954f unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. discards 8999494 unixhelper.h: forgot to declare type of unix_cleanup() function. discards 64babdd unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. discards 466b5c3 x2goclient.cpp: fix std::edit -> std::exit typo. discards 15ff43e x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. discards c2e44d1 x2goclient.cpp: add myself to copyright header. discards 6088298 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. discards 5038c1d x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. discards 29466ed x2goclient.cpp: wrap X2Go Client main function and use that. discards 65e9a8b unixhelper.{cpp,h}: implement cleanup program for process group. discards 6294e3c {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. adds be52b79 copy-deps-win32.bat: actually let xcopy error correctly. new 05689c7 general: fix spelling and English language syntax issues. Fixes: #389. new 5d55e6d general: improve debug output and error messages. new 379e418 {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. new 42bd7f7 unixhelper.{cpp,h}: implement cleanup program for process group. new 1f1a968 x2goclient.cpp: wrap X2Go Client main function and use that. new 1c561a8 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. new e616d36 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. new 6d8e68f x2goclient.cpp: add myself to copyright header. new e0b4f8a x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. new ee79211 x2goclient.cpp: fix std::edit -> std::exit typo. new 2a6dde3 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. new a6b1ccc unixhelper.h: forgot to declare type of unix_cleanup() function. new 8bf9126 unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. new 188f981 unixhelper.{cpp,h}: add documentation/comments. new 302cdef x2goclient.cpp: return return value of unixhelper::unix_cleanup(). new 366aeb1 unixhelper.cpp: kill process group on error. new d1ef997 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. new e9c78cc unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. new ca7b166 x2goclient.cpp: clean up. new 40bedba x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. new 8ea5210 x2goclient.cpp: fix compile problems introduced with the last commit. new eff85e1 x2goclient.cpp: fix string comparison. new 515d424 x2goclient.cpp: create new argv array on the heap instead of on the stack. new ebc5457 unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. new c3ef5db {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. new 01c8f30 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. new 57e260c x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. new 29c1b1b {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. new 4f40993 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. new 7c4382b onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. new c4fbbc7 compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. new 9519c58 compat.{cpp,h}: remove inline keyword, because function is not defined in header file. new 253f411 compat.h: include QtCore/qglobal.h for Q_OS_... macros. new 937cb33 pulsemanager.{cpp,h}: new class for PulseAudio management. new 02636d3 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. new b3c0791 macbuild.sh: add new MACPORTS_PREFIX detection/variable. new bb25cbd macbuild.sh: add new dependency_error() helper function. new 4068480 macbuild.sh: add new lazy_canonical_path() helper function. new bae4b60 macbuild.sh: add new get_nesting_level() helper function. new cb80887 macbuild.sh: add new repeat_str() helper function. new bc343f6 macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. new 2d95731 macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. new 14abcb7 macbuild.sh: define PulseAudio libraries and binaries to be later copied. new 6b0abfe macbuild.sh: copy PulseAudio libraries and binaries. new 5b9a19c macbuild.sh: add phase output for bundling nxproxy. new ffb88a5 macbuild.sh: add work-in-progress PulseAudio bundling. 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 (1ae582a) \ N -- N -- N refs/heads/bugfix/osx (ffb88a5) 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 46 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 | 28 +-- debian/changelog | 29 +++ src/LDAPSession.cpp | 2 +- src/configdialog.cpp | 6 +- src/contest.cpp | 2 +- src/cupsprintersettingsdialog.cpp | 4 +- src/exportdialog.cpp | 2 +- src/folderexplorer.cpp | 8 +- src/httpbrokerclient.cpp | 56 ++--- src/onmainwindow.cpp | 487 +++++++++++++++++++------------------ src/onmainwindow.h | 4 +- src/printdialog.cpp | 9 +- src/printprocess.cpp | 19 +- src/printwidget.cpp | 2 +- src/sessionbutton.cpp | 6 +- src/sessionexplorer.cpp | 10 +- src/sessionmanagedialog.cpp | 2 +- src/sessionwidget.cpp | 22 +- src/settingswidget.cpp | 6 +- src/sharewidget.cpp | 8 +- src/sshmasterconnection.cpp | 158 ++++++------ src/sshprocess.cpp | 42 ++-- src/wapi.cpp | 10 +- 23 files changed, 476 insertions(+), 446 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 05689c7275195fa8650f6bd25b9f0e8f9c73624f Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 24 19:55:59 2015 +0200 general: fix spelling and English language syntax issues. Fixes: #389. v2: apply more fixes in the original changes context. (Mihai Moldovan) --- debian/changelog | 5 +++++ src/httpbrokerclient.cpp | 4 ++-- src/onmainwindow.cpp | 6 +++--- src/sessionwidget.cpp | 12 ++++++------ src/sharewidget.cpp | 6 +++--- src/sshmasterconnection.cpp | 4 ++-- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index d830bc8..ebbdc77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -429,6 +429,11 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low configuration with x2goplugin. Fixes: #798. + v2: refactor patch, fix whitespace issues. (Mihai Moldovan) + [ Stefan Baur ] + * New upstream release (4.0.4.0): + - general: fix spelling and English language syntax issues. Fixes: #389. + + v2: apply more fixes in the original changes context. (Mihai Moldovan) + -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 x2goclient (4.0.3.2-0x2go1) unstable; urgency=medium diff --git a/src/httpbrokerclient.cpp b/src/httpbrokerclient.cpp index 5780cca..b25ffb1 100644 --- a/src/httpbrokerclient.cpp +++ b/src/httpbrokerclient.cpp @@ -165,8 +165,8 @@ void HttpBrokerClient::slotSshServerAuthError(int error, QString sshMessage, Ssh slotSshUserAuthError ( sshMessage ); return ; case SSH_SERVER_FILE_NOT_FOUND: - errMsg=tr ( "Could not find known host file." - "If you accept the host key here, the file will be automatically created" ); + errMsg=tr ( "Could not find known hosts file." + "If you accept the host key here, the file will be automatically created." ); break; case SSH_SERVER_NOT_KNOWN: diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index fecf6ed..db51edc 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -3001,8 +3001,8 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa slotSshUserAuthError ( sshMessage ); return ; case SSH_SERVER_FILE_NOT_FOUND: - errMsg=tr ( "Could not find known host file." - "If you accept the host key here, the file will be automatically created" ); + errMsg=tr ( "Could not find known hosts file." + "If you accept the host key here, the file will be automatically created." ); break; case SSH_SERVER_NOT_KNOWN: @@ -10194,7 +10194,7 @@ void ONMainWindow::slotConfigXinerama() QRect newGeometry=proxyWinGeometry(); if (newGeometry.isNull()) { - x2goWarningf(7)<< tr("Error getting window geometry (window closed)?"); + x2goWarningf(7)<< tr("Error getting window geometry. (Did you close the window?)"); xineramaTimer->stop(); return; } diff --git a/src/sessionwidget.cpp b/src/sessionwidget.cpp index 13abd99..f06efde 100644 --- a/src/sessionwidget.cpp +++ b/src/sessionwidget.cpp @@ -325,11 +325,11 @@ void SessionWidget::slot_proxyGetKey() { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "x2goclient is running in " + tr ( "X2Go Client is running in " "portable mode. You should " - "use a path on your usb device " + "use a path on your USB device " "to be able to access your data " - "whereever you are" ), + "wherever you are." ), QMessageBox::Ok,QMessageBox::NoButton ); slot_getKey(); return; @@ -440,11 +440,11 @@ void SessionWidget::slot_getKey() { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "x2goclient is running in " + tr ( "X2Go Client is running in " "portable mode. You should " - "use a path on your usb device " + "use a path on your USB device " "to be able to access your data " - "whereever you are" ), + "wherever you are." ), QMessageBox::Ok,QMessageBox::NoButton ); slot_getKey(); return; diff --git a/src/sharewidget.cpp b/src/sharewidget.cpp index 7004938..b42fd75 100644 --- a/src/sharewidget.cpp +++ b/src/sharewidget.cpp @@ -173,11 +173,11 @@ void ShareWidget::slot_openDir() { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "x2goclient is running in " + tr ( "X2Go Client is running in " "portable mode. You should " - "use a path on your usb device " + "use a path on your USB device " "to be able to access your data " - "whereever you are" ), + "wherever you are." ), QMessageBox::Ok,QMessageBox::NoButton ); slot_openDir(); return; diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 1e11c62..17cde87 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1170,7 +1170,7 @@ bool SshMasterConnection::userAuthKrb() if (!ssh.waitForFinished(20000)) { sshProcErrString=ssh.errorString(); - authErrors<<tr("Failed to start SSH Client. Please check your installation and GSSApi configuration"); + authErrors<<tr("Failed to start SSH Client. Please check your installation and GSSApi configuration."); authErrors<<sshProcErrString; #ifdef DEBUG x2goDebug<<"ssh not finished:" <<sshProcErrString<<endl; @@ -1196,7 +1196,7 @@ bool SshMasterConnection::userAuthKrb() if (ssh.exitCode() == 0 && ssh.exitStatus() == 0 && outp== user) return true; - authErrors<<tr("Check your GSSApi configuration or choose another authentication method"); + authErrors<<tr("Check your GSSApi configuration or choose another authentication method."); return false; } -- 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 42bd7f752ecfb473ef7003cac448b1c8755fcc0b Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 14 23:57:49 2015 +0100 unixhelper.{cpp,h}: implement cleanup program for process group. --- debian/changelog | 1 + src/unixhelper.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/unixhelper.h | 9 +++++++++ 3 files changed, 48 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5503e3a..b96c1f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -426,6 +426,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low + sshprocess.cpp + wapi.cpp - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. + - unixhelper.{cpp,h}: implement cleanup program for process group. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 221bdb2..545c2c1 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -19,5 +19,43 @@ #ifdef Q_OS_UNIX +#include <csignal> +#include <unistd.h> +#include <iostream> +#include <cstring> +#include <cerrno> +#include <cstdlib> + +#include "unixhelper.h" + +void unixhelper::kill_pgroup (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; + } + + /* Grant a grace period of (at least) 5 seconds. */ + sleep (5); + + /* Don't handle any errors here, because we die anyway. */ + killpg (getpgrp (), SIGKILL); + } +} + + +int unixhelper::unix_cleanup () { + if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { + std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + std::exit (1); + } + + std::signal (SIGHUP, kill_pgroup); + + /* Sleep forever... at least one second in each run. */ + for (;;) { + sleep (1); + } +} #endif /* defined (Q_OS_UNIX) */ diff --git a/src/unixhelper.h b/src/unixhelper.h index 31d983e..fab611e 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -22,7 +22,16 @@ #ifndef UNIXHELPER_H #define UNIXHELPER_H +class unixhelper { + public: + unixhelper () {} + ~unixhelper () {} + unix_cleanup (); + private: + unixhelper (const unixhelper &other); + void kill_pgroup (int signal); +}; #endif /* !defined (UNIXHELPER_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 1f1a968391065ce46ddb6078cdd36279b3eb4e58 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Mar 15 00:03:42 2015 +0100 x2goclient.cpp: wrap X2Go Client main function and use that. --- debian/changelog | 1 + src/x2goclient.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b96c1f4..fa256c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -427,6 +427,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low + wapi.cpp - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. - unixhelper.{cpp,h}: implement cleanup program for process group. + - x2goclient.cpp: wrap X2Go Client main function and use that. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index a619cd7..80fd967 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -17,7 +17,11 @@ #include "ongetpass.h" +int wrap_x2go_main (int argc, char **argv) { + return (x2goMain (argc, argv)); +} + int main(int argc, char *argv[]) { - return x2goMain(argc,argv); + return (wrap_x2go_main (argc, argv)); } -- 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 5d55e6d5672cc2e7d37774bc37049c4c81f9a04c Author: Mihai Moldovan <ionic@ionic.de> Date: Mon May 25 01:21:49 2015 +0200 general: improve debug output and error messages. Affects: - LDAPSession.cpp - configdialog.cpp - contest.cpp - cupsprintersettingsdialog.cpp - exportdialog.cpp - folderexplorer.cpp - httpbrokerclient.cpp - onmainwindow.cpp - onmainwindow.h - printdialog.cpp - printprocess.cpp - printwidget.cpp - sessionbutton.cpp - sessionexplorer.cpp - sessionmanagedialog.cpp - sessionwidget.cpp - settingswidget.cpp - sharewidget.cpp - sshmasterconnection.cpp - sshprocess.cpp - wapi.cpp --- debian/changelog | 23 ++ src/LDAPSession.cpp | 2 +- src/configdialog.cpp | 6 +- src/contest.cpp | 2 +- src/cupsprintersettingsdialog.cpp | 4 +- src/exportdialog.cpp | 2 +- src/folderexplorer.cpp | 8 +- src/httpbrokerclient.cpp | 52 ++-- src/onmainwindow.cpp | 483 +++++++++++++++++++------------------ src/onmainwindow.h | 4 +- src/printdialog.cpp | 9 +- src/printprocess.cpp | 19 +- src/printwidget.cpp | 2 +- src/sessionbutton.cpp | 6 +- src/sessionexplorer.cpp | 10 +- src/sessionmanagedialog.cpp | 2 +- src/sessionwidget.cpp | 10 +- src/settingswidget.cpp | 6 +- src/sharewidget.cpp | 2 +- src/sshmasterconnection.cpp | 156 ++++++------ src/sshprocess.cpp | 42 ++-- src/wapi.cpp | 10 +- 22 files changed, 442 insertions(+), 418 deletions(-) diff --git a/debian/changelog b/debian/changelog index ebbdc77..f4666e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -402,6 +402,29 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - onmainwindow.h: revert const-qualifier for get_translator(). It's static and can't have any cv-qualifier. - copy-deps-win32.bat: actually let xcopy error correctly. + - general: improve debug output and error messages. + Affects: + + LDAPSession.cpp + + configdialog.cpp + + contest.cpp + + cupsprintersettingsdialog.cpp + + exportdialog.cpp + + folderexplorer.cpp + + httpbrokerclient.cpp + + onmainwindow.cpp + + onmainwindow.h + + printdialog.cpp + + printprocess.cpp + + printwidget.cpp + + sessionbutton.cpp + + sessionexplorer.cpp + + sessionmanagedialog.cpp + + sessionwidget.cpp + + settingswidget.cpp + + sharewidget.cpp + + sshmasterconnection.cpp + + sshprocess.cpp + + wapi.cpp [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/LDAPSession.cpp b/src/LDAPSession.cpp index 5e1bb04..18501e8 100644 --- a/src/LDAPSession.cpp +++ b/src/LDAPSession.cpp @@ -80,7 +80,7 @@ LDAPSession::LDAPSession ( string server,int port,string bindDN, { ld=ldap_init ( server.c_str(),port ); if ( !ld ) - throw LDAPExeption ( "ldap_init","Can't init LDAP library" ); + throw LDAPExeption ( "ldap_init","Can't initialize LDAP library." ); int ver=3; int errc=ldap_set_option ( ld,LDAP_OPT_PROTOCOL_VERSION,&ver ); if ( errc != LDAP_SUCCESS ) diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 0b9701b..c0b2285 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -204,7 +204,7 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WFlags f ) #endif //USELDAP #ifdef Q_OS_DARWIN - QGroupBox* xgb=new QGroupBox ( tr ( "X-Server settings" ),fr ); + QGroupBox* xgb=new QGroupBox ( tr ( "X.Org Server settings" ),fr ); QGridLayout *xLay=new QGridLayout ( xgb ); leXexec=new QLineEdit ( xgb ); @@ -257,7 +257,7 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WFlags f ) QHBoxLayout* sshLay=new QHBoxLayout(); sshLay->addWidget ( new QLabel ( tr ( - "Clientside SSH port for file system export usage:" + "Clientside (local) SSH daemon port for file system export usage:" ),fr ) ); sshLay->addWidget ( clientSshPort ); sshLay->addStretch(); @@ -349,7 +349,7 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WFlags f ) #if defined ( Q_OS_WIN) && defined (CFGCLIENT ) xsetWidg=new XSettingsWidget(this); - tabWidg->addTab(xsetWidg, tr("X-Server settings")); + tabWidg->addTab(xsetWidg, tr("X.Org Server settings")); #endif } diff --git a/src/contest.cpp b/src/contest.cpp index 2d0351a..94e68de 100644 --- a/src/contest.cpp +++ b/src/contest.cpp @@ -145,7 +145,7 @@ void ConTest::slotError(QAbstractSocket::SocketError socketError) { QString error; if (socketError==QAbstractSocket::SocketTimeoutError) - error=tr("Socket operation timed out"); + error=tr("Socket operation timed out."); else error=socket->errorString(); diff --git a/src/cupsprintersettingsdialog.cpp b/src/cupsprintersettingsdialog.cpp index d3a4f13..2489364 100644 --- a/src/cupsprintersettingsdialog.cpp +++ b/src/cupsprintersettingsdialog.cpp @@ -269,7 +269,7 @@ bool CUPSPrinterSettingsDialog::setNewValue ( const QString& option, if ( !res ) { QString textMessage= - tr ( "This value is in conflict with other option" ); + tr ( "This value is in conflict with another option." ); QString txt; m_cups->getOptionText ( confOpt,txt ); QString val,valt; @@ -279,7 +279,7 @@ bool CUPSPrinterSettingsDialog::setNewValue ( const QString& option, textMessage+="\n("+txt+" : "+valt+")"; } - QMessageBox::critical ( this,tr ( "Options conflict" ), + QMessageBox::critical ( this,tr ( "Options conflict." ), textMessage ); } return res; diff --git a/src/exportdialog.cpp b/src/exportdialog.cpp index c205e5c..6d4495c 100644 --- a/src/exportdialog.cpp +++ b/src/exportdialog.cpp @@ -77,7 +77,7 @@ ExportDialog::ExportDialog ( QString sid,QWidget * par, Qt::WFlags f ) fr->setLineWidth ( 2 ); setSizeGripEnabled ( true ); - setWindowTitle ( tr ( "share folders" ) ); + setWindowTitle ( tr ( "Share Folders" ) ); connect ( sessions,SIGNAL ( clicked ( const QModelIndex& ) ), this,SLOT ( slot_activated ( const QModelIndex& ) ) ); connect ( sessions,SIGNAL ( doubleClicked ( const QModelIndex& ) ), diff --git a/src/folderexplorer.cpp b/src/folderexplorer.cpp index 8694d77..a358414 100644 --- a/src/folderexplorer.cpp +++ b/src/folderexplorer.cpp @@ -78,9 +78,9 @@ void FolderExplorer::slotContextMenu(QPoint p) if(menuItem!=root) { - connect(menu.addAction(tr("Rename Folder...")), SIGNAL(triggered(bool)), this, SLOT(slotChangeName())); - connect(menu.addAction(tr("Change Icon...")), SIGNAL(triggered(bool)), this, SLOT(slotChangeIcon())); - connect(menu.addAction(tr("Delete Folder...")), SIGNAL(triggered(bool)), this, SLOT(slotDeleteFolder())); + connect(menu.addAction(tr("Rename Folder ...")), SIGNAL(triggered(bool)), this, SLOT(slotChangeName())); + connect(menu.addAction(tr("Change Icon ...")), SIGNAL(triggered(bool)), this, SLOT(slotChangeIcon())); + connect(menu.addAction(tr("Delete Folder ...")), SIGNAL(triggered(bool)), this, SLOT(slotDeleteFolder())); } menu.exec(treeWidget->viewport()->mapToGlobal(p)); } @@ -128,7 +128,7 @@ void FolderExplorer::slotDeleteFolder() if(!explorer->isFolderEmpty(menuItem->data(0, Qt::UserRole).toString())) { QMessageBox::critical(this, tr("Error"), tr("Unable to remove \"")+menuItem->text(0)+ - tr("\". Folder is not empty. Please remove content of folder and try again.")); + tr("\". Folder is not empty. Please remove the contents of this directory and try again.")); return; } if(QMessageBox::question(this, "X2Go Client", tr("Delete folder \"")+menuItem->text(0)+"\"?",QMessageBox::Ok|QMessageBox::Cancel) == QMessageBox::Ok) diff --git a/src/httpbrokerclient.cpp b/src/httpbrokerclient.cpp index b25ffb1..4f40191 100644 --- a/src/httpbrokerclient.cpp +++ b/src/httpbrokerclient.cpp @@ -126,7 +126,7 @@ void HttpBrokerClient::slotSshServerAuthError(int error, QString sshMessage, Ssh { case SSH_SERVER_KNOWN_CHANGED: errMsg=tr ( "Host key for server changed.\nIt is now: " ) +sshMessage+"\n"+ - tr ( "For security reasons, connection will be stopped" ); + tr ( "For security reasons, the connection attempt will be aborted." ); connection->writeKnownHosts(false); connection->wait(); if(sshConnection && sshConnection !=connection) @@ -139,9 +139,9 @@ void HttpBrokerClient::slotSshServerAuthError(int error, QString sshMessage, Ssh return; case SSH_SERVER_FOUND_OTHER: - errMsg=tr ( "The host key for this server was not found but an other" - "type of key exists.An attacker might change the default server key to" - "confuse your client into thinking the key does not exist" ); + errMsg=tr ( "The host key for this server was not found but another" + "type of key exists. An attacker might have changed the default server key to " + "trick your client into thinking the key does not exist yet." ); connection->writeKnownHosts(false); connection->wait(); if(sshConnection && sshConnection !=connection) @@ -174,7 +174,7 @@ void HttpBrokerClient::slotSshServerAuthError(int error, QString sshMessage, Ssh break; } - if ( QMessageBox::warning ( 0, tr ( "Host key verification failed" ),errMsg,tr ( "Yes" ), tr ( "No" ) ) !=0 ) + if ( QMessageBox::warning ( 0, tr ( "Host key verification failed." ),errMsg,tr ( "Yes" ), tr ( "No" ) ) !=0 ) { connection->writeKnownHosts(false); connection->wait(); @@ -184,7 +184,7 @@ void HttpBrokerClient::slotSshServerAuthError(int error, QString sshMessage, Ssh delete sshConnection; } sshConnection=0; - slotSshUserAuthError ( tr ( "Host key verification failed" ) ); + slotSshUserAuthError ( tr ( "Host key verification failed." ) ); return; } connection->writeKnownHosts(true); @@ -232,7 +232,7 @@ void HttpBrokerClient::slotSshUserAuthError(QString error) sshConnection=0l; } - QMessageBox::critical ( 0l,tr ( "Authentication failed" ),error, + QMessageBox::critical ( 0l,tr ( "Authentication failed." ),error, QMessageBox::Ok, QMessageBox::NoButton ); emit authFailed(); @@ -246,7 +246,7 @@ void HttpBrokerClient::getUserSessions() if (config->brokerAutologoff) { nextAuthId=config->brokerUserId; } - x2goDebug<<"called getUserSessions: brokeruser: "<<brokerUser<<" authid: "<<nextAuthId; + x2goDebug<<"Called getUserSessions: brokeruser: "<<brokerUser<<" authid: "<<nextAuthId; if(mainWindow->getUsePGPCard()) brokerUser=mainWindow->getCardLogin(); config->sessiondata=QString::null; @@ -297,7 +297,7 @@ void HttpBrokerClient::selectUserSession(const QString& session) "user="<<QUrl::toPercentEncoding(brokerUser)<<"&"<< "password="<<QUrl::toPercentEncoding(config->brokerPass)<<"&"<< "authid="<<nextAuthId; - x2goDebug << "sending request: "<< req.toUtf8(); + x2goDebug << "Sending request: "<< req.toUtf8(); QNetworkRequest request(QUrl(config->brokerurl)); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); selSessRequest=http->post (request, req.toUtf8() ); @@ -332,7 +332,7 @@ void HttpBrokerClient::changePassword(QString newPass) "user="<<QUrl::toPercentEncoding(brokerUser)<<"&"<< "password="<<QUrl::toPercentEncoding(config->brokerPass)<<"&"<< "authid="<<nextAuthId; - x2goDebug << "sending request: "<< req.toUtf8(); + x2goDebug << "Sending request: "<< req.toUtf8(); QNetworkRequest request(QUrl(config->brokerurl)); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); chPassRequest=http->post (request, req.toUtf8() ); @@ -351,13 +351,13 @@ void HttpBrokerClient::changePassword(QString newPass) void HttpBrokerClient::testConnection() { - x2goDebug<<"called testConnection"; + x2goDebug<<"Called testConnection."; if(!sshBroker) { QString req; QTextStream ( &req ) << "task=testcon"; - x2goDebug << "sending request: "<< req.toUtf8(); + x2goDebug << "Sending request: "<< req.toUtf8(); QNetworkRequest request(QUrl(config->brokerurl)); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); testConRequest=http->post (request, req.toUtf8() ); @@ -380,7 +380,7 @@ void HttpBrokerClient::createIniFile(const QString& raw_content) QString content; content = raw_content; content.replace("<br>","\n"); - x2goDebug<<"inifile content: "<<content<<"\n"; + x2goDebug<<"Inifile content: "<<content<<endl; QString cont; QStringList lines=content.split("START_USER_SESSIONS\n"); if (lines.count()>1) @@ -394,13 +394,13 @@ void HttpBrokerClient::createIniFile(const QString& raw_content) bool HttpBrokerClient::checkAccess(QString answer ) { - x2goDebug<<"called checkAccess - answer was: "<<answer; + x2goDebug<<"Called checkAccess - answer was: "<<answer; if (answer.indexOf("Access granted")==-1) { QMessageBox::critical ( 0,tr ( "Error" ), tr ( "Login failed!<br>" - "Please try again" ) ); + "Please try again." ) ); emit authFailed(); return false; } @@ -416,7 +416,7 @@ bool HttpBrokerClient::checkAccess(QString answer ) void HttpBrokerClient::slotConnectionTest(bool success, QString answer, int) { - x2goDebug<<"called slotConnectionTest"; + x2goDebug<<"Called slotConnectionTest."; if(!success) { x2goDebug<<answer; @@ -428,7 +428,7 @@ void HttpBrokerClient::slotConnectionTest(bool success, QString answer, int) return; if(!sshBroker) { - x2goDebug<<"elapsed: "<<requestTime.elapsed()<<"received:"<<answer.size()<<endl; + x2goDebug<<"Elapsed: "<<requestTime.elapsed()<<"; received:"<<answer.size()<<endl; emit connectionTime(requestTime.elapsed(),answer.size()); } return; @@ -491,7 +491,7 @@ void HttpBrokerClient::slotRequestFinished ( QNetworkReply* reply ) } QString answer ( reply->readAll() ); - x2goDebug<<"A http request returned. Result was: "<<answer; + x2goDebug<<"A http request returned. Result was: "<<answer; if (reply == testConRequest) { slotConnectionTest(true,answer,0); @@ -516,7 +516,7 @@ void HttpBrokerClient::slotRequestFinished ( QNetworkReply* reply ) void HttpBrokerClient::parseSession(QString sinfo) { - x2goDebug<<"starting parser\n"; + x2goDebug<<"Starting parser."; QStringList lst=sinfo.split("SERVER:",QString::SkipEmptyParts); int keyStartPos=sinfo.indexOf("-----BEGIN DSA PRIVATE KEY-----"); if(keyStartPos==-1) @@ -535,15 +535,15 @@ void HttpBrokerClient::parseSession(QString sinfo) config->serverIp=words[0]; if (words.count()>1) config->sshport=words[1]; - x2goDebug<<"server IP: "<<config->serverIp<<"\n"; - x2goDebug<<"server port: "<<config->sshport<<"\n"; + x2goDebug<<"Server IP address: "<<config->serverIp; + x2goDebug<<"Server port: "<<config->sshport; if (sinfo.indexOf("SESSION_INFO")!=-1) { QStringList lst=sinfo.split("SESSION_INFO:",QString::SkipEmptyParts); config->sessiondata=lst[1]; - x2goDebug<<"session data: "<<config->sessiondata<<"\n"; + x2goDebug<<"Session data: "<<config->sessiondata<<"\n"; } - x2goDebug<<"parsing has finished\n"; + x2goDebug<<"Parsing has finished."; emit sessionSelected(); } @@ -589,7 +589,7 @@ void HttpBrokerClient::slotSslErrors ( QNetworkReply* netReply, const QList<QSsl "if you are using an internet connection " "that you do not trust completely or if you are " "not used to seeing a warning for this server.</p>" ); - QMessageBox mb ( QMessageBox::Warning,tr ( "Secure connection failed" ), + QMessageBox mb ( QMessageBox::Warning,tr ( "Secure connection failed." ), text ); text=QString::null; QTextStream ( &text ) <<err.join ( "\n" ) <<"\n"<< @@ -638,7 +638,7 @@ void HttpBrokerClient::slotSslErrors ( QNetworkReply* netReply, const QList<QSsl mb.exec(); if ( mb.clickedButton() == ( QAbstractButton* ) okButton ) { - x2goDebug<<"accept certificate"; + x2goDebug<<"User accepted certificate."; QDir dr; dr.mkpath ( homeDir+"/.x2go/ssl/exceptions/"+lurl.host() +"/" ); QFile fl ( homeDir+"/.x2go/ssl/exceptions/"+ @@ -647,7 +647,7 @@ void HttpBrokerClient::slotSslErrors ( QNetworkReply* netReply, const QList<QSsl QTextStream ( &fl ) <<cert.toPem(); fl.close(); netReply->ignoreSslErrors(); - x2goDebug<<"store certificate in "<<homeDir+"/.x2go/ssl/exceptions/"+ + x2goDebug<<"Storing certificate in "<<homeDir+"/.x2go/ssl/exceptions/"+ lurl.host() +"/"+fname; requestTime.restart(); } diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index db51edc..eba9a3a 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -58,7 +58,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_LINUX image=shape=0; #endif - x2goInfof(1) << tr("Starting x2goclient..."); + x2goInfof(1) << tr("Starting X2Go Client..."); debugging = false; setFocusPolicy ( Qt::NoFocus ); @@ -259,7 +259,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) homeDir=portableDataPath; - x2goInfof(2)<<tr("Starting x2goclient in portable mode... data directory is: ")<<portableDataPath; + x2goInfof(2)<<tr("Starting X2Go Client in portable mode. Data directory is: ")<<portableDataPath; QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(slotCheckPortableDir())); timer->start(1000); @@ -492,11 +492,11 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) connect( xineramaTimer, SIGNAL(timeout()), this, SLOT(slotConfigXinerama())); - x2goInfof(3)<<tr("Started x2goclient."); + x2goInfof(3)<<tr("Started X2Go Client."); x2goDebug<<"$HOME=" + homeDir.toAscii(); if (thinMode) { - x2goDebug<<"ThinMode is active."; + x2goDebug<<"Thin Mode is active."; showMaximized(); activateWindow(); raise(); @@ -506,10 +506,10 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) ONMainWindow::~ONMainWindow() { - x2goDebug<<"Destroying x2goclient..."; + x2goDebug<<"Destroying X2Go Client's main window."; if ( !closeEventSent ) closeClient(); - x2goDebug<<"Destroyed x2goclient."; + x2goDebug<<"Finished destructor hooks for X2Go Client's main window."; } void ONMainWindow::slotShutdownThinClient() @@ -585,7 +585,7 @@ bool ONMainWindow::get_translator (QString file_name_start, QTranslator **transl for (QStringList::const_iterator it = ui_languages.constBegin (); it != ui_languages.constEnd (); ++it) { /* Respect English locales. Don't try to load any translation, because we do not ship nop-English translations. */ if ((*it).startsWith ("en")) { - x2goWarningf (1) << tr ("English language requested, not loading translator"); + x2goWarningf (1) << tr ("English language requested, not loading translator."); break; } else { @@ -858,7 +858,7 @@ void ONMainWindow::initWidgetsNormal() setWindowIcon ( QIcon ( ":/img/icons/128x128/x2go.png" ) ); act_edit=new QAction ( QIcon ( iconsPath ( "/32x32/edit.png" ) ), - tr ( "Session management..." ),this ); + tr ( "Session management ..." ),this ); act_edit->setShortcut ( tr ( "Ctrl+E" ) ); if (noSessionEdit) @@ -869,7 +869,7 @@ void ONMainWindow::initWidgetsNormal() act_sessicon=new QAction ( QIcon ( iconsPath ( "/32x32/create_file.png" ) ), - tr ( "&Create session icon on desktop..." ), + tr ( "&Create session icon on desktop ..." ), this ); if (brokerMode) act_sessicon->setEnabled(false); @@ -878,7 +878,7 @@ void ONMainWindow::initWidgetsNormal() { act_changeBrokerPass=new QAction ( QIcon ( iconsPath ( "/32x32/auth.png" ) ), - tr ( "&Set broker password..." ), + tr ( "&Set broker password ..." ), this ); connect ( act_changeBrokerPass,SIGNAL ( triggered(bool)),this, SLOT ( slotChangeBrokerPass()) ); @@ -889,7 +889,7 @@ void ONMainWindow::initWidgetsNormal() { act_testCon=new QAction ( QIcon ( iconsPath ( "/32x32/contest.png" ) ), - tr ( "&Connectivity test..." ), + tr ( "&Connectivity test ..." ), this ); connect ( act_testCon,SIGNAL ( triggered(bool)),this, SLOT ( slotTestConnection()) ); @@ -1047,7 +1047,7 @@ void ONMainWindow::slotCheckPortableDir() { if (!QFile::exists(homeDir)) { - x2goDebug<<"Portable directory does not exists, closing."; + x2goDebug<<"Portable directory does not exist, closing."; close(); } } @@ -1163,7 +1163,7 @@ void ONMainWindow::trayIconInit() if (!hideFolderSharing) - trayIconActiveConnectionMenu->addAction(tr ("Share folder..." ),this, SLOT(slotExportDirectory())); + trayIconActiveConnectionMenu->addAction(tr ("Share folder ..." ),this, SLOT(slotExportDirectory())); trayIconActiveConnectionMenu->addAction(tr("Suspend"),this, SLOT(slotSuspendSessFromSt())); trayIconActiveConnectionMenu->addAction(tr("Terminate"),this, SLOT(slotTermSessFromSt())); connect (trayIconActiveConnectionMenu, SIGNAL(triggered(QAction*)), this, @@ -1193,7 +1193,7 @@ void ONMainWindow::trayIconInit() trayIcon->setContextMenu(trayIconMenu); trayIcon->setIcon(QIcon ( ":/img/icons/128x128/x2go.png") ); - trayIcon->setToolTip(tr("Left mouse button to hide/restore - Right mouse button to display context menu")); + trayIcon->setToolTip(tr("A left click hides or restores the window. A right click displays the context menu.")); } if (!startHidden | forceToShowTrayicon) @@ -1379,13 +1379,13 @@ void ONMainWindow::slotResize ( const QSize sz ) void ONMainWindow::closeClient() { - x2goInfof(6)<<tr("Closing x2goclient..."); + x2goInfof(6)<<tr("Closing X2Go Client ..."); if(trayIcon) trayIcon->hide(); closeEventSent=true; if ( !startMaximized && !startHidden && !embedMode ) { - x2goDebug<<"Saving settings..."; + x2goDebug<<"Saving settings ..."; X2goSettings st ( "sizes" ); st.setting()->setValue ( "mainwindow/size", @@ -1394,7 +1394,7 @@ void ONMainWindow::closeClient() st.setting()->setValue ( "mainwindow/maximized", QVariant ( isMaximized() ) ); st.setting()->sync(); - x2goDebug<<"Saved settings."; + x2goDebug<<"Saved settings."; #ifdef Q_OS_LINUX if (image) XFreePixmap(QX11Info::display(),image); @@ -1406,19 +1406,19 @@ void ONMainWindow::closeClient() { if ( nxproxy->state() ==QProcess::Running ) { - x2goDebug<<"Terminating proxy..."; + x2goDebug<<"Terminating proxy ..."; nxproxy->terminate(); - x2goDebug<<"Terminated proxy."; + x2goDebug<<"Terminated proxy."; } - x2goDebug<<"Deleting proxy..."; + x2goDebug<<"Deleting proxy ..."; delete nxproxy; - x2goDebug<<"Deleted proxy."; + x2goDebug<<"Deleted proxy."; } if ( sshConnection && !useLdap) { - x2goDebug<<"Waiting for the SSH connection to finish..."; + x2goDebug<<"Waiting for the SSH connection to finish ..."; delete sshConnection; - x2goDebug<<"Waited for the SSH connection to finish."; + x2goDebug<<"SSH connection finished."; sshConnection=0; } if (useLdap) @@ -1427,26 +1427,26 @@ void ONMainWindow::closeClient() { if (serverSshConnections[i]) { - x2goDebug<<"Waiting for the SSH connection to finish..."; + x2goDebug<<"Waiting for the SSH connection to finish ..."; delete serverSshConnections[i]; - x2goDebug<<"Waited for the SSH connection to finish."; + x2goDebug<<"SSH connection finished."; } } } if ( soundServer ) { - x2goDebug<<"Deleting the sound server..."; + x2goDebug<<"Deleting the sound server ..."; delete soundServer; - x2goDebug<<"Deleted the sound server."; + x2goDebug<<"Deleted the sound server."; } if ( gpgAgent!=0l ) { if ( gpgAgent->state() ==QProcess::Running ) { - x2goDebug<<"Terminating gpg-agent..."; + x2goDebug<<"Terminating GPG Agent ..."; gpgAgent->terminate(); - x2goDebug<<"Terminated gpg-agent."; + x2goDebug<<"Terminated GPG Agent."; } } @@ -1464,15 +1464,15 @@ void ONMainWindow::closeClient() #ifdef Q_OS_WIN if ( pulseServer && pulseStarted ) { - x2goDebug<<"Deleting the pulse timer..."; + x2goDebug<<"Deleting the pulse timer ..."; delete pulseTimer; - x2goDebug<<"Deleted the pulse timer."; - x2goDebug<<"Killing the pulse sound server..."; + x2goDebug<<"Deleted the pulse timer."; + x2goDebug<<"Killing the PulseAudio sound server ..."; pulseServer->kill(); - x2goDebug<<"Killed the pulse sound server."; - x2goDebug<<"Deleting the pulse process..."; + x2goDebug<<"Killed the PulseAudio sound server."; + x2goDebug<<"Deleting the PulseAudio process ..."; delete pulseServer; - x2goDebug<<"Deleted the pulse process."; + x2goDebug<<"Deleted the PulseAudio process."; QDir dr ( homeDir ); dr.remove ( pulseDir+"/config.pa" ); @@ -1482,12 +1482,12 @@ void ONMainWindow::closeClient() } if ( xorg ) { - x2goDebug<<"Terminating xorg..."; + x2goDebug<<"Terminating the X.Org Server ..."; xorg->terminate(); - x2goDebug<<"Terminated xorg."; - x2goDebug<<"Deleting xorg..."; + x2goDebug<<"Terminated the X.Org Server."; + x2goDebug<<"Deleting the X.Org Server ..."; delete xorg; - x2goDebug<<"Deleted xorg."; + x2goDebug<<"Deleted the X.Org Server."; } if ( winSshdStarted ) @@ -1499,9 +1499,9 @@ void ONMainWindow::closeClient() #else if ( userSshd && sshd ) { - x2goDebug<<"Terminating sshd..."; + x2goDebug<<"Terminating the OpenSSH server ..."; sshd->terminate(); - x2goDebug<<"Terminated sshd."; + x2goDebug<<"Terminated the OpenSSH server."; delete sshd; } @@ -1527,7 +1527,7 @@ void ONMainWindow::closeClient() } SshMasterConnection::finalizeLibSsh(); - x2goInfof(7)<<tr("Closed x2goclient."); + x2goInfof(7)<<tr("Finished X2Go Client closing hooks."); } void ONMainWindow::closeEvent ( QCloseEvent* event ) @@ -1556,7 +1556,7 @@ void ONMainWindow::hideEvent(QHideEvent* event) void ONMainWindow::trayQuit() { - x2goDebug<<"Quitting tray icon and closing application."<<endl; + x2goDebug<<"Quitting from tray icon and closing application."<<endl; closeClient(); qApp->quit(); @@ -1751,7 +1751,7 @@ void ONMainWindow::slotClosePass() { if (!config.brokerAuthenticated) { - x2goErrorf(15)<<tr("Broker authenication failed!"); + x2goErrorf(15)<<tr("Broker authentication failed!"); close(); } } @@ -1825,7 +1825,7 @@ void ONMainWindow::slotPassEnter() } catch ( LDAPExeption e ) { - QString message="Exeption in: "; + QString message="Exception in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); QMessageBox::critical ( 0l,tr ( "Error" ),message, @@ -1835,7 +1835,7 @@ void ONMainWindow::slotPassEnter() } if ( res.size() ==0 ) { - QString message=tr ( "no X2Go server found in LDAP " ); + QString message=tr ( "no X2Go Server found in LDAP " ); QMessageBox::critical ( 0l,tr ( "Error" ),message, QMessageBox::Ok,QMessageBox::NoButton ); slotConfig(); @@ -1862,7 +1862,7 @@ void ONMainWindow::slotPassEnter() sPort=sL.front().c_str(); } - x2goDebug<<"SSH-Server("<<server.name<<") port: "<<sPort; + x2goDebug<<"SSH server: "<<server.name<<"; port: "<<sPort; QString sFactor="1"; list<string> serialNumber=LDAPSession::getStringAttrValues ( @@ -1872,7 +1872,7 @@ void ONMainWindow::slotPassEnter() sFactor=serialNumber.front().c_str(); } - x2goDebug<<"SSH-Server("<<server.name<<") factor: "<<sFactor; + x2goDebug<<"SSH server: "<<server.name<<"; factor: "<<sFactor; server.factor=sFactor.toFloat(); server.sess=0; @@ -2008,7 +2008,7 @@ void ONMainWindow::readUsers() } catch ( LDAPExeption e ) { - QString message="Exeption in: "; + QString message="Exception in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); QMessageBox::critical ( 0l,tr ( "Error" ), @@ -2184,7 +2184,7 @@ void ONMainWindow::slotReadSessions() if(!startHidden) QMessageBox::critical(this,tr("Error"),error); else - x2goErrorf(1)<<error; // tr("No X2Go sessions not found, closing."); + x2goErrorf(1)<<error; close(); return; } @@ -2310,7 +2310,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) { #ifdef USELDAP - x2goDebug<<"Initializing LDAP sessions..."; + x2goDebug<<"Initializing LDAP sessions ..."; try { @@ -2319,7 +2319,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) } catch ( LDAPExeption e ) { - QString message="Exeption0 in: "; + QString message="Exception0 in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); @@ -2335,7 +2335,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) } catch ( LDAPExeption e ) { - QString message="Exeption1 in: "; + QString message="Exception1 in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); @@ -2353,7 +2353,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) catch ( LDAPExeption e ) { QString message= - "Exeption2 in: "; + "Exception2 in: "; message=message+ e.err_type.c_str(); message=message+" : "+ @@ -2423,7 +2423,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) } catch ( LDAPExeption e ) { - QString message="Exeption in: "; + QString message="Exception in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); QMessageBox::critical ( 0l,tr ( "Error" ),message, @@ -2468,7 +2468,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) } catch ( LDAPExeption e ) { - QString message="Exeption in: "; + QString message="Exception in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); QMessageBox::critical ( 0l,tr ( "Error" ),message, @@ -2520,7 +2520,7 @@ bool ONMainWindow::initLdapSession ( bool showError ) } } #endif - x2goDebug<<"Initialized LDAP sessions."; + x2goDebug<<"Initialized LDAP sessions."; return true; } @@ -2654,7 +2654,7 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session ) selectedCommand=command.split("/").last(); command=transAppName ( command ); login->setText ( userName ); - x2goDebug << "creating QPixmap with session icon: '" << sessIcon << "'."; + x2goDebug << "Creating QPixmap with session icon: '" << sessIcon << "'."; QPixmap pix ( sessIcon ); if ( !miniMode ) { @@ -2721,7 +2721,7 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session ) } else if ( cardReady || autologin || krblogin ) { - x2goDebug<<"Starting session via smartcard, ssh-agent or kerberos token."; + x2goDebug<<"Starting session via Smart Card, SSH Agent or Kerberos token."; nopass=true; if ( cardReady ) login->setText ( cardLogin ); @@ -2755,7 +2755,7 @@ SshMasterConnection* ONMainWindow::startSshConnection ( QString host, QString po x2goInfof(8)<<tr("Starting connection to server: ") + host + ":" + port; SshMasterConnection* con; - x2goDebug<<"Start new ssh connection to server:"<<host<<":"<<port<<" krbLogin: "<<krbLogin; + x2goDebug<<"Starting new ssh connection to server:"<<host<<":"<<port<<" krbLogin: "<<krbLogin; for ( int i=0; i<sshEnv.size(); ++i ) { @@ -2806,7 +2806,7 @@ SshMasterConnection* ONMainWindow::startSshConnection ( QString host, QString po void ONMainWindow::slotSshConnectionError ( QString message, QString lastSessionError ) { - x2goErrorf(2)<< tr("Connection Error(") + message + "): " + lastSessionError; + x2goErrorf(2)<< tr("Connection error: ") + message + ": " + lastSessionError; if ( sshConnection ) { sshConnection->wait(); @@ -2863,7 +2863,7 @@ void ONMainWindow::slotSshConnectionOk() SshMasterConnection* ONMainWindow::findServerSshConnection(QString host) { - x2goDebug<<"Searching for SSH connections..."; + x2goDebug<<"Searching for SSH connections ..."; for (int i=0; i<serverSshConnections.count(); ++i) { if (serverSshConnections[i]) @@ -2875,7 +2875,7 @@ SshMasterConnection* ONMainWindow::findServerSshConnection(QString host) } } } - x2goWarningf(3)<< tr("Couldn't find a SSH connection."); + x2goWarningf(3)<< tr("Couldn't find an SSH connection."); return 0l; } @@ -2884,7 +2884,7 @@ void ONMainWindow::slotServSshConnectionOk(QString server) SshMasterConnection* con=findServerSshConnection(server); if (!con) return; - x2goDebug<<"Getting sessions on Host: " + server; + x2goDebug<<"Getting sessions on host: " + server; con->executeCommand( "export HOSTNAME && x2golistsessions", this, SLOT (slotListAllSessions ( bool,QString,int ) )); } @@ -2937,9 +2937,9 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa errMsg=tr ( "Host key for server changed.\nIt is now: " ) +sshMessage+"\n"+ tr ( "This can be an indication of a man-in-the-middle attack.\n" "Somebody might be eavesdropping on you.\n" - "For security reasons, it is recommended to stop the connection.\n" + "For security reasons, it is recommended to stop the connection attempt.\n" "Do you want to terminate the connection?\n" ); - if (QMessageBox::warning (0, tr ("Host key verification failed"), + if (QMessageBox::warning (0, tr ("Host key verification failed."), errMsg, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { @@ -2950,7 +2950,7 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa sshConnection->wait(); delete sshConnection; } - slotSshUserAuthError ( tr ( "Host key verification failed" ) ); + slotSshUserAuthError ( tr ( "Host key verification failed." ) ); sshConnection=0; return; } @@ -2962,12 +2962,12 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa } break; case SSH_SERVER_FOUND_OTHER: - errMsg=tr ( "The host key for this server was not found but an other" - "type of key exists. An attacker might change the default server key to " - "confuse your client into thinking the key does not exist. \n" - "For security reasons, it is recommended to stop the connection.\n" + errMsg=tr ( "The host key for this server was not found but another" + "type of key exists. An attacker might have changed the default server key to " + "trick your client into thinking the key does not exist yet.\n" + "For security reasons, it is recommended to stop the connection attempt.\n" "Do you want to terminate the connection?\n"); - if (QMessageBox::warning (0, tr ("Host key verification failed"), + if (QMessageBox::warning (0, tr ("Host key verification failed."), errMsg, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { @@ -2978,7 +2978,7 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa sshConnection->wait(); delete sshConnection; } - slotSshUserAuthError ( tr ( "Host key verification failed" ) ); + slotSshUserAuthError ( tr ( "Host key verification failed." ) ); sshConnection=0; return; } @@ -3010,7 +3010,7 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa break; } - if (QMessageBox::warning (this, tr ("Host key verification failed"), + if (QMessageBox::warning (this, tr ("Host key verification failed."), errMsg, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { @@ -3022,7 +3022,7 @@ void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMa delete sshConnection; } sshConnection=0; - slotSshUserAuthError ( tr ( "Host key verification failed" ) ); + slotSshUserAuthError ( tr ( "Host key verification failed." ) ); return; } connection->writeKnownHosts(true); @@ -3054,7 +3054,7 @@ void ONMainWindow::slotSshUserAuthError ( QString error ) trayQuit(); } - QMessageBox::critical (0l, tr ("Authentication failed"), + QMessageBox::critical (0l, tr ("Authentication failed."), error, QMessageBox::Ok, QMessageBox::NoButton); setEnabled ( true ); @@ -3117,7 +3117,7 @@ void ONMainWindow::slotSessEnter() void ONMainWindow::continueNormalSession() { - x2goDebug<<"Continue normal x2go session"; + x2goDebug<<"Continue normal X2Go session"; if (brokerMode && !shadowSession) { @@ -3460,7 +3460,7 @@ void ONMainWindow::slotListSessions ( bool result,QString output, { cardReady=false; cardStarted=false; - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -3512,7 +3512,7 @@ void ONMainWindow::slotListSessions ( bool result,QString output, else { x2goSession s=getSessionFromString (config.sessiondata); - x2goDebug<<"Resuming managed session with Id: " + s.sessionId; + x2goDebug<<"Resuming managed session with ID: " + s.sessionId; resumeSession ( s ); } return; @@ -3670,7 +3670,7 @@ void ONMainWindow::startNewSession() if ( host==QString::null ) { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "No server available" ), + tr ( "No server available." ), QMessageBox::Ok, QMessageBox::NoButton ); return; @@ -3679,7 +3679,7 @@ void ONMainWindow::startNewSession() if (!sshConnection) { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "Server not available" ), + tr ( "Server not available." ), QMessageBox::Ok, QMessageBox::NoButton ); return; @@ -4028,7 +4028,7 @@ void ONMainWindow::resumeSession ( const x2goSession& s ) if (!sshConnection) { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "Server not availabel" ), + tr ( "Server not available." ), QMessageBox::Ok, QMessageBox::NoButton ); return; @@ -4239,8 +4239,12 @@ void ONMainWindow::resumeSession ( const x2goSession& s ) * @brief ONMainWindow::setTrayIconToSessionIcon * @param info: message to be displayed in tray icon message * - * set the tray session icon picture as tray icon picture and show a tray icon information message about something is doing - * this message avoid the users think nothing is happend for some seconds while x2go session window is showed + * Sets the tray session icon picture as the tray icon picture and + * shows a tray icon information message about what X2Go Client + * is currently doing. + * + * This message gives the user some feedback while the X2Go session + * window is displayed. * */ void ONMainWindow::setTrayIconToSessionIcon(QString info) { @@ -4305,7 +4309,7 @@ void ONMainWindow::selectSession ( QStringList& sessions ) QFontMetrics fm ( sessTv->font() ); for ( int row = 0; row < sessions.size(); ++row ) { - x2goDebug<<"Decoding Sessionstring:" + sessions[row]; + x2goDebug<<"Decoding session string:" + sessions[row]; x2goSession s=getSessionFromString ( sessions[row] ); selectedSessions.append ( s ); @@ -4362,7 +4366,7 @@ void ONMainWindow::selectSession ( QStringList& sessions ) { QMessageBox::information ( this,tr ( "Information" ), tr ( "No accessible desktop " - "found" ) ); + "found." ) ); slotCloseSelectDlg(); return; } @@ -4491,19 +4495,18 @@ void ONMainWindow::slotResumeSess() { res=QMessageBox::warning ( 0l,tr ( "Warning" ), - tr ( - "Your current color depth is " - "different to the color depth of your " - "x2go-session. This may cause problems " - "reconnecting to this session and in most " - "cases <b>you will loose the session</b> " - "and have to start a new one! It's highly " - "recommended to change the color depth of " - "your Display to " ) +tr ( "24 or 32" ) + - tr ( - " bit and restart your X-server before you " - "reconnect to this x2go-session.<br>Resume " - "this session anyway?" ),tr ( "Yes" ), + tr ("Your current color depth is different from " + "the session's color depth. This may cause " + "problems reconnecting to this session and " + "in most cases <b>you will loose the " + "session</b> and have to start a new one! " + "It's highly recommended to change the color " + "depth of your display to " ) + + tr ( "24 or 32" ) + + tr (" bits and restart your X.Org Server before you " + "reconnect to this X2Go session.<br />" + "Do you want to resume this session anyway?" ), + tr ( "Yes" ), tr ( "No" ) ); } @@ -4511,19 +4514,18 @@ void ONMainWindow::slotResumeSess() { res=QMessageBox::warning ( 0l,tr ( "Warning" ), - tr ( - "Your current color depth is different to " - "the color depth of your x2go-session. " - "This may cause problems reconnecting to " - "this session and in most cases <b>you " - "will loose the session</b> and have to " - "start a new one! It's highly recommended " - "to change the color depth of your " - "Display to " ) +depth+ - tr ( - " bit and restart your X-server before you " - "reconnect to this x2go-session.<br>Resume " - "this session anyway?" ),tr ( "Yes" ), + tr ("Your current color depth is different from " + "the session's color depth. This may cause " + "problems reconnecting to this session and " + "in most cases <b>you will loose the " + "session</b> and have to start a new one! " + "It's highly recommended to change the color " + "depth of your display to " ) + + depth + + tr (" bits and restart your X.Org Server before you " + "reconnect to this X2Go session.<br />" + "Do you want to resume this session anyway?" ), + tr ( "Yes" ), tr ( "No" ) ); } if ( res==0 ) @@ -4582,7 +4584,7 @@ void ONMainWindow::slotSuspendSess() if (!sshConnection) { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "Server not availabel" ), + tr ( "Server not available." ), QMessageBox::Ok, QMessageBox::NoButton ); return; @@ -4655,7 +4657,7 @@ void ONMainWindow::slotRetSuspSess ( bool result, QString output, { if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( @@ -4727,7 +4729,7 @@ void ONMainWindow::slotTermSess() if (!sshConnection) { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "Server not availabel" ), + tr ( "Server not available." ), QMessageBox::Ok, QMessageBox::NoButton ); return; @@ -4749,7 +4751,7 @@ void ONMainWindow::slotRetTermSess ( bool result, QString output, { if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( @@ -4782,7 +4784,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( @@ -4797,7 +4799,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, } if ( output.indexOf ( "ACCESS DENIED" ) !=-1 ) { - message="Access denied from user"; + message="Access denied for user"; } QMessageBox::critical ( 0l,tr ( "Error" ), @@ -5456,7 +5458,7 @@ void ONMainWindow::slotSndTunnelFailed ( bool result, QString output, { if ( !managedMode ) { - QString message=tr ( "Unable to create SSH Tunnel for audio data:\n" ) + QString message=tr ( "Unable to create SSH tunnel for audio data:\n" ) +output; QMessageBox::warning ( 0l,tr ( "Warning" ),message, QMessageBox::Ok, @@ -5608,7 +5610,7 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus ) x2goWarningf(5)<< tr( "Waiting for proxy to exit." ); if ( !nxproxy->waitForFinished ( 3000 ) ) { - x2goWarningf(6)<< tr( "Failed, killing the proxy." ); + x2goWarningf(6)<< tr( "Proxy didn't terminate after 3 seconds. Killing the proxy." ); nxproxy->kill(); } } @@ -5646,16 +5648,16 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus ) { x2goDebug<<"Deleting SSH connection instance."; delete sshConnection; - x2goDebug<<"Deleted SSH connection instance." ; + x2goDebug<<"Deleted SSH connection instance." ; sshConnection=0; if (startHidden) { - x2goInfof(9) << tr("Closing X2Go Client (because it was started in hidden mode)."); + x2goInfof(9) << tr("Closing X2Go Client because it was started in hidden mode."); close(); } else if (closeDisconnect) { - x2goInfof(10) << tr("Closing X2Go Client (because --close-disconnect was used on the cmdline)."); + x2goInfof(10) << tr("Closing X2Go Client because the --close-disconnect parameter was passed."); close(); } } @@ -5680,7 +5682,7 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus ) } else if ( brokerMode && config.brokerAutologoff ) { - x2goDebug<<"Logging off from broker as requested via cmdline."; + x2goDebug<<"Logging off from broker as requested via command line."; QTimer::singleShot(1, this,SLOT(slotGetBrokerAuth())); } else if ( !embedMode ) @@ -5696,7 +5698,7 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus ) sessionStatusDlg->hide(); resumeSession ( resumingSession ); } - x2goDebug<<"Finished Proxy."; + x2goDebug<<"Finished proxy."; setStatStatus ( tr ( "Finished" ) ); #ifdef Q_OS_DARWIN //fixes bug, when mainwindow inputs not accepting focus under mac @@ -5873,7 +5875,7 @@ void ONMainWindow::slotShowPassForm() { #ifdef Q_OS_DARWIN //fixes bug, when mainwindow inputs not accepting focus under mac - x2goDebug<<"set focus"<<endl; + x2goDebug<<"Setting focus."<<endl; QTimer::singleShot(500, this, SLOT(setFocus())); setFocus(); #endif @@ -6016,7 +6018,7 @@ bool ONMainWindow::termSession ( QString sessId, bool warn ) tr ( "Are you sure you want to terminate " "this session?\n" - "Unsaved documents will be lost" ), + "Unsaved documents will be lost." ), QMessageBox::Yes,QMessageBox::No ); if (hide_after) hide(); @@ -6402,7 +6404,7 @@ void ONMainWindow::slotRetRunCommand ( bool result, QString output, { if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n:\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n:\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -6432,7 +6434,7 @@ void ONMainWindow::slotReadApplications(bool result, QString output, { if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n:\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n:\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -6564,7 +6566,7 @@ void ONMainWindow::slotReadApplications(bool result, QString output, if (runStartApp && autostartApp.length()>1) { if (!startAppFound) { - x2goDebug<<"Autostart application "<<autostartApp<< " not found in Desktop files."; + x2goDebug<<"Autostart application "<<autostartApp<< " not found in desktop files."; } else { @@ -6947,7 +6949,7 @@ bool ONMainWindow::parseParameter ( QString param ) value = expandHome(value); if (! QFile::exists(value)) { - printError( param + tr(" (file not exists)")); + printError( param + tr(" (file does not exist)")); return false; } supportMenuFile=value; @@ -6958,7 +6960,7 @@ bool ONMainWindow::parseParameter ( QString param ) value = expandHome(value); if (! QFile::exists(value)) { - printError( param + tr(" (file not exists)")); + printError( param + tr(" (file does not exist)")); return false; } BGFile=value; @@ -6969,7 +6971,7 @@ bool ONMainWindow::parseParameter ( QString param ) value=expandHome(value); if (! QFile::exists(value)) { - printError( param + tr(" (file not exists)")); + printError( param + tr(" (file does not exist)")); return false; } SPixFile=value; @@ -6996,7 +6998,7 @@ bool ONMainWindow::parseParameter ( QString param ) #endif if (! dr.exists(value)) { - printError( param + tr(" (directory not exists)")); + printError( param + tr(" (directory does not exist)")); return false; } homeDir=value; @@ -7024,7 +7026,7 @@ bool ONMainWindow::linkParameter ( QString value ) else { printError( tr ( - "wrong value for argument\"--link\"" + "Invalid value for parameter \"--link\"." ).toLocal8Bit().data() ); return false; } @@ -7041,7 +7043,7 @@ bool ONMainWindow::clipboardParameter ( QString value ) else { printError( tr ( - "wrong value for argument\"--clipboard\"" + "Invalid value for parameter \"--clipboard\"." ).toLocal8Bit().data() ); return false; } @@ -7056,8 +7058,8 @@ bool ONMainWindow::soundParameter ( QString val ) defaultUseSound=false; else { - printError( tr ( "wrong value for " - "argument\"--sound\"" ).toLocal8Bit().data() ); + printError( tr ( "Invalid value for " + "parameter \"--sound\"." ).toLocal8Bit().data() ); return false; } return true; @@ -7073,7 +7075,7 @@ bool ONMainWindow::geometry_par ( QString val ) if ( res.size() !=2 ) { printError( tr ( - "wrong value for argument\"--geometry\"" ). + "Invalid value for parameter \"--geometry\"." ). toLocal8Bit().data() ); return false; } @@ -7083,7 +7085,7 @@ bool ONMainWindow::geometry_par ( QString val ) if ( ! ( defaultWidth >0 && defaultHeight >0 && o1 && o2 ) ) { printError( tr ( - "wrong value for argument\"--geometry\"" ). + "Invalid value for parameter \"--geometry\"." ). toLocal8Bit().data() ); return false; } @@ -7100,7 +7102,7 @@ bool ONMainWindow::setKbd_par ( QString val ) else { printError( tr ( - "wrong value for argument\"--set-kbd\"" ). + "Invalid value for parameter \"--set-kbd\"." ). toLocal8Bit().data() ); return false; } @@ -7116,7 +7118,7 @@ bool ONMainWindow::ldapParameter ( QString val ) if ( lst.size() !=3 ) { printError( tr ( - "wrong value for argument\"--ldap\"" ). + "Invalid value for parameter \"--ldap\"." ). toLocal8Bit().data() ); return false; } @@ -7137,7 +7139,7 @@ bool ONMainWindow::ldap1Parameter ( QString val ) if ( lst.size() !=2 ) { printError( tr ( - "wrong value for argument\"--ldap1\"" ). + "Invalid value for parameter \"--ldap1\"." ). toLocal8Bit().data() ); return false; } @@ -7156,7 +7158,7 @@ bool ONMainWindow::ldap2Parameter ( QString val ) { printError( tr ( - "wrong value for argument\"--ldap2\"" ). + "Invalid value for parameter \"--ldap2\"." ). toLocal8Bit().data() ); return false; } @@ -7209,7 +7211,7 @@ bool ONMainWindow::packParameter ( QString val ) } } file.close(); - printError ( tr("wrong value for argument\"--pack\"" )); + printError ( tr("Invalid value for parameter \"--pack\"." )); return false; } @@ -7245,7 +7247,7 @@ void ONMainWindow::showHelp () void ONMainWindow::showHelpPack() { qCritical ( "%s",tr ( - "Available pack methodes:" ).toLocal8Bit().data() ); + "Available pack methods:" ).toLocal8Bit().data() ); QFile file ( ":/txt/packs" ); if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) return; @@ -7266,7 +7268,7 @@ void ONMainWindow::showHelpPack() if (!startHidden && !haveTerminal) { HelpDialog dlg(this); - dlg.setWindowTitle(tr("Pack Methodes")); + dlg.setWindowTitle(tr("Pack Methods")); dlg.setText(msg); dlg.exec(); } @@ -7296,7 +7298,7 @@ void ONMainWindow::showChangelog() { if(!QFile::exists(":/txt/changelog")) { - qCritical()<<tr("Option is not availabel in this build"); + qCritical()<<tr("Option is not available in this build."); return; } showTextFile(":/txt/changelog", tr("Changelog")); @@ -7306,7 +7308,7 @@ void ONMainWindow::showGit() { if(!QFile::exists(":/txt/git-info")) { - qCritical()<<tr("Option is not availabel in this build"); + qCritical()<<tr("Option is not available in this build."); return; } showTextFile(":/txt/git-info", tr("Git Info")); @@ -7331,7 +7333,7 @@ void ONMainWindow::slotGetServers ( bool result, QString output, cardReady=false; cardStarted=false; - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -7413,7 +7415,7 @@ void ONMainWindow::slotListAllSessions ( bool result,QString output, if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -7443,7 +7445,7 @@ void ONMainWindow::slotListAllSessions ( bool result,QString output, ( listedSessions.size() ==1 && listedSessions[0].length() <5 ) ) { - x2goDebug<<"Start new session."; + x2goDebug<<"Starting new session."; startNewSession(); } else if ( listedSessions.size() ==1 ) @@ -7452,7 +7454,7 @@ void ONMainWindow::slotListAllSessions ( bool result,QString output, x2goSession s=getSessionFromString ( listedSessions[0] ); - x2goDebug<<"Will proceed with session."; + x2goDebug<<"Will proceed with this session."; QDesktopWidget wd; if ( s.status=="S" && isColorDepthOk ( @@ -7462,7 +7464,7 @@ void ONMainWindow::slotListAllSessions ( bool result,QString output, } else { - x2goDebug<<"Please select one session..."; + x2goDebug<<"Please select one session ..."; selectSession ( listedSessions ); } } @@ -7678,7 +7680,7 @@ void ONMainWindow::exportDefaultDirs() { QString message= tr ( - "Unable to create folder:" ) + path; + "Unable to create directory:" ) + path; QMessageBox::critical ( 0l,tr ( "Error" ),message, QMessageBox::Ok, @@ -7786,7 +7788,7 @@ QString ONMainWindow::createRSAKey() QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ) ) { - x2goErrorf(10)<<tr("Can not open key: ")<<keyName; + x2goErrorf(10)<<tr("Cannot open key: ")<<keyName; return keyName; } QTextStream out ( &file ); @@ -7806,7 +7808,7 @@ void ONMainWindow::slotCopyKey ( bool result, QString output, int pid) if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -7870,7 +7872,7 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, if ( result==false ) { - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; x2goDebug<<"startX2goMount failed to mount client-side folder, reason: "<<message<<endl; if ( message.indexOf ( "publickey,password" ) !=-1 ) { @@ -8110,29 +8112,29 @@ void ONMainWindow::slotSupport() void ONMainWindow::slotAbout() { - QString aboutStr=tr ( - "</b><br> (C. 2005-2015 <b>obviously nice</b>: " - "Oleksandr Shneyder, Heinz-Markus Graesing)<br>" ); + QString aboutStr=tr ("<br>(C) 2005-2015 by <b>obviously nice</b>: " + "Oleksandr Shneyder, Heinz-Markus Graesing<br>" ); if ( embedMode ) - aboutStr+=tr ( "<br>x2goplugin mode was sponsored by " + aboutStr+=tr ( "<br>X2Go Plugin mode was sponsored by " "<a href=\"http://www.foss-group.de/\">" - "FOSS-Group GmbH(Freiburg)</a><br>" ); + "FOSS-Group GmbH (Freiburg)</a><br>" ); aboutStr+= tr ( - "<br>Client for use with the X2Go network based " - "computing environment. This Client will be able " - "to connect to X2Go server(s) and start, stop, " + "<br>This is a client to access the X2Go network-based " + "computing environment. This client will be able " + "to connect to X2Go Server(s) and start, stop, " "resume and terminate (running) desktop sessions. " "X2Go Client stores different server connections " "and may automatically request authentication " - "data from LDAP directories. Furthermore it can be " - "used as fullscreen loginscreen (replacement for " - "loginmanager like xdm). Please visit x2go.org for " - "further information." ); + "data from LDAP directories. Furthermore, it can be " + "used as a fullscreen login screen (replacement for " + "login managers like XDM). Please visit <a " + "href=\"http://www.x2go.org\">the project home page at " + "x2go.org</a> for further information." ); QMessageBox::about ( - this,tr ( "About X2GO client" ), - tr ( "<b>X2Go Client V. " ) +VERSION+ - " </b >(Qt - "+qVersion() +")"+ + this,tr ( "About X2Go Client" ), + tr ( "<b>X2Go Client v. " ) +VERSION+ + "</b> (Qt - "+qVersion() +")"+ aboutStr ); } @@ -8170,13 +8172,13 @@ void ONMainWindow::slotRereadUsers() } catch ( LDAPExeption e ) { - QString message="Exeption in: "; + QString message="Exception in: "; message=message+e.err_type.c_str(); message=message+" : "+e.err_str.c_str(); QMessageBox::critical ( 0l,tr ( "Error" ),message, QMessageBox::Ok,QMessageBox::NoButton ); QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "Please check LDAP Settings" ), + tr ( "Please check LDAP Settings." ), QMessageBox::Ok,QMessageBox::NoButton ); slotConfig(); return; @@ -8416,7 +8418,7 @@ void ONMainWindow::slotGpgError() if ( stdOut.indexOf ( "failed" ) !=-1 ) { QMessageBox::critical ( 0l,tr ( "Error" ), - tr ( "No valid card found" ), + tr ( "No valid card found." ), QMessageBox::Ok, QMessageBox::NoButton ); gpg->kill(); @@ -8473,7 +8475,7 @@ void ONMainWindow::slotGpgFinished ( int exitCode, QMessageBox::critical ( 0l,tr ( "Error" ), tr ( - "This card is unknown by X2Go system" ), + "This card is unknown to the X2Go system." ), QMessageBox::Ok, QMessageBox::NoButton ); QTimer::singleShot ( 1000, this, @@ -8546,9 +8548,9 @@ void ONMainWindow::slotGpgAgentFinished ( int , QProcess::ExitStatus ) QString ssh_auth_sock=envLst[2].split ( "=" ) [1]; agentPid=envLst[4].split ( "=" ) [1]; - x2goDebug<<"GPG-agent info: "<<gpg_agent_info<<ssh_auth_sock<<agentPid; - x2goDebug<<"GPG-agent pid: "<<agentPid; - x2goDebug<<"GPG-agent out:"<<envLst[0]<<envLst[2]<<envLst[4]; + x2goDebug<<"GPG Agent info: "<<gpg_agent_info<<ssh_auth_sock<<agentPid; + x2goDebug<<"GPG Agent PID: "<<agentPid; + x2goDebug<<"GPG Agent out: "<<envLst[0]<<envLst[2]<<envLst[4]; agentCheckTimer->start ( 1000 ); cardReady=true; @@ -8579,7 +8581,7 @@ void ONMainWindow::slotGpgAgentFinished ( int , QProcess::ExitStatus ) QString sshout ( sshadd.readAllStandardOutput() ); sshout=sshout.simplified(); - x2goDebug<<"SSH-ADD out: "<<sshout; + x2goDebug<<"ssh-add out: "<<sshout; if(brokerMode && (!config.brokerAutologoff)) { @@ -8600,7 +8602,7 @@ void ONMainWindow::slotGpgAgentFinished ( int , QProcess::ExitStatus ) QString sshout ( sshadd.readAllStandardOutput() ); sshout=sshout.simplified(); - x2goDebug<<"SSH-ADD out: "<<sshout; + x2goDebug<<"ssh-add out: "<<sshout; return; } @@ -8626,14 +8628,14 @@ void ONMainWindow::slotCheckAgentProcess() if ( nxproxy ) if ( nxproxy->state() ==QProcess::Running ) { - x2goDebug<<"Suspending session..."; + x2goDebug<<"Suspending session ..."; slotSuspendSessFromSt(); - x2goDebug<<"Suspended session."; + x2goDebug<<"Suspended session."; // nxproxy->terminate(); } } - x2goDebug<<"GPG-Agent finished."; + x2goDebug<<"GPG Agent finished."; slotStartPGPAuth(); } @@ -8664,7 +8666,7 @@ QString ONMainWindow::getXDisplay() // There, it is possible no $DISPLAY variable is set. // Start X11 manually. First, find a free display number. - x2goDebug<< "entering 10.4 compat mode, checking for free X11 display"; + x2goDebug<< "Entering 10.4 compat mode, checking for free X11 display."; int xFreeDisp = 0; @@ -8800,7 +8802,7 @@ QString ONMainWindow::getXDisplay() QMessageBox::critical ( this,QString::null, tr ( - "Can't start X Server\nPlease check your installation" ) + "Can't start X.Org Server.\nPlease check your installation." ) ); close(); } @@ -8938,12 +8940,12 @@ void ONMainWindow::check_cmd_status() void ONMainWindow::slotCmdMessage ( bool result,QString output, int) { - x2goDebug<<"Command Message: " + output; + x2goDebug<<"Command message: " + output; if ( result==false ) { cardReady=false; cardStarted=false; - QString message=tr ( "<b>Connection failed</b>\n" ) +output; + QString message=tr ( "<b>Connection failed.</b>\n" ) +output; if ( message.indexOf ( "publickey,password" ) !=-1 ) { message=tr ( "<b>Wrong password!</b><br><br>" ) + @@ -8980,12 +8982,12 @@ void ONMainWindow::slotCmdMessage ( bool result,QString output, sshConnection=0; if (startHidden) { - x2goInfof(11) << tr("Closing X2Go Client (because it was started in hidden mode)."); + x2goInfof(11) << tr("Closing X2Go Client because it was started in hidden mode."); close(); } else if (closeDisconnect) { - x2goInfof(12) << tr("Closing X2Go Client (because --close-disconnect was used on the cmdline)."); + x2goInfof(12) << tr("Closing X2Go Client because the --close-disconnect parameter was passed."); close(); } } @@ -8995,18 +8997,17 @@ int ONMainWindow::startSshFsTunnel() { fsTunReady=false; - x2goDebug<<"Starting fs tunnel for: "<<resumingSession.sessionId; - x2goDebug<<"fs port: "<<resumingSession.fsPort; + x2goDebug<<"Starting Folder Sharing tunnel for: "<<resumingSession.sessionId; + x2goDebug<<"FS port: "<<resumingSession.fsPort; if ( resumingSession.fsPort.length() <=0 ) { - QString message=tr ( - "Remote server does not " - "support file system export " - "through SSH Tunnel\n" - "Please update to a newer " - "x2goserver package" ); + QString message=tr ("Remote server does not " + "support file system exports " + "through SSH tunnels.\n" + "Please update your x2goserver " + "package." ); slotFsTunnelFailed ( false,message,0 ); return 1; } @@ -9027,7 +9028,7 @@ void ONMainWindow::slotFsTunnelFailed ( bool result, QString output, if ( !managedMode ) { - QString message=tr ( "Unable to create SSH tunnel for foldersharing and printing:\n" ) + QString message=tr ( "Unable to create SSH tunnel for Folder Sharing and Printing support:\n" ) +output; QMessageBox::critical ( 0l,tr ( "Error" ),message, QMessageBox::Ok, @@ -9041,7 +9042,7 @@ void ONMainWindow::slotFsTunnelFailed ( bool result, QString output, void ONMainWindow::slotFsTunnelOk(int) { - x2goDebug<<"FS tunnel through SSH seems to be up and running..."<<endl; + x2goDebug<<"FS tunnel through SSH seems to be up and running ..."<<endl; fsTunReady=true; //start reverse mounting if RSA Key and FS tunnel are ready @@ -9056,7 +9057,7 @@ void ONMainWindow::startX2goMount() QFile file ( fsExportKey+".pub" ); if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { - QString message=tr ( "Unable to read :\n" ) +fsExportKey+".pub"; + QString message=tr ( "Unable to read:\n" ) +fsExportKey+".pub"; QMessageBox::critical ( 0l,tr ( "Error" ),message, QMessageBox::Ok, QMessageBox::NoButton ); @@ -9083,7 +9084,7 @@ void ONMainWindow::startX2goMount() if ( !file1.open ( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ) ) { - QString message=tr ( "Unable to write :\n" ) + authofname; + QString message=tr ( "Unable to write:\n" ) + authofname; QMessageBox::critical ( 0l,tr ( "Error" ),message, QMessageBox::Ok, QMessageBox::NoButton ); @@ -9292,7 +9293,7 @@ bool ONMainWindow::isServerRunning ( int port ) if (addr.s_addr == INADDR_NONE) { - x2goDebug<< "WARNING: The IPv4 address entered must be a legal address\n"; + x2goDebug<< "WARNING: The IPv4 address entered was invalid.\n"; return false; } @@ -9306,7 +9307,7 @@ bool ONMainWindow::isServerRunning ( int port ) return false; } - x2goDebug<<"got localhost"; + x2goDebug<<"Resolved localhost."; localIP = inet_ntoa (*(struct in_addr *)*localHost->h_addr_list); @@ -9318,7 +9319,7 @@ bool ONMainWindow::isServerRunning ( int port ) ConnectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (ConnectSocket == INVALID_SOCKET) { - x2goDebug<<"WARNING: socket failed with error: "<< WSAGetLastError(); + x2goDebug<<"WARNING: Socket failed with error: "<< WSAGetLastError(); return false; } @@ -9334,7 +9335,7 @@ bool ONMainWindow::isServerRunning ( int port ) } closesocket(ConnectSocket); - x2goDebug<<"Port already used: "<<port; + x2goDebug<<"Port already in use: "<<port; return true; #endif @@ -9394,7 +9395,7 @@ void ONMainWindow::startXOrg () exec=appDir+"\\vcxsrv\\vcxsrv.exe"; winServersReady=false; - x2goDebug<<"using internal X: "<<useInternalX; + x2goDebug<<"Using internal X.Org Server: "<<useInternalX; //#ifdef CFGCLIENT if (!useInternalX || internalX!=XMING) @@ -9468,8 +9469,8 @@ void ONMainWindow::startXOrg () { QMessageBox::critical ( 0,QString::null, - tr ( "Can't start X Server\n" - "Please check your installation" ) ); + tr ( "Can't start X.Org Server.\n" + "Please check your installation." ) ); close(); } // #ifdef CFGCLIENT @@ -9488,7 +9489,7 @@ void ONMainWindow::slotCheckXOrgConnection() if (isServerRunning(6000+xDisplay)) { - x2goDebug<<"X is started."; + x2goDebug<<"X.Org Server started."; slotSetWinServersReady(); } @@ -9498,14 +9499,14 @@ void ONMainWindow::slotCheckXOrgConnection() { QMessageBox::critical ( 0,QString::null, - tr ( "Can't start X Server\n" - "Please check your installation" ) ); + tr ( "Can't start X.Org Server.\n" + "Please check your installation." ) ); close(); } else { - x2goDebug<<"...waiting for X."; + x2goDebug<<"Waiting for X.Org Server to start."; QTimer::singleShot(1000, this, SLOT(slotCheckXOrgConnection())); } @@ -9537,7 +9538,7 @@ void WinServerStarter::run() void ONMainWindow::startWinServers() { - x2goDebug<<"Starting win servers..."; + x2goDebug<<"Starting helper servers for Windows ..."; QString etcDir=homeDir+"/.x2go/etc"; QDir dr ( homeDir ); @@ -9634,7 +9635,7 @@ void ONMainWindow::removeCygwinEntry() QSettings st ( "HKEY_CURRENT_USER\\Software" "\\Cygwin", QSettings::NativeFormat ); - x2goDebug<<"Removing cygwin from registry\n"; + x2goDebug<<"Removing cygwin entry from registry."; st.remove ( "" ); st.sync(); @@ -9654,7 +9655,7 @@ void ONMainWindow::startPulsed() QString pulseVersionLine= pulseVersionTest->readAllStandardOutput().replace("\n"," ").simplified(); - x2goDebug <<"PulseAudio Version Line: "<<pulseVersionLine; + x2goDebug <<"PulseAudio version line: "<<pulseVersionLine; if (pulseVersionLine.contains("pulseaudio 0.", Qt::CaseInsensitive)) pulseVersionIsLegacy = true; if (pulseVersionLine.contains("pulseaudio 1.", Qt::CaseInsensitive)) @@ -9664,11 +9665,11 @@ void ONMainWindow::startPulsed() if (pulseVersionIsLegacy) { - x2goDebug <<"PulseAudio <= 2.1 Detected. PulseAudio will automatically use .pulse-cookie"; + x2goDebug <<"PulseAudio <= 2.1 detected. PulseAudio will automatically use .pulse-cookie"; } else { - x2goDebug <<"PulseAudio >= 3.0 Detected. x2goclient will tell PulseAudio to use .pulse-cookie."; + x2goDebug <<"PulseAudio >= 3.0 detected. X2Go Client will tell PulseAudio to use .pulse-cookie."; } #endif while ( isServerRunning ( pulsePort ) ) @@ -9685,7 +9686,7 @@ void ONMainWindow::startPulsed() // The tempoerary dir for config.pa (and pulse.log if it exists) pulseDir=pulseBaseDir; pulseDir=wapiShortFileName ( pulseDir ); - x2goDebug<<"pulse template: "<<pulseDir+"/tmp"; + x2goDebug<<"PulseAudio template: "<<pulseDir+"/tmp"; QTemporaryFile* fl=new QTemporaryFile ( pulseDir+"/tmp" ); fl->open(); pulseDir=fl->fileName(); @@ -9694,7 +9695,7 @@ void ONMainWindow::startPulsed() QFile::remove ( pulseDir ); dr.mkpath ( pulseDir ); - x2goDebug<<"pulse tmp file: "<<pulseDir; + x2goDebug<<"PulseAudio tmp file: "<<pulseDir; QStringList pEnv=QProcess::systemEnvironment(); for ( int i=0; i<pEnv.size(); ++i ) @@ -9772,7 +9773,7 @@ void ONMainWindow::startPulsed() QSysInfo::WindowsVersion == QSysInfo::WV_2003 ) { x2goDebug<<"Windows XP or Server 2003 (R2) detected."; - x2goDebug<<"Setting PulseAudio to \"Normal\" CPU priority."; + x2goDebug<<"Setting PulseAudio to \"normal\" CPU priority."; pulseArgs<<"--high-priority=no"; } #else @@ -9811,7 +9812,7 @@ void ONMainWindow::slotCheckPulse() void ONMainWindow::xorgSettings() { - x2goDebug<<"Getting Xorg settings."; + x2goDebug<<"Getting X.Org Server settings."; X2goSettings st ( "settings" ); @@ -9855,7 +9856,7 @@ void ONMainWindow::xorgSettings() void ONMainWindow::slotSetWinServersReady() { - x2goDebug<<"All winservers are started."; + x2goDebug<<"All helper servers for Windows are started."; winServersReady=true; restoreCygnusSettings(); @@ -10015,11 +10016,11 @@ bool ONMainWindow::startSshd() if (!isServerRunning (clientSshPort.toInt ())) { printSshDError_startupFailure (); - x2goDebug << "Failed to start usermode sshd."; + x2goDebug << "Failed to start user mode OpenSSH server."; return (false); } else { - x2goDebug << "Usermode sshd started successfully."; + x2goDebug << "User mode OpenSSH server started successfully."; return (true); } } @@ -10121,7 +10122,7 @@ void ONMainWindow::slotSetProxyWinFullscreen() False, SubstructureNotifyMask ,&event); if(!st) { - x2goDebug<<"Couldn't get fullscreen"; + x2goDebug<<"Couldn't fetch fullscreen setting."; } XSync(QX11Info::display(),false); XMapWindow(QX11Info::display(), proxyWinId); @@ -10149,7 +10150,7 @@ void ONMainWindow::resizeProxyWinOnDisplay(int disp) ", y: "+ QString("%1").arg(geom.y()) + ", w: "+ QString("%1").arg(geom.width()) + ", h: "+ QString("%1").arg(geom.height()); - x2goDebug<<"Resizing proxy window to fit Display: " + QString("%1").arg(disp) + " " + geoStr; + x2goDebug<<"Resizing proxy window to fit display: " + QString("%1").arg(disp) + " " + geoStr; #ifdef Q_OS_LINUX XSync(QX11Info::display(),false); @@ -10272,13 +10273,13 @@ void ONMainWindow::slotXineramaConfigured() void ONMainWindow::slotFindProxyWin() { #ifndef Q_OS_DARWIN - x2goDebug<<"Searching proxy win: X2GO-" + resumingSession.sessionId; + x2goDebug<<"Searching proxy window: X2GO-" + resumingSession.sessionId; proxyWinId=findWindow ( "X2GO-"+resumingSession.sessionId ); bool xinerama=defaultXinerama; if ( proxyWinId ) { - x2goDebug<<"Proxy win found: " + QString("%1").arg(proxyWinId); + x2goDebug<<"Proxy window found: " + QString("%1").arg(proxyWinId); setProxyWinTitle(); proxyWinTimer->stop(); @@ -10316,7 +10317,7 @@ void ONMainWindow::slotFindProxyWin() } if (xinerama) { - x2goDebug<<"Starting Xinerama Timer."; + x2goDebug<<"Starting Xinerama timer."; lastDisplayGeometry=QRect(); xineramaScreens.clear(); @@ -10338,7 +10339,7 @@ void ONMainWindow::slotFindProxyWin() } #ifdef Q_OS_WIN - x2goDebug<<"Maximize proxy win: "<<maximizeProxyWin; + x2goDebug<<"Maximize proxy window: "<<maximizeProxyWin; if ( !startEmbedded ) { @@ -10346,7 +10347,7 @@ void ONMainWindow::slotFindProxyWin() { QDesktopWidget dw; - x2goDebug<<"Making proxy win full screen."; + x2goDebug<<"Putting proxy window into fullscreen."; wapiSetFSWindow ( ( HWND ) proxyWinId, dw.screenGeometry ( this ) ); /*wapiShowWindow ( ( HWND ) proxyWinId, @@ -10388,7 +10389,7 @@ void ONMainWindow::slotDetachProxyWindow() if ( !embedControlChanged ) { slotFindProxyWin(); - x2goDebug<<"Proxy win detached, proxywin is: "<<proxyWinId; + x2goDebug<<"Proxy window detached, proxywin is: "<<proxyWinId; } #endif embedControlChanged=false; @@ -10675,7 +10676,7 @@ void ONMainWindow::processCfgLine ( QString line ) { qCritical ( "%s",tr ( - "wrong value for argument\"speed\"" + "Invalid value for argument \"speed\"" ).toLocal8Bit().data() ); } return; @@ -11045,14 +11046,14 @@ void ONMainWindow::initStatusDlg() slVal->setFixedHeight ( slName->sizeHint().height() ); sbApps=new QToolButton (sessionStatusDlg ); - sbApps->setToolTip(tr ( "Applications..." )); + sbApps->setToolTip(tr ( "Applications ..." )); sbApps->setIcon(QPixmap(":/img/icons/32x32/apps.png")); sbApps->setAutoRaise(true); sbApps->setFocusPolicy(Qt::NoFocus); sbExp=new QToolButton (sessionStatusDlg ); sbExp->setIcon(QPixmap(":/img/icons/32x32/open_dir.png")); - sbExp->setToolTip (tr ("Share folder..." )); + sbExp->setToolTip (tr ("Share folder ..." )); sbExp->setAutoRaise(true); sbExp->setFocusPolicy(Qt::NoFocus); @@ -11995,7 +11996,7 @@ void ONMainWindow::setX2goconfig ( const QString& text ) { m_x2goconfig=text; - x2goDebug<<"Haveing a session config."; + x2goDebug<<"Having a session config."; initWidgetsEmbed(); } @@ -12135,7 +12136,7 @@ void ONMainWindow::embedWindow ( long wndId ) embedContainer->show(); #ifdef Q_OS_LINUX - x2goDebug<<"Embedding window with id "<<wndId<<" in container."; + x2goDebug<<"Embedding window with ID "<<wndId<<" in container."; embedContainer->embedClient ( wndId ); #endif @@ -12185,8 +12186,8 @@ void ONMainWindow::detachClient() -QTNPFACTORY_BEGIN ( "X2GoClient Plug-in "VERSION, - "Allows you to start X2Go session in a webbrowser" ) +QTNPFACTORY_BEGIN ( "X2Go Client Plug-in "VERSION, + "Allows you to start X2Go sessions in a web browser." ) QTNPCLASS ( ONMainWindow ) QTNPFACTORY_END() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 69f1a57..1797258 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -177,7 +177,7 @@ struct ConfigFile QString brokerCaCertFile; QString iniFile; QString server; - QString serverIp;//Can be different from server (use for loadballancing) + QString serverIp;//Can be different from server (use for load balancing) QString sshport; QString command; QString key; @@ -294,7 +294,7 @@ class ONMainWindow : public QMainWindow Q_CLASSINFO ( "EventsID", "{44900013-f8bd-4d2e-a2cf-eab407c03005}" ) Q_CLASSINFO ( "MIME", "application/x2go:x2go:Configuration File " - "for X2Go Session" ) + "for X2Go Sessions" ) Q_CLASSINFO ( "ToSuperClass", "ONMainWindow" ) Q_CLASSINFO ( "DefaultProperty","x2goconfig" ) #endif diff --git a/src/printdialog.cpp b/src/printdialog.cpp index d0a85b1..30c72d2 100644 --- a/src/printdialog.cpp +++ b/src/printdialog.cpp @@ -58,10 +58,11 @@ void PrintDialog::accept() void PrintDialog::slot_dlgShowEnabled ( bool enable ) { if ( !enable ) - QMessageBox::warning ( this, tr ( "You've deactivated the x2go " - "client printing dialog." ), + QMessageBox::warning ( this, tr ( "You've deactivated the X2Go " + "Client printing dialog." ), tr ( "You may reactivate this dialog " - "using the x2goclient settings " - "dialog (Menu -> Options -> " + "using the X2Go Client settings " + "dialog. To do so, follow this path " + "in the menu bar: Options -> " "Settings)" ) ); } diff --git a/src/printprocess.cpp b/src/printprocess.cpp index afe93ad..c7a6509 100644 --- a/src/printprocess.cpp +++ b/src/printprocess.cpp @@ -38,7 +38,7 @@ PrintProcess::PrintProcess ( QString pdf, QString title, QObject *parent ) : QObject ( parent ) { - x2goDebug<<"Starting print process."<<endl; + x2goDebug<<"Starting print process."; pdfFile=pdf; pdfTitle=title; parentWidg= ( QWidget* ) parent; @@ -49,12 +49,12 @@ PrintProcess::PrintProcess ( QString pdf, QString title, QObject *parent ) : } if ( viewPdf ) { - x2goDebug<<"Opening PDF file: "<<pdfFile<<" ("<<pdfTitle<<")"<<endl; + x2goDebug<<"Opening PDF file: "<<pdfFile<<"; title: "<<pdfTitle; QTimer::singleShot ( 100, this, SLOT ( openPdf() ) ); } else { - x2goDebug<<"Printing PDF file: "<<pdfFile<<" ("<<pdfTitle<<")"<<endl; + x2goDebug<<"Printing PDF file: "<<pdfFile<<"; title: "<<pdfTitle; QTimer::singleShot ( 100, this, SLOT ( print() ) ); } } @@ -62,7 +62,7 @@ PrintProcess::PrintProcess ( QString pdf, QString title, QObject *parent ) : PrintProcess::~PrintProcess() { - x2goDebug<<"Closing print process."<<endl; + x2goDebug<<"Closing print process."; } @@ -138,7 +138,7 @@ bool PrintProcess::loadSettings() void PrintProcess::openPdf() { - x2goDebug<<"opening/saving PDF..."<<endl; + x2goDebug<<"Opening/saving PDF ..."; if ( pdfOpen ) { #ifndef Q_OS_WIN @@ -147,8 +147,7 @@ void PrintProcess::openPdf() #else QString cmd=pdfOpenCmd+"\""+pdfFile+"\""; #endif - x2goDebug<<"Using PDF viewer command: "<<cmd<<endl; - x2goDebug<<cmd; + x2goDebug<<"Using PDF viewer command: "<<cmd; if ( ! QProcess::startDetached ( cmd ) ) slot_error ( QProcess::FailedToStart ); @@ -187,7 +186,7 @@ void PrintProcess::print() prn.setCurrentPrinter ( prn.getDefaultUserPrinter() ); prn.print ( pdfFile, pdfTitle ); #else - x2goDebug<<"printing to "<<winX2goPrinter<<endl; + x2goDebug<<"Printing to "<<winX2goPrinter; wapiShellExecute ( "printto", wapiShortFileName ( pdfFile ), winX2goPrinter, @@ -279,14 +278,14 @@ void PrintProcess::slot_error ( QProcess::ProcessError ) message+=pdfFile; } } - QMessageBox::critical ( 0l, tr ( "Printing error" ), + QMessageBox::critical ( 0l, tr ( "Printing error." ), message ); } void PrintProcess::slot_pdf2psError ( QProcess::ProcessError ) { - QMessageBox::critical ( 0l, tr ( "Printing error" ), + QMessageBox::critical ( 0l, tr ( "Printing error." ), tr ( "Failed to execute command:\n" ) + "pdf2ps "+pdfFile+" "+psFile ); } diff --git a/src/printwidget.cpp b/src/printwidget.cpp index bcb75d3..6ac18c0 100644 --- a/src/printwidget.cpp +++ b/src/printwidget.cpp @@ -63,7 +63,7 @@ PrintWidget::PrintWidget ( QWidget* parent ) "<a href=\"http://pages.cs.wisc.edu/~ghost/doc/GPL/index.htm\">" "ghostprint</a> and " "<a href=\"http://pages.cs.wisc.edu/~ghost/gsview/\">" - "ghostview</a><br>You can find further information " + "ghostview</a><br>You can find further information " "<a href=\"http://www.x2go.org/index.php?id=49\">here</a>." ), ui.gbPrint ); rtfm->setWordWrap ( true ); diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp index 75d676f..2d51a23 100644 --- a/src/sessionbutton.cpp +++ b/src/sessionbutton.cpp @@ -134,12 +134,12 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id ) act_edit=sessMenu->addAction ( QIcon ( mw->iconsPath ( "/16x16/edit.png" ) ), - tr ( "Session preferences..." ) ); + tr ( "Session preferences ..." ) ); #if (!defined Q_WS_HILDON) && (!defined Q_OS_DARWIN) act_createIcon=sessMenu->addAction ( QIcon ( mw->iconsPath ( "/16x16/create_file.png" ) ), tr ( - "Create session icon on desktop..." ) ); + "Create session icon on desktop ..." ) ); #endif act_remove=sessMenu->addAction ( QIcon ( mw->iconsPath ( "/16x16/delete.png" ) ), @@ -316,7 +316,7 @@ void SessionButton::redraw() sessIcon = expandHome(sessIcon); QPixmap* pix; - x2goDebug << "creating QPixmap with session icon: '" << sessIcon.toAscii () << "'."; + x2goDebug << "Creating QPixmap with session icon: " << sessIcon.toAscii () << "."; if (!par->brokerMode || sessIcon == ":/img/icons/128x128/x2gosession.png") pix=new QPixmap( sessIcon ); else diff --git a/src/sessionexplorer.cpp b/src/sessionexplorer.cpp index 5e54c0d..0ccbae9 100644 --- a/src/sessionexplorer.cpp +++ b/src/sessionexplorer.cpp @@ -136,13 +136,13 @@ void SessionExplorer::slotEdit ( SessionButton* bt ) void SessionExplorer::slotCreateDesktopIcon ( SessionButton* bt ) { QMessageBox messageBox(QMessageBox::Question, - tr ( "Create session icon on desktop" ), + tr ( "Create session icon on desktop." ), tr ( "Desktop icons can be configured " - "not to show x2goclient (hidden mode). " + "not to show X2Go Client (hidden mode.) " "If you like to use this feature you'll " - "need to configure login by a gpg key " - "or gpg smart card.\n\n" - "Use x2goclient hidden mode?" ), + "need to configure login via a GPG key " + "or GPG Smart Card.\n\n" + "Use X2Go Client's hidden mode?" ), QMessageBox::Yes|QMessageBox::No, parent); diff --git a/src/sessionmanagedialog.cpp b/src/sessionmanagedialog.cpp index c88f0f2..59423fa 100644 --- a/src/sessionmanagedialog.cpp +++ b/src/sessionmanagedialog.cpp @@ -55,7 +55,7 @@ SessionManageDialog::SessionManageDialog ( QWidget * parent, #if (!defined Q_WS_HILDON) && (!defined Q_OS_DARWIN) if ( !ONMainWindow::getPortable() ) createSessionIcon=new QPushButton ( - tr ( "&Create session icon on desktop..." ),fr ); + tr ( "&Create session icon on desktop ..." ),fr ); #endif par= ( ONMainWindow* ) parent; newSession->setIcon ( QIcon ( diff --git a/src/sessionwidget.cpp b/src/sessionwidget.cpp index f06efde..db92d5b 100644 --- a/src/sessionwidget.cpp +++ b/src/sessionwidget.cpp @@ -137,7 +137,7 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, sgbLay->addLayout ( suLay ); sgbLay->addLayout ( keyLay ); - cbAutoLogin=new QCheckBox(tr("Try auto login (ssh-agent or default ssh key)"),sgb); + cbAutoLogin=new QCheckBox(tr("Try auto login (via SSH Agent or default SSH key)"),sgb); cbKrbLogin=new QCheckBox(tr("Kerberos 5 (GSSAPI) authentication"),sgb); cbKrbDelegation=new QCheckBox(tr("Delegation of GSSAPI credentials to the server"),sgb); sgbLay->addWidget(cbAutoLogin); @@ -168,7 +168,7 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, pbOpenProxyKey=new QPushButton ( QIcon ( mainWindow->iconsPath ( "/16x16/file-open.png" ) ), QString::null,proxyBox ); - cbProxyAutologin=new QCheckBox(tr("ssh-agent or default ssh key"),proxyBox); + cbProxyAutologin=new QCheckBox(tr("SSH Agent or default SSH key"),proxyBox); cbProxyKrbLogin=new QCheckBox(tr("Kerberos 5 (GSSAPI) authentication"),proxyBox); @@ -213,7 +213,7 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, sessBox->addItem ( "TRINITY" ); sessBox->addItem ( "OPENBOX" ); sessBox->addItem ( "ICEWM" ); - sessBox->addItem ( tr ( "Connect to Windows terminal server" ) ); + sessBox->addItem ( tr ( "Connect to Windows Terminal Server" ) ); sessBox->addItem ( tr ( "XDMCP" ) ); sessBox->addItem ( tr ( "Connect to local desktop" ) ); sessBox->addItem ( tr ( "Custom desktop" ) ); @@ -244,7 +244,7 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, sessLay->addWidget ( sgb ); sessLay->addWidget ( deskSess ); #ifdef Q_OS_LINUX - cbDirectRDP=new QCheckBox(tr("Direct RDP Connection"), deskSess); + cbDirectRDP=new QCheckBox(tr("Direct RDP connection"), deskSess); cmdLay->addWidget(cbDirectRDP,1,0,1,6); cbDirectRDP->hide(); connect(cbDirectRDP,SIGNAL(clicked()), this, SLOT(slot_rdpDirectClicked())); @@ -516,7 +516,7 @@ void SessionWidget::slot_rdpOptions() bool ok; QString text = QInputDialog::getText ( this, - tr ( "Connect to Windows terminal server" ), + tr ( "Connect to Windows Terminal Server" ), tr ( "rdesktop command line options:" ), QLineEdit::Normal, rdpOptions, &ok ); diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp index 46de1e4..e2c8881 100644 --- a/src/settingswidget.cpp +++ b/src/settingswidget.cpp @@ -47,7 +47,7 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw, tabSettings->addTab ( kgb,tr ( "&Keyboard" ) ); #else QGroupBox *dgb=new QGroupBox ( tr ( "&Display" ),this ); - clipGr=new QGroupBox ( tr ( "&Clipboard Mode" ),this ); + clipGr=new QGroupBox ( tr ( "&Clipboard mode" ),this ); kgb=new QGroupBox ( tr ( "&Keyboard" ),this ); #endif QVBoxLayout *dbLay = new QVBoxLayout ( dgb ); @@ -165,7 +165,7 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw, clipRadioGroup->addButton(rbClipNone); - rbKbdAuto=new QRadioButton(tr("Auto detect keyboard settings"),kgb); + rbKbdAuto=new QRadioButton(tr("Auto-detect keyboard settings"),kgb); rbKbdNoSet=new QRadioButton(tr("Do not configure keyboard"),kgb); rbKbdSet=new QRadioButton(tr("Configure keyboard"),kgb); QButtonGroup* kbRadio=new QButtonGroup(kgb); @@ -201,7 +201,7 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw, setLay->addWidget ( kgb ); #ifdef Q_OS_LINUX #ifdef CFGCLIENT - rdpBox=new QGroupBox ( tr ( "RDP Client" ),this ); + rdpBox=new QGroupBox ( tr ( "RDP client" ),this ); setLay->addWidget ( rdpBox ); rRdesktop=new QRadioButton ("rdesktop",rdpBox ); rRdesktop->setChecked(true); diff --git a/src/sharewidget.cpp b/src/sharewidget.cpp index b42fd75..9f28121 100644 --- a/src/sharewidget.cpp +++ b/src/sharewidget.cpp @@ -98,7 +98,7 @@ ShareWidget::ShareWidget ( QString id, ONMainWindow * mw, loadEnc ( cbTo ); cbFsSshTun=new QCheckBox ( - tr ( "Use ssh port forwarding to tunnel file system " + tr ( "Use SSH port forwarding to tunnel file system " "connections through firewalls" ),egb ); QVBoxLayout* expLay=new QVBoxLayout ( this ); diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 17cde87..9871c9f 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -137,7 +137,7 @@ void SshMasterConnection::parseKnownHosts() fields.removeFirst(); settings.setValue(keyName,fields.join(",")); #ifdef DEBUG - x2goDebug<<"writing key in registry: HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\SshHostKeys"<<endl; + x2goDebug<<"Writing key to registry: HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\SshHostKeys"<<endl; x2goDebug<<keyName<<"="<<fields.join(",")<<endl; #endif } @@ -198,15 +198,15 @@ SshMasterConnection::SshMasterConnection (QObject* parent, QString host, int por #ifdef DEBUG if (kerberos) { - x2goDebug<<"starting ssh connection with kerberos authentication"<<endl; + x2goDebug<<"Starting SSH connection with Kerberos authentication."; } else { - x2goDebug<<"starting ssh connection without kerberos authentication"<<endl; + x2goDebug<<"Starting SSH connection without Kerberos authentication."; } #endif #ifdef DEBUG - x2goDebug<<"SshMasterConnection, instance "<<this<<" created"; + x2goDebug<<"SshMasterConnection, instance "<<this<<" created."; #endif } @@ -214,7 +214,7 @@ SshMasterConnection::SshMasterConnection (QObject* parent, QString host, int por void SshMasterConnection::slotSshProxyConnectionOk() { #ifdef DEBUG - x2goDebug<<"sshproxy connected"; + x2goDebug<<"SSH proxy connected."; #endif @@ -324,7 +324,7 @@ void SshMasterConnection::checkReverseTunnelConnections() address.sin_family=AF_INET; address.sin_port=htons ( req.localPort ); #ifdef DEBUG - x2goDebug<<"connecting to "<<req.localHost<<":"<<req.localPort<<endl; + x2goDebug<<"Connecting to "<<req.localHost<<":"<<req.localPort<<endl; #endif #ifndef Q_OS_WIN inet_aton ( req.localHost.toAscii(), &address.sin_addr ); @@ -402,7 +402,7 @@ int SshMasterConnection::startTunnel(const QString& forwardHost, uint forwardPor void SshMasterConnection::slotSshProxyConnectionError(QString err1, QString err2) { breakLoop=true; - emit connectionError(tr("SSH proxy connection error"),err1+" "+err2); + emit connectionError(tr("SSH proxy connection error."),err1+" "+err2); } void SshMasterConnection::slotSshProxyServerAuthError(int errCode, QString err, SshMasterConnection* con) @@ -420,7 +420,7 @@ void SshMasterConnection::slotSshProxyUserAuthError(QString err) void SshMasterConnection::slotSshProxyTunnelOk(int) { #ifdef DEBUG - x2goDebug<<"Ssh proxy tunnel established"; + x2goDebug<<"SSH proxy tunnel established."; #endif sshProxyReady=true; } @@ -429,7 +429,7 @@ void SshMasterConnection::slotSshProxyTunnelFailed(bool , QString output, int) { breakLoop=true; - emit connectionError(tr("Failed to create SSH proxy tunnel"), output); + emit connectionError(tr("Failed to create SSH proxy tunnel."), output); } @@ -442,7 +442,7 @@ void SshMasterConnection::slotSshProxyServerAuthAborted() void SshMasterConnection::run() { #ifdef DEBUG - x2goDebug<<"SshMasterConnection, instance "<<this<<" entering thread"; + x2goDebug<<"SshMasterConnection, instance "<<this<<" entering thread."; #endif if(useproxy && proxytype==PROXYSSH) { @@ -478,11 +478,11 @@ void SshMasterConnection::run() if ( !isLibSshInited ) { #ifdef DEBUG - x2goDebug<<"libSsh not inited yet, initting\n"; + x2goDebug<<"libssh not initialized yet. Initializing."; #endif if ( ssh_init() !=0 ) { - QString err=tr ( "Cannot initialize libssh" ); + QString err=tr ( "Cannot initialize libssh." ); #ifdef DEBUG x2goDebug<<err<<endl; #endif @@ -495,7 +495,7 @@ void SshMasterConnection::run() #ifdef DEBUG else { - x2goDebug<<"already inited\n"; + x2goDebug<<"libssh already initialized."; } #endif @@ -510,7 +510,7 @@ void SshMasterConnection::run() my_ssh_session = ssh_new(); if ( my_ssh_session == NULL ) { - QString err=tr ( "Cannot create ssh session" ); + QString err=tr ( "Cannot create SSH session." ); #ifdef DEBUG x2goDebug<<err<<endl; #endif @@ -522,7 +522,7 @@ void SshMasterConnection::run() #ifdef Q_OS_WIN ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, (mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit()); #ifdef DEBUG - x2goDebug<<"setting SSH DIR to "<<(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit(); + x2goDebug<<"Setting SSH directory to "<<(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit(); #endif if (kerberos) { @@ -546,7 +546,7 @@ void SshMasterConnection::run() proxysocket = tcpProxySocket->socketDescriptor(); if (!tcpProxySocket->waitForConnected(30000)) { - QString message=tr ( "Cannot connect to proxy server" ); + QString message=tr ( "Cannot connect to proxy server." ); #ifdef DEBUG x2goDebug<<message<<endl; #endif @@ -556,12 +556,12 @@ void SshMasterConnection::run() return; } #ifdef DEBUG - x2goDebug << "Created HTTP proxy socket " << proxysocket << endl; + x2goDebug << "Created HTTP proxy socket: " << proxysocket << endl; #endif ssh_options_set( my_ssh_session, SSH_OPTIONS_FD, &proxysocket); ssh_set_fd_toread( my_ssh_session); #ifdef DEBUG - x2goDebug<<"Connected to HTTP proxy server " << proxyserver << ":" + x2goDebug<<"Connected to HTTP proxy server: " << proxyserver << ":" << proxyport <<endl; #endif } @@ -571,7 +571,7 @@ void SshMasterConnection::run() if(disconnectSessionFlag) { #ifdef DEBUG - x2goDebug<<"session already disconnected, exiting"<<endl; + x2goDebug<<"Session is already disconnected, exiting."<<endl; #endif return; } @@ -588,7 +588,7 @@ void SshMasterConnection::run() if(disconnectSessionFlag) { #ifdef DEBUG - x2goDebug<<"session already disconnected, exiting"<<endl; + x2goDebug<<"Session is already disconnected, exiting."<<endl; #endif return; } @@ -599,7 +599,7 @@ void SshMasterConnection::run() if(disconnectSessionFlag) { #ifdef DEBUG - x2goDebug<<"session already disconnected, exiting"<<endl; + x2goDebug<<"Session is already disconnected, exiting."<<endl; #endif return; } @@ -626,7 +626,7 @@ void SshMasterConnection::run() if(disconnectSessionFlag) { #ifdef DEBUG - x2goDebug<<"session already disconnected, exiting"<<endl; + x2goDebug<<"Session is already disconnected, exiting."<<endl; #endif return; } @@ -640,7 +640,7 @@ void SshMasterConnection::run() #ifdef Q_OS_WIN ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, (mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit()); #ifdef DEBUG - x2goDebug<<"setting SSH DIR to "<<(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit(); + x2goDebug<<"Setting SSH directory to "<<(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit(); #endif #endif @@ -649,12 +649,12 @@ void SshMasterConnection::run() if(disconnectSessionFlag) { #ifdef DEBUG - x2goDebug<<"session already disconnected, exiting"<<endl; + x2goDebug<<"Session is already disconnected, exiting."<<endl; #endif return; } #ifdef DEBUG - x2goDebug<<"user auth OK\n"; + x2goDebug<<"User authentication OK."; #endif emit connectionOk(host); } @@ -663,7 +663,7 @@ void SshMasterConnection::run() if(disconnectSessionFlag) { #ifdef DEBUG - x2goDebug<<"session already disconnected, exiting"<<endl; + x2goDebug<<"Session is already disconnected, exiting."<<endl; #endif return; } @@ -676,7 +676,7 @@ void SshMasterConnection::run() { err=sshProcErrString; } - QString message=tr ( "Authentication failed" ); + QString message=tr ( "Authentication failed." ); #ifdef DEBUG x2goDebug<<message<<" - "<<err; #endif @@ -708,18 +708,18 @@ SshMasterConnection::~SshMasterConnection() disconnectSessionFlag=true; disconnectFlagMutex.unlock(); #ifdef DEBUG - x2goDebug<<"SshMasterConnection, instance "<<this<<" waiting for thread to finish"; + x2goDebug<<"SshMasterConnection, instance "<<this<<" waiting for thread to finish."; #endif wait(15000); #ifdef DEBUG - x2goDebug<<"SshMasterConnection, instance "<<this<<" thread finished"; + x2goDebug<<"SshMasterConnection, instance "<<this<<" thread finished."; #endif for(int i=processes.count()-1; i>=0; --i) { delete processes[i]; } #ifdef DEBUG - x2goDebug<<"SshMasterConnection, instance "<<this<<" SshMasterConnection, instance SshMasterConnection(0x7fce7c008aa0) deleted"; + x2goDebug<<"SshMasterConnection, instance "<<this<<" finished destructor."; #endif } @@ -729,14 +729,14 @@ void SshMasterConnection::finalizeLibSsh() if ( !isLibSshInited ) { #ifdef DEBUG - x2goDebug<<"libssh not inited yet\n"; + x2goDebug<<"libssh not initialized yet."; #endif return; } ssh_finalize(); #ifdef DEBUG - x2goDebug<<"libssh finalized\n"; + x2goDebug<<"libssh finalized."; #endif } @@ -789,7 +789,7 @@ void SshMasterConnection::writeKnownHosts(bool write) int SshMasterConnection::serverAuth ( QString& errorMsg ) { #ifdef DEBUG - x2goDebug<<"cserverAuth\n "; + x2goDebug<<"cserverAuth"; #endif int state, hlen; @@ -899,7 +899,7 @@ bool SshMasterConnection::userChallengeAuth() challengeAuthVerificationCode=keyPhrase; if(challengeAuthVerificationCode==QString::null) { - authErrors<<tr("Authentication failed"); + authErrors<<tr("Authentication failed."); return false; } } @@ -917,7 +917,7 @@ bool SshMasterConnection::userChallengeAuth() } case SSH_AUTH_SUCCESS: #ifdef DEBUG - x2goDebug<<"Challenge auth ok"<<endl; + x2goDebug<<"Challenge authentication OK."<<endl; #endif return true; case SSH_AUTH_DENIED: @@ -954,7 +954,7 @@ bool SshMasterConnection::userAuthWithPass() if (method& SSH_AUTH_METHOD_INTERACTIVE) { #ifdef DEBUG - x2goDebug<<"Challenge authentication"<<endl; + x2goDebug<<"Challenge authentication requested."<<endl; #endif challengeAuthPasswordAccepted=false; return userChallengeAuth(); @@ -963,7 +963,7 @@ bool SshMasterConnection::userAuthWithPass() if (method & SSH_AUTH_METHOD_PASSWORD) { #ifdef DEBUG - x2goDebug<<"Password authentication"<<endl; + x2goDebug<<"Password authentication requested."<<endl; #endif int rc = ssh_userauth_password ( my_ssh_session, NULL, pass.toAscii() ); if ( rc != SSH_AUTH_SUCCESS ) @@ -1034,7 +1034,7 @@ void SshMasterConnection::setKeyPhrase(QString phrase) bool SshMasterConnection::userAuthWithKey() { #ifdef DEBUG - x2goDebug<<"try authenticate user with private key" <<endl; + x2goDebug<<"Trying to authenticate user with private key." <<endl; #endif QString keyName=key; bool autoRemove=false; @@ -1052,7 +1052,7 @@ bool SshMasterConnection::userAuthWithKey() fl.close(); autoRemove=true; #ifdef DEBUG - x2goDebug<<"temporary save key in "<<keyName<<endl; + x2goDebug<<"Temporarily saved key in "<<keyName<<endl; #endif } @@ -1094,7 +1094,7 @@ bool SshMasterConnection::userAuthWithKey() if (!prkey) { #ifdef DEBUG - x2goDebug<<"Failed to get public key from private key"<<endl; + x2goDebug<<"Failed to get public key from private key."<<endl; #endif privatekey_free(prkey); if ( autoRemove ) @@ -1115,7 +1115,7 @@ bool SshMasterConnection::userAuthWithKey() string_free(pubkeyStr); #ifdef DEBUG - x2goDebug<<"auth with key: "<<rc<<endl; + x2goDebug<<"Authenticating with key: "<<rc<<endl; #endif if ( autoRemove ) @@ -1153,7 +1153,7 @@ bool SshMasterConnection::userAuthKrb() #endif #ifdef DEBUG - x2goDebug<<"starting ssh:" <<sshCmd<<endl; + x2goDebug<<"Starting ssh:" <<sshCmd<<endl; #endif ssh.start(sshCmd); @@ -1163,17 +1163,17 @@ bool SshMasterConnection::userAuthKrb() sshProcErrString=ssh.errorString(); authErrors<<sshProcErrString; #ifdef DEBUG - x2goDebug<<"ssh start failed:" <<sshProcErrString<<endl; + x2goDebug<<"SSH start failed:" <<sshProcErrString<<endl; #endif return false; } if (!ssh.waitForFinished(20000)) { sshProcErrString=ssh.errorString(); - authErrors<<tr("Failed to start SSH Client. Please check your installation and GSSApi configuration."); + authErrors<<tr("Failed to start SSH client. Please check your installation and GSSApi configuration."); authErrors<<sshProcErrString; #ifdef DEBUG - x2goDebug<<"ssh not finished:" <<sshProcErrString<<endl; + x2goDebug<<"SSH did not finish:" <<sshProcErrString<<endl; #endif return false; @@ -1181,10 +1181,10 @@ bool SshMasterConnection::userAuthKrb() QString outp=ssh.readAllStandardOutput(); QString err=ssh.readAllStandardError(); #ifdef DEBUG - x2goDebug<<"ssh exited\n"; - x2goDebug<<"stdout - "<<outp<<endl; - x2goDebug<<"stderr - "<<err<<endl; - x2goDebug<<"code - "<<ssh.exitCode()<<", status - "<<ssh.exitStatus()<<endl; + x2goDebug<<"SSH exited."; + x2goDebug<<"stdout: "<<outp<<endl; + x2goDebug<<"stderr: "<<err<<endl; + x2goDebug<<"Exit code: "<<ssh.exitCode()<<"; status: "<<ssh.exitStatus()<<endl; #endif QString begin_marker = "X2GODATABEGIN:"+uuidStr+"\n"; @@ -1245,11 +1245,11 @@ void SshMasterConnection::addChannelConnection ( SshProcess* creator, QString uu con.command=cmd; con.uuid=uuid; - x2goDebug << "locking SSH channel connection MUTEX."; + x2goDebug << "Locking SSH channel connection MUTEX."; channelConnectionsMutex.lock(); - x2goDebug << "passing con to channelConnections."; + x2goDebug << "Passing new channel conenction object to channelConnections."; channelConnections<<con; - x2goDebug << "unlocking SSH channel connection MUTEX."; + x2goDebug << "Unlocking SSH channel connection MUTEX."; channelConnectionsMutex.unlock(); } @@ -1282,7 +1282,7 @@ void SshMasterConnection::copy() if ( scp == NULL ) { #ifdef DEBUG - x2goDebug<<"Error allocating scp session: "<< ssh_get_error ( my_ssh_session ) <<endl; + x2goDebug<<"Error allocating SCP session: "<< ssh_get_error ( my_ssh_session ) <<endl; #endif return; } @@ -1290,7 +1290,7 @@ void SshMasterConnection::copy() if ( rc != SSH_OK ) { #ifdef DEBUG - x2goDebug<<"Error initializing scp session: "<< ssh_get_error ( my_ssh_session ) <<endl; + x2goDebug<<"Error initializing SCP session: "<< ssh_get_error ( my_ssh_session ) <<endl; #endif ssh_scp_free ( scp ); return; @@ -1356,7 +1356,7 @@ void SshMasterConnection::channelLoop() if ( disconnect ) { #ifdef DEBUG - x2goDebug<<"Disconnecting..."<<endl; + x2goDebug<<"Disconnecting ..."<<endl; #endif if (useproxy && proxytype==PROXYSSH&&sshProxy) @@ -1367,7 +1367,7 @@ void SshMasterConnection::channelLoop() channelConnectionsMutex.lock(); #ifdef DEBUG - x2goDebug<<"Deleting channel connections"<<endl; + x2goDebug<<"Deleting channel connections."<<endl; #endif for ( int i=0; i<channelConnections.size(); ++i ) { @@ -1375,20 +1375,20 @@ void SshMasterConnection::channelLoop() } channelConnectionsMutex.unlock(); #ifdef DEBUG - x2goDebug<<"Disconnect session"<<endl; + x2goDebug<<"Disconnecting session."<<endl; #endif ssh_disconnect ( my_ssh_session ); ssh_free ( my_ssh_session ); #ifdef DEBUG - x2goDebug<<"Delete sockets"<<endl; + x2goDebug<<"Deleting sockets."<<endl; #endif if (tcpProxySocket != NULL) delete tcpProxySocket; if (tcpNetworkProxy != NULL) delete tcpNetworkProxy; #ifdef DEBUG - x2goDebug<<"All channels closed, session disconnected, quiting session loop"<<endl; + x2goDebug<<"All channels closed and session disconnected. Quiting session loop."<<endl; #endif quit(); return; @@ -1437,17 +1437,17 @@ void SshMasterConnection::channelLoop() if ( channelConnections.at ( i ).channel==0l ) { #ifdef DEBUG - x2goDebug<<"creating new channel"<<endl; + x2goDebug<<"Creating new channel."<<endl; #endif ssh_channel channel=channel_new ( my_ssh_session ); #ifdef DEBUG - x2goDebug<<"new channel:"<<channel<<endl; + x2goDebug<<"New channel:"<<channel<<endl; #endif channelConnections[i].channel=channel; if ( tcpSocket>0 ) { #ifdef DEBUG - x2goDebug<<"forwarding new channel, local port: "<<channelConnections.at ( i ).localPort<<endl; + x2goDebug<<"Forwarding new channel, local port: "<<channelConnections.at ( i ).localPort<<endl; #endif if ( channel_open_forward ( channel, channelConnections.at ( i ).forwardHost.toAscii(), @@ -1456,7 +1456,7 @@ void SshMasterConnection::channelLoop() channelConnections.at ( i ).localPort ) != SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_open_forward failed" ); + QString errorMsg=tr ( "channel_open_forward failed." ); emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG x2goDebug<<errorMsg<<": "<<err<<endl; @@ -1465,19 +1465,19 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG else { - x2goDebug<<" new channel forwarded"<<endl; + x2goDebug<<"New channel forwarded."<<endl; } #endif } else { #ifdef DEBUG - x2goDebug<<"executing remote: "<<channelConnections.at ( i ).command<<endl; + x2goDebug<<"Executing remote: "<<channelConnections.at ( i ).command<<endl; #endif if ( channel_open_session ( channel ) !=SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_open_session failed" ); + QString errorMsg=tr ( "channel_open_session failed." ); emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG x2goDebug<<errorMsg<<": "<<err<<endl; @@ -1495,7 +1495,7 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG else { - x2goDebug<<" new exec channel created"<<endl; + x2goDebug<<"New exec channel created."<<endl; } #endif } @@ -1513,7 +1513,7 @@ void SshMasterConnection::channelLoop() if ( retval == -1 ) { #ifdef DEBUG - x2goDebug<<"select error\n"; + x2goDebug<<"select() error."; #endif continue; } @@ -1544,7 +1544,7 @@ void SshMasterConnection::channelLoop() if ( rez==SSH_EOF ) { #ifdef DEBUG - x2goDebug<<"EOF ON CHANNEL "<<channel<<" (SshProcess: "<<channelConnections[i].creator->pid<<")"<<endl; + x2goDebug<<"EOF on channel "<<channel<<"; SshProcess PID: "<<channelConnections[i].creator->pid<<<<endl; #endif //////Finished//////// finalize ( i ); @@ -1565,9 +1565,9 @@ void SshMasterConnection::channelLoop() { if ( send ( tcpSocket,buffer, nbytes,0 ) != nbytes ) { - QString errMsg=tr ( "error writing to socket" ); + QString errMsg=tr ( "Error writing to socket." ); #ifdef DEBUG - x2goDebug<<"error writing "<<nbytes<<" to tcp socket"<<tcpSocket<<endl; + x2goDebug<<"Error writing "<<nbytes<<" to TCP socket"<<tcpSocket<<endl; #endif emit ioErr ( channelConnections[i].creator,errMsg,"" ); finalize ( i ); @@ -1587,7 +1587,7 @@ void SshMasterConnection::channelLoop() { //////ERROR!!!!!//////// QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "error reading channel" ); + QString errorMsg=tr ( "Error reading channel." ); emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG x2goDebug<<errorMsg<<" - "<<err<<endl; @@ -1599,7 +1599,7 @@ void SshMasterConnection::channelLoop() if ( channel_is_eof ( channel ) ) { #ifdef DEBUG - x2goDebug<<"EOF ON CHANNEL "<<channel<<" (SshProcess: "<<channelConnections[i].creator->pid<<")"<<endl; + x2goDebug<<"EOF on channel "<<channel<<"; SshProcess PID: "<<channelConnections[i].creator->pid<<endl; #endif //////Finished//////// finalize ( i ); @@ -1621,7 +1621,7 @@ void SshMasterConnection::channelLoop() if ( channel_write ( channel, buffer, nbytes ) !=nbytes ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_write failed" ); + QString errorMsg=tr ( "channel_write failed." ); emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG x2goDebug<<errorMsg<<" - "<<err<<endl; @@ -1637,7 +1637,7 @@ void SshMasterConnection::channelLoop() { //////ERROR!!!!!//////// QString err=""; - QString errorMsg=tr ( "error reading tcp socket" ); + QString errorMsg=tr ( "Error reading from TCP socket." ); emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG x2goDebug<<errorMsg<<" - "<<err<<endl; @@ -1648,7 +1648,7 @@ void SshMasterConnection::channelLoop() if ( nbytes==0 ) { #ifdef DEBUG - x2goDebug<<"socket closed "<<tcpSocket<<endl; + x2goDebug<<"Socket "<<tcpSocket<<" closed."<<endl; #endif finalize ( i ); continue; @@ -1667,11 +1667,11 @@ void SshMasterConnection::finalize ( int item ) { channel_send_eof ( channel ); #ifdef DEBUG - x2goDebug<<"eof sent\n"; + x2goDebug<<"EOF sent."; #endif channel_close ( channel ); #ifdef DEBUG - x2goDebug<<"channel closed\n"; + x2goDebug<<"Channel closed."; #endif channel_free ( channel ); } diff --git a/src/sshprocess.cpp b/src/sshprocess.cpp index dc27bd2..94948bc 100644 --- a/src/sshprocess.cpp +++ b/src/sshprocess.cpp @@ -49,7 +49,7 @@ SshProcess::SshProcess(SshMasterConnection* master, int pid): QObject(0) SshProcess::~SshProcess() { #ifdef DEBUG - x2goDebug<<"ssh process destructor"; + x2goDebug<<"SshProcess destructor called."; #endif if (proc) @@ -106,12 +106,12 @@ void SshProcess::slotCheckNewConnection() return; #ifdef DEBUG - x2goDebug<<"new tcp connection\n"; + x2goDebug<<"New TCP connection."; #endif int tcpSocket=accept(serverSocket, (struct sockaddr*)&address,&addrlen); #ifdef DEBUG - x2goDebug<<"new socket:"<<tcpSocket<<endl; + x2goDebug<<"New socket: "<<tcpSocket; #endif masterCon->addChannelConnection(this, tcpSocket, forwardHost, forwardPort, localHost, ntohs(address.sin_port)); @@ -124,7 +124,7 @@ void SshProcess::tunnelLoop() serverSocket=socket(AF_INET, SOCK_STREAM, 0); if (serverSocket<=0) { - QString err=tr("Error creating socket"); + QString err=tr("Error creating socket."); x2goDebug<<err<<endl; emit sshFinished(false,err,pid); return; @@ -154,7 +154,7 @@ void SshProcess::tunnelLoop() timer->start(100); emit sshTunnelOk(pid); #ifdef DEBUG - x2goDebug<<"Direct tunnel: waiting for connections on "<<localHost<<":"<<localPort<<endl; + x2goDebug<<"Direct tunnel: waiting for connections on "<<localHost<<":"<<localPort; #endif } @@ -174,12 +174,12 @@ void SshProcess::rmPuttyReg(QString uuidStr) if (uuidStr.isEmpty()) { #ifdef DEBUG - x2goDebug<<"uuidStr is empty. No PuTTY session reg key to delete."<<endl; + x2goDebug<<"uuidStr is empty. No PuTTY session reg key to delete."; #endif return; } #ifdef DEBUG - x2goDebug<<"deleting key in registry: HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions\\"+uuidStr<<endl; + x2goDebug<<"Deleting key in registry: HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions\\"+uuidStr; #endif QSettings st("HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions", QSettings::NativeFormat); @@ -196,12 +196,12 @@ void SshProcess::startNormal(const QString& cmd) //#ifdef DEBUG // ONLY UNCOMMENT FOR TESTING, MIGHT REVEAL PASSWORD WHEN command=RDP - x2goDebug<<"executing remote command via SshProcess object ("<<pid<<"): "<<cmd<<endl; + x2goDebug<<"Executing remote command via SshProcess object "<<pid<<": "<<cmd; // #endif if(!masterCon->useKerberos()) { QString shcmd = "sh -c 'echo X2GODATABEGIN:" + uuidStr + "; PATH=/usr/local/bin:/usr/bin:/bin "+cmd+"; echo X2GODATAEND:" + uuidStr +";'"; - x2goDebug << "running masterCon->addChannelConnection(this, '" << uuidStr << "', '" << shcmd.left (200) << "');"; + x2goDebug << "Running masterCon->addChannelConnection(this, '" << uuidStr << "', '" << shcmd.left (200) << "');"; masterCon->addChannelConnection(this, uuidStr, shcmd); connect(masterCon,SIGNAL(stdOut(SshProcess*,QByteArray)),this,SLOT(slotStdOut(SshProcess*,QByteArray))); connect(masterCon,SIGNAL(channelClosed(SshProcess*,QString)), this,SLOT(slotChannelClosed(SshProcess*,QString))); @@ -229,7 +229,7 @@ void SshProcess::startNormal(const QString& cmd) QString::number(masterCon->getPort())+" -l "+ masterCon->getUser()+" "+ host + " \""+shcmd+"\""; - x2goDebug<<"evoking ssh command via SshProcess object ("<<pid<<"): "<<sshString<<endl; + x2goDebug<<"Evoking SSH command via SshProcess object "<<pid<<": "<<sshString; procUuid=uuidStr; proc->start(sshString); @@ -252,7 +252,7 @@ void SshProcess::startNormal(const QString& cmd) void SshProcess::start_cp(QString src, QString dst) { - x2goDebug<<"copying file via SshProcess object ("<<pid<<"): "<<src<<" -> "<<dst<<endl; + x2goDebug<<"Copying file via SshProcess object "<<pid<<": "<<src<<" -> "<<dst; scpSource=src; if(!masterCon->useKerberos()) @@ -299,7 +299,7 @@ void SshProcess::start_cp(QString src, QString dst) QString::number(masterCon->getPort())+" "+src+" "+ masterCon->getUser()+"@"+ masterCon->getHost()+":"+dst; #ifdef DEBUG - x2goDebug<<"running scp:" <<sshString<<endl; + x2goDebug<<"Running scp:" <<sshString; #endif proc->start(sshString); @@ -307,7 +307,7 @@ void SshProcess::start_cp(QString src, QString dst) { stdErrString=proc->errorString(); #ifdef DEBUG - x2goDebug<<"ssh start failed:" <<stdErrString<<endl; + x2goDebug<<"SSH start failed:" <<stdErrString; #endif slotChannelClosed(this,""); return; @@ -323,7 +323,7 @@ void SshProcess::start_cp(QString src, QString dst) void SshProcess::startTunnel(const QString& forwardHost, uint forwardPort, const QString& localHost, uint localPort, bool reverse) { - x2goDebug<<"Starting tunnel via SshProcess object ("<<pid<<"): "<<forwardHost<<":"<<forwardPort<<" -> "<<localHost<<":"<<localPort<<endl; + x2goDebug<<"Starting tunnel via SshProcess object "<<pid<<": "<<forwardHost<<":"<<forwardPort<<" -> "<<localHost<<":"<<localPort<<endl; tunnel=true; tunnelOkEmited=false; @@ -353,7 +353,7 @@ void SshProcess::startTunnel(const QString& forwardHost, uint forwardPort, const sshString+=" -R "+ QString::number(forwardPort)+":"+forwardHost+":"+QString::number(localPort); #ifdef DEBUG - x2goDebug<<"TUNNEL: running ssh:" <<sshString<<endl; + x2goDebug<<"Tunnel: running ssh:" <<sshString; #endif proc->start(sshString); @@ -361,7 +361,7 @@ void SshProcess::startTunnel(const QString& forwardHost, uint forwardPort, const { stdErrString=proc->errorString(); #ifdef DEBUG - x2goDebug<<"ssh start failed:" <<stdErrString<<endl; + x2goDebug<<"SSH start failed:" <<stdErrString; #endif slotChannelClosed(this,""); return; @@ -392,7 +392,7 @@ void SshProcess::slotStdErr(SshProcess* creator, QByteArray data) { tunnelOkEmited=true; #ifdef DEBUG - x2goDebug<<"Tunnel OK"<<endl; + x2goDebug<<"Tunnel OK"; #endif emit sshTunnelOk(pid); } @@ -414,7 +414,7 @@ void SshProcess::slotIOerr(SshProcess* creator, QString message, QString sshSess if (sshSessionErr.length()) sshSessionErr = " - "+sshSessionErr; #ifdef DEBUG - x2goDebug<<"I/O error: "<<message<<sshSessionErr<<" ("<<pid<<")."<<endl; + x2goDebug<<"I/O error: "<<message<<sshSessionErr<<" ("<<pid<<")."; #endif normalExited=false; abortString="I/O error: "+message+sshSessionErr; @@ -473,12 +473,12 @@ void SshProcess::slotChannelClosed(SshProcess* creator, QString uuid) normalExited=false; output=stdErrString; #ifdef DEBUG - x2goDebug<<"have only stderr, something must be wrong"<<endl; + x2goDebug<<"Have stderr only, something must be wrong."; #endif } } #ifdef DEBUG - x2goDebug<<"ssh finished: "<<normalExited<<" - "<<output<<" ("<<pid<<")."<<endl; + x2goDebug<<"SSH finished: "<<normalExited<<" - "<<output<<" ("<<pid<<")."; #endif emit sshFinished(normalExited, output, pid); } @@ -489,7 +489,7 @@ void SshProcess::slotSshProcFinished(int exitCode, QProcess::ExitStatus exitStat if (exitCode==0 && exitStatus==QProcess::NormalExit) normalExited=true; #ifdef DEBUG - x2goDebug<<"ssh process exit code :"<<exitStatus; + x2goDebug<<"SSH process exit code :"<<exitStatus; #endif #ifdef Q_OS_WIN if(masterCon->useKerberos()) diff --git a/src/wapi.cpp b/src/wapi.cpp index e98e1ba..2977c21 100644 --- a/src/wapi.cpp +++ b/src/wapi.cpp @@ -223,8 +223,8 @@ void wapiSetWindowIcon ( HWND wnd, const QPixmap& icon) largeIcon=icon.scaled(iconx,icony, Qt::IgnoreAspectRatio,Qt::SmoothTransformation).toWinHICON (); smallIcon=icon.scaled(smallx,smally, Qt::IgnoreAspectRatio,Qt::SmoothTransformation).toWinHICON (); - x2goDebug<<"large icon: "<<largeIcon<<iconx<<"x"<<icony<<endl; - x2goDebug<<"small icon: "<<smallIcon<<smallx<<"x"<<smally<<endl; + x2goDebug<<"Large icon: "<<largeIcon<<iconx<<"x"<<icony; + x2goDebug<<"Small icon: "<<smallIcon<<smallx<<"x"<<smally; int rez=SetClassLong(wnd,GCL_HICON, (LONG)largeIcon); if (!rez) x2goDebug<<"ERROR: "<<GetLastError()<<endl; @@ -270,13 +270,13 @@ QString wapiGetDriveByLabel(const QString& label) for (int i=0; i<len; i+=4) { QString drive=QString::fromUtf16 ( ( const ushort* ) buf+i ); - x2goDebug<<"drive:"<<drive; + x2goDebug<<"Drive: "<<drive; TCHAR vol[MAX_PATH+1]; TCHAR fs[MAX_PATH+1]; GetVolumeInformation(buf+i,vol,MAX_PATH,0,0,0,fs,MAX_PATH); QString volume=QString::fromUtf16 ( ( const ushort* ) vol ); - x2goDebug<<"vol:"<<volume<< - "fs:"<<QString::fromUtf16 ( ( const ushort* ) fs ); + x2goDebug<<"Volume: "<<volume<< + "; fs: "<<QString::fromUtf16 ( ( const ushort* ) fs ); if (!volume.compare(label,Qt::CaseInsensitive)) { x2goDebug<<"matched! "; -- 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 379e41802bea87b7146f331794b11d01e6adf769 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 14 22:21:34 2015 +0100 {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. --- debian/changelog | 1 + src/unixhelper.cpp | 23 +++++++++++++++++++++++ src/unixhelper.h | 29 +++++++++++++++++++++++++++++ x2goclient.pro | 6 ++++-- x2goclient.pro.maemo | 6 ++++-- 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f4666e0..5503e3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -425,6 +425,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low + sshmasterconnection.cpp + sshprocess.cpp + wapi.cpp + - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp new file mode 100644 index 0000000..221bdb2 --- /dev/null +++ b/src/unixhelper.cpp @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef Q_OS_UNIX + + +#endif /* defined (Q_OS_UNIX) */ diff --git a/src/unixhelper.h b/src/unixhelper.h new file mode 100644 index 0000000..31d983e --- /dev/null +++ b/src/unixhelper.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef Q_OS_UNIX + +#ifndef UNIXHELPER_H +#define UNIXHELPER_H + + + +#endif /* !defined (UNIXHELPER_H) */ + +#endif /* defined (Q_OS_UNIX) */ diff --git a/x2goclient.pro b/x2goclient.pro index ccf8fa7..e5428ce 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -79,7 +79,8 @@ HEADERS += src/configdialog.h \ src/folderbutton.h \ src/folderexplorer.h \ src/non_modal_messagebox.h \ - src/help.h + src/help.h \ + src/unixhelper.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -122,7 +123,8 @@ SOURCES += src/sharewidget.cpp \ src/folderbutton.cpp \ src/folderexplorer.cpp \ src/non_modal_messagebox.cpp \ - src/help.cpp + src/help.cpp \ + src/unixhelper.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 diff --git a/x2goclient.pro.maemo b/x2goclient.pro.maemo index ac2eacf..63cc3d8 100644 --- a/x2goclient.pro.maemo +++ b/x2goclient.pro.maemo @@ -35,7 +35,8 @@ HEADERS += src/configdialog.h \ src/settingswidget.h \ src/sharewidget.h \ src/clicklineedit.h \ - src/help.h + src/help.h \ + src/unixhelper.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -62,7 +63,8 @@ SOURCES += src/sharewidget.cpp \ src/embedwidget.cpp \ src/wapi.cpp \ src/clicklineedit.cpp \ - src/help.cpp + src/help.cpp \ + src/unixhelper.cpp TEMPLATE = app TARGET = -- 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 1c561a82ce531a7877bfef7e64f50c446876afc5 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:27:23 2015 +0100 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. --- debian/changelog | 2 ++ src/x2goclient.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/debian/changelog b/debian/changelog index fa256c2..99fa04e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -428,6 +428,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. - unixhelper.{cpp,h}: implement cleanup program for process group. - x2goclient.cpp: wrap X2Go Client main function and use that. + - x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup + helper. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 80fd967..f285f40 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -15,12 +15,45 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ +#include <iostream> +#include <unistd.h> +#include <cstring> +#include <cerrno> +#include <cstdlib> + +#include "unixhelper.h" #include "ongetpass.h" int wrap_x2go_main (int argc, char **argv) { return (x2goMain (argc, argv)); } +#ifdef Q_OS_UNIX +int fork_helper (int argc, char **argv) { + /* Fork off to start helper process. */ + pid_t tmp_pid = fork (); + + /* Child. */ + if (0 == tmp_pid) { + /* Starting unixhelper. */ + unixhelper cleanup_helper (); + cleanup_helper.unix_cleanup (); + } + /* Error. */ + else if (-1 == tmp_pid) { + std::cerr << "Unable to create a new process for the UNIX cleanup watchdog: " << std::strerror (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); + } + /* Parent. */ + else { + /* Start real X2Go Client. */ + return (wrap_x2go_main (argc, argv)); + } +} +#endif /* defined (Q_OS_UNIX) */ + int main(int argc, char *argv[]) { return (wrap_x2go_main (argc, argv)); -- 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 6d8e68f248f4a421a907bd10910d2309e10663c2 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:36:35 2015 +0100 x2goclient.cpp: add myself to copyright header. --- debian/changelog | 1 + src/x2goclient.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0930e3e..fda35a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -434,6 +434,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low leader. If that fails, fork, terminate the parent and execute setsid() in the child process. Use fork_helper() to start the UNIX cleanup helper in a child process and continue with the main application in the parent. + - x2goclient.cpp: add myself to copyright header. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 1a57178..c242ad2 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -1,6 +1,7 @@ /************************************************************************** * Copyright (C) 2005-2015 by Oleksandr Shneyder * * o.shneyder@phoca-gmbh.de * +* Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * -- 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 e616d3653b5f3930e8d5b082425e7d5b4e3cc18f Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:30:49 2015 +0100 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. If that fails, fork, terminate the parent and execute setsid() in the child process. Use fork_helper() to start the UNIX cleanup helper in a child process and continue with the main application in the parent. --- debian/changelog | 4 ++++ src/x2goclient.cpp | 43 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 99fa04e..0930e3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -430,6 +430,10 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goclient.cpp: wrap X2Go Client main function and use that. - x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. + - x2goclient.cpp: use setsid() on UNIX to become session and process group + leader. If that fails, fork, terminate the parent and execute setsid() + in the child process. Use fork_helper() to start the UNIX cleanup helper + in a child process and continue with the main application in the parent. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index f285f40..1a57178 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -54,7 +54,44 @@ int fork_helper (int argc, char **argv) { } #endif /* defined (Q_OS_UNIX) */ -int main(int argc, char *argv[]) -{ - return (wrap_x2go_main (argc, argv)); +int main (int argc, char **argv) { +#ifdef Q_OS_UNIX + if (-1 == setsid ()) { + std::cerr << "Unable to create a new process session: " << std::strerror (errno) << "\n"; + + std::cerr << "Trying to fork." << std::endl; + pid_t tmp_pid = fork (); + + /* Child. */ + if (0 == tmp_pid) { + /* Trying to get a new session and become session + process group leader again. */ + if (-1 == setsid ()) { + std::cerr << "Child was unable to create a new process session: " << std::strerror (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); + } + + /* By now, we should be session and group leader. */ + return (fork_helper (argc, argv)); + } + /* Error. */ + else if (-1 == tmp_pid) { + std::cerr << "Error while forking: " << std::strerror (errno) << std::endl; + std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + + std::edit (EXIT_FAILURE); + } + /* Parent. Just die here. */ + else { + std::exit (EXIT_SUCCESS); + } + } + else { + /* setsid() worked. Starting helper and main program. */ + return (fork_helper (argc, argv)); + } +#else /* defined (Q_OS_UNIX) */ + return (wrap_x2go_main (argc, argv)); +#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 2a6dde3a53c556125301787598bc48c75d559d63 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 21:13:05 2015 +0100 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. --- debian/changelog | 2 ++ src/unixhelper.cpp | 5 ++++- src/unixhelper.h | 9 ++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 47eedb6..c7d6951 100644 --- a/debian/changelog +++ b/debian/changelog @@ -438,6 +438,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. - x2goclient.cpp: fix std::edit -> std::exit typo. + - unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX + defined on UNIX-based platforms. Move guards around. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 545c2c1..b326f35 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -17,6 +17,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +/* Necessary for Q_OS_UNIX! */ + +#include "unixhelper.h" + #ifdef Q_OS_UNIX #include <csignal> @@ -26,7 +30,6 @@ #include <cerrno> #include <cstdlib> -#include "unixhelper.h" void unixhelper::kill_pgroup (int signal) { if (SIGHUP == signal) { diff --git a/src/unixhelper.h b/src/unixhelper.h index fab611e..27cb735 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -17,11 +17,14 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifdef Q_OS_UNIX #ifndef UNIXHELPER_H #define UNIXHELPER_H +#include <QtCore/qglobal.h> + +#ifdef Q_OS_UNIX + class unixhelper { public: unixhelper () {} @@ -33,6 +36,6 @@ class unixhelper { void kill_pgroup (int signal); }; -#endif /* !defined (UNIXHELPER_H) */ - #endif /* defined (Q_OS_UNIX) */ + +#endif /* !defined (UNIXHELPER_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 e0b4f8afc5191a1445b79d6fc2b13773f6b71dbc Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:37:43 2015 +0100 x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. --- debian/changelog | 2 ++ src/x2goclient.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index fda35a9..530145d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -435,6 +435,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low in the child process. Use fork_helper() to start the UNIX cleanup helper in a child process and continue with the main application in the parent. - x2goclient.cpp: add myself to copyright header. + - x2goclient.cpp: add legacy <sys/types.h> header needed for old operating + systems. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index c242ad2..58f80f0 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -17,6 +17,7 @@ ***************************************************************************/ #include <iostream> +#include <sys/types.h> #include <unistd.h> #include <cstring> #include <cerrno> -- 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 ee792117b41e0bd865f5f0c937f3e97dd77da179 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:45:24 2015 +0100 x2goclient.cpp: fix std::edit -> std::exit typo. --- debian/changelog | 1 + src/x2goclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 530145d..47eedb6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -437,6 +437,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goclient.cpp: add myself to copyright header. - x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. + - x2goclient.cpp: fix std::edit -> std::exit typo. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 58f80f0..dd9e489 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -82,7 +82,7 @@ int main (int argc, char **argv) { std::cerr << "Error while forking: " << std::strerror (errno) << std::endl; std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; - std::edit (EXIT_FAILURE); + std::exit (EXIT_FAILURE); } /* Parent. Just die here. */ else { -- 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 8bf912610aaf4449f8c7c7d9c04141651007d9f9 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 21:38:10 2015 +0100 unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. --- debian/changelog | 2 ++ src/unixhelper.cpp | 43 ++++++++++++++++++++++--------------------- src/unixhelper.h | 14 ++++---------- src/x2goclient.cpp | 3 +-- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/debian/changelog b/debian/changelog index 462d5b9..154e937 100644 --- a/debian/changelog +++ b/debian/changelog @@ -441,6 +441,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. - unixhelper.h: forgot to declare type of unix_cleanup() function. + - {unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a + (module) namespace, not a class. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index b326f35..b0729c6 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,34 +30,35 @@ #include <cerrno> #include <cstdlib> +namespace unixhelper { + void kill_pgroup (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 unixhelper::kill_pgroup (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; - } - - /* Grant a grace period of (at least) 5 seconds. */ - sleep (5); + /* Grant a grace period of (at least) 5 seconds. */ + sleep (5); - /* Don't handle any errors here, because we die anyway. */ - killpg (getpgrp (), SIGKILL); + /* Don't handle any errors here, because we die anyway. */ + killpg (getpgrp (), SIGKILL); + } } -} -int unixhelper::unix_cleanup () { - if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { - std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; - std::exit (1); - } + int unix_cleanup () { + if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { + std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + std::exit (1); + } - std::signal (SIGHUP, kill_pgroup); + std::signal (SIGHUP, kill_pgroup); - /* Sleep forever... at least one second in each run. */ - for (;;) { - sleep (1); + /* Sleep forever... at least one second in each run. */ + for (;;) { + sleep (1); + } } } diff --git a/src/unixhelper.h b/src/unixhelper.h index 9069b5d..fe86017 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -25,16 +25,10 @@ #ifdef Q_OS_UNIX -class unixhelper { - public: - unixhelper () {} - ~unixhelper () {} - int unix_cleanup (); - - private: - unixhelper (const unixhelper &other); - void kill_pgroup (int signal); -}; +namespace unixhelper { + int unix_cleanup (); + void kill_pgroup (int signal); +} #endif /* defined (Q_OS_UNIX) */ diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index dd9e489..005d819 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -38,8 +38,7 @@ int fork_helper (int argc, char **argv) { /* Child. */ if (0 == tmp_pid) { /* Starting unixhelper. */ - unixhelper cleanup_helper (); - cleanup_helper.unix_cleanup (); + unixhelper::unix_cleanup (); } /* Error. */ else if (-1 == tmp_pid) { -- 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 a6b1ccc617607c4515c673275d3048ffc32db2e4 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 21:17:49 2015 +0100 unixhelper.h: forgot to declare type of unix_cleanup() function. --- debian/changelog | 1 + src/unixhelper.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c7d6951..462d5b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -440,6 +440,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goclient.cpp: fix std::edit -> std::exit typo. - unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. + - unixhelper.h: forgot to declare type of unix_cleanup() function. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.h b/src/unixhelper.h index 27cb735..9069b5d 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -29,7 +29,7 @@ class unixhelper { public: unixhelper () {} ~unixhelper () {} - unix_cleanup (); + int unix_cleanup (); private: unixhelper (const unixhelper &other); -- 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 302cdeff1c361411dd9d3d71645685c64bca3eed Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:14:46 2015 +0100 x2goclient.cpp: return return value of unixhelper::unix_cleanup(). --- debian/changelog | 1 + src/x2goclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0faa34c..69e091f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -444,6 +444,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - {unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. - unixhelper.{cpp,h}: add documentation/comments. + - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index de3b7c9..4558784 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -38,7 +38,7 @@ int fork_helper (int argc, char **argv) { /* Child. */ if (0 == tmp_pid) { /* Starting unixhelper. */ - unixhelper::unix_cleanup (); + return (unixhelper::unix_cleanup ()); /* Anything here shall be unreachable. */ } -- 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 d1ef997cf729ce189e801de953338771edb1c38c Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:42:14 2015 +0100 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. --- debian/changelog | 2 ++ src/unixhelper.cpp | 20 ++++++++++++++++++++ src/unixhelper.h | 10 +++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6fd843f..749bb87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -446,6 +446,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - unixhelper.{cpp,h}: add documentation/comments. - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). - unixhelper.cpp: kill process group on error. + - unixhelper.{cpp,h}: implement signal unblocking in + unixhelper::unix_cleanup(). Update documentation. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d9ef3d7..1877890 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -54,6 +54,26 @@ namespace unixhelper { int unix_cleanup () { + /* + * Unblock all signals first. + * Signal blocks are inherited, so you never you what is currently set. + */ + sigset_t empty_set; + if (0 != sigemptyset (&empty_set)) { + std::cerr << "Unable to fetch empty signal set: " << std::strerror (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; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } + + /* Set up signal handler to ignore SIGTERM. */ if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; kill_pgroup (-1); diff --git a/src/unixhelper.h b/src/unixhelper.h index a00d21b..7ca8b43 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -27,12 +27,12 @@ namespace unixhelper { /* - * TODO: Unblocks all signals and - * installs a signal handler for SIGHUP, which calls kill_pgroup. + * Unblocks all signals and installs a signal handler for SIGHUP, + * which calls kill_pgroup. * - * TODO: Should signal unblocking or - * installing the signal handler fail, an emergency exit is performed - * and the whole process group killed. + * Should signal unblocking or installing the signal handler fail, + * an emergency exit is performed and + * the whole process group killed. * * Loops indefinitely afterwards. */ -- 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 188f98105957eef97cb562c88bbb7ff9c83da461 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:04:19 2015 +0100 unixhelper.{cpp,h}: add documentation/comments. --- debian/changelog | 1 + src/unixhelper.cpp | 4 ++++ src/unixhelper.h | 24 ++++++++++++++++++++++++ src/x2goclient.cpp | 2 ++ 4 files changed, 31 insertions(+) diff --git a/debian/changelog b/debian/changelog index 154e937..0faa34c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -443,6 +443,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - unixhelper.h: forgot to declare type of unix_cleanup() function. - {unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. + - unixhelper.{cpp,h}: add documentation/comments. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index b0729c6..2ad0740 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,6 +30,8 @@ #include <cerrno> #include <cstdlib> +/* For documentation please see unixhelper.h. */ + namespace unixhelper { void kill_pgroup (int signal) { if (SIGHUP == signal) { @@ -51,6 +53,8 @@ namespace unixhelper { if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; std::exit (1); + + /* Anything here shall be unreachable. */ } std::signal (SIGHUP, kill_pgroup); diff --git a/src/unixhelper.h b/src/unixhelper.h index fe86017..a00d21b 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -26,7 +26,31 @@ #ifdef Q_OS_UNIX namespace unixhelper { + /* + * TODO: Unblocks all signals and + * installs a signal handler for SIGHUP, which calls kill_pgroup. + * + * TODO: Should signal unblocking or + * installing the signal handler fail, an emergency exit is performed + * and the whole process group killed. + * + * Loops indefinitely afterwards. + */ int unix_cleanup (); + + /* + * Kills the whole process group. + * First, SIGTERM is sent to the group. + * A 5 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. + * + * signal may be any of: + * * -1 to indicate an error leading to emergency termination + * * SIGHUP as the standard signal that is sent when the + * group leeader dies + */ void kill_pgroup (int signal); } diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 005d819..de3b7c9 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -39,6 +39,8 @@ int fork_helper (int argc, char **argv) { if (0 == tmp_pid) { /* Starting unixhelper. */ unixhelper::unix_cleanup (); + + /* Anything here shall be unreachable. */ } /* Error. */ else if (-1 == tmp_pid) { -- 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 366aeb1bf488c35b9b36905aa47a3878be2e450e Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:15:58 2015 +0100 unixhelper.cpp: kill process group on error. --- debian/changelog | 1 + src/unixhelper.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 69e091f..6fd843f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -445,6 +445,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low (module) namespace, not a class. - unixhelper.{cpp,h}: add documentation/comments. - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). + - unixhelper.cpp: kill process group on error. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2ad0740..d9ef3d7 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -28,13 +28,17 @@ #include <iostream> #include <cstring> #include <cerrno> -#include <cstdlib> /* For documentation please see unixhelper.h. */ namespace unixhelper { void kill_pgroup (int signal) { - if (SIGHUP == signal) { + if ((SIGHUP == signal) || (-1 == signal)) { + if (-1 == signal) { + std::cerr << "ERROR: emergency exit due to previous error(s)." << "\n"; + std::cerr << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + } + /* 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; @@ -52,7 +56,7 @@ namespace unixhelper { int unix_cleanup () { if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; - std::exit (1); + kill_pgroup (-1); /* Anything here shall be unreachable. */ } -- 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 e9c78cc4c9aaffa7f1de7ce991224144dfd68514 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 23:08:13 2015 +0100 unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. --- debian/changelog | 1 + src/unixhelper.cpp | 33 ++++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 749bb87..61296ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -448,6 +448,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - unixhelper.cpp: kill process group on error. - unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. + - unixhelper.cpp: port from std::signal() to sigactio(). Handle errors. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 1877890..2b057ff 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -73,15 +73,34 @@ namespace unixhelper { /* Anything here shall be unreachable. */ } - /* Set up signal handler to ignore SIGTERM. */ - if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { - std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; - kill_pgroup (-1); - - /* Anything here shall be unreachable. */ + { + struct sigaction sig_action; + sig_action.sa_handler = SIG_IGN; + sig_action.sa_mask = empty_set; + sig_action.sa_flags = SA_RESTART; + + /* Set up signal handler to ignore SIGTERM. */ + if (0 != sigaction (SIGTERM, &sig_action, NULL)) { + std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } } - std::signal (SIGHUP, kill_pgroup); + { + struct sigaction sig_action; + sig_action.sa_handler = kill_pgroup; + sig_action.sa_mask = empty_set; + 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; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } + } /* Sleep forever... at least one second in each run. */ for (;;) { -- 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 40bedbac3c5f1be42ed224d7a2470a989be3ab3d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 01:04:33 2015 +0100 x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. Introduce a new command line option --unixhelper and re-execute the main binary with this new option to indicate that the UNIX cleanup helper tool is requested. It is necessary to call exec() after fork on virtually all operating system, especially on OS X. --- debian/changelog | 5 ++++ src/x2goclient.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index f7e6d25..54bf06d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -453,6 +453,11 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low and we certainly do not need to fork to force it to succeed. Whether we are a process group leader already or become one doesn't matter, if the end result is that we are process group leader. + - x2goclient.cpp: don't start the UNIX cleanup helper process right after + forking, but introduce a new command line option --unixhelper and + re-execute the main binary with this new option to indicate that the + UNIX cleanup helper tool is requested. It is necessary to call exec() + after fork on virtually all operating system, especially on OS X. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index f7f7c81..2aff41f 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -22,6 +22,10 @@ #include <cstring> #include <cerrno> #include <cstdlib> +#include <string> +#include <algorithm> +#include <cctype> +#include <vector> #include "unixhelper.h" #include "ongetpass.h" @@ -38,7 +42,28 @@ int fork_helper (int argc, char **argv) { /* Child. */ if (0 == tmp_pid) { /* Starting unixhelper. */ - return (unixhelper::unix_cleanup ()); + std::vector<std::string> new_argv; + new_argv.push (std::string (argv[0])); + new_argv.push ("--unixhelper"); + + std::vector<const char *> new_argv_c_str; + for (const_iterator it = new_argv.begin (); it != new_argv.end (); ++it) { + new_argv_c_str.push ((*it).c_str ()); + } + new_argv_c_str.push (""); + + if (0 != execv (new_argv_c_str.data (), new_argv_c_str.data ())) { + std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (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; + } + + std::exit (EXIT_FAILURE); + } /* Anything here shall be unreachable. */ } @@ -59,15 +84,35 @@ int fork_helper (int argc, char **argv) { int main (int argc, char **argv) { #ifdef Q_OS_UNIX - /* - * setsid() may succeed and we become a session and process - * group leader, or it may fail indicating that we already - * are a process group leader. Either way is fine. - */ - setsid (); - - /* We should be process group leader by now. */ - return (fork_helper (argc, argv)); + /* Scan program arguments for --unixhelper flag. */ + bool unix_helper_request = 0; + for (int i = 0; i < argc; ++i) { + std::string cur_arg (argv[i]); + + /* Make the current argument lowercase. */ + std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), std::tolower); + + if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper"))) { + unix_helper_request = 1; + break; + } + } + + if (unix_helper_request) { + /* We were instructed to start as the UNIX cleanup helper tool. */ + return (unixhelper::unix_cleanup ()); + } + else { + /* + * setsid() may succeed and we become a session and process + * group leader, or it may fail indicating that we already + * are a process group leader. Either way is fine. + */ + setsid (); + + /* We should be process group leader by now. */ + return (fork_helper (argc, argv)); + } #else /* defined (Q_OS_UNIX) */ return (wrap_x2go_main (argc, argv)); #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 ca7b16661591b1b42f0ff4246d70aa558d756aaf Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 23:41:12 2015 +0100 x2goclient.cpp: clean up. We don't care if setsid() fails or succeeds and we certainly do not need to fork to force it to succeed. Whether we are a process group leader already or become one doesn't matter, if the end result is that we are process group leader. --- debian/changelog | 4 ++++ src/x2goclient.cpp | 42 ++++++++---------------------------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/debian/changelog b/debian/changelog index 61296ee..f7e6d25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -449,6 +449,10 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. - unixhelper.cpp: port from std::signal() to sigactio(). Handle errors. + - x2goclient.cpp: clean up. We don't care if setsid() fails or succeeds + and we certainly do not need to fork to force it to succeed. Whether we + are a process group leader already or become one doesn't matter, if the + end result is that we are process group leader. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 4558784..f7f7c81 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -59,41 +59,15 @@ int fork_helper (int argc, char **argv) { int main (int argc, char **argv) { #ifdef Q_OS_UNIX - if (-1 == setsid ()) { - std::cerr << "Unable to create a new process session: " << std::strerror (errno) << "\n"; + /* + * setsid() may succeed and we become a session and process + * group leader, or it may fail indicating that we already + * are a process group leader. Either way is fine. + */ + setsid (); - std::cerr << "Trying to fork." << std::endl; - pid_t tmp_pid = fork (); - - /* Child. */ - if (0 == tmp_pid) { - /* Trying to get a new session and become session + process group leader again. */ - if (-1 == setsid ()) { - std::cerr << "Child was unable to create a new process session: " << std::strerror (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); - } - - /* By now, we should be session and group leader. */ - return (fork_helper (argc, argv)); - } - /* Error. */ - else if (-1 == tmp_pid) { - std::cerr << "Error while forking: " << std::strerror (errno) << std::endl; - 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); - } - /* Parent. Just die here. */ - else { - std::exit (EXIT_SUCCESS); - } - } - else { - /* setsid() worked. Starting helper and main program. */ - return (fork_helper (argc, argv)); - } + /* We should be process group leader by now. */ + return (fork_helper (argc, argv)); #else /* defined (Q_OS_UNIX) */ return (wrap_x2go_main (argc, argv)); #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 eff85e1cadcec1be4760322049d69e63563aa9d7 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 04:39:43 2015 +0100 x2goclient.cpp: fix string comparison. --- debian/changelog | 1 + src/x2goclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 48b461f..756471b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -459,6 +459,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low UNIX cleanup helper tool is requested. It is necessary to call exec() after fork on virtually all operating system, especially on OS X. - x2goclient.cpp: fix compile problems introduced with the last commit. + - x2goclient.cpp: fix string comparison. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index cd13406..c695e26 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -101,7 +101,7 @@ int main (int argc, char **argv) { /* Make the current argument lowercase. */ std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), ::tolower); - if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper"))) { + if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper") == 0)) { unix_helper_request = 1; 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 8ea52108c7e5f204f2fc68d1088ec59eab1886fc Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 03:06:15 2015 +0100 x2goclient.cpp: fix compile problems introduced with the last commit. --- debian/changelog | 1 + src/x2goclient.cpp | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 54bf06d..48b461f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -458,6 +458,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low re-execute the main binary with this new option to indicate that the UNIX cleanup helper tool is requested. It is necessary to call exec() after fork on virtually all operating system, especially on OS X. + - x2goclient.cpp: fix compile problems introduced with the last commit. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 2aff41f..cd13406 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -26,6 +26,7 @@ #include <algorithm> #include <cctype> #include <vector> +#include <csignal> #include "unixhelper.h" #include "ongetpass.h" @@ -43,16 +44,23 @@ int fork_helper (int argc, char **argv) { if (0 == tmp_pid) { /* Starting unixhelper. */ std::vector<std::string> new_argv; - new_argv.push (std::string (argv[0])); - new_argv.push ("--unixhelper"); + new_argv.push_back (std::string (argv[0])); + new_argv.push_back ("--unixhelper"); - std::vector<const char *> new_argv_c_str; - for (const_iterator it = new_argv.begin (); it != new_argv.end (); ++it) { - new_argv_c_str.push ((*it).c_str ()); + std::vector<char *> new_argv_c_str; + for (std::vector<std::string>::iterator it = new_argv.begin (); it != new_argv.end (); ++it) { + const char *elem = (*it).c_str (); + new_argv_c_str.push_back (strndup (elem, std::strlen (elem))); } - new_argv_c_str.push (""); - if (0 != execv (new_argv_c_str.data (), new_argv_c_str.data ())) { + /* Add null pointer as last element. */ + { + std::vector<char> tmp; + tmp.push_back (0); + new_argv_c_str.push_back (&tmp.front ()); + } + + 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" << "Terminating and killing parent." << "\n" << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; @@ -66,6 +74,7 @@ int fork_helper (int argc, char **argv) { } /* Anything here shall be unreachable. */ + return (0); } /* Error. */ else if (-1 == tmp_pid) { @@ -90,7 +99,7 @@ int main (int argc, char **argv) { std::string cur_arg (argv[i]); /* Make the current argument lowercase. */ - std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), std::tolower); + std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), ::tolower); if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper"))) { unix_helper_request = 1; -- 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 515d424fe71ce700f83a1bf0871a04db170d3bd5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 05:51:03 2015 +0100 x2goclient.cpp: create new argv array on the heap instead of on the stack. Stack data will be invalid once the function goes out of scope (which is what execv is doing.) --- debian/changelog | 3 +++ src/x2goclient.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 756471b..9f78b3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -460,6 +460,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low after fork on virtually all operating system, especially on OS X. - x2goclient.cpp: fix compile problems introduced with the last commit. - x2goclient.cpp: fix string comparison. + - x2goclient.cpp: create new argv array on the heap instead of on the + stack. Stack data will be invalid once the function goes out of scope + (which is what execv is doing.) [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index c695e26..479d564 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -47,20 +47,20 @@ int fork_helper (int argc, char **argv) { new_argv.push_back (std::string (argv[0])); new_argv.push_back ("--unixhelper"); - std::vector<char *> new_argv_c_str; + std::vector<char *> *new_argv_c_str = new (std::vector<char *>) (); for (std::vector<std::string>::iterator it = new_argv.begin (); it != new_argv.end (); ++it) { const char *elem = (*it).c_str (); - new_argv_c_str.push_back (strndup (elem, std::strlen (elem))); + new_argv_c_str->push_back (strndup (elem, std::strlen (elem))); } /* Add null pointer as last element. */ { - std::vector<char> tmp; - tmp.push_back (0); - new_argv_c_str.push_back (&tmp.front ()); + std::vector<char> *tmp = new (std::vector<char>) (); + tmp->push_back (0); + new_argv_c_str->push_back (&tmp->front ()); } - if (0 != execv (new_argv_c_str.front (), &(new_argv_c_str.front ()))) { + 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" << "Terminating and killing parent." << "\n" << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; -- 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 ebc5457910b11635b60028bfde0f176ec25120d5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 21:08:46 2015 +0100 unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. --- debian/changelog | 2 ++ src/unixhelper.cpp | 8 ++++---- src/unixhelper.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9f78b3b..3dce297 100644 --- a/debian/changelog +++ b/debian/changelog @@ -463,6 +463,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goclient.cpp: create new argv array on the heap instead of on the stack. Stack data will be invalid once the function goes out of scope (which is what execv is doing.) + - unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period + to 10 seconds. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2b057ff..2bdaec1 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -44,8 +44,8 @@ namespace unixhelper { std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; } - /* Grant a grace period of (at least) 5 seconds. */ - sleep (5); + /* Grant a grace period of (at least) 10 seconds. */ + sleep (10); /* Don't handle any errors here, because we die anyway. */ killpg (getpgrp (), SIGKILL); @@ -102,9 +102,9 @@ namespace unixhelper { } } - /* Sleep forever... at least one second in each run. */ + /* Sleep forever... at least two seconds in each run. */ for (;;) { - sleep (1); + sleep (2); } } } diff --git a/src/unixhelper.h b/src/unixhelper.h index 7ca8b43..9f213a8 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -28,7 +28,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 @@ -41,7 +41,7 @@ namespace unixhelper { /* * Kills the whole process group. * First, SIGTERM is sent to the group. - * A 5 seconds grace period is granted to make sure + * 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. -- 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 c3ef5db1027bad287a07cf02bff237872cdb2870 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 21:15:08 2015 +0100 {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. --- debian/changelog | 2 ++ src/unixhelper.cpp | 9 ++++++++- src/unixhelper.h | 11 +++++++++-- src/x2goclient.cpp | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3dce297..50f8161 100644 --- a/debian/changelog +++ b/debian/changelog @@ -465,6 +465,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low (which is what execv is doing.) - unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. + - {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to + parent PID polling. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2bdaec1..2f89e2f 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -53,7 +53,7 @@ namespace unixhelper { } - int unix_cleanup () { + int unix_cleanup (const pid_t parent) { /* * Unblock all signals first. * Signal blocks are inherited, so you never you what is currently set. @@ -104,6 +104,13 @@ namespace unixhelper { /* Sleep forever... at least two seconds in each run. */ for (;;) { + pid_t cur_ppid = getppid (); + + /* cur_ppid should match parent, otherwise the parent died. */ + if (cur_ppid != parent) { + kill_pgroup (SIGHUP); + } + sleep (2); } } diff --git a/src/unixhelper.h b/src/unixhelper.h index 9f213a8..7511d4d 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -22,6 +22,7 @@ #define UNIXHELPER_H #include <QtCore/qglobal.h> +#include <unistd.h> #ifdef Q_OS_UNIX @@ -35,8 +36,12 @@ namespace unixhelper { * the whole process group killed. * * Loops indefinitely afterwards. + * + * 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. */ - int unix_cleanup (); + int unix_cleanup (const pid_t parent); /* * Kills the whole process group. @@ -49,7 +54,9 @@ namespace unixhelper { * signal may be any of: * * -1 to indicate an error leading to emergency termination * * SIGHUP as the standard signal that is sent when the - * group leeader dies + * group leader dies under specific circumstances + * (we cannot rely that this always happens, though, + * so a polling solution is needed, see unix_cleanup().) */ void kill_pgroup (int signal); } diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 479d564..92d614d 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -109,7 +109,7 @@ int main (int argc, char **argv) { if (unix_helper_request) { /* We were instructed to start as the UNIX cleanup helper tool. */ - return (unixhelper::unix_cleanup ()); + return (unixhelper::unix_cleanup (getppid ())); } else { /* -- 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 57e260c980d327f62c660cf4e419049ca6322177 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Mar 20 04:02:06 2015 +0100 x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. --- debian/changelog | 2 ++ src/x2goclient.cpp | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ba6b83..bdc9207 100644 --- a/debian/changelog +++ b/debian/changelog @@ -469,6 +469,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low parent PID polling. - unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. + - x2goclient.cpp: fix failing exec() call for the UNIX helper utility: + correctly terminate arguments vector. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 92d614d..d8ae6fa 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -54,11 +54,7 @@ int fork_helper (int argc, char **argv) { } /* Add null pointer as last element. */ - { - std::vector<char> *tmp = new (std::vector<char>) (); - tmp->push_back (0); - new_argv_c_str->push_back (&tmp->front ()); - } + 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" -- 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 01c8f308eff95cf31f7caa2aae0b4332962a5233 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 22:22:27 2015 +0100 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. --- debian/changelog | 2 ++ src/unixhelper.cpp | 17 +++++++++++++---- src/unixhelper.h | 3 +++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 50f8161..0ba6b83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -467,6 +467,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low to 10 seconds. - {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. + - unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 + and SIGUSR2. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2f89e2f..afc7b60 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -28,6 +28,7 @@ #include <iostream> #include <cstring> #include <cerrno> +#include <vector> /* For documentation please see unixhelper.h. */ @@ -73,15 +74,23 @@ namespace unixhelper { /* Anything here shall be unreachable. */ } - { + std::vector<int> ignore_signals; + ignore_signals.push_back (SIGINT); + ignore_signals.push_back (SIGTERM); + ignore_signals.push_back (SIGPIPE); + ignore_signals.push_back (SIGQUIT); + ignore_signals.push_back (SIGUSR1); + ignore_signals.push_back (SIGUSR2); + + for (std::vector<int>::iterator it = ignore_signals.begin (); it != ignore_signals.end (); ++it) { struct sigaction sig_action; sig_action.sa_handler = SIG_IGN; sig_action.sa_mask = empty_set; sig_action.sa_flags = SA_RESTART; - /* Set up signal handler to ignore SIGTERM. */ - if (0 != sigaction (SIGTERM, &sig_action, NULL)) { - std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + /* 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; kill_pgroup (-1); /* Anything here shall be unreachable. */ diff --git a/src/unixhelper.h b/src/unixhelper.h index 7511d4d..a34456e 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -35,6 +35,9 @@ namespace unixhelper { * an emergency exit is performed and * the whole process group killed. * + * The signals SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and + * SIGUSR2 are ignored. + * * Loops indefinitely afterwards. * * In this loop, the current parent PID is polled and compared against -- 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 4f4099384de24df0d0d6190b6ffbb31993b5a698 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 00:04:44 2015 +0100 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. --- debian/changelog | 2 ++ src/appdialog.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index e81cc7e..6017c13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -473,6 +473,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low correctly terminate arguments vector. - {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. + - appdialog.cpp: initialize parent in default case. Another GCC compile + warning fix. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/appdialog.cpp b/src/appdialog.cpp index a8ec4ec..013eb79 100644 --- a/src/appdialog.cpp +++ b/src/appdialog.cpp @@ -153,6 +153,7 @@ void AppDialog::loadApps() parent=other; break; default: + parent = NULL; 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 29c1b1bcb826425dd6d7a98fc020d6ce1677bd89 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 00:00:59 2015 +0100 {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. --- debian/changelog | 2 ++ src/appdialog.cpp | 22 ++++++++++++---------- src/configwidget.cpp | 6 ++---- src/onmainwindow.cpp | 9 ++++++--- src/unixhelper.cpp | 7 +++++++ 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index bdc9207..e81cc7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -471,6 +471,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low and SIGUSR2. - x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. + - {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile + warnings with GCC. Fix a few whitespace issues. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/appdialog.cpp b/src/appdialog.cpp index f10be8f..a8ec4ec 100644 --- a/src/appdialog.cpp +++ b/src/appdialog.cpp @@ -156,16 +156,18 @@ void AppDialog::loadApps() break; } - QTreeWidgetItem* it; - if (app.category==Application::TOP) - it=new QTreeWidgetItem(treeWidget); - else - it=new QTreeWidgetItem(parent); - it->setText(0, app.name); - it->setToolTip(0,app.comment); - it->setIcon(0,app.icon); - it->setData(0, Qt::UserRole, app.exec); - it->setData(0, Qt::UserRole+1, app.comment); + if (parent) { + QTreeWidgetItem* it; + if (app.category==Application::TOP) + it=new QTreeWidgetItem(treeWidget); + else + it=new QTreeWidgetItem(parent); + it->setText(0, app.name); + it->setToolTip(0,app.comment); + it->setIcon(0,app.icon); + it->setData(0, Qt::UserRole, app.exec); + it->setData(0, Qt::UserRole+1, app.comment); + } } treeWidget->sortItems(0,Qt::AscendingOrder); } diff --git a/src/configwidget.cpp b/src/configwidget.cpp index e98ad4d..c9b8baa 100644 --- a/src/configwidget.cpp +++ b/src/configwidget.cpp @@ -24,8 +24,8 @@ ConfigWidget::ConfigWidget ( QString id, ONMainWindow * mw, { sessionId=id; mainWindow=mw; - miniMode=mw->retMiniMode(); - embedMode=embedMode= mw->getEmbedMode(); + miniMode=mw->retMiniMode(); + embedMode = mw->getEmbedMode(); if(embedMode) sessionId="embedded"; } @@ -34,5 +34,3 @@ ConfigWidget::ConfigWidget ( QString id, ONMainWindow * mw, ConfigWidget::~ConfigWidget() { } - - diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index eba9a3a..5b664b2 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -4140,8 +4140,10 @@ void ONMainWindow::resumeSession ( const x2goSession& s ) if (! startXorgOnStart) startXOrg(); // #endif +#else /* defined (Q_OS_WIN) */ + UNUSED (rootless); +#endif /* defined (Q_OS_WIN) */ -#endif if ( fullscreen ) { geometry="fullscreen"; @@ -10470,6 +10472,7 @@ void ONMainWindow::slotEmbedIntoParentWindow() void ONMainWindow::processSessionConfig() { bool haveKey=false; + UNUSED (haveKey); config.command="KDE"; config.brokerNoAuth=false; @@ -11523,8 +11526,6 @@ void ONMainWindow::printSshDError_noHostPubKey() if ( closeEventSent ) return; - int port = clientSshPort.toInt (); - QString error_message = tr ("SSH daemon failed to open its public host key."); QString detailed_error_message = tr ("You have enabled Remote Printing or File Sharing.\n" @@ -11554,6 +11555,8 @@ void ONMainWindow::printSshDError_noHostPubKey() } else { #ifdef Q_OS_DARWIN + int port = clientSshPort.toInt (); + detailed_error_message += tr ("On OS X, please follow these steps to generate the " "required keys:" diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index afc7b60..3870a94 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -29,6 +29,7 @@ #include <cstring> #include <cerrno> #include <vector> +#include <cstdlib> /* For documentation please see unixhelper.h. */ @@ -122,6 +123,12 @@ namespace unixhelper { sleep (2); } + + /* + * Anything here shall be unreachable. + * But make compilers happy by returning something. + */ + return (EXIT_SUCCESS); } } -- 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 7c4382be20a58bcd8cef90253dcf855cb1a321a6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 03:58:18 2015 +0100 onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. Put the authorized_keys file in there. Check and set correct permissions for both the directory and authorized_keys file. Generalize some Windows-specific sections by using QDir and QFile. --- debian/changelog | 4 ++ src/onmainwindow.cpp | 183 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 126 insertions(+), 61 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6017c13..10b4e60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -475,6 +475,10 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low warnings with GCC. Fix a few whitespace issues. - appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. + - onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when + starting sshd in user mode. Put the authorized_keys file in there. Check + and set correct permissions for both the directory and authorized_keys + file. Generalize some Windows-specific sections by using QDir and QFile. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 5b664b2..b02b04d 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -7898,43 +7898,54 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, QByteArray line = file.readLine(); file.close(); - QString authofname=homeDir; -#ifdef Q_OS_WIN - QDir dir; - dir.mkpath ( authofname+"\\.x2go\\.ssh" ); - x2goDebug<<"Creating "<<authofname+"\\.x2go\\.ssh"; + QDir authorized_keys_dir (homeDir); - authofname=wapiShortFileName ( authofname ) +"/.x2go"; -#endif - authofname+="/.ssh/authorized_keys" ; - file.setFileName ( authofname ); - if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) - { - printSshDError_noAuthorizedKeysFile(); - QFile::remove - ( key+".pub" ); - return; + /* + * Do the user SSHD/global SSHD dance here and either use the + * private .x2go/.ssh or the global .ssh dir. + */ + if (userSshd) { + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/"); } + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.ssh/"); + QFile authorized_keys_file (authorized_keys_dir.absolutePath () + "/authorized_keys"); - QTemporaryFile tfile ( authofname ); - tfile.open(); - tfile.setAutoRemove ( true ); - QTextStream out ( &tfile ); + /* + * We do not try to create the file first. + * This has been already done in startX2goMount(). + * We wouldn't be here if that failed. + */ + if (!authorized_keys_file.open (QIODevice::ReadOnly | QIODevice::Text)) { + printSshDError_noAuthorizedKeysFile (); + QFile::remove (key + ".pub"); + return; + } - while ( !file.atEnd() ) - { - QByteArray newline = file.readLine(); - if ( newline!=line ) - out<<newline; + QTemporaryFile tfile (authorized_keys_file.fileName ()); + tfile.open (); + tfile.setPermissions (QFile::ReadOwner | QFile::WriteOwner); + tfile.setAutoRemove (true); + QTextStream out (&tfile); + + /* + * Copy the content of the authorized_keys file to our new temporary file + * and remove the public authorized key for the current "session" again. + */ + while (!authorized_keys_file.atEnd ()) { + QByteArray newline = authorized_keys_file.readLine (); + if (newline != line) + out << newline; } - file.close(); - tfile.close(); - file.remove(); - tfile.copy ( authofname ); - QFile::remove - ( key+".pub" ); + + authorized_keys_file.close (); + tfile.close (); + + authorized_keys_file.remove (); + + tfile.copy (authorized_keys_file.fileName ()); + QFile::remove (key + ".pub"); } @@ -9070,41 +9081,90 @@ void ONMainWindow::startX2goMount() QByteArray line = file.readLine(); file.close(); - QString authofname=homeDir; -#ifdef Q_OS_WIN - QDir tdir; - tdir.mkpath ( authofname+"\\.x2go\\.ssh" ); - x2goDebug<<"Creating "<<authofname+"\\.x2go\\.ssh"; + QDir authorized_keys_dir (homeDir); - authofname=wapiShortFileName ( authofname ) +"/.x2go"; -#endif - authofname+= "/.ssh/authorized_keys" ; + /* + * Do the user SSHD/global SSHD dance here and either use the + * private .x2go/.ssh or the global .ssh dir. + */ + if (userSshd) { + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/"); + } - QFile file1 ( authofname ); + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.ssh/"); + QFile authorized_keys_file (authorized_keys_dir.absolutePath () + "/authorized_keys"); - if ( !file1.open ( QIODevice::WriteOnly | QIODevice::Text | - QIODevice::Append ) ) - { - QString message=tr ( "Unable to write:\n" ) + authofname; - QMessageBox::critical ( 0l,tr ( "Error" ),message, - QMessageBox::Ok, - QMessageBox::NoButton ); - QFile::remove - ( fsExportKey+".pub" ); - return; + if (userSshd) { + x2goDebug << "Creating dir " << authorized_keys_dir.absolutePath (); + authorized_keys_dir.mkpath (authorized_keys_dir.absolutePath ()); + } + x2goDebug << "Potentially creating file " << authorized_keys_file.fileName (); + if (!authorized_keys_file.open (QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) { + QString message = tr ("Unable to create or append to file: ") + authorized_keys_file.fileName (); + QMessageBox::critical (0l, tr ("Error"), message, + QMessageBox::Ok, QMessageBox::NoButton); + QFile::remove (fsExportKey + ".pub"); + return; } - directory* dir=getExpDir ( fsExportKey ); - bool rem=dir->isRemovable; - if ( !dir ) - return; - QTextStream out ( &file1 ); - out<<line; - file1.close(); +#ifdef Q_OS_UNIX + QFile::Permissions authorized_keys_file_perm = authorized_keys_file.permissions (); + QFile::Permissions authorized_keys_file_target_perm = QFile::ReadOwner | QFile::WriteOwner; + + bool permission_error = false; + + /* + * Try to set the permissions if they are wrong. + * (sshd would disallow such a file.) + */ + if (authorized_keys_file_perm != authorized_keys_file_target_perm) { + if (!authorized_keys_file.setPermissions (authorized_keys_file_target_perm)) { + /* FIXME: use a function for this... */ + QString message = tr ("Unable to change the permissions of file: ") + authorized_keys_file.fileName (); + message += "\n" + tr ("This is an error because sshd would deny such a file."); + QMessageBox::critical (NULL, tr ("Error"), message, + QMessageBox::Ok, QMessageBox::NoButton); + permission_error = true; + } + } + + QFile::Permissions authorized_keys_dir_perm = QFile (authorized_keys_dir.absolutePath ()).permissions (); + QFile::Permissions authorized_keys_dir_target_perm = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner; + + /* + * Try to set the permissions if they are wrong. + * (sshd would disallow such a directory.) + */ + if (authorized_keys_dir_perm != authorized_keys_dir_target_perm) { + if (!QFile (authorized_keys_dir.absolutePath ()).setPermissions (authorized_keys_dir_target_perm)) { + /* FIXME: use a function for this... */ + QString message = tr ("Unable to change the permissions of directory: ") + authorized_keys_dir.absolutePath (); + message += "\n" + tr ("This is an error because sshd would deny such a directory."); + QMessageBox::critical (NULL, tr ("Error"), message, + QMessageBox::Ok, QMessageBox::NoButton); + permission_error = true; + } + } + + if (permission_error) { + QFile::remove (fsExportKey + ".pub"); + return; + } +#endif /* defined (Q_OS_UNIX) */ + + directory* dir = getExpDir (fsExportKey); + bool rem = dir->isRemovable; + if (!dir) { + return; + } - x2goDebug<<"Temporarily activated public key from file "<<fsExportKey<<".pub."<<endl; + QTextStream out (&authorized_keys_file); + out << line; + authorized_keys_file.close (); + + x2goDebug << "Temporarily activated public key from file " << fsExportKey << ".pub."; QString passwd=getCurrentPass(); QString user=getCurrentUname(); @@ -9878,18 +9938,19 @@ void ONMainWindow::generateEtcFiles() QFile file ( etcDir +"/sshd_config" ); if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) ) return; + QString authKeyPath = homeDir + "/.x2go/.ssh/authorized_keys"; #ifdef Q_OS_WIN - QString authKeyPath=cygwinPath ( homeDir+"/.x2go/.ssh/authorized_keys" ); - authKeyPath.replace(wapiGetUserName(),"%u"); -#endif + authKeyPath = cygwinPath (authKeyPath); + authKeyPath.replace (wapiGetUserName (), "%u"); +#endif /* defined (Q_OS_WIN) */ QTextStream out ( &file ); out<<"StrictModes no\n"<< "UsePrivilegeSeparation no\n"<< "PidFile " + varDir + "/sshd.pid\n" << + "AuthorizedKeysFile \"" << authKeyPath << "\"\n" << #ifdef Q_OS_WIN "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"<< - "AuthorizedKeysFile \""<<authKeyPath<<"\""; #else "Subsystem sftp " <<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 253f411ea4fe274b32501d7c90e5387a84a5f927 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 23:51:37 2015 +0100 compat.h: include QtCore/qglobal.h for Q_OS_... macros. --- debian/changelog | 1 + src/compat.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fd43ca3..3f91bd0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -483,6 +483,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. - compat.{cpp,h}: remove inline keyword, because function is not defined in header file. + - compat.h: include QtCore/qglobal.h for Q_OS_... macros. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/compat.h b/src/compat.h index 36b71ef..39da9eb 100644 --- a/src/compat.h +++ b/src/compat.h @@ -17,10 +17,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - #ifndef COMPAT_H #define COMPAT_H +#include <QtCore/qglobal.h> + #ifdef Q_OS_DARWIN /* * strndup() is not available on 10.6 and below, define a compat version here. -- 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 c4fbbc79587371d22c59a0dc82db9d08ff3ab5cc Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 23:30:54 2015 +0100 compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. --- debian/changelog | 2 ++ src/compat.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/compat.h | 38 ++++++++++++++++++++++++++++++++++++++ src/x2goclient.cpp | 1 + x2goclient.pro | 6 ++++-- x2goclient.pro.maemo | 6 ++++-- 6 files changed, 98 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 10b4e60..57dee01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -479,6 +479,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low starting sshd in user mode. Put the authorized_keys file in there. Check and set correct permissions for both the directory and authorized_keys file. Generalize some Windows-specific sections by using QDir and QFile. + - compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. + Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/compat.cpp b/src/compat.cpp new file mode 100644 index 0000000..877d07b --- /dev/null +++ b/src/compat.cpp @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "compat.h" + +#ifdef Q_OS_DARWIN +/* + * strndup() is not available on 10.6 and below, define a compat version here. + * Shameless copy from libiberty. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +inline char *strndup (const char *s, size_t n) { + char *result; + size_t len = strlen (s); + + if (n < len) { + len = n; + } + + result = (char *) malloc (len + 1); + if (!result) { + return (0); + } + + result[len] = '\0'; + return ((char *) memcpy (result, s, len)); +} +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ +#endif /* defined (Q_OS_DARWIN) */ diff --git a/src/compat.h b/src/compat.h new file mode 100644 index 0000000..8b9d77e --- /dev/null +++ b/src/compat.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef COMPAT_H +#define COMPAT_H + +#ifdef Q_OS_DARWIN +/* + * strndup() is not available on 10.6 and below, define a compat version here. + * Shameless copy from libiberty. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +inline char *strndup (const char *s, size_t n); +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ +#endif /* defined (Q_OS_DARWIN) */ + +#endif /* !defined (COMPAT_H) */ diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index d8ae6fa..b7fe5bc 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -30,6 +30,7 @@ #include "unixhelper.h" #include "ongetpass.h" +#include "compat.h" int wrap_x2go_main (int argc, char **argv) { return (x2goMain (argc, argv)); diff --git a/x2goclient.pro b/x2goclient.pro index e5428ce..b26cfa2 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -80,7 +80,8 @@ HEADERS += src/configdialog.h \ src/folderexplorer.h \ src/non_modal_messagebox.h \ src/help.h \ - src/unixhelper.h + src/unixhelper.h \ + src/compat.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -124,7 +125,8 @@ SOURCES += src/sharewidget.cpp \ src/folderexplorer.cpp \ src/non_modal_messagebox.cpp \ src/help.cpp \ - src/unixhelper.cpp + src/unixhelper.cpp \ + src/compat.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 diff --git a/x2goclient.pro.maemo b/x2goclient.pro.maemo index 63cc3d8..905ef77 100644 --- a/x2goclient.pro.maemo +++ b/x2goclient.pro.maemo @@ -36,7 +36,8 @@ HEADERS += src/configdialog.h \ src/sharewidget.h \ src/clicklineedit.h \ src/help.h \ - src/unixhelper.h + src/unixhelper.h \ + src/compat.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -64,7 +65,8 @@ SOURCES += src/sharewidget.cpp \ src/wapi.cpp \ src/clicklineedit.cpp \ src/help.cpp \ - src/unixhelper.cpp + src/unixhelper.cpp \ + src/compat.cpp TEMPLATE = app TARGET = -- 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 9519c58a4eeb00fe50a1e52ed26cdd5bb9ce3e37 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 23:40:41 2015 +0100 compat.{cpp,h}: remove inline keyword, because function is not defined in header file. --- debian/changelog | 2 ++ src/compat.cpp | 2 +- src/compat.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 57dee01..fd43ca3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -481,6 +481,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low file. Generalize some Windows-specific sections by using QDir and QFile. - compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. + - compat.{cpp,h}: remove inline keyword, because function is not defined + in header file. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/compat.cpp b/src/compat.cpp index 877d07b..c443489 100644 --- a/src/compat.cpp +++ b/src/compat.cpp @@ -29,7 +29,7 @@ #include <string.h> #include <stdlib.h> -inline char *strndup (const char *s, size_t n) { +char *strndup (const char *s, size_t n) { char *result; size_t len = strlen (s); diff --git a/src/compat.h b/src/compat.h index 8b9d77e..36b71ef 100644 --- a/src/compat.h +++ b/src/compat.h @@ -31,7 +31,7 @@ #include <string.h> #include <stdlib.h> -inline char *strndup (const char *s, size_t n); +char *strndup (const char *s, size_t n); #endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ #endif /* defined (Q_OS_DARWIN) */ -- 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 937cb33259fe7fa2febb858e1086a5c6386138cd Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 29 02:34:13 2015 +0200 pulsemanager.{cpp,h}: new class for PulseAudio management. --- debian/changelog | 1 + src/pulsemanager.cpp | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/pulsemanager.h | 92 +++++++++++++++++ 3 files changed, 363 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3f91bd0..02fe444 100644 --- a/debian/changelog +++ b/debian/changelog @@ -484,6 +484,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - compat.{cpp,h}: remove inline keyword, because function is not defined in header file. - compat.h: include QtCore/qglobal.h for Q_OS_... macros. + - pulsemanager.{cpp,h}: new class for PulseAudio management. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp new file mode 100644 index 0000000..af1ba2b --- /dev/null +++ b/src/pulsemanager.cpp @@ -0,0 +1,270 @@ +/*************************************************************************** + * Copyright (C) 2012-2015 by Mihai Moldovan <ionic@ionic.de> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "pulsemanager.h" + +#ifndef DEBUG +#define DEBUG_UNDEF +#define DEBUG +#endif + +PulseManager::PulseManager () { + _pulse_X2Go = "/.x2go/pulse"; + + _pulse_dir = QDir (QDir::homePath ()); + _pulse_dir.mkpath (_pulse_dir.absolutePath () + _pulse_X2Go + "/tmp"); + _pulse_dir.cd (_pulse_X2Go.mid (1)); + + _env = QProcessEnvironment::systemEnvironment (); + _env.insert ("HOME", _pulse_dir.absolutePath ()); + _env.insert ("TEMP", _pulse_dir.absolutePath () + "/tmp"); + + _pulse_port = 4713; + + _state = QProcess::NotRunning; + + _pulse_server = 0; + + _app_dir = QApplication::applicationDirPath (); +} + +PulseManager::~PulseManager () { + if (_pulse_server && is_server_running ()) + shutdown (); + + delete (_pulse_server); +} + +void PulseManager::start () { + assert (!is_server_running ()); + + delete (_pulse_server); + + _pulse_server = new QProcess (0); + _state = QProcess::Starting; + +#ifdef Q_OS_DARWIN + start_osx (); +#elif defined (Q_OS_WIN) + start_win (); +#elif defined (Q_OS_LINUX) + start_linux (); +#endif +} + +void PulseManager::start_osx () { + find_port (); + + if (generate_server_config () && generate_client_config ()) { + cleanup_client_dir (); + + _pulse_server->setProcessEnvironment (_env); + + QStringList args; + args << "--exit-idle-time=-1" << "-n" + << "-F" << _pulse_dir.absolutePath () + "/config.pa" + << "-p" + << QDir (_app_dir + + "/../Frameworks/pulse-2.0/modules").absolutePath () + << "--high-priority"; +#ifdef DEBUG + args << "--log-level=debug"; +#endif + + _pulse_server->setWorkingDirectory (_app_dir + "/../exe/"); + _pulse_server->start (_app_dir + "/../exe/pulseaudio", args); + + if (_pulse_server->waitForStarted ()) { + x2goDebug << "pulse started with" << args << "waiting for finish..."; + _state = QProcess::Running; + + connect (_pulse_server, SIGNAL (finished (int)), + this, SLOT (on_pulse_finished (int))); + +#ifdef DEBUG + // Give PA a little time to come up. + QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); +#endif + } + } +} + +void PulseManager::find_port () { + QTcpSocket tcpSocket (0); + bool free = false; + + do { + tcpSocket.connectToHost ("127.0.0.1", _pulse_port); + + if (tcpSocket.waitForConnected (1000)) { + tcpSocket.close (); + free = false; + _pulse_port++; + } + else + free = true; + } while (!free); +} + +bool PulseManager::generate_server_config () { + QString config_file_name = _pulse_dir.absolutePath () + "/config.pa"; + QTemporaryFile config_tmp_file (_pulse_dir.absolutePath () + "/tmp/tmpconfig"); + X2goSettings settings ("settings"); + bool disable_input = false; + bool ret = false; + + disable_input = settings.setting ()->value ("soundnoinput", + (QVariant) false).toBool (); + + if (config_tmp_file.open ()) { + QTextStream config_tmp_file_stream (&config_tmp_file); + + config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + + QString::number (_pulse_port) << endl; + config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; + config_tmp_file_stream << "load-module module-coreaudio-detect"; + + if (disable_input) + config_tmp_file_stream << " record=0"; + + config_tmp_file_stream << endl; + + QFile config_file (config_file_name); + if (QFile::exists (config_file_name)) + QFile::remove (config_file_name); + + config_tmp_file.copy (config_file_name); + config_tmp_file.remove (); + + ret = true; + } + + return (ret); +} + +bool PulseManager::generate_client_config () { + QTemporaryFile client_config_tmp_file (_pulse_dir.absolutePath () + + "/tmp/tmpconfig"); + QString client_config_file_name (_pulse_dir.absolutePath () + "/.pulse/client.conf"); + bool ret = false; + + if (client_config_tmp_file.open ()) { + QTextStream config_tmp_file_stream (&client_config_tmp_file); + + config_tmp_file_stream << "autospawn=no" << endl; + config_tmp_file_stream << "daemon-binary=" + << QDir (_app_dir + + "/../exe/pulseaudio").absolutePath () + << endl; + + if (QFile::exists (client_config_file_name)) + QFile::remove (client_config_file_name); + + client_config_tmp_file.copy (client_config_file_name); + client_config_tmp_file.remove (); + + ret = true; + } + + return (ret); +} + +void PulseManager::cleanup_client_dir () { + // PA expects $HOME/.pulse/$HOST-runtime to be a symbolic link + // and will fail, if it's just a plain directory on Mac OS X. + // Delete it first. + QDir machine_dir (_pulse_dir.absolutePath () + "/.pulse/" + + QHostInfo::localHostName () + "-runtime"); + + if (QFile::exists (machine_dir.absolutePath () + "/pid")) + QFile::remove (machine_dir.absolutePath () + "/pid"); + + if (machine_dir.exists ()) + machine_dir.remove (machine_dir.absolutePath ()); +} + +void PulseManager::slot_play_startup_sound () { + QProcess play_file (0); + + play_file.setWorkingDirectory (_pulse_server->workingDirectory ()); + play_file.setProcessEnvironment (_env); + play_file.start (_app_dir + "/../exe/paplay " + + _app_dir + "/../Resources/startup.wav"); + + if (play_file.waitForStarted ()) + play_file.waitForFinished (); +} + +void PulseManager::on_pulse_finished (int exit_code) { + if (!exit_code) + x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; + + QByteArray ba = _pulse_server->readAllStandardOutput (); + char *data = ba.data (); + std::cout << data; + ba = _pulse_server->readAllStandardError (); + data = ba.data (); + std::cout << data; + + _state = QProcess::NotRunning; + emit (sig_pulse_server_terminated ()); +} + +bool PulseManager::is_server_running () { + if (_pulse_server) + return (_pulse_server->state () == QProcess::Running); + else + return (false); +} + +void PulseManager::shutdown () { + QEventLoop loop; + + connect (this, SIGNAL (sig_pulse_server_terminated ()), + &loop, SLOT (quit ())); + + _pulse_server->terminate (); + + loop.exec (); +} + +int PulseManager::get_pulse_port () { + return (_pulse_port); +} + +void PulseManager::set_pulse_port (int pulse_port) { + _pulse_port = pulse_port; +} + +void PulseManager::relaunch () { + if (_pulse_server && is_server_running ()) + shutdown (); + + x2goDebug << "restarting pulse"; + start (); +} + +QProcess::ProcessState PulseManager::state () { + return (_state); +} + +#ifdef DEBUG_UNDEF +#undef DEBUG +#undef DEBUG_UNDEF +#endif diff --git a/src/pulsemanager.h b/src/pulsemanager.h new file mode 100644 index 0000000..fc0a989 --- /dev/null +++ b/src/pulsemanager.h @@ -0,0 +1,92 @@ +/*************************************************************************** + * Copyright (C) 2012-2015 by Mihai Moldovan <ionic@ionic.de> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef PULSEMANAGER_H +#define PULSEMANAGER_H + +#ifdef NDEBUG +#define NDEBUG_DEFINE +#undef NDEBUG +#endif + +#include <iostream> +#include <QDir> +#include <QTcpSocket> +#include <QEventLoop> +#include <QTemporaryFile> +#include <QHostInfo> +#include <QProcess> +#include <QApplication> +#include <QTimer> +#include <assert.h> +#include "x2gologdebug.h" +#include "x2gosettings.h" + +class PulseManager: public QObject +{ + Q_OBJECT; + +public: + PulseManager (); + ~PulseManager (); + int get_pulse_port (); + void set_pulse_port (int pulse_port); + QProcess::ProcessState state (); + +public slots: + void start (); + void relaunch (); + +private: + PulseManager (const PulseManager &other); + void start_osx (); + // FIXME + void start_win (); + // FIXME + void start_linux (); + void find_port (); + bool generate_server_config (); + bool generate_client_config (); + void cleanup_client_dir (); + void shutdown (); + bool is_server_running (); + +private slots: + void on_pulse_finished (int exit_code); + void slot_play_startup_sound (); + +signals: + void sig_pulse_server_terminated (); + +private: + QString _pulse_X2Go; + QDir _pulse_dir; + QProcessEnvironment _env; + QProcess *_pulse_server; + int _pulse_port; + QProcess::ProcessState _state; + QString _app_dir; +}; + +#ifdef NDEBUG_DEFINE +#define NDEBUG +#undef NDEBUG_DEFINE +#endif + +#endif // PULSEMANAGER_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 b3c079148ba2d48854d39c274a990484f83068d3 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:16:27 2015 +0200 macbuild.sh: add new MACPORTS_PREFIX detection/variable. --- debian/changelog | 1 + macbuild.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 80ccd4f..d332002 100644 --- a/debian/changelog +++ b/debian/changelog @@ -486,6 +486,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - compat.h: include QtCore/qglobal.h for Q_OS_... macros. - pulsemanager.{cpp,h}: new class for PulseAudio management. - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. + - macbuild.sh: add new MACPORTS_PREFIX detection/variable. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 097ac91..6c42c44 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -30,6 +30,7 @@ usage() { printf "\tDEBUG\t\t\t\tenables or disables debug builds [boolean]\n\t\t\t\t\tdefault: disabled\n" printf "\tBUNDLE\t\t\t\tenables or disables library bundling and the creation of a .dmg installer [boolean]\n\t\t\t\t\tdefault: enabled\n" printf "\tUNIVERSAL\t\t\tenables or disables x86 support. x86_64 support is always enabled [boolean]\n\t\t\t\t\tdefault: enabled\n" + printf "\tMACPORTS_PREFIX\t\t\tsets the (MacPorts) prefix used to detect PulseAudio and nxproxy binaries\n\t\t\t\t\tdefault: /opt/local/\n" printf "\n" printf "Boolean values help:\n" printf "\ta value of ${NO_VAL} will be treated as false\n" @@ -52,12 +53,25 @@ PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" NXPROXY="$(which nxproxy)" +# Try to find the MacPorts prefix. +typeset MACPORTS_PREFIX_SEARCH="" +if type -P port >/dev/null 2>&1; then + MACPORTS_PREFIX_SEARCH="$(type -P port)" + MACPORTS_PREFIX_SEARCH="${MACPORTS_PREFIX_SEARCH%%bin/port}" +else + # Port not being part find in ${PATH} doesn't necessarily mean it isn't available. + # Try to guess. + MACPORTS_PREFIX_SEARCH="/opt/local/" +fi : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} : ${DEBUG:="0"} : ${BUNDLE:="1"} : ${UNIVERSAL:="1"} +: ${MACPORTS_PREFIX:="${MACPORTS_PREFIX_SEARCH}"} + +unset MACPORTS_PREFIX_SEARCH DEBUG="$(make_boolean "${DEBUG}")" BUNDLE="$(make_boolean "${BUNDLE}")" -- 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 02636d3c2f0498cb5db3e5d6e45691b9182dfeb5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 29 02:36:24 2015 +0200 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. --- debian/changelog | 1 + x2goclient.pro | 6 ++++-- x2goclient.pro.maemo | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 02fe444..80ccd4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -485,6 +485,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low in header file. - compat.h: include QtCore/qglobal.h for Q_OS_... macros. - pulsemanager.{cpp,h}: new class for PulseAudio management. + - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/x2goclient.pro b/x2goclient.pro index b26cfa2..4a5bf13 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -81,7 +81,8 @@ HEADERS += src/configdialog.h \ src/non_modal_messagebox.h \ src/help.h \ src/unixhelper.h \ - src/compat.h + src/compat.h \ + src/pulsemanager.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -126,7 +127,8 @@ SOURCES += src/sharewidget.cpp \ src/non_modal_messagebox.cpp \ src/help.cpp \ src/unixhelper.cpp \ - src/compat.cpp + src/compat.cpp \ + src/pulsemanager.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 diff --git a/x2goclient.pro.maemo b/x2goclient.pro.maemo index 905ef77..4a06622 100644 --- a/x2goclient.pro.maemo +++ b/x2goclient.pro.maemo @@ -37,7 +37,8 @@ HEADERS += src/configdialog.h \ src/clicklineedit.h \ src/help.h \ src/unixhelper.h \ - src/compat.h + src/compat.h \ + src/pulsemanager.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -66,7 +67,8 @@ SOURCES += src/sharewidget.cpp \ src/clicklineedit.cpp \ src/help.cpp \ src/unixhelper.cpp \ - src/compat.cpp + src/compat.cpp \ + src/pulsemanager.cpp TEMPLATE = app TARGET = -- 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 bb25cbd47408c230e1c6ac405ab713a0418fc455 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:19:59 2015 +0200 macbuild.sh: add new dependency_error() helper function. --- debian/changelog | 1 + macbuild.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index d332002..6cc8a08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -487,6 +487,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - pulsemanager.{cpp,h}: new class for PulseAudio management. - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. - macbuild.sh: add new MACPORTS_PREFIX detection/variable. + - macbuild.sh: add new dependency_error() helper function. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 6c42c44..10b0f50 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -39,6 +39,20 @@ usage() { exit 2 } +dependency_error() { + exec >&2 + + typeset element="${1}"; shift + typeset component="${1}"; shift + typeset type="${1}"; shift + + echo "${element} ${type} not found." + echo "Install ${component} -- e.g., via "port -vt install ${component}" if using MacPorts." + echo "If ${component} is already installed, try passing MACPORTS_PREFIX if the autodetected or default value (${MACPORTS_PREFIX}) does not match your setup." + + exit 3 +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- 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 40684804fe571836a8f1b48d9d94d5bf600dcbe6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:21:31 2015 +0200 macbuild.sh: add new lazy_canonical_path() helper function. --- debian/changelog | 1 + macbuild.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6cc8a08..4efe5e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -488,6 +488,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. - macbuild.sh: add new MACPORTS_PREFIX detection/variable. - macbuild.sh: add new dependency_error() helper function. + - macbuild.sh: add new lazy_canonical_path() helper function. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 10b0f50..f222df8 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -53,6 +53,18 @@ dependency_error() { exit 3 } +lazy_canonical_path() { + typeset path="${1}" + + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done + + printf "${old_path}" +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- 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 bae4b60c35721545abd9bae3e3111d2241b093f0 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:22:49 2015 +0200 macbuild.sh: add new get_nesting_level() helper function. --- debian/changelog | 1 + macbuild.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4efe5e5..2607477 100644 --- a/debian/changelog +++ b/debian/changelog @@ -489,6 +489,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - macbuild.sh: add new MACPORTS_PREFIX detection/variable. - macbuild.sh: add new dependency_error() helper function. - macbuild.sh: add new lazy_canonical_path() helper function. + - macbuild.sh: add new get_nesting_level() helper function. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index f222df8..4d24e52 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -65,6 +65,20 @@ lazy_canonical_path() { printf "${old_path}" } +get_nesting_level() { +set -x + typeset -i level=0 + typeset path="${1}" + + while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do + i="$((${i} + 1))" + path="$(dirname "${path}")" + done + + printf "${level}" +set +x +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- 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 cb80887ead1b25fc637838275851e223ee47818c Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:24:37 2015 +0200 macbuild.sh: add new repeat_str() helper function. --- debian/changelog | 1 + macbuild.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2607477..783d784 100644 --- a/debian/changelog +++ b/debian/changelog @@ -490,6 +490,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - macbuild.sh: add new dependency_error() helper function. - macbuild.sh: add new lazy_canonical_path() helper function. - macbuild.sh: add new get_nesting_level() helper function. + - macbuild.sh: add new repeat_str() helper function. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 4d24e52..83e0228 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -79,6 +79,22 @@ set -x set +x } +repeat_str() { # INPUT COUNT + typeset INPUT="${1:?"Error: no input string passed to ${FUNCNAME}()."}" + typeset COUNT="${2:?"Error: no count passed to ${FUNCNAME}()."}" + + typeset ret="" + typeset -i i=0 + while [ "${i}" -lt "${COUNT}" ]; do + ret="${ret}$(printf "${INPUT}")" + i=$((${i} + 1)) + done + + printf "${ret}" + + return 0 +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- 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 bc343f6dd68186c372f726f5a202cd1268898a4e Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:28:02 2015 +0200 macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. --- debian/changelog | 1 + macbuild.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 783d784..7c0e693 100644 --- a/debian/changelog +++ b/debian/changelog @@ -491,6 +491,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - macbuild.sh: add new lazy_canonical_path() helper function. - macbuild.sh: add new get_nesting_level() helper function. - macbuild.sh: add new repeat_str() helper function. + - macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 83e0228..85ae181 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -108,7 +108,6 @@ DMGFILE="${BUILD_DIR}/${NAME}.dmg" PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" -NXPROXY="$(which nxproxy)" # Try to find the MacPorts prefix. typeset MACPORTS_PREFIX_SEARCH="" if type -P port >/dev/null 2>&1; then @@ -120,6 +119,8 @@ else MACPORTS_PREFIX_SEARCH="/opt/local/" fi +NXPROXY="nxproxy" + : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} : ${DEBUG:="0"} @@ -149,6 +150,11 @@ else exit 1 fi +# Gather files. +NXPROXY="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${NXPROXY}")" + +[ -x "${NXPROXY}" ] || dependency_error "nxproxy" "nxproxy" "binary" + set -e phase "Cleaning" -- 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 2d957314e9d9afde6e4d901be2face48180219a1 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:30:08 2015 +0200 macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. Create directories based on that. Use them when bundling. --- debian/changelog | 2 ++ macbuild.sh | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7c0e693..554f770 100644 --- a/debian/changelog +++ b/debian/changelog @@ -492,6 +492,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - macbuild.sh: add new get_nesting_level() helper function. - macbuild.sh: add new repeat_str() helper function. - macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. + - macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. Create + directories based on that. Use them when bundling. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 85ae181..234cdc0 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -104,6 +104,8 @@ TOP_DIR="$(dirname "$0")" [[ "${TOP_DIR}" == /* ]] || TOP_DIR="${PWD}/${TOP_DIR#./}" BUILD_DIR="${TOP_DIR}/client_build" APPBUNDLE="${BUILD_DIR}/${NAME}.app" +EXE_DIR="${APPBUNDLE}/Contents/exe/" +FRAMEWORKS_DIR="${APPBUNDLE}/Contents/Frameworks/" DMGFILE="${BUILD_DIR}/${NAME}.dmg" PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" @@ -185,15 +187,17 @@ qmake -config "${BUILD_MODE}" -spec macx-g++ "${PROJECT}" \ phase "Running make" make -j2 +mkdir -p "${EXE_DIR}/" +mkdir -p "${FRAMEWORKS_DIR}/" + phase "Copying nxproxy" -mkdir -p "${APPBUNDLE}/Contents/exe" -cp "${NXPROXY}" "${APPBUNDLE}/Contents/exe" +cp -av "${NXPROXY}" "${EXE_DIR}/" if [ "${BUNDLE}" = "1" ]; then dylibbundler \ - --fix-file "${APPBUNDLE}/Contents/exe/nxproxy" \ + --fix-file "${EXE_DIR}/nxproxy" \ --bundle-deps \ - --dest-dir "${APPBUNDLE}/Contents/Frameworks" \ + --dest-dir "${FRAMEWORKS_DIR}/" \ --install-path "@executable_path/../Frameworks/" \ --create-dir -- 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 14abcb7832844de7f5cc37bee3e1703b97254b2a Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:33:59 2015 +0200 macbuild.sh: define PulseAudio libraries and binaries to be later copied. Discover them using MACPORTS_PREFIX. Error out if any component was not found. --- debian/changelog | 3 +++ macbuild.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/debian/changelog b/debian/changelog index 554f770..9dd69d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -494,6 +494,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. - macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. Create directories based on that. Use them when bundling. + - macbuild.sh: define PulseAudio libraries and binaries to be later + copied. Discover them using MACPORTS_PREFIX. Error out if any component + was not found. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 234cdc0..e7ca22d 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -122,6 +122,13 @@ else fi NXPROXY="nxproxy" +PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" + "pamon" "paplay" "parec" "parecord" "pasuspender" ) +PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" + "libpulse.0.dylib" + "libpulsecore-6.0.dylib" + "pulse-6.0" + "pulseaudio" ) : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} @@ -157,6 +164,50 @@ NXPROXY="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${NXPROXY}")" [ -x "${NXPROXY}" ] || dependency_error "nxproxy" "nxproxy" "binary" +typeset -i i +typeset -i fail +typeset -a PULSEAUDIO_BINARIES_FULL +typeset cur_binary +fail="0" +for cur_binary in ${PULSEAUDIO_BINARIES[@]}; do + cur_binary="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${cur_binary}")" + + if [ -x "${cur_binary}" ]; then + PULSEAUDIO_BINARIES_FULL+=( "${cur_binary}" ) + else + fail="1" + break + fi +done + +[ "${fail}" -eq "1" ] && dependency_error "${cur_binary##"$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/")"}" "pulseaudio" "binary" + +typeset cur_lib_or_libdir +typeset -a PULSEAUDIO_LIBRARIES_FULL +fail="0" +for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do + cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" + + if [ -x "${cur_lib_or_libdir}" ]; then + PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) + elif [ -d "${cur_lib_or_libdir}" ]; then + # That's a directory... more work needed here. + typeset entry="" + for entry in "${cur_lib_or_libdir}"/*; do + typeset TMP_REGEX='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' + if [[ "${entry}" =~ ${TMP_REGEX} ]]; then + # Filename matched the expected template. + PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) + fi + done + else + fail="1" + break + fi +done + +[ "${fail}" -eq "1" ] && dependency_error "${cur_lib_or_libdir}" "pulseaudio" "library or library directory" + set -e phase "Cleaning" -- 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 6b0abfea899aa9d1955ce132a920179099cc7e0e Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:35:00 2015 +0200 macbuild.sh: copy PulseAudio libraries and binaries. --- debian/changelog | 1 + macbuild.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9dd69d1..8f3327c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -497,6 +497,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - macbuild.sh: define PulseAudio libraries and binaries to be later copied. Discover them using MACPORTS_PREFIX. Error out if any component was not found. + - macbuild.sh: copy PulseAudio libraries and binaries. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index e7ca22d..6405b29 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -244,6 +244,23 @@ mkdir -p "${FRAMEWORKS_DIR}/" phase "Copying nxproxy" cp -av "${NXPROXY}" "${EXE_DIR}/" +phase "Copying PulseAudio" +for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do + cp -av "${cur_binary}" "${EXE_DIR}/" +done + +typeset intermediate_lib_dir="" +for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do +set -x + intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" + intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" + + mkdir -p "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" + + cp -av "${cur_binary}" "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" +set +x +done + if [ "${BUNDLE}" = "1" ]; then dylibbundler \ --fix-file "${EXE_DIR}/nxproxy" \ -- 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 5b9a19c8af7ae307e0ea424c8b9bbfce9b9670b1 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:36:16 2015 +0200 macbuild.sh: add phase output for bundling nxproxy. --- debian/changelog | 1 + macbuild.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8f3327c..64c1743 100644 --- a/debian/changelog +++ b/debian/changelog @@ -498,6 +498,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low copied. Discover them using MACPORTS_PREFIX. Error out if any component was not found. - macbuild.sh: copy PulseAudio libraries and binaries. + - macbuild.sh: add phase output for bundling nxproxy. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 6405b29..61df87b 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -262,6 +262,7 @@ set +x done if [ "${BUNDLE}" = "1" ]; then + phase "Bundling nxproxy" dylibbundler \ --fix-file "${EXE_DIR}/nxproxy" \ --bundle-deps \ -- 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 ffb88a5d7d52fe4f4069c97fa67d09bb7d042a88 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:37:46 2015 +0200 macbuild.sh: add work-in-progress PulseAudio bundling. Needs to be ripped apart and be redone, because dylibbundler is not smart enough to handle our case. --- debian/changelog | 3 +++ macbuild.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/debian/changelog b/debian/changelog index 64c1743..cf4a27d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -499,6 +499,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low was not found. - macbuild.sh: copy PulseAudio libraries and binaries. - macbuild.sh: add phase output for bundling nxproxy. + - macbuild.sh: add work-in-progress PulseAudio bundling. Needs to be ripped + apart and be redone, because dylibbundler is not smart enough to handle + our case. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/macbuild.sh b/macbuild.sh index 61df87b..7b69dcf 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -270,6 +270,41 @@ if [ "${BUNDLE}" = "1" ]; then --install-path "@executable_path/../Frameworks/" \ --create-dir + phase "Bundling PulseAudio" + typeset cur_binary_name="" + for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do + if [ ! -L "${cur_binary}" ]; then + cur_binary_name="$(basename "${cur_binary}")" + dylibbundler \ + --fix-file "${EXE_DIR}/${cur_binary_name}" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --install-path "@executable_path/../Frameworks/" \ + --create-dir \ + --overwrite-files + fi + done + + typeset intermediate_lib_dir="" + for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do + intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" + intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" + + if [ ! -L "${cur_binary}" ]; then + cur_binary_name="$(basename "${cur_binary}")" + + typeset nesting_level="$(get_nesting_level "${intermediate_lib_dir}")" + + dylibbundler \ + --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --install-path "@loader_path/$(repeat_str "../" "${nesting_level}")Frameworks/" \ + --create-dir \ + --overwrite-files + fi + done + phase "Bundling up using macdeployqt" macdeployqt "${APPBUNDLE}" -verbose=2 -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git