This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. discards 302c416 macbuild.sh: make compatible with new llvm-based otool binary, which now uses proper return values. discards 34e372f src/mediawidget.cpp: add deprecation warning for ESounD. discards 6648940 src/mediawidget.cpp: add deprecation warning for ARTS. discards 8a5e3e5 src/mediawidget.cpp: simplify expression. discards 9c61957 src/mediawidget.cpp: unify some redundant code. discards c1b1a67 src/onmainwindow.cpp: convert piece of code to non-Windows and non-Darwin, so that not only Linux but other operating systems are covered as well. discards 882adda src/onmainwindow.{cpp,h}: remove left-over parec references and code. discards 856b009 src/unix_stdint.h: use same hack to import ssize_t into std namespace. discards 15ff67d src/pulsemanager.cpp: cast the return value of realloc () to char*, as GCC doesn't seem to like reassigning the pointer otherwise. discards 6d186eb src/pulsemanager.cpp: use std::ssize_t for the path length, because it could be -1 and std::size_t is not applicable. discards 51d13bb src/pulsemanager.cpp: fix Linux-based code by fixing a really stupid typo ("erange" instead of "errno") and including the cerrno header. discards cb661f8 src/pulsemanager.h: use unix_stdint.h on non-Windows-platforms to get std::(u)int*_t types without having to use C++11. discards a13b92c src/: create new file unix_stdint.h which imports the (u)int*_t types into the std namespace. discards 4499dc9 src/unixhelper.cpp: use cstdio instead of stdio.h. discards 44bdd1a src/x2goutils.cpp: fix add_to_path (). discards 201f9dd src/x2goutils.cpp: add debugging output to add_to_path (). discards 818163d src/onmainwindow.cpp: remove trailing slash from Mageia/SUSE/Arch sftp-server binary search path. discards 2779177 src/{onmainwindow,pulsemanager}.cpp: actually *use* what we got back from add_to_path ()... discards 777cec1 src/onmainwindow.cpp: stop duplicating the list of known sftp-server binary locations. discards e440f47 src/onmainwindow.cpp: move generateEtcFiles () call to startSshd (). discards 6e986e2 src/pulsemanager.cpp: fix PA binary searching logic. discards ae89ac6 src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. discards 4cd32bc src/pulsemanager.cpp: refactor PA binary searching code. discards 1cfcd80 src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. discards efb8da2 src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance. discards 642e4c5 src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in generateKey (). discards c3c8bdf src/onmainwindow.h: actually, we do need startSshd () to be public. Move it back. discards 4f4e1a3 src/onmainwindow.cpp: re-order initializer list of WinServerStarter constructor. discards e78ee21 src/onmainwindow.{cpp,h}: don't try to initialize non-static ssh_key_type_ member variable directly, but in the constructor. discards 1f7051e src/onmainwindow.h: remove WWrapper definition, seems to be unused. discards 5dc534f src/onmainwindow.h: move WinServerStarter class definition around to hopefully get the definition of ONMainWindow::key_types. discards 8c2bb96 src/onmainwindow.cpp: actually use key_type parameter in startSshd () and make selection more generic. discards fc24102 src/onmainwindow.cpp: add and use key_types parameter to startWinServers (). discards 7826b3d src/onmainwindow.cpp: pass key_type parameter to startSshd () in createKeyBundle (). discards c6567c1 src/onmainwindow.cpp: pass new ssh_key_type_ member to startSshd () call in WinServerStarter::run (). discards da7833b src/onmainwindow.{cpp,h}: add SSH key type parameter to startSshd (). discards 9bce12a src/onmainwindow.{cpp,h}: add ssh_key_type_ member variable and getter and setter to WinServerStarter class. discards 5391148 src/onmainwindow.{cpp,h}: make startSshd () private. discards 40b7fda src/onmainwindow.cpp: add listening-check loop to the Windows-specific code of startSshd (). discards e5c6396 src/onmainwindow.cpp: add comment to last all-in listening check in startSshd (). discards 290987c src/onmainwindow.cpp: move QProcess startup check in startSshd () to non-Windows code section and add a listening socket check loop. discards 4455230 macbuild.sh: switch to bundling PA 9.0. discards bb16e81 src/onmainwindow.{cpp,h}: rename createRSAKey () to the more-appropriate name createKeyBundle (). discards e3439e4 src/onmainwindow.cpp: add some comments only to createRSAKey (). discards 299f4e1 src/onmainwindow.cpp: let startSshd () act as a wrapper and be called multiple times. discards 3b43148 src/onmainwindow.{cpp,h}: reformat createRSAKey () only. discards 07bcb15 src/onmainwindow.{cpp,h}: move createRSAKey () around. discards 4ee6820 src/onmainwindow.{cpp,h}: reformat generateKey () only. discards 59da4b8 src/onmainwindow.h: move generateKey () declaration around. discards b8878c2 src/onmainwindow.cpp: use the new functions in generateKey (). discards 8f652e7 src/onmainwindow.{cpp,h}: add new function default_size_for_key_type (). discards cb59e62 src/onmainwindow.{cpp,h}: add new function key_type_to_string (). discards 33c23e0 src/onmainwindow.{cpp,h}: add new function check_key_type (). discards a0ee3c1 src/onmainwindow.cpp: terminate sshd more correctly. discards 5307708 src/onmainwindow.cpp: uppercase key type in debug output and comment string in generateKey (). discards 88134de src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise maximum startup time to 5 seconds and break out early, if the process went into running state earlier. discards fc842aa src/{onmainwindow.{cpp,h},configdialog.cpp}: remove userSshd variable and code related to non-user-mode-sshd setups. discards 1111f95 src/onmainwindow.cpp: fix up a few debug strings. discards 0eaec37 src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section. discards e94e94e src/onmainwindow.{cpp,h}: rewrite generateKey () function to actually also generate user keys. discards 994a129 src/onmainwindow.cpp: refactor generateKey () a little bit to compact it. discards 2685544 src/onmainwindow.{cpp,h}: rename generateHostKey () to generateKey () and add a boolean parameter with a default of false to request a public key. discards 34fa207 src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). discards cf97425 src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. discards 5078b83 src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. discards 6fe0ef0 src/unixhelper.cpp: code cleanup. discards e04e71a src/pulsemanager.cpp: remove unused variables. discards 8c011d9 src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper around real_kill_pgroup (). discards a193a4c src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). discards c0d1921 src/unixhelper.h: style and general fixes within comments. discards 0518893 src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. discards 1e7bc07 src/pulsemanager.cpp: fix PA version fetching on OS X again. discards 0620fd7 src/pulsemanager.cpp: make sure that wherever we interface with non-Qt functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) discards 1b466dc src/pulsemanager.cpp: make PA version parsing function more generic and don't expect that a number is always terminated with a period or dash. discards b4bef6a src/pulsemanager.h: include accidentally omitted wapi.h header file. discards cbdb450 src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. discards 90c0da3 src/onmainwindow.cpp: fix compile error on Windows after moving some code around. discards d0b0af4 src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. discards 5862ae1 src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. discards 73dc547 src/onmainwindow.cpp: drop obsolete pulseVersionTest variable initialization in Windows-only code. discards 37c2f8b src/onmainwindow.cpp: short out code parts unconditionally checking for the userSshd variable. discards 62fffcf src/pulsemanager.h: use windows_stdint.h header on Windows, cstdint otherwise. discards dc56238 src/: new file windows_stdint.h for Windows-compatibility when using std::(u)int*_t types. discards 23d0e4e nsis/x2goclient.nsi: add startup.wav to installer package. discards a279b70 src/x2goutils.cpp: add some debug logging to find_binary (). discards 38e6efd src/x2goutils.cpp: fix faulty logic in find_binary (): only reset the given path to CWD iff it's actually empty. Not the other way around. discards 4dec14f src/pulsemanager.cpp: remove extraneous newlines from debug output. discards 6719756 src/pulsemanager.cpp: add warning message boxes where appropriate. discards 126e4a8 src/pulsemanager.cpp: fix startup sound playback when using the system-PA version. discards 7768dfc src/pulsemanager.cpp: fix startup when using the system-PA version. discards 1318656 src/pulsemanager.cpp: fix compile error on Windows. discards ebc5bdd debian/changelog: fix typo in function name. discards 861f990 src/x2goutils.h: fix compile error due to typo. discards fa0c8de src/pulsemanager.cpp: add error message boxes throughout PulseManager. discards 5f0e2cb src/x2goutils.{cpp,h}: add application modality parameter to show_RichText_Generic_MsgBox () and its wrappers. discards 7b4d671 src/pulsemanager.cpp: correctly initialize and set system_pulse_ when required. discards 01dde02 src/pulsemanager.h: add new system_pulse_ variable to indicate that a system PA binary shall be used. discards 239ede4 src/x2goutils.cpp: fix compile error. discards 86c9541 src/pulsemanager.cpp: add reminder for Linux-implementation in play_startup_sound (). discards 3417610 src/pulsemanager.cpp: add comments to Qt 4 code part. discards 1a34ea4 src/pulsemanager.cpp: auto-detect PA binary in $PATH and MacPorts default prefix as well on OS X. discards 9f298d9 src/x2goutils.{cpp,h}: add new function find_binary (). discards a0bc125 src/pulsemanager.cpp: don't remove PA config and log file in ~/.x2go/pulse on PA shutdown if debugging has been requested. discards 967a839 src/pulsemanager.cpp: insert PULSE_SERVER and PULSE_COOKIE variables into environment as used by PulseManager. discards 665823a src/pulsemanager.cpp: don't insert stray newline into config.pa. discards d987d6d src/pulsemanager.cpp: actually only play startup sound if debugging is enabled. discards 4192bab src/pulsemanager.{cpp,h}: rename on_pulse_finished () to slot_on_pulse_finished (). discards f206423 src/pulsemanager.cpp: don't overwrite the temporary string variable for the current line with what was supposed to hold new data in fetch_pulseaudio_version (). discards 56171d7 src/pulsemanager.cpp: fix typo in fetch_pulseaudio_version (). discards 8db27c1 macbuild.sh: save return value of parse_otool_output (). discards d94eadf macbuild.sh: don't error out while executing parse_otool_output (). discards 015b521 macbuild.sh: also add PA binaries to deduplication fixup list. discards 066655a macbuild.sh: fix copying of resource files. discards 1fccb2d res: rename "sound" to "audio". discards 796b5b6 macbuild.sh: add support for copying resource files. discards 7865b56 src/pulsemanager.cpp: don't time out while trying to start PA or paplay. discards e4691a2 res/sound: add startup.wav sound to be played back when starting the PA daemon in debug mode. discards 203aede src/pulsemanager.h: fix compile error due to mismatching function declaration for set_debug (). discards e068a55 src/onmainwindow.cpp: port to new debugging feature of PulseManager. discards 9356691 src/pulsemanager.{cpp,h}: port to new debugging feature. discards e1a2016 src/pulsemanager.{cpp,h}: add debugging setter and private variable. discards 2ff420e src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. discards f91bb55 src/pulsemanager.cpp: fix compile error due to typo. discards 841ebb0 src/onmainwindow.cpp: make use of new PulseManager::start () behavior and always use it, no matter whether server is up already or not. discards 6b08295 src/onmainwindow.cpp: convert QDir object to QString for further processing. discards b613baf src/onmainwindow.cpp: fix compile error due to misuse of #ifdef. discards 0e276ad src/pulsemanager.cpp: let start () act as a wrapper and do nothing if the PA server is already running. discards b356a80 src/onmainwindow.cpp: fix compile errors due to misspelled function names. discards 5a2ce74 src/configdialog.cpp: fix compile error by removing obsolete (and now faulty) line for removed restart message. discards 78f998a src/pulsemanager.cpp: output PA stdout/stderr via x2goDebug, not plainly to stdout. discards 9b0e1bd src/pulsemanager.h: move x2gologdebug.h inclusion into implementation file. discards 822ac31 src/mediawidget.cpp: reflect new capabilities through PulseManager. discards f2f849b src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. discards e266f8f src/configdialog.cpp: whitespace only. discards 8173f20 src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) discards 7921f0d src/pulsemanager.cpp: backport fix for 422. discards a5d45b3 src/pulsemanager.cpp: backport fix for 526. discards ee43b4c src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) discards c8ac3db src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. discards 1a85a09 src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. discards 54bd8cf pulsemanager.cpp: remove config.pa while doing post-exit cleanups. discards a036bce macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". discards c628cd7 macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. discards ca08199 pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. discards 649e739 pulsemanager.cpp: use record and playback member variables. discards 8fd429e pulsemanager.h: more moving around. discards 1c95b06 pulsemanager.cpp: fix compile error in startup sound function. discards f92ee5c pulsemanager.cpp: reorder member variables in initializer list. discards 2cbf5bb pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. discards 1d19c5d pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. discards f345591 pulsemanager.cpp: add algorithm for actually extracting PA version number. discards 7cd6b80 pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. discards 066c8cb pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. discards a508d02 pulsemanager.cpp: fix some error messages by removing redundant newlines. discards c50e429 pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. discards 9d28e79 pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. discards 547aeff pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. discards 3344476 pulsemanager.cpp: add "dummy" start_linux () function. discards 2b546a3 pulsemanager.cpp: reorder member variables in initialization list. discards 47fbb31 pulsemanager.cpp: another typo fix: findPort -> find_port. discards 97b32a9 pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). discards 6602b15 pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. discards 77fd710 pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. discards e4ad215 pulsemanager.cpp: typo fix in member variable name server_working_dir_. discards 4a4bea9 pulsemanager.h: whitespace only. discards e3fc560 pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. discards 7070895 pulsemanager.cpp: only play startup sound if DEBUG macro is defined. discards 00c6f79 pulsemanager.cpp: make generate_client_config () Windows-compatible. discards 52e1e0d pulsemanager.cpp: make generate_server_config () Windows-compatible. discards 9146491 pulsemanager.cpp: also load module-esound-protocol-tcp module. discards fde3b88 pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. discards 7e5fd58 pulsemanager.cpp: let start_osx () use start_generic (). discards 9038551 pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. discards 44d2d61 pulsemanager.cpp: add Windows stuff to initial env in constructor. discards a577194 pulsemanager.cpp: add cleanup support to on_pulse_finished (). discards 7b48132 pulsemanager.cpp: add Windows support to shutdown (). discards 2e43da4 pulsemanager.{cpp,h}: new function create_client_dir (). discards 2fb2ad6 pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. discards 0389589 pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. discards 53df4ba pulsemanager.{cpp,h}: fixup preprocessor usage. discards 26b054d pulsemanager.cpp: reformat only. discards d3eb996 pulsemanager.{cpp,h}: rename relaunch () to restart (). discards 724bab1 pulsemanager.{cpp,h}: add ESD support. discards 6c2e4eb pulsemanager.h: add std:: namespace selector for uint32_t version variables. discards 18e3858 pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. discards ef7ccd4 pulsemanager.cpp: reformat only. discards 93d56b8 pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. discards 57b8b72 pulsemanager.cpp: use initializer list for constructor. discards ebdeaef pulsemanager.{cpp,h}: reformat only. discards baafffc pulsemanager.cpp: minor non-behavior changing fixes. discards ede7d81 pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. discards 823e495 macbuild.sh: rewrite ID line detection algorithm. discards 1459742 macbuild.sh: copy "special" files, so that they can be removed later on. discards c7be38a macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. discards da99597 macbuild.sh: more debug messages and a whitespace change. discards 5575ccc macbuild.sh: spelling fix. discards 92b73d6 macbuild.sh: merge deduplicate.sh content in. discards a058c82 deduplicate.sh: replace tabs with two spaces. No functional changes. discards f4cd198 macbuild.sh: replace tabs with two spaces. No functional changes. discards a84a817 deduplicate.sh: remove some noisy debug output. discards 7ad9134 deduplicate.sh: add WARNING to status message. discards e52d7eb deduplicate.sh: fix wrong return value capture. discards 4ef1268 deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. discards 90e5d02 deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. discards 73475de deduplicate.sh: surprisingly, it turned out that only checking the duplicate's basename against the current dependency's basename is not good enough. discards ff427a9 deduplicate.sh: more temporary debugging output in fixup section. discards e23dc88 deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. discards 4df76a3 deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. discards 5c88593 deduplicate.sh: actually include file name in install_name_tool pseudo output. discards 5146821 deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. discards a3c50f7 deduplicate.sh: unstub fixup section. discards 1079389 deduplicate.sh: add more useful information in fixup section's error message. discards 9f8b79d deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. discards c9f9888 deduplicate.sh: prevent word splitting when parsing otool's output. discards 12ee219 deduplicate.sh: debug parse_otool_output fiercely for the time being. discards cbb174e deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. discards bb20604 deduplicate.sh: change exit to return in parse_otool_output. discards f70b4fd deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. discards 1bdbd9a deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. discards f498ad4 deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. discards 209d167 deduplicate.sh: correctly unset an array element. discards 2ecf444 deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. discards d495a0a deduplicate.sh: non-functional: change WARNING to ERROR in error messages. discards c78f27d deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. discards f900a7d deduplicate.sh: add missed local variable declaration. discards e05c465 deduplicate.sh: add duplicates-to-real mapping. discards b7704e9 deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. discards 3c487eb macbuild.sh: also install libraries into staging area with intermediate library path. discards d416c5e macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. discards 2cd9333 macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. discards 583d588 macbuild.sh: add the correct file path to the library bundling array. discards 6e59f60 macbuild.sh: check current file name against regex, not a (now) full path. discards bd6d3fd macbuild.sh: use while-read-loop and find to actually recurse through directories. discards 1ea7af4 macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. discards d78c5b9 macbuild.sh: add some more debugging output. discards fb74e67 macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. discards e521d3f macbuild.sh: add Linux library file name scheme regex as a precaution. discards fbc4ac8 macbuild.sh: add work-in-progress PulseAudio bundling. discards 200fe5b macbuild.sh: add phase output for bundling nxproxy. discards 6da5640 macbuild.sh: copy PulseAudio libraries and binaries. discards 3740f47 macbuild.sh: define PulseAudio libraries and binaries to be later copied. discards 783628e macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. discards c9c5f3c macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. discards 015d810 macbuild.sh: add new repeat_str() helper function. discards ca9c9d2 macbuild.sh: add new get_nesting_level() helper function. discards f3d3640 macbuild.sh: add new lazy_canonical_path() helper function. discards 59812f4 macbuild.sh: add new dependency_error() helper function. discards e874dc3 macbuild.sh: add new MACPORTS_PREFIX detection/variable. discards 758b4ba x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. discards aa1727b pulsemanager.{cpp,h}: new class for PulseAudio management. discards 1ba8caf compat.h: include QtCore/qglobal.h for Q_OS_... macros. discards 7b54b79 compat.{cpp,h}: remove inline keyword, because function is not defined in header file. discards 732d343 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 536e614 onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. discards ead8507 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. discards 7cec536 {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. discards 0d0788f x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. discards 874b923 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. discards b0e8602 {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. discards ddd92ff unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. discards 1c274a8 x2goclient.cpp: create new argv array on the heap instead of on the stack. discards 3404eb0 x2goclient.cpp: fix string comparison. discards c224af3 x2goclient.cpp: fix compile problems introduced with the last commit. discards 184a757 x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. discards 7a1ea91 x2goclient.cpp: clean up. discards df64bd4 unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. discards 395d9bc unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. discards 88ee873 unixhelper.cpp: kill process group on error. discards 971f61d x2goclient.cpp: return return value of unixhelper::unix_cleanup(). discards 521aec8 unixhelper.{cpp,h}: add documentation/comments. discards ab82e0a unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. discards 6a97413 unixhelper.h: forgot to declare type of unix_cleanup() function. discards ea5a459 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. discards b0a4e8a x2goclient.cpp: fix std::edit -> std::exit typo. discards ab46352 x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. discards 99e06df x2goclient.cpp: add myself to copyright header. discards 7119325 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. discards b6dae74 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. discards 4630575 x2goclient.cpp: wrap X2Go Client main function and use that. discards 71b8fa7 unixhelper.{cpp,h}: implement cleanup program for process group. discards 1740675 {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. adds 1267231 src/onmainwindow.cpp: remove left-over debug test message. new 33efb13 {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. new 063cc4a unixhelper.{cpp,h}: implement cleanup program for process group. new 35978d8 x2goclient.cpp: wrap X2Go Client main function and use that. new 448d891 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. new c219f37 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. new 38c40d6 x2goclient.cpp: add myself to copyright header. new 72ca36e x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. new 7188d69 x2goclient.cpp: fix std::edit -> std::exit typo. new 7799e94 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. new 2f08e76 unixhelper.h: forgot to declare type of unix_cleanup() function. new 7b2bb8b unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. new 5a2b6bd unixhelper.{cpp,h}: add documentation/comments. new e080ab1 x2goclient.cpp: return return value of unixhelper::unix_cleanup(). new 880d401 unixhelper.cpp: kill process group on error. new ab201f0 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. new 9822394 unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. new 678d59f x2goclient.cpp: clean up. new 297e1ec x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. new 27a98c9 x2goclient.cpp: fix compile problems introduced with the last commit. new ba3945b x2goclient.cpp: fix string comparison. new 7bc682d x2goclient.cpp: create new argv array on the heap instead of on the stack. new d662747 unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. new 1bc2069 {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. new 0996b80 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. new 720061d x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. new 420f089 {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. new f4c4944 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. new a298f8a onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. new 15a38d2 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 f8a5fe8 compat.{cpp,h}: remove inline keyword, because function is not defined in header file. new e9bbaea compat.h: include QtCore/qglobal.h for Q_OS_... macros. new 43aae96 pulsemanager.{cpp,h}: new class for PulseAudio management. new 1d14155 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. new 713d455 macbuild.sh: add new MACPORTS_PREFIX detection/variable. new 0069829 macbuild.sh: add new dependency_error() helper function. new 4a6ae0c macbuild.sh: add new lazy_canonical_path() helper function. new aef8eb0 macbuild.sh: add new get_nesting_level() helper function. new 1cd24f0 macbuild.sh: add new repeat_str() helper function. new da6920e macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. new 03032c1 macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. new 5147686 macbuild.sh: define PulseAudio libraries and binaries to be later copied. new 4cb0e1e macbuild.sh: copy PulseAudio libraries and binaries. new b4bc691 macbuild.sh: add phase output for bundling nxproxy. new 761fc19 macbuild.sh: add work-in-progress PulseAudio bundling. new 2d2e15d macbuild.sh: add Linux library file name scheme regex as a precaution. new c8a864e macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. new bcf52e9 macbuild.sh: add some more debugging output. new d5e9e59 macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. new 3be3704 macbuild.sh: use while-read-loop and find to actually recurse through directories. new 5ef5c2f macbuild.sh: check current file name against regex, not a (now) full path. new b820060 macbuild.sh: add the correct file path to the library bundling array. new a0f77fe macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. new c87c2e9 macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. new 455194d macbuild.sh: also install libraries into staging area with intermediate library path. new 9b65c3a deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. new 9c1c292 deduplicate.sh: add duplicates-to-real mapping. new 70b8ac4 deduplicate.sh: add missed local variable declaration. new acedeec deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. new 9105ed9 deduplicate.sh: non-functional: change WARNING to ERROR in error messages. new 1b3e9e1 deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. new 273a5a7 deduplicate.sh: correctly unset an array element. new 04f90b6 deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. new 2f4b106 deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. new b47413f deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. new 41a9e8d deduplicate.sh: change exit to return in parse_otool_output. new b7bcbd5 deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. new 0802fa1 deduplicate.sh: debug parse_otool_output fiercely for the time being. new 552f684 deduplicate.sh: prevent word splitting when parsing otool's output. new 9f191b2 deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. new c5a6f50 deduplicate.sh: add more useful information in fixup section's error message. new d9e15bf deduplicate.sh: unstub fixup section. new 4ac9f68 deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. new 0de9f7d deduplicate.sh: actually include file name in install_name_tool pseudo output. new d4068aa deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. new a8c0f98 deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. new 2b0ec35 deduplicate.sh: more temporary debugging output in fixup section. new 0644895 deduplicate.sh: surprisingly, it turned out that only checking the duplicate's basename against the current dependency's basename is not good enough. new 12405a2 deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. new 6242ef6 deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. new 9cea725 deduplicate.sh: fix wrong return value capture. new 196b174 deduplicate.sh: add WARNING to status message. new bedabe4 deduplicate.sh: remove some noisy debug output. new 42ff10d macbuild.sh: replace tabs with two spaces. No functional changes. new 60563fc deduplicate.sh: replace tabs with two spaces. No functional changes. new 1e7e0e4 macbuild.sh: merge deduplicate.sh content in. new d9b51df macbuild.sh: spelling fix. new c5af510 macbuild.sh: more debug messages and a whitespace change. new d85ce34 macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. new 067d109 macbuild.sh: copy "special" files, so that they can be removed later on. new fe5079a macbuild.sh: rewrite ID line detection algorithm. new 2f34734 pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. new 873dde7 pulsemanager.cpp: minor non-behavior changing fixes. new 9e2c0e8 pulsemanager.{cpp,h}: reformat only. new 51904b9 pulsemanager.cpp: use initializer list for constructor. new b0f8a0c pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. new 0c0b19d pulsemanager.cpp: reformat only. new be7db93 pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. new 41283a8 pulsemanager.h: add std:: namespace selector for uint32_t version variables. new 043fa0f pulsemanager.{cpp,h}: add ESD support. new b370677 pulsemanager.{cpp,h}: rename relaunch () to restart (). new 405452d pulsemanager.cpp: reformat only. new bea743f pulsemanager.{cpp,h}: fixup preprocessor usage. new 6cc2d71 pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. new b0ca4d0 pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. new 26b1815 pulsemanager.{cpp,h}: new function create_client_dir (). new f4054fe pulsemanager.cpp: add Windows support to shutdown (). new ca5537f pulsemanager.cpp: add cleanup support to on_pulse_finished (). new 3ba2663 pulsemanager.cpp: add Windows stuff to initial env in constructor. new 15c3ce0 pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. new f24f730 pulsemanager.cpp: let start_osx () use start_generic (). new 1353f79 pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. new 53987d2 pulsemanager.cpp: also load module-esound-protocol-tcp module. new b4c1263 pulsemanager.cpp: make generate_server_config () Windows-compatible. new 578ffe9 pulsemanager.cpp: make generate_client_config () Windows-compatible. new 3098843 pulsemanager.cpp: only play startup sound if DEBUG macro is defined. new 6ddb068 pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. new 3d24ba5 pulsemanager.h: whitespace only. new ef1c70f pulsemanager.cpp: typo fix in member variable name server_working_dir_. new dee043a pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. new 0ae076c pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. new d4bd05d pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). new a86f6a4 pulsemanager.cpp: another typo fix: findPort -> find_port. new 388ada2 pulsemanager.cpp: reorder member variables in initialization list. new 2ddb2cb pulsemanager.cpp: add "dummy" start_linux () function. new 54f9a06 pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. new 206bb56 pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. new 63ee944 pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. new 3a94112 pulsemanager.cpp: fix some error messages by removing redundant newlines. new ccd5bf2 pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. new 0e95703 pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. new 3167742 pulsemanager.cpp: add algorithm for actually extracting PA version number. new 92f25f5 pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. new 89c439e pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. new ec8830b pulsemanager.cpp: reorder member variables in initializer list. new b8b84f7 pulsemanager.cpp: fix compile error in startup sound function. new 712db79 pulsemanager.h: more moving around. new f6ccf5f pulsemanager.cpp: use record and playback member variables. new 4decb75 pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. new 639e5e2 macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. new 0a750a9 macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". new 04927c9 pulsemanager.cpp: remove config.pa while doing post-exit cleanups. new 59f0ab1 src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. new ac3dc22 src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. new 617081f src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) new 0bedbd5 src/pulsemanager.cpp: backport fix for 526. new d73fc1f src/pulsemanager.cpp: backport fix for 422. new 34dbda2 src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) new b058a2a src/configdialog.cpp: whitespace only. new 84d8029 src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. new 4d597c3 src/mediawidget.cpp: reflect new capabilities through PulseManager. new 5d95516 src/pulsemanager.h: move x2gologdebug.h inclusion into implementation file. new 6ca4a2b src/pulsemanager.cpp: output PA stdout/stderr via x2goDebug, not plainly to stdout. new 8570d31 src/configdialog.cpp: fix compile error by removing obsolete (and now faulty) line for removed restart message. new b6ed557 src/onmainwindow.cpp: fix compile errors due to misspelled function names. new 2c431cf src/pulsemanager.cpp: let start () act as a wrapper and do nothing if the PA server is already running. new 352bf7a src/onmainwindow.cpp: fix compile error due to misuse of #ifdef. new 715423f src/onmainwindow.cpp: convert QDir object to QString for further processing. new 93e00db src/onmainwindow.cpp: make use of new PulseManager::start () behavior and always use it, no matter whether server is up already or not. new 5e35802 src/pulsemanager.cpp: fix compile error due to typo. new 9f33919 src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. new a69a356 src/pulsemanager.{cpp,h}: add debugging setter and private variable. new fdd59e2 src/pulsemanager.{cpp,h}: port to new debugging feature. new 6e84957 src/onmainwindow.cpp: port to new debugging feature of PulseManager. new aa6bec8 src/pulsemanager.h: fix compile error due to mismatching function declaration for set_debug (). new 98ffc89 res/sound: add startup.wav sound to be played back when starting the PA daemon in debug mode. new 3edbfc7 src/pulsemanager.cpp: don't time out while trying to start PA or paplay. new b30aae5 macbuild.sh: add support for copying resource files. new d3bdae1 res: rename "sound" to "audio". new 02d9402 macbuild.sh: fix copying of resource files. new 9898f33 macbuild.sh: also add PA binaries to deduplication fixup list. new 4754cb3 macbuild.sh: don't error out while executing parse_otool_output (). new 3559f5f macbuild.sh: save return value of parse_otool_output (). new 9b591ac src/pulsemanager.cpp: fix typo in fetch_pulseaudio_version (). new 83659a9 src/pulsemanager.cpp: don't overwrite the temporary string variable for the current line with what was supposed to hold new data in fetch_pulseaudio_version (). new 813d47b src/pulsemanager.{cpp,h}: rename on_pulse_finished () to slot_on_pulse_finished (). new cb65ba6 src/pulsemanager.cpp: actually only play startup sound if debugging is enabled. new 482afb7 src/pulsemanager.cpp: don't insert stray newline into config.pa. new 86ab7a7 src/pulsemanager.cpp: insert PULSE_SERVER and PULSE_COOKIE variables into environment as used by PulseManager. new 5973703 src/pulsemanager.cpp: don't remove PA config and log file in ~/.x2go/pulse on PA shutdown if debugging has been requested. new 6691194 src/x2goutils.{cpp,h}: add new function find_binary (). new 9d2b38a src/pulsemanager.cpp: auto-detect PA binary in $PATH and MacPorts default prefix as well on OS X. new d3038b8 src/pulsemanager.cpp: add comments to Qt 4 code part. new 2e4da1c src/pulsemanager.cpp: add reminder for Linux-implementation in play_startup_sound (). new b3c2308 src/x2goutils.cpp: fix compile error. new f5cc192 src/pulsemanager.h: add new system_pulse_ variable to indicate that a system PA binary shall be used. new 3c8c60c src/pulsemanager.cpp: correctly initialize and set system_pulse_ when required. new 29cdb87 src/x2goutils.{cpp,h}: add application modality parameter to show_RichText_Generic_MsgBox () and its wrappers. new 30f4aa6 src/pulsemanager.cpp: add error message boxes throughout PulseManager. new c894ba5 src/x2goutils.h: fix compile error due to typo. new d6b4cc2 debian/changelog: fix typo in function name. new a941232 src/pulsemanager.cpp: fix compile error on Windows. new ad5681f src/pulsemanager.cpp: fix startup when using the system-PA version. new c798539 src/pulsemanager.cpp: fix startup sound playback when using the system-PA version. new 2769efb src/pulsemanager.cpp: add warning message boxes where appropriate. new 936cdba src/pulsemanager.cpp: remove extraneous newlines from debug output. new c26042e src/x2goutils.cpp: fix faulty logic in find_binary (): only reset the given path to CWD iff it's actually empty. Not the other way around. new cfad226 src/x2goutils.cpp: add some debug logging to find_binary (). new dc47754 nsis/x2goclient.nsi: add startup.wav to installer package. new 3619d2f src/: new file windows_stdint.h for Windows-compatibility when using std::(u)int*_t types. new c1d7d29 src/pulsemanager.h: use windows_stdint.h header on Windows, cstdint otherwise. new 8ad8087 src/onmainwindow.cpp: short out code parts unconditionally checking for the userSshd variable. new b26d82b src/onmainwindow.cpp: drop obsolete pulseVersionTest variable initialization in Windows-only code. new afe920c src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. new 79e4720 src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. new 3635837 src/onmainwindow.cpp: fix compile error on Windows after moving some code around. new f73d307 src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. new c23500b src/pulsemanager.h: include accidentally omitted wapi.h header file. new 371010e src/pulsemanager.cpp: make PA version parsing function more generic and don't expect that a number is always terminated with a period or dash. new 5a59711 src/pulsemanager.cpp: make sure that wherever we interface with non-Qt functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) new cfccb8a src/pulsemanager.cpp: fix PA version fetching on OS X again. new bec2e92 src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. new 83cb263 src/unixhelper.h: style and general fixes within comments. new 48b054f src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). new ef305a4 src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper around real_kill_pgroup (). new 64d9a06 src/pulsemanager.cpp: remove unused variables. new 009384d src/unixhelper.cpp: code cleanup. new 0acbdcb src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. new 376a013 src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. new 33b91f3 src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). new a347d02 src/onmainwindow.{cpp,h}: rename generateHostKey () to generateKey () and add a boolean parameter with a default of false to request a public key. new 7ac26e8 src/onmainwindow.cpp: refactor generateKey () a little bit to compact it. new fdbfe8a src/onmainwindow.{cpp,h}: rewrite generateKey () function to actually also generate user keys. new 0ada6b7 src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section. new 202a6b7 src/onmainwindow.cpp: fix up a few debug strings. new a2f3bfb src/{onmainwindow.{cpp,h},configdialog.cpp}: remove userSshd variable and code related to non-user-mode-sshd setups. new cc19d5c src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise maximum startup time to 5 seconds and break out early, if the process went into running state earlier. new 62058c2 src/onmainwindow.cpp: uppercase key type in debug output and comment string in generateKey (). new d2fe563 src/onmainwindow.cpp: terminate sshd more correctly. new 0d24934 src/onmainwindow.{cpp,h}: add new function check_key_type (). new 25cf30c src/onmainwindow.{cpp,h}: add new function key_type_to_string (). new 4f26db0 src/onmainwindow.{cpp,h}: add new function default_size_for_key_type (). new 86fee87 src/onmainwindow.cpp: use the new functions in generateKey (). new 0dafa6d src/onmainwindow.h: move generateKey () declaration around. new 84a9958 src/onmainwindow.{cpp,h}: reformat generateKey () only. new 5c2cd92 src/onmainwindow.{cpp,h}: move createRSAKey () around. new 77dff6c src/onmainwindow.{cpp,h}: reformat createRSAKey () only. new 6073c3c src/onmainwindow.cpp: let startSshd () act as a wrapper and be called multiple times. new 23b9e77 src/onmainwindow.cpp: add some comments only to createRSAKey (). new 71efa33 src/onmainwindow.{cpp,h}: rename createRSAKey () to the more-appropriate name createKeyBundle (). new ebcb7e6 macbuild.sh: switch to bundling PA 9.0. new 076fe4a src/onmainwindow.cpp: move QProcess startup check in startSshd () to non-Windows code section and add a listening socket check loop. new 56abaee src/onmainwindow.cpp: add comment to last all-in listening check in startSshd (). new d68e4ed src/onmainwindow.cpp: add listening-check loop to the Windows-specific code of startSshd (). new 7afae87 src/onmainwindow.{cpp,h}: make startSshd () private. new d833306 src/onmainwindow.{cpp,h}: add ssh_key_type_ member variable and getter and setter to WinServerStarter class. new bfe09a2 src/onmainwindow.{cpp,h}: add SSH key type parameter to startSshd (). new d79652c src/onmainwindow.cpp: pass new ssh_key_type_ member to startSshd () call in WinServerStarter::run (). new 45ce189 src/onmainwindow.cpp: pass key_type parameter to startSshd () in createKeyBundle (). new 543bfa7 src/onmainwindow.cpp: add and use key_types parameter to startWinServers (). new 431a047 src/onmainwindow.cpp: actually use key_type parameter in startSshd () and make selection more generic. new 55b0e02 src/onmainwindow.h: move WinServerStarter class definition around to hopefully get the definition of ONMainWindow::key_types. new f72ddfa src/onmainwindow.h: remove WWrapper definition, seems to be unused. new 827579d src/onmainwindow.{cpp,h}: don't try to initialize non-static ssh_key_type_ member variable directly, but in the constructor. new d13d2fd src/onmainwindow.cpp: re-order initializer list of WinServerStarter constructor. new 05dc4d0 src/onmainwindow.h: actually, we do need startSshd () to be public. Move it back. new 6fe3aa3 src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in generateKey (). new 805b394 src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance. new c012d25 src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. new 68930b5 src/pulsemanager.cpp: refactor PA binary searching code. new 0b84096 src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. new e5bac32 src/pulsemanager.cpp: fix PA binary searching logic. new b3f3e29 src/onmainwindow.cpp: move generateEtcFiles () call to startSshd (). new af07a40 src/onmainwindow.cpp: stop duplicating the list of known sftp-server binary locations. new 47048cf src/{onmainwindow,pulsemanager}.cpp: actually *use* what we got back from add_to_path ()... new d02a836 src/onmainwindow.cpp: remove trailing slash from Mageia/SUSE/Arch sftp-server binary search path. new 7b36d12 src/x2goutils.cpp: add debugging output to add_to_path (). new 1593e83 src/x2goutils.cpp: fix add_to_path (). new f836bed src/unixhelper.cpp: use cstdio instead of stdio.h. new 4596fb8 src/: create new file unix_stdint.h which imports the (u)int*_t types into the std namespace. new 2d9d3b2 src/pulsemanager.h: use unix_stdint.h on non-Windows-platforms to get std::(u)int*_t types without having to use C++11. new 6d0a465 src/pulsemanager.cpp: fix Linux-based code by fixing a really stupid typo ("erange" instead of "errno") and including the cerrno header. new e891ec2 src/pulsemanager.cpp: use std::ssize_t for the path length, because it could be -1 and std::size_t is not applicable. new b838252 src/pulsemanager.cpp: cast the return value of realloc () to char*, as GCC doesn't seem to like reassigning the pointer otherwise. new 92106d6 src/unix_stdint.h: use same hack to import ssize_t into std namespace. new 09bdbd6 src/onmainwindow.{cpp,h}: remove left-over parec references and code. new 7442496 src/onmainwindow.cpp: convert piece of code to non-Windows and non-Darwin, so that not only Linux but other operating systems are covered as well. new ef62c50 src/mediawidget.cpp: unify some redundant code. new 0915f76 src/mediawidget.cpp: simplify expression. new b8d193c src/mediawidget.cpp: add deprecation warning for ARTS. new f8e9390 src/mediawidget.cpp: add deprecation warning for ESounD. new e552d9a macbuild.sh: make compatible with new llvm-based otool binary, which now uses proper return values. 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 (302c416) \ N -- N -- N refs/heads/bugfix/osx (e552d9a) 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 281 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 1 + src/onmainwindow.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) -- 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 33efb1390af79079ad0a4a55e6bef3e4acb267c7 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 39b1e75..dd44f89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium otherwise the icon will not show up. Also change the icon size back to 16x16 px, that's big enough. - src/onmainwindow.cpp: remove left-over debug test message. + - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 9fbac48..47b2197 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 063cc4aec94c45587538e24513355a1428e4eac7 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 dd44f89..d8b27c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 16x16 px, that's big enough. - src/onmainwindow.cpp: remove left-over debug test message. - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. + - unixhelper.{cpp,h}: implement cleanup program for process group. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 35978d8545f89c1c2112229c897f959b7c627de4 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 d8b27c6..4a9343b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,6 +38,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: remove left-over debug test message. - {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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 015bbce..fb63fe5 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 448d891695d4185b651fea1d78bc899f14c8a97b 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 4a9343b..01f58c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -39,6 +39,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - {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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index fb63fe5..df15858 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 c219f37ac3e7137bb7647d682aeffe402ffb57de 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 01f58c2..7110368 100644 --- a/debian/changelog +++ b/debian/changelog @@ -41,6 +41,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index df15858..f56bed2 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 38c40d62051108eee4e3d73af19603eab7418d3f 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 7110368..2088c5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,6 +45,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index f56bed2..44c41d3 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -1,6 +1,7 @@ /************************************************************************** * Copyright (C) 2005-2016 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 72ca36e5387bc5cebd509a5c1702ea0340c97f90 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 2088c5f..72c3e5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 44c41d3..1e92536 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 7188d69105092947c2f6ae96b8de0cec9cb944eb 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 72c3e5b..09a9251 100644 --- a/debian/changelog +++ b/debian/changelog @@ -48,6 +48,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 1e92536..f495796 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 7799e945ee72a087fd0e6ffc211637bb8895f654 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 09a9251..b1defdf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -49,6 +49,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 2f08e765b36694c9b107958be49d1c849f7c4d5e 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 b1defdf..98c2991 100644 --- a/debian/changelog +++ b/debian/changelog @@ -51,6 +51,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 7b2bb8bff72f24524f9c4dfee6efa1a3dbd6728c 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 98c2991..652ef84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 f495796..7eb6511 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 5a2b6bddc843f7e010ec2a764612d7a70be9114a 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 652ef84..8fcc8e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -54,6 +54,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 7eb6511..e7ec69b 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 e080ab1aeaf16c12c30bf78d0d23747cd7f50ef0 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 8fcc8e9..3b10052 100644 --- a/debian/changelog +++ b/debian/changelog @@ -55,6 +55,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - {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(). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index e7ec69b..be070d8 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 880d4012bdcc7de35eb39af58f8f5237cb0fa1cd 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 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 3b10052..e0ff753 100644 --- a/debian/changelog +++ b/debian/changelog @@ -56,6 +56,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium (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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): -- 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 ab201f0f6e7a8fc5f13a885fef92a54f161ee474 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 e0ff753..dfc69a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -57,6 +57,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2ad0740..f2cc11c 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -50,6 +50,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; std::exit (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 9822394da21d85626aff0b30adb4599e4f5514ed 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 dfc69a7..124aa66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -59,6 +59,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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 sigaction(). Handle errors. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index f2cc11c..fdcaac9 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -69,15 +69,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; - std::exit (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 678d59fea3f5f08c7a7b06d1c30bbaf368eb999f 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 124aa66..5abed08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -60,6 +60,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. - unixhelper.cpp: port from std::signal() to sigaction(). 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index be070d8..ad613fb 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 297e1ec9d0df7c51e9dba801fa067aea947ccb73 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 5abed08..60007cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -64,6 +64,11 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index ad613fb..3f11d55 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 27a98c9abbe66cff300ea95664780b39b57f2184 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 60007cd..f6efd08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -69,6 +69,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 3f11d55..895db0d 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 ba3945b7c2b2c6fc2bdcd822861ef58b86770a95 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 f6efd08..a19d7d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -70,6 +70,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 895db0d..eee541f 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 7bc682d3673536c8bbee1a78165bc13daa082d26 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 a19d7d6..f4e69fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -71,6 +71,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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.) [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index eee541f..c8df342 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 d66274757a5b074d5609afbef113db206456020d 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 f4e69fb..39120fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -74,6 +74,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index fdcaac9..d4698df 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -40,8 +40,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); @@ -98,9 +98,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 1bc2069811ffe3b9914c46972770d541e95f1b97 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 39120fe..cca6ee7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -76,6 +76,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium (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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d4698df..410c320 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -49,7 +49,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. @@ -100,6 +100,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 c8df342..2c334e1 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 0996b805b6579a29b6afd8d970724f7584c86dc1 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 | 18 +++++++++++++----- src/unixhelper.h | 3 +++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index cca6ee7..1712612 100644 --- a/debian/changelog +++ b/debian/changelog @@ -78,6 +78,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 410c320..acdee33 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -28,7 +28,7 @@ #include <iostream> #include <cstring> #include <cerrno> -#include <cstdlib> +#include <vector> /* For documentation please see unixhelper.h. */ @@ -69,15 +69,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 720061d42ca40aab706cbf229909e493fde49860 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 1712612..66ebd38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -80,6 +80,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 2c334e1..df53ba1 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 420f089c3cb03296f694d5124f501d30e9b755c3 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 | 5 ++++- src/unixhelper.cpp | 7 +++++++ 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 66ebd38..bdd7fe7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -82,6 +82,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/appdialog.cpp b/src/appdialog.cpp index 4b25ee9..327ffdc 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 d0f67ba..c450e48 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 d8e178c..70266e2 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -4329,8 +4329,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"; @@ -11017,6 +11019,7 @@ void ONMainWindow::slotEmbedIntoParentWindow() void ONMainWindow::processSessionConfig() { bool haveKey=false; + UNUSED (haveKey); config.command="KDE"; config.brokerNoAuth=false; diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index acdee33..d5aa67d 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. */ @@ -117,6 +118,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 f4c494401154715e7c2fc3d333f08070e5b502f0 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 bdd7fe7..cfa93ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -84,6 +84,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/appdialog.cpp b/src/appdialog.cpp index 327ffdc..f41361c 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 a298f8a17d7b142297962374201cbd26c8953a5c 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 | 187 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 128 insertions(+), 63 deletions(-) diff --git a/debian/changelog b/debian/changelog index cfa93ae..1a42535 100644 --- a/debian/changelog +++ b/debian/changelog @@ -86,6 +86,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 70266e2..c5f0798 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8278,43 +8278,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"); + + /* + * 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; + } - QTemporaryFile tfile ( authofname ); - tfile.open(); - tfile.setAutoRemove ( true ); - QTextStream out ( &tfile ); + QTemporaryFile tfile (authorized_keys_file.fileName ()); + tfile.open (); + tfile.setPermissions (QFile::ReadOwner | QFile::WriteOwner); + tfile.setAutoRemove (true); + QTextStream out (&tfile); - while ( !file.atEnd() ) - { - QByteArray newline = file.readLine(); - if ( newline!=line ) - out<<newline; + /* + * 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"); } @@ -9545,41 +9556,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; + } + } - x2goDebug<<"Temporarily activated public key from file "<<fsExportKey<<".pub."<<endl; + if (permission_error) { + QFile::remove (fsExportKey + ".pub"); + return; + } +#endif /* defined (Q_OS_UNIX) */ + + directory* dir = getExpDir (fsExportKey); + bool rem = dir->isRemovable; + if (!dir) { + return; + } + + 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(); @@ -10362,20 +10422,21 @@ 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"); - varDir=cygwinPath (varDir); - x2goDebug<<varDir<<" cygwin var path"; -#endif + authKeyPath = cygwinPath (authKeyPath); + authKeyPath.replace (wapiGetUserName (), "%u"); + varDir = cygwinPath (varDir); + x2goDebug << varDir << " cygwin var path"; +#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<<"\"\n"; #else "Subsystem sftp " /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 15a38d25ff0f09b6cf5080e11488eb19945ed245 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 1a42535..aa6a1be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -90,6 +90,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 df53ba1..b201a4e 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 47b2197..a7b74a0 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 f8a5fe866a3dea1f7cc7c055dcf3c1fe8124512d 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 aa6a1be..397410c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -92,6 +92,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 1d14155c095c3554c229b4cd455fb31f4baa75c9 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 f59434a..90ed2d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -96,6 +96,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/x2goclient.pro b/x2goclient.pro index a7b74a0..a5e421f 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 e9bbaea9dd2141d2a7f2395638e1bc675813f80b 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 397410c..f5ed9df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -94,6 +94,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 43aae964dc0b19a82d97bde0f7f376aedc96f96d 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 f5ed9df..f59434a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -95,6 +95,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): 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 00698298dbf4bb4deb20f8ef21403b18d66b192e 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 dc83ad6..9f9efc4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -98,6 +98,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 6e37740..83df7ea 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -41,6 +41,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 4a6ae0cab648732bc7175be7cd7baeef5fb85e48 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 9f9efc4..8fb84e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -99,6 +99,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 83df7ea..0c8e47b 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -55,6 +55,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 713d45547505369cf0c353325ecfa00172ef948d 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 | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 90ed2d8..dc83ad6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -97,6 +97,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 64a93ec..6e37740 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -32,6 +32,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" @@ -54,6 +55,16 @@ 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"} @@ -61,6 +72,9 @@ NXPROXY="$(which nxproxy)" : ${DEBUG:="0"} : ${BUNDLE:="1"} : ${UNIVERSAL:="1"} +: ${MACPORTS_PREFIX:="${MACPORTS_PREFIX_SEARCH}"} + +unset MACPORTS_PREFIX_SEARCH FORCE_STDLIB="$(make_boolean "${FORCE_STDLIB}")" DEBUG="$(make_boolean "${DEBUG}")" @@ -114,10 +128,6 @@ pushd "${BUILD_DIR}" phase "Running lrelease" lrelease "${PROJECT}" - -# WILL BE REMOVED IN OTHER BRANCH - ONLY HERE FOR COMPAT REASONS -MACPORTS_PREFIX="/opt/local" - phase "Running qmake" qmake -config "${BUILD_MODE}" -spec macx-g++ "${PROJECT}" \ CONFIG+="${BUILD_ARCH}" \ -- 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 aef8eb0e3feea095d099d4324c1879b3c67db288 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 8fb84e1..57c657a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -100,6 +100,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 0c8e47b..5df4670 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -67,6 +67,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 1cd24f0e488c20e6d34511cec752769b16f00c85 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 57c657a..8272e4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -101,6 +101,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 5df4670..e264e86 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -81,6 +81,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 da6920ef15d3d12df4e5b6c38001f1c46630f992 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 8272e4e..47767d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -102,6 +102,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index e264e86..9ea2d32 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -110,7 +110,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 @@ -122,6 +121,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"} : ${FORCE_STDLIB:="0"} @@ -164,6 +165,11 @@ else fi 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 03032c1a842b495c9875bd77fdcf8f837898b1b4 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 47767d3..a80daba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -103,6 +103,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 9ea2d32..e0db1f7 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -106,6 +106,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" @@ -202,15 +204,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 5147686e7c6117fda13601252906fe570aa5dd6b 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 a80daba..db2d344 100644 --- a/debian/changelog +++ b/debian/changelog @@ -105,6 +105,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index e0db1f7..ae7cc7f 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -124,6 +124,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"} @@ -172,6 +179,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 b4bc6913962c31ed9c638fe433227059a9894a91 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 7dcba78..8d45f21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -109,6 +109,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index c10c814..cff39ae 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -279,6 +279,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 4cb0e1e0b62a57467ea7ffa89228c4929a1b835a 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 db2d344..7dcba78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -108,6 +108,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index ae7cc7f..c10c814 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -261,6 +261,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 2d2e15d4b534c6c3e6e0a6eea059969f34984b62 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jun 29 23:03:23 2015 +0200 macbuild.sh: add Linux library file name scheme regex as a precaution. --- debian/changelog | 1 + macbuild.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 32e50b4..e66186d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -113,6 +113,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. + - macbuild.sh: add Linux library file name scheme regex as a precaution. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 7b14bb5..9e9a1f8 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -209,8 +209,13 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # 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 + typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' + + # This is only here should the PA build system ever break and create + # "linux-style" library file names. Let's hope it never actually comes to that. + typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' + + if [[ "${entry}" =~ ${TMP_REGEX} ]] || [[ "${entry}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then # Filename matched the expected template. PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) fi -- 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 761fc19643fe146cd664181f3e161d0c3e609518 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 8d45f21..32e50b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -110,6 +110,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium 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. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index cff39ae..7b14bb5 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -287,6 +287,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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bcf52e9e0476a856fe9603dfc1043f5c3dc2b52f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:31:52 2015 +0200 macbuild.sh: add some more debugging output. --- debian/changelog | 1 + macbuild.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4e1c847..98a4bbf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -116,6 +116,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add Linux library file name scheme regex as a precaution. - macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. + - macbuild.sh: add some more debugging output. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index a6b9224..b3f5177 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -204,9 +204,11 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" if [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then + echo "Adding ${cur_lib_or_libdir} to \${PULSEAUDIO_LIBRARIES_FULL}" PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) elif [ -d "${cur_lib_or_libdir}" ]; then # That's a directory... more work needed here. + echo "Scrubbing directory ${cur_lib_or_libdir}" typeset entry="" for entry in "${cur_lib_or_libdir}"/*; do typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' @@ -314,6 +316,7 @@ if [ "${BUNDLE}" = "1" ]; then if [ ! -L "${cur_binary}" ]; then cur_binary_name="$(basename "${cur_binary}")" + echo "Handling ${cur_binary} => ${cur_binary_name}." typeset nesting_level="$(get_nesting_level "${intermediate_lib_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 c8a864e4c5dca2527bcdd2761fce840f4de7316a Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jun 29 23:09:05 2015 +0200 macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. --- debian/changelog | 2 ++ macbuild.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e66186d..4e1c847 100644 --- a/debian/changelog +++ b/debian/changelog @@ -114,6 +114,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium apart and be redone, because dylibbundler is not smart enough to handle our case. - macbuild.sh: add Linux library file name scheme regex as a precaution. + - macbuild.sh: directories are "executable", so the first check must + explicitly include a check for the argument being not a directory. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 9e9a1f8..a6b9224 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -203,7 +203,7 @@ 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 + if [ ! -d "${cur_lib_or_libdir}" ] && [ -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. -- 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 5ef5c2fcdc5ec87ab20262a52e0cdcb043583ed0 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:42:01 2015 +0200 macbuild.sh: check current file name against regex, not a (now) full path. --- debian/changelog | 2 ++ macbuild.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index daff410..025bb56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -121,6 +121,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium bundled, as something else will bundle them anyway. - macbuild.sh: use while-read-loop and find to actually recurse through directories. + - macbuild.sh: check current file name against regex, not a (now) full + path. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index cbf9909..d0d5f8a 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -213,13 +213,14 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed # by a NUL character, the delimiter is set to this very NUL (\000) character. while read -r -d '' entry; do + typeset cur_file="$(basename "${entry}")" typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' # This is only here should the PA build system ever break and create # "linux-style" library file names. Let's hope it never actually comes to that. typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' - if [[ "${entry}" =~ ${TMP_REGEX} ]] || [[ "${entry}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then + if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then # Filename matched the expected template. PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) fi -- 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 d5e9e595cbc134766bbc28fdeef1c5a561800c1a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:33:30 2015 +0200 macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. --- debian/changelog | 2 ++ macbuild.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 98a4bbf..a3bbe4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -117,6 +117,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. - macbuild.sh: add some more debugging output. + - macbuild.sh: remove libpulse and libpulsecore from libraries to be + bundled, as something else will bundle them anyway. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index b3f5177..231e030 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -127,8 +127,6 @@ 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" ) -- 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 3be37043ee1a6b6c330c4d4c3a39f6355f079a93 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:39:59 2015 +0200 macbuild.sh: use while-read-loop and find to actually recurse through directories. --- debian/changelog | 2 ++ macbuild.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a3bbe4d..daff410 100644 --- a/debian/changelog +++ b/debian/changelog @@ -119,6 +119,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add some more debugging output. - macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. + - macbuild.sh: use while-read-loop and find to actually recurse through + directories. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 231e030..cbf9909 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -208,7 +208,11 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # That's a directory... more work needed here. echo "Scrubbing directory ${cur_lib_or_libdir}" typeset entry="" - for entry in "${cur_lib_or_libdir}"/*; do + + # -r parameter to read: Backslashes may NOT escape any characters! + # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed + # by a NUL character, the delimiter is set to this very NUL (\000) character. + while read -r -d '' entry; do typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' # This is only here should the PA build system ever break and create @@ -219,7 +223,7 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # Filename matched the expected template. PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) fi - done + done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) else fail="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 a0f77febc157702869ad84cb5099c9472ca102db Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:45:40 2015 +0200 macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. Will need testing. --- debian/changelog | 2 ++ macbuild.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 29408e8..34b3487 100644 --- a/debian/changelog +++ b/debian/changelog @@ -124,6 +124,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: check current file name against regex, not a (now) full path. - macbuild.sh: add the correct file path to the library bundling array. + - macbuild.sh: when actually bundling libraries, use @executable_path + instead of @loader_path. Will need testing. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index b15d62a..b3a6203 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -328,7 +328,7 @@ if [ "${BUNDLE}" = "1" ]; then --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/" \ + --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/" \ --create-dir \ --overwrite-files fi -- 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 b820060cbefafa66170ea0665707e1aac25bd64f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:43:25 2015 +0200 macbuild.sh: add the correct file path to the library bundling array. --- debian/changelog | 1 + macbuild.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 025bb56..29408e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -123,6 +123,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium directories. - macbuild.sh: check current file name against regex, not a (now) full path. + - macbuild.sh: add the correct file path to the library bundling array. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index d0d5f8a..b15d62a 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -222,7 +222,8 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then # Filename matched the expected template. - PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) + echo "Adding $(lazy_canonical_path "${entry}") to \${PULSEAUDIO_LIBRARIES_FULL}" + PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${entry}")" ) fi done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) 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 c87c2e9c1ab8230b59545da27be67776137d4901 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 20:55:14 2015 +0200 macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. Helps debugging. --- debian/changelog | 2 ++ macbuild.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 34b3487..6edd568 100644 --- a/debian/changelog +++ b/debian/changelog @@ -126,6 +126,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add the correct file path to the library bundling array. - macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. Will need testing. + - macbuild.sh: fix echo call to also show the intermediate lib dir, not + just the library file name. Helps debugging. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index b3a6203..0a974b6 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -320,7 +320,7 @@ if [ "${BUNDLE}" = "1" ]; then if [ ! -L "${cur_binary}" ]; then cur_binary_name="$(basename "${cur_binary}")" - echo "Handling ${cur_binary} => ${cur_binary_name}." + echo "Handling ${cur_binary} => ${intermediate_lib_dir}/${cur_binary_name}." typeset nesting_level="$(get_nesting_level "${intermediate_lib_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 455194df393d39a077d63a2f5b3e8db35dae9186 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 20:56:29 2015 +0200 macbuild.sh: also install libraries into staging area with intermediate library path. Putting everything into a single place is a stupid idea. --- debian/changelog | 2 ++ macbuild.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6edd568..834d5da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -128,6 +128,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium instead of @loader_path. Will need testing. - macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. Helps debugging. + - macbuild.sh: also install libraries into staging area with intermediate + library path. Putting everything into a single place is a stupid idea. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 0a974b6..26f0d7e 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -327,8 +327,8 @@ if [ "${BUNDLE}" = "1" ]; then dylibbundler \ --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ --bundle-deps \ - --dest-dir "${FRAMEWORKS_DIR}/" \ - --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/" \ + --dest-dir "${FRAMEWORKS_DIR}/${intermediate_lib_dir}" \ + --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/${intermediate_lib_dir}" \ --create-dir \ --overwrite-files fi -- 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 9c1c29234f371282b648bb723970eb57011dc39a Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 21:40:13 2015 +0200 deduplicate.sh: add duplicates-to-real mapping. --- debian/changelog | 1 + deduplicate.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/debian/changelog b/debian/changelog index bfa43d0..52860cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -132,6 +132,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium library path. Putting everything into a single place is a stupid idea. - deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. + - deduplicate.sh: add duplicates-to-real mapping. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 7c4de14..19dc584 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -77,3 +77,31 @@ echo "New value for all_files:" for entry in ${all_files[@]}; do echo "${entry}" done + +echo "Duplicates-to-real map:" +# Build complementary array to duplicates. +typeset -a to_files +for entry in ${duplicates[@]}; do + typeset filename="$(basename "${entry}")" + + for all_entry in ${all_files[@]}; do + typeset all_entry_filename="$(basename "${all_entry}")" + + if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then + if [ "${filename}" = "${all_entry_filename}" ]; then + to_files+=( "${all_entry}" ) + + echo "${entry} => ${all_entry}" + + # There should be only one entry matching, so we can save a bit of time and break out of the loop. + # Even more importantly, we only want one entry for each duplicates entry anyway... + break + fi + else + echo "WARNING: empty file name while matching duplicates with non-duplicates." >&2 + echo "WARNING: duplicate entry: \"${entry}\"" >&2 + echo "WARNING: real entry: \"${all_entry}\"" >&2 + exit 1 + fi + done +done -- 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 9b65c3ac820b990374bdbdea8f86ea43d7c8c866 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 20:57:41 2015 +0200 deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. --- debian/changelog | 2 ++ deduplicate.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/debian/changelog b/debian/changelog index 834d5da..bfa43d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -130,6 +130,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium just the library file name. Helps debugging. - macbuild.sh: also install libraries into staging area with intermediate library path. Putting everything into a single place is a stupid idea. + - deduplicate.sh: add new, more or less Proof of Concept, and Work in + Progress file deduplication script. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh new file mode 100755 index 0000000..7c4de14 --- /dev/null +++ b/deduplicate.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +typeset base_dir="" +base_dir="${1:?"No base dir given."}" + +typeset -a special_files_regex +special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) + +typeset -a all_files +typeset entry="" +while read -r -d '' entry; do + all_files+=( "${entry}" ) +done < <(find "${base_dir}" -type 'f' -print0) + +typeset -a top_files +for entry in ${all_files[@]}; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset tmp_regex='^[^/]+$' + if [[ "${relative_path}" =~ ${tmp_regex} ]]; then + echo "${relative_path} is top file, adding to array." + top_files+=( "${relative_path}" ) + fi +done + +typeset -a duplicates +for entry in ${all_files[@]}; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset file_name="$(basename "${entry}")" + typeset top_entry="" + for top_entry in ${top_files[@]}; do + if [ "${top_entry}" != "${relative_path}" ]; then + if [ "${file_name}" = "${top_entry}" ]; then + echo "Adding duplicate: ${relative_path}" + duplicates+=( "${relative_path}" ) + fi + fi + done +done + +echo "duplicates array before:" +for entry in ${duplicates[@]}; do + echo "${entry}" +done + +typeset -i i="0" +for ((i = 0; i < ${#duplicates[@]}; ++i)); do + entry="${duplicates[${i}]}" + typeset special_file_regex="" + for special_file_regex in ${special_files_regex[@]}; do + typeset tmp_regex='^'"${special_file_regex}"'$' + if [[ "${entry}" =~ ${tmp_regex} ]]; then + echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" + duplicates[${i}]="$(basename "${entry}")" + echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" + fi + done +done + +echo "duplicates array after:" +for entry in ${duplicates[@]}; do + echo "${entry}" +done + +for entry in ${duplicates[@]}; do + echo "rm -v ${base_dir}/${entry}" + typeset -i i="0" + for ((i = 0; i < ${#all_files[@]}; ++i)); do + typeset all_entry="${all_files[${i}]}" + typeset relative_path="${all_entry##"${base_dir}/"}" + if [ "${relative_path}" = "${entry}" ]; then + all_files[${i}]="" + fi + done +done + +echo "New value for all_files:" +for entry in ${all_files[@]}; do + echo "${entry}" +done -- 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 70b8ac4430c8072e3db1be734aa7a764e12f5d81 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 22:26:52 2015 +0200 deduplicate.sh: add missed local variable declaration. --- debian/changelog | 1 + deduplicate.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 52860cb..907a309 100644 --- a/debian/changelog +++ b/debian/changelog @@ -133,6 +133,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. - deduplicate.sh: add duplicates-to-real mapping. + - deduplicate.sh: add missed local variable declaration. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 19dc584..30fd3ad 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -84,6 +84,7 @@ typeset -a to_files for entry in ${duplicates[@]}; do typeset filename="$(basename "${entry}")" + typeset all_entry="" for all_entry in ${all_files[@]}; do typeset all_entry_filename="$(basename "${all_entry}")" -- 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 9105ed98f1e1f853df41da4335cc394f9b676516 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 03:56:21 2015 +0200 deduplicate.sh: non-functional: change WARNING to ERROR in error messages. --- debian/changelog | 2 ++ deduplicate.sh | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 459cb31..f731a07 100644 --- a/debian/changelog +++ b/debian/changelog @@ -136,6 +136,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add missed local variable declaration. - deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. + - deduplicate.sh: non-functional: change WARNING to ERROR in error + messages. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index a5b59e9..41d2cbf 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -126,9 +126,9 @@ for entry in ${duplicates[@]}; do break fi else - echo "WARNING: empty file name while matching duplicates with non-duplicates." >&2 - echo "WARNING: duplicate entry: \"${entry}\"" >&2 - echo "WARNING: real entry: \"${all_entry}\"" >&2 + echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 + echo "ERROR: duplicate entry: \"${entry}\"" >&2 + echo "ERROR: real entry: \"${all_entry}\"" >&2 exit 1 fi done -- 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 acedeec2353129cce10f2b6e6df085bf719ea67a Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 22:28:09 2015 +0200 deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. --- debian/changelog | 2 ++ deduplicate.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/debian/changelog b/debian/changelog index 907a309..459cb31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -134,6 +134,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium Progress file deduplication script. - deduplicate.sh: add duplicates-to-real mapping. - deduplicate.sh: add missed local variable declaration. + - deduplicate.sh: new function for parsing otool's output and printing + library dependencies if no error occurred. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 30fd3ad..a5b59e9 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -6,6 +6,33 @@ base_dir="${1:?"No base dir given."}" typeset -a special_files_regex special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) +typeset -a otool_fail_str +otool_fail_str=( "is not an object file" + "can't open file" + "Archive : " ) + +parse_otool_output() { + typeset raw_output="${@}" + + typeset fail_str="" + for fail_str in ${otool_fail_str}; do + if ! echo "${raw_output}" | grep -q "${fail_str}"; then + exit 1 + fi + done + + typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + typeset line="" + while read -r line; do + if [[ "${line}" =~ ${tmp_regex} ]]; then + echo "${BASH_REMATCH[1]}" + fi + done <<< "${raw_output}" + + exit 0 +} + typeset -a all_files typeset entry="" while read -r -d '' entry; do -- 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 2f4b106f34669ce464e498f0576c6cc1671e6813 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:51:07 2015 +0200 deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. --- debian/changelog | 2 ++ deduplicate.sh | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 583c540..b609d46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -143,6 +143,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: correctly unset an array element. - deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. + - deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word + splitting. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index d932fbb..33c4628 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -40,7 +40,7 @@ while read -r -d '' entry; do done < <(find "${base_dir}" -type 'f' -print0) typeset -a top_files -for entry in ${all_files[@]}; do +for entry in "${all_files[@]}"; do typeset relative_path="${entry##"${base_dir}/"}" typeset tmp_regex='^[^/]+$' if [[ "${relative_path}" =~ ${tmp_regex} ]]; then @@ -50,11 +50,11 @@ for entry in ${all_files[@]}; do done typeset -a duplicates -for entry in ${all_files[@]}; do +for entry in "${all_files[@]}"; do typeset relative_path="${entry##"${base_dir}/"}" typeset file_name="$(basename "${entry}")" typeset top_entry="" - for top_entry in ${top_files[@]}; do + for top_entry in "${top_files[@]}"; do if [ "${top_entry}" != "${relative_path}" ]; then if [ "${file_name}" = "${top_entry}" ]; then echo "Adding duplicate: ${relative_path}" @@ -65,7 +65,7 @@ for entry in ${all_files[@]}; do done echo "duplicates array before:" -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do echo "${entry}" done @@ -73,7 +73,7 @@ typeset -i i="0" for i in "${!duplicates[@]}"; do entry="${duplicates[${i}]}" typeset special_file_regex="" - for special_file_regex in ${special_files_regex[@]}; do + for special_file_regex in "${special_files_regex[@]}"; do typeset tmp_regex='^'"${special_file_regex}"'$' if [[ "${entry}" =~ ${tmp_regex} ]]; then echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" @@ -84,11 +84,11 @@ for i in "${!duplicates[@]}"; do done echo "duplicates array after:" -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do echo "${entry}" done -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do echo "rm -v ${base_dir}/${entry}" typeset -i i="0" for i in "${!all_files[@]}"; do @@ -101,18 +101,18 @@ for entry in ${duplicates[@]}; do done echo "New value for all_files:" -for entry in ${all_files[@]}; do +for entry in "${all_files[@]}"; do echo "${entry}" done echo "Duplicates-to-real map:" # Build complementary array to duplicates. typeset -a to_files -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do typeset filename="$(basename "${entry}")" typeset all_entry="" - for all_entry in ${all_files[@]}; do + for all_entry in "${all_files[@]}"; do typeset all_entry_filename="$(basename "${all_entry}")" if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then @@ -135,7 +135,7 @@ for entry in ${duplicates[@]}; do done # Try to fixup files broken by duplicates removal. -for all_entry in ${all_files[@]}; do +for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" typeset dependencies="$(parse_otool_output "${otool_out}")" -- 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 273a5a7aef8471af6c6f0d930047f6977d03acab Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:46:07 2015 +0200 deduplicate.sh: correctly unset an array element. --- debian/changelog | 1 + deduplicate.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c12122b..0b0ae72 100644 --- a/debian/changelog +++ b/debian/changelog @@ -140,6 +140,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium messages. - deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. + - deduplicate.sh: correctly unset an array element. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index ddf5984..b7d066a 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -95,7 +95,7 @@ for entry in ${duplicates[@]}; do typeset all_entry="${all_files[${i}]}" typeset relative_path="${all_entry##"${base_dir}/"}" if [ "${relative_path}" = "${entry}" ]; then - all_files[${i}]="" + unset all_files[${i}] fi done done -- 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 04f90b6e4af757d603634fec99a46d3067bb89bc Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:48:32 2015 +0200 deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. --- debian/changelog | 2 ++ deduplicate.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b0ae72..583c540 100644 --- a/debian/changelog +++ b/debian/changelog @@ -141,6 +141,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. - deduplicate.sh: correctly unset an array element. + - deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle + "sparse" arrays correctly. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index b7d066a..d932fbb 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -70,7 +70,7 @@ for entry in ${duplicates[@]}; do done typeset -i i="0" -for ((i = 0; i < ${#duplicates[@]}; ++i)); do +for i in "${!duplicates[@]}"; do entry="${duplicates[${i}]}" typeset special_file_regex="" for special_file_regex in ${special_files_regex[@]}; do @@ -91,7 +91,7 @@ done for entry in ${duplicates[@]}; do echo "rm -v ${base_dir}/${entry}" typeset -i i="0" - for ((i = 0; i < ${#all_files[@]}; ++i)); do + for i in "${!all_files[@]}"; do typeset all_entry="${all_files[${i}]}" typeset relative_path="${all_entry##"${base_dir}/"}" if [ "${relative_path}" = "${entry}" ]; then -- 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 1b3e9e152e0146c28b0eab0de2a6a9e39039ccb0 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 03:57:10 2015 +0200 deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. --- debian/changelog | 2 ++ deduplicate.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/debian/changelog b/debian/changelog index f731a07..c12122b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -138,6 +138,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium library dependencies if no error occurred. - deduplicate.sh: non-functional: change WARNING to ERROR in error messages. + - deduplicate.sh: add first skeleton for library dependency rewriting of + deleted duplicates. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 41d2cbf..ddf5984 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -133,3 +133,33 @@ for entry in ${duplicates[@]}; do fi done done + +# Try to fixup files broken by duplicates removal. +for all_entry in ${all_files[@]}; do + typeset otool_out="$(otool -L "${all_entry}")" + + typeset dependencies="$(parse_otool_output "${otool_out}")" + if [ "${?}" -eq 0 ]; then + typeset line="" + while read -r line; do + typeset dependencies_filename="$(basename "${line}")" + + typeset duplicate_entry="" + for duplicate_entry in ${duplicates[@]}; do + typeset duplicate_filename="$(basename "${duplicate_entry}")" + + if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then + + else + echo "ERROR: empty file name while duplicates with dependencies." >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" + else + echo "ERROR: otool returned error for file: ${all_entry}" >&2 + exit 1 + fi +done -- 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 b47413fa401273d69f2a752a48918ad8152fff27 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:53:44 2015 +0200 deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. --- debian/changelog | 3 +++ deduplicate.sh | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index b609d46..d401a2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -145,6 +145,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium "sparse" arrays correctly. - deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. + - deduplicate.sh: fix parse_otool_output: we want to return failure only + iff any of the strings are present in otool's output and actually handle + the failure string *ARRAY* correctly as that. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 33c4628..939eb55 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -15,9 +15,9 @@ parse_otool_output() { typeset raw_output="${@}" typeset fail_str="" - for fail_str in ${otool_fail_str}; do - if ! echo "${raw_output}" | grep -q "${fail_str}"; then - exit 1 + for fail_str in "${otool_fail_str[@]}"; do + if echo "${raw_output}" | grep -q "${fail_str}"; then + return 1 fi done -- 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 b7bcbd5e9d209a67ac42f8e329e9a3df047a181a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:56:56 2015 +0200 deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. --- debian/changelog | 2 ++ deduplicate.sh | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 927c43a..55b9826 100644 --- a/debian/changelog +++ b/debian/changelog @@ -149,6 +149,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. - deduplicate.sh: change exit to return in parse_otool_output. + - deduplicate.sh: record crafted "library path" values in duplicates + replacement to_files array. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 235d4b1..ab86a0b 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -117,9 +117,10 @@ for entry in "${duplicates[@]}"; do if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then if [ "${filename}" = "${all_entry_filename}" ]; then - to_files+=( "${all_entry}" ) + typeset dependency_format="@executable_path/../Frameworks/${all_entry##${base_dir}}" + to_files+=( "${dependency_format}" ) - echo "${entry} => ${all_entry}" + echo "${entry} => ${dependency_format}" # There should be only one entry matching, so we can save a bit of time and break out of the loop. # Even more importantly, we only want one entry for each duplicates entry anyway... -- 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 41a9e8d91c1cabf40fc7881633e1f1c839749b88 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:54:58 2015 +0200 deduplicate.sh: change exit to return in parse_otool_output. --- debian/changelog | 1 + deduplicate.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d401a2b..927c43a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -148,6 +148,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. + - deduplicate.sh: change exit to return in parse_otool_output. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 939eb55..235d4b1 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -30,7 +30,7 @@ parse_otool_output() { fi done <<< "${raw_output}" - exit 0 + return 0 } typeset -a all_files -- 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 9f191b29c598f976477cb645c6490d014a846793 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:05:07 2015 +0200 deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. --- debian/changelog | 3 +++ deduplicate.sh | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 54423f4..f69481e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -154,6 +154,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: debug parse_otool_output fiercely for the time being. - deduplicate.sh: prevent word splitting when parsing otool's output. We want the raw bits. + - deduplicate.sh: switch to range-based for loop in fixup section for + duplicate array walking as we need to access the same element index in + the replacement array. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 93a5c8f..d625590 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -154,7 +154,9 @@ for all_entry in "${all_files[@]}"; do typeset dependencies_filename="$(basename "${line}")" typeset duplicate_entry="" - for duplicate_entry in ${duplicates[@]}; do + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" typeset duplicate_filename="$(basename "${duplicate_entry}")" if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then -- 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 0802fa1b25d021e395806a4954db2e45b50ee4c6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:57:54 2015 +0200 deduplicate.sh: debug parse_otool_output fiercely for the time being. --- debian/changelog | 1 + deduplicate.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 55b9826..e3d822b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -151,6 +151,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: change exit to return in parse_otool_output. - deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. + - deduplicate.sh: debug parse_otool_output fiercely for the time being. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index ab86a0b..5e1000f 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -12,6 +12,7 @@ otool_fail_str=( "is not an object file" "Archive : " ) parse_otool_output() { +set -x typeset raw_output="${@}" typeset fail_str="" @@ -30,6 +31,7 @@ parse_otool_output() { fi done <<< "${raw_output}" +set +x return 0 } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 552f6846031726e52377f1baf636f1e7fa48a009 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:59:27 2015 +0200 deduplicate.sh: prevent word splitting when parsing otool's output. We want the raw bits. --- debian/changelog | 2 ++ deduplicate.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index e3d822b..54423f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -152,6 +152,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. - deduplicate.sh: debug parse_otool_output fiercely for the time being. + - deduplicate.sh: prevent word splitting when parsing otool's output. We + want the raw bits. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 5e1000f..93a5c8f 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -24,6 +24,11 @@ set -x typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + # In this special case, we do not want read to perform any word splitting. + typeset oldifs="${IFS}" + IFS='' + typeset line="" while read -r line; do if [[ "${line}" =~ ${tmp_regex} ]]; then @@ -31,6 +36,7 @@ set -x fi done <<< "${raw_output}" + IFS="${oldifs}" set +x return 0 } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit c5a6f50b50374d0f2a7d26a1d4e6a5c582215188 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:06:04 2015 +0200 deduplicate.sh: add more useful information in fixup section's error message. --- debian/changelog | 2 ++ deduplicate.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f69481e..275120c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -157,6 +157,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. + - deduplicate.sh: add more useful information in fixup section's error + message. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index d625590..7dc6cd0 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -162,7 +162,9 @@ for all_entry in "${all_files[@]}"; do if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then else - echo "ERROR: empty file name while duplicates with dependencies." >&2 + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 echo "ERROR: dependency: \"${line}\"" >&2 exit 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 4ac9f687aaa071ff520f6e1388d3905dbdea3cba Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:17:24 2015 +0200 deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. --- debian/changelog | 2 ++ deduplicate.sh | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 04059ec..af3869b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -160,6 +160,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add more useful information in fixup section's error message. - deduplicate.sh: unstub fixup section. + - deduplicate.sh: parse_otool_output: jump over first matching entry, + which is - hopefully - the id line. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 08f13df..c24705d 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -29,10 +29,19 @@ set -x typeset oldifs="${IFS}" IFS='' + # Used for skipping the first matching entry - which should typically be the ID line... + # That's a very naïve way to do this. Maybe there should be a bit more magic + # to catch this more reliably. + typeset -i first="1" + typeset line="" while read -r line; do if [[ "${line}" =~ ${tmp_regex} ]]; then - echo "${BASH_REMATCH[1]}" + if [ "${first}" -ne "1" ]; then + echo "${BASH_REMATCH[1]}" + else + first="0" + fi fi done <<< "${raw_output}" -- 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 d9e15bf0f609c68b162286ff69401504ff49cd42 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:07:35 2015 +0200 deduplicate.sh: unstub fixup section. --- debian/changelog | 1 + deduplicate.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 275120c..04059ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -159,6 +159,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium the replacement array. - deduplicate.sh: add more useful information in fixup section's error message. + - deduplicate.sh: unstub fixup section. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 7dc6cd0..08f13df 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -159,8 +159,10 @@ for all_entry in "${all_files[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" typeset duplicate_filename="$(basename "${duplicate_entry}")" - if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then - + if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then + if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then + echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\"" + fi else echo "ERROR: empty file name while replacing duplicate dependencies." >&2 echo "ERROR: for file ${all_entry}" >&2 -- 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 0de9f7debcf7b82061e9d7385e80e8b8aefe7166 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:18:15 2015 +0200 deduplicate.sh: actually include file name in install_name_tool pseudo output. --- debian/changelog | 2 ++ deduplicate.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index af3869b..fd74597 100644 --- a/debian/changelog +++ b/debian/changelog @@ -162,6 +162,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: unstub fixup section. - deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. + - deduplicate.sh: actually include file name in install_name_tool pseudo + output. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index c24705d..f020b9c 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -170,7 +170,7 @@ for all_entry in "${all_files[@]}"; do if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then - echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\"" + echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" fi else echo "ERROR: empty file name while replacing duplicate dependencies." >&2 -- 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 d4068aa0edceb50b7c0ad34f981a94aa92539864 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:36:33 2015 +0200 deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. --- debian/changelog | 2 ++ deduplicate.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fd74597..a48b9a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -164,6 +164,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium which is - hopefully - the id line. - deduplicate.sh: actually include file name in install_name_tool pseudo output. + - deduplicate.sh: save dependency format base string as a readonly + variable and use that instead of repeating a fixed string. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index f020b9c..130a04e 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -6,6 +6,8 @@ base_dir="${1:?"No base dir given."}" typeset -a special_files_regex special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) +typeset -r dependency_base_format='@executable_path/../Frameworks/' + typeset -a otool_fail_str otool_fail_str=( "is not an object file" "can't open file" @@ -134,7 +136,7 @@ for entry in "${duplicates[@]}"; do if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then if [ "${filename}" = "${all_entry_filename}" ]; then - typeset dependency_format="@executable_path/../Frameworks/${all_entry##${base_dir}}" + typeset dependency_format="${dependency_base_format}/${all_entry##${base_dir}}" to_files+=( "${dependency_format}" ) echo "${entry} => ${dependency_format}" -- 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 a8c0f98b1f29de4ca633b6d369aa3cb29ca72898 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:39:24 2015 +0200 deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. deduplicate.sh will eventually be merged into macbuild.sh anyway. --- debian/changelog | 2 ++ deduplicate.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index a48b9a1..ab220e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -166,6 +166,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium output. - deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. + - deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. + deduplicate.sh will eventually be merged into macbuild.sh anyway. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 130a04e..dadf334 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -52,6 +52,18 @@ set +x return 0 } +lazy_canonical_path() { + typeset path="${1}" + + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done + + printf "${old_path}" +} + typeset -a all_files typeset entry="" while read -r -d '' entry; do -- 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 0644895a303d88088c4f5b467ea54bd07496dc22 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:43:31 2015 +0200 deduplicate.sh: surprisingly, it turned out that only checking the duplicate's basename against the current dependency's basename is not good enough. Actually construct "the real dependency-format duplicate string" and check it against "the real dependency". Even this is still not good enough as it needs a bit cleanup - coming up next. --- debian/changelog | 5 +++++ deduplicate.sh | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2f1db5b..ed2d09c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -169,6 +169,11 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. deduplicate.sh will eventually be merged into macbuild.sh anyway. - deduplicate.sh: more temporary debugging output in fixup section. + - deduplicate.sh: surprisingly, it turned out that only checking the + duplicate's basename against the current dependency's basename is not + good enough. Actually construct "the real dependency-format duplicate + string" and check it against "the real dependency". Even this is still + not good enough as it needs a bit cleanup - coming up next. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 12732a4..7df0698 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -174,18 +174,17 @@ for all_entry in "${all_files[@]}"; do if [ "${?}" -eq 0 ]; then typeset line="" while read -r line; do - typeset dependencies_filename="$(basename "${line}")" echo "dependency of ${all_entry}: ${line}" typeset duplicate_entry="" typeset -i i="0" for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" - typeset duplicate_filename="$(basename "${duplicate_entry}")" echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="${dependency_base_format}/${duplicate_entry}" - if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then - if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" fi 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 12405a274007ab7b10d45f32b24bb7980eb26e27 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:50:45 2015 +0200 deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. --- debian/changelog | 2 ++ deduplicate.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ed2d09c..1c58676 100644 --- a/debian/changelog +++ b/debian/changelog @@ -174,6 +174,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium good enough. Actually construct "the real dependency-format duplicate string" and check it against "the real dependency". Even this is still not good enough as it needs a bit cleanup - coming up next. + - deduplicate.sh: cleanup as announced in the last commit - using + lazy_canonical_path. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 7df0698..f8e5668 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -148,7 +148,7 @@ for entry in "${duplicates[@]}"; do if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then if [ "${filename}" = "${all_entry_filename}" ]; then - typeset dependency_format="${dependency_base_format}/${all_entry##${base_dir}}" + typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" to_files+=( "${dependency_format}" ) echo "${entry} => ${dependency_format}" @@ -181,7 +181,7 @@ for all_entry in "${all_files[@]}"; do for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" echo "checking for duplicate ${duplicate_entry}" - typeset duplicate_format="${dependency_base_format}/${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then if [ "${line}" = "${duplicate_format}" ]; then -- 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 2b0ec35c7e7a2741fd0d7a41d607eb6db35a48b8 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:40:46 2015 +0200 deduplicate.sh: more temporary debugging output in fixup section. --- debian/changelog | 1 + deduplicate.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index ab220e7..2f1db5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -168,6 +168,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium variable and use that instead of repeating a fixed string. - deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. deduplicate.sh will eventually be merged into macbuild.sh anyway. + - deduplicate.sh: more temporary debugging output in fixup section. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index dadf334..12732a4 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -175,12 +175,14 @@ for all_entry in "${all_files[@]}"; do typeset line="" while read -r line; do typeset dependencies_filename="$(basename "${line}")" + echo "dependency of ${all_entry}: ${line}" typeset duplicate_entry="" typeset -i i="0" for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" typeset duplicate_filename="$(basename "${duplicate_entry}")" + echo "checking for duplicate ${duplicate_entry}" if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then -- 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 6242ef6bac44dd124a1086d5e2a9f475f0789db3 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 21:01:45 2015 +0200 deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. --- debian/changelog | 2 ++ deduplicate.sh | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1c58676..e9e9d0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -176,6 +176,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium not good enough as it needs a bit cleanup - coming up next. - deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. + - deduplicate.sh: remove a bit of noisy debug output, but turn on + parse_otool_output debugging. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index f8e5668..e357529 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -171,16 +171,17 @@ for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" typeset dependencies="$(parse_otool_output "${otool_out}")" - if [ "${?}" -eq 0 ]; then + echo "parse_otool_output return value: ${?}" + if [ "${?}" -eq "0" ]; then typeset line="" while read -r line; do - echo "dependency of ${all_entry}: ${line}" + #echo "dependency of ${all_entry}: ${line}" typeset duplicate_entry="" typeset -i i="0" for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" - echo "checking for duplicate ${duplicate_entry}" + #echo "checking for duplicate ${duplicate_entry}" typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then -- 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 9cea725bcda705d942c038e8f9cbf53311611f38 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:39:26 2015 +0200 deduplicate.sh: fix wrong return value capture. We want to check the return value of the executed function/command, not that of "typeset". --- debian/changelog | 2 ++ deduplicate.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e9e9d0f..8a5c0f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -178,6 +178,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium lazy_canonical_path. - deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. + - deduplicate.sh: fix wrong return value capture. We want to check the + return value of the executed function/command, not that of "typeset". [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index e357529..98f0b26 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -170,8 +170,12 @@ done for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" - typeset dependencies="$(parse_otool_output "${otool_out}")" - echo "parse_otool_output return value: ${?}" + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + dependencies="$(parse_otool_output "${otool_out}")" + if [ "${?}" -eq "0" ]; then typeset line="" while read -r line; do -- 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 196b174b93b2b053b08016393c75bedf545ad66f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:40:35 2015 +0200 deduplicate.sh: add WARNING to status message. --- debian/changelog | 1 + deduplicate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8a5c0f3..9dbd1f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -180,6 +180,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium parse_otool_output debugging. - deduplicate.sh: fix wrong return value capture. We want to check the return value of the executed function/command, not that of "typeset". + - deduplicate.sh: add WARNING to status message. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 98f0b26..26182d4 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -203,7 +203,7 @@ for all_entry in "${all_files[@]}"; do done done <<< "${dependencies}" else - echo "ERROR: otool returned error for file: ${all_entry}" >&2 - exit 1 + echo "WARNING: otool returned error for file: ${all_entry}" >&2 + echo "WARNING: skipping." >&2 fi done -- 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 c5af51041a9436faf4525fdf109ee760a1bf517d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:22:57 2015 +0200 macbuild.sh: more debug messages and a whitespace change. --- debian/changelog | 1 + macbuild.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 555b2fb..2897b54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -187,6 +187,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: merge deduplicate.sh content in. Also enable the functionality "for real", not just as a dry-run. - macbuild.sh: spelling fix. + - macbuild.sh: more more debug messages and a whitespace change. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 8a2eba3..9e44f15 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -115,7 +115,6 @@ parse_otool_output() { typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' - # In this special case, we do not want read to perform any word splitting. typeset oldifs="${IFS}" IFS='' @@ -389,6 +388,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -a all_files typeset entry="" while read -r -d '' entry; do + echo "Adding ${entry} to all files" all_files+=( "${entry}" ) done < <(find "${base_dir}" -type 'f' -print0) @@ -396,6 +396,7 @@ if [ "${BUNDLE}" = "1" ]; then for entry in "${all_files[@]}"; do typeset relative_path="${entry##"${base_dir}/"}" typeset tmp_regex='^[^/]+$' + echo "Checking ${relative_path} against regex '${tmp_regex}'" if [[ "${relative_path}" =~ ${tmp_regex} ]]; then echo "${relative_path} is top file, adding to array." top_files+=( "${relative_path}" ) -- 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 bedabe41806a43e0d5f3446b002e90ffd32c107e Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:42:40 2015 +0200 deduplicate.sh: remove some noisy debug output. --- debian/changelog | 1 + deduplicate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9dbd1f3..3e7271a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -181,6 +181,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: fix wrong return value capture. We want to check the return value of the executed function/command, not that of "typeset". - deduplicate.sh: add WARNING to status message. + - deduplicate.sh: remove some noisy debug output. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index 26182d4..c298194 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -14,7 +14,7 @@ otool_fail_str=( "is not an object file" "Archive : " ) parse_otool_output() { -set -x +#set -x typeset raw_output="${@}" typeset fail_str="" @@ -48,7 +48,7 @@ set -x done <<< "${raw_output}" IFS="${oldifs}" -set +x +#set +x return 0 } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 42ff10de9991fc412d47c0c8cfa555f6ec3fded9 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:48:48 2015 +0200 macbuild.sh: replace tabs with two spaces. No functional changes. --- debian/changelog | 1 + macbuild.sh | 394 +++++++++++++++++++++++++++--------------------------- 2 files changed, 198 insertions(+), 197 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3e7271a..9160187 100644 --- a/debian/changelog +++ b/debian/changelog @@ -182,6 +182,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium return value of the executed function/command, not that of "typeset". - deduplicate.sh: add WARNING to status message. - deduplicate.sh: remove some noisy debug output. + - macbuild.sh: replace tabs with two spaces. No functional changes. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 26f0d7e..80999bd 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -1,100 +1,100 @@ #!/bin/bash make_boolean() { - OPTION="${1}" + OPTION="${1}" - case "${OPTION}" in - ("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") OPTION="0";; - (*) OPTION="1";; - esac + case "${OPTION}" in + ("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") OPTION="0";; + (*) OPTION="1";; + esac - printf "${OPTION}" + printf "${OPTION}" } phase() { - echo - echo "***" - echo "*** ${1}..." - echo "***" - echo + echo + echo "***" + echo "*** ${1}..." + echo "***" + echo } usage() { - exec >&2 - - NO_VAL="0, no, NO, No, nO, false or FALSE" - printf "$(basename ${0}): usage\n\n" - printf "Accepted environment variables:\n" - printf "\tSDK:\t\t\t\tsets the target SDK [string]\n\t\t\t\t\tdefault: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk\n" - printf "\tMACOSX_DEPLOYMENT_TARGET:\tsets the deployment target (specific OS X version to optimize/build for) [string]\n\t\t\t\t\tdefault: 10.7\n" - printf "\tSTDLIB:\t\t\t\tsets a specific stdlib variant. Must be used with FORCE_STDLIB to have any effect. [string]\n\t\t\t\t\tdefault: autodetect\n" - printf "\tFORCE_STDLIB:\t\t\tforces a specific C++ stdlib version. If you use this, also specify STDLIB. YOU SHOULD NEVER USE THIS, UNLESS YOU KNOW WHAT YOU ARE DOING! [boolean]\n\t\t\t\t\tdefault: disabled\n" - 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" - printf "\tany other value will be treated as true\n" - - exit 2 + exec >&2 + + NO_VAL="0, no, NO, No, nO, false or FALSE" + printf "$(basename ${0}): usage\n\n" + printf "Accepted environment variables:\n" + printf "\tSDK:\t\t\t\tsets the target SDK [string]\n\t\t\t\t\tdefault: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk\n" + printf "\tMACOSX_DEPLOYMENT_TARGET:\tsets the deployment target (specific OS X version to optimize/build for) [string]\n\t\t\t\t\tdefault: 10.7\n" + printf "\tSTDLIB:\t\t\t\tsets a specific stdlib variant. Must be used with FORCE_STDLIB to have any effect. [string]\n\t\t\t\t\tdefault: autodetect\n" + printf "\tFORCE_STDLIB:\t\t\tforces a specific C++ stdlib version. If you use this, also specify STDLIB. YOU SHOULD NEVER USE THIS, UNLESS YOU KNOW WHAT YOU ARE DOING! [boolean]\n\t\t\t\t\tdefault: disabled\n" + 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" + printf "\tany other value will be treated as true\n" + + exit 2 } dependency_error() { - exec >&2 + exec >&2 - typeset element="${1}"; shift - typeset component="${1}"; shift - typeset type="${1}"; shift + 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." + 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 + exit 3 } lazy_canonical_path() { - typeset path="${1}" + typeset path="${1}" - typeset old_path="" - while [ "${old_path}" != "${path}" ]; do - old_path="${path}" - path="${path//\/\///}" - done + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done - printf "${old_path}" + printf "${old_path}" } get_nesting_level() { set -x - typeset -i level=0 - typeset path="${1}" + typeset -i level=0 + typeset path="${1}" - while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do - i="$((${i} + 1))" - path="$(dirname "${path}")" - done + while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do + i="$((${i} + 1))" + path="$(dirname "${path}")" + done - printf "${level}" + printf "${level}" 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 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 + typeset ret="" + typeset -i i=0 + while [ "${i}" -lt "${COUNT}" ]; do + ret="${ret}$(printf "${INPUT}")" + i=$((${i} + 1)) + done - printf "${ret}" + printf "${ret}" - return 0 + return 0 } MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' @@ -115,12 +115,12 @@ PKG_DMG="${TOP_DIR}/pkg-dmg" # 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}" + 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/" + # Port not being part find in ${PATH} doesn't necessarily mean it isn't available. + # Try to guess. + MACPORTS_PREFIX_SEARCH="/opt/local/" fi NXPROXY="nxproxy" @@ -151,25 +151,25 @@ BUILD_ARCH="x86_64" [ "${UNIVERSAL}" -eq "1" ] && BUILD_ARCH="${BUILD_ARCH} x86" if [ "${FORCE_STDLIB}" -eq "1" ]; then - if [[ -z "${STDLIB}" ]]; then - echo "stdlib forcing enabled, but STDLIB not passed." >&2 - exit 1 - fi - - if [[ "${STDLIB}" != "libc++" && "${STDLIB}" != "libstdc++" ]]; then - echo "stdlib forcing enabled, but STDLIB contains illegal value. Legal values: libc++, libstdc++" >&2 - exit 1 - fi + if [[ -z "${STDLIB}" ]]; then + echo "stdlib forcing enabled, but STDLIB not passed." >&2 + exit 1 + fi + + if [[ "${STDLIB}" != "libc++" && "${STDLIB}" != "libstdc++" ]]; then + echo "stdlib forcing enabled, but STDLIB contains illegal value. Legal values: libc++, libstdc++" >&2 + exit 1 + fi else - SDK_MINOR_VERSION="$(/usr/bin/perl -pe 's#.*?10\.(\d+).*?\.sdk$#\1#' <<< "${SDK}")" - MATCH_NUMBERS='^[0-9]+$' - if [[ "${SDK_MINOR_VERSION}" =~ ${MATCH_NUMBERS} ]]; then - [ "${SDK_MINOR_VERSION}" -gt "6" ] && STDLIB="libstdc++" - [ "${SDK_MINOR_VERSION}" -gt "8" ] && STDLIB="libc++" - else - echo "Unable to determine OS X version. Unknown value '${SDK_MINOR_VERSION}'." >&2 - exit 1 - fi + SDK_MINOR_VERSION="$(/usr/bin/perl -pe 's#.*?10\.(\d+).*?\.sdk$#\1#' <<< "${SDK}")" + MATCH_NUMBERS='^[0-9]+$' + if [[ "${SDK_MINOR_VERSION}" =~ ${MATCH_NUMBERS} ]]; then + [ "${SDK_MINOR_VERSION}" -gt "6" ] && STDLIB="libstdc++" + [ "${SDK_MINOR_VERSION}" -gt "8" ] && STDLIB="libc++" + else + echo "Unable to determine OS X version. Unknown value '${SDK_MINOR_VERSION}'." >&2 + exit 1 + fi fi # Gather files. @@ -183,14 +183,14 @@ 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 + 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" @@ -199,37 +199,37 @@ 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 [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then - echo "Adding ${cur_lib_or_libdir} to \${PULSEAUDIO_LIBRARIES_FULL}" - PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) - elif [ -d "${cur_lib_or_libdir}" ]; then - # That's a directory... more work needed here. - echo "Scrubbing directory ${cur_lib_or_libdir}" - typeset entry="" - - # -r parameter to read: Backslashes may NOT escape any characters! - # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed - # by a NUL character, the delimiter is set to this very NUL (\000) character. - while read -r -d '' entry; do - typeset cur_file="$(basename "${entry}")" - typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' - - # This is only here should the PA build system ever break and create - # "linux-style" library file names. Let's hope it never actually comes to that. - typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' - - if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then - # Filename matched the expected template. - echo "Adding $(lazy_canonical_path "${entry}") to \${PULSEAUDIO_LIBRARIES_FULL}" - PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${entry}")" ) - fi - done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) - else - fail="1" - break - fi + cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" + + if [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then + echo "Adding ${cur_lib_or_libdir} to \${PULSEAUDIO_LIBRARIES_FULL}" + PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) + elif [ -d "${cur_lib_or_libdir}" ]; then + # That's a directory... more work needed here. + echo "Scrubbing directory ${cur_lib_or_libdir}" + typeset entry="" + + # -r parameter to read: Backslashes may NOT escape any characters! + # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed + # by a NUL character, the delimiter is set to this very NUL (\000) character. + while read -r -d '' entry; do + typeset cur_file="$(basename "${entry}")" + typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' + + # This is only here should the PA build system ever break and create + # "linux-style" library file names. Let's hope it never actually comes to that. + typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' + + if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then + # Filename matched the expected template. + echo "Adding $(lazy_canonical_path "${entry}") to \${PULSEAUDIO_LIBRARIES_FULL}" + PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${entry}")" ) + fi + done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) + else + fail="1" + break + fi done [ "${fail}" -eq "1" ] && dependency_error "${cur_lib_or_libdir}" "pulseaudio" "library or library directory" @@ -256,12 +256,12 @@ lrelease "${PROJECT}" phase "Running qmake" qmake -config "${BUILD_MODE}" -spec macx-g++ "${PROJECT}" \ - CONFIG+="${BUILD_ARCH}" \ - QMAKE_MAC_SDK="${SDK}" \ - QMAKE_MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \ - OSX_STDLIB="${STDLIB}" \ - MACPORTS_INCLUDE_PATH="${MACPORTS_PREFIX}/include" \ - MACPORTS_LIBRARY_PATH="${MACPORTS_PREFIX}/lib" + CONFIG+="${BUILD_ARCH}" \ + QMAKE_MAC_SDK="${SDK}" \ + QMAKE_MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \ + OSX_STDLIB="${STDLIB}" \ + MACPORTS_INCLUDE_PATH="${MACPORTS_PREFIX}/include" \ + MACPORTS_LIBRARY_PATH="${MACPORTS_PREFIX}/lib" phase "Running make" make -j2 @@ -274,84 +274,84 @@ cp -av "${NXPROXY}" "${EXE_DIR}/" phase "Copying PulseAudio" for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do - cp -av "${cur_binary}" "${EXE_DIR}/" + 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/")"}" + 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}/" + mkdir -p "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" - cp -av "${cur_binary}" "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" + cp -av "${cur_binary}" "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" set +x done if [ "${BUNDLE}" = "1" ]; then - phase "Bundling nxproxy" - dylibbundler \ - --fix-file "${EXE_DIR}/nxproxy" \ - --bundle-deps \ - --dest-dir "${FRAMEWORKS_DIR}/" \ - --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}")" - echo "Handling ${cur_binary} => ${intermediate_lib_dir}/${cur_binary_name}." - - 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}/${intermediate_lib_dir}" \ - --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/${intermediate_lib_dir}" \ - --create-dir \ - --overwrite-files - fi - done - - phase "Bundling up using macdeployqt" - macdeployqt "${APPBUNDLE}" -verbose=2 - - phase "Creating DMG" - ${PKG_DMG} \ - --source "${APPBUNDLE}" \ - --sourcefile \ - --target "${DMGFILE}" \ - --volname "x2goclient" \ - --verbosity 2 \ - --mkdir "/.background" \ - --copy "${TOP_DIR}/res/img/png/macinstaller_background.png:/.background" \ - --copy "${TOP_DIR}/res/osxbundle/macdmg.DS_Store:/.DS_Store" \ - --copy "${TOP_DIR}/LICENSE" \ - --copy "${TOP_DIR}/COPYING" \ - --symlink "/Applications: " \ - --icon "${TOP_DIR}/res/img/icons/x2go-mac.icns" \ - --format "UDBZ" + phase "Bundling nxproxy" + dylibbundler \ + --fix-file "${EXE_DIR}/nxproxy" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --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}")" + echo "Handling ${cur_binary} => ${intermediate_lib_dir}/${cur_binary_name}." + + 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}/${intermediate_lib_dir}" \ + --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/${intermediate_lib_dir}" \ + --create-dir \ + --overwrite-files + fi + done + + phase "Bundling up using macdeployqt" + macdeployqt "${APPBUNDLE}" -verbose=2 + + phase "Creating DMG" + ${PKG_DMG} \ + --source "${APPBUNDLE}" \ + --sourcefile \ + --target "${DMGFILE}" \ + --volname "x2goclient" \ + --verbosity 2 \ + --mkdir "/.background" \ + --copy "${TOP_DIR}/res/img/png/macinstaller_background.png:/.background" \ + --copy "${TOP_DIR}/res/osxbundle/macdmg.DS_Store:/.DS_Store" \ + --copy "${TOP_DIR}/LICENSE" \ + --copy "${TOP_DIR}/COPYING" \ + --symlink "/Applications: " \ + --icon "${TOP_DIR}/res/img/icons/x2go-mac.icns" \ + --format "UDBZ" fi popd -- 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 60563fcbabb89a7dbc0bb5eb65978baac1df8174 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:50:54 2015 +0200 deduplicate.sh: replace tabs with two spaces. No functional changes. --- debian/changelog | 1 + deduplicate.sh | 290 +++++++++++++++++++++++++++--------------------------- 2 files changed, 146 insertions(+), 145 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9160187..623ecbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -183,6 +183,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add WARNING to status message. - deduplicate.sh: remove some noisy debug output. - macbuild.sh: replace tabs with two spaces. No functional changes. + - deduplicate.sh: replace tabs with two spaces. No functional changes. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/deduplicate.sh b/deduplicate.sh index c298194..636ea5c 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -10,200 +10,200 @@ typeset -r dependency_base_format='@executable_path/../Frameworks/' typeset -a otool_fail_str otool_fail_str=( "is not an object file" - "can't open file" - "Archive : " ) + "can't open file" + "Archive : " ) parse_otool_output() { #set -x - typeset raw_output="${@}" - - typeset fail_str="" - for fail_str in "${otool_fail_str[@]}"; do - if echo "${raw_output}" | grep -q "${fail_str}"; then - return 1 - fi - done - - typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' - - - # In this special case, we do not want read to perform any word splitting. - typeset oldifs="${IFS}" - IFS='' - - # Used for skipping the first matching entry - which should typically be the ID line... - # That's a very naïve way to do this. Maybe there should be a bit more magic - # to catch this more reliably. - typeset -i first="1" - - typeset line="" - while read -r line; do - if [[ "${line}" =~ ${tmp_regex} ]]; then - if [ "${first}" -ne "1" ]; then - echo "${BASH_REMATCH[1]}" - else - first="0" - fi - fi - done <<< "${raw_output}" - - IFS="${oldifs}" + typeset raw_output="${@}" + + typeset fail_str="" + for fail_str in "${otool_fail_str[@]}"; do + if echo "${raw_output}" | grep -q "${fail_str}"; then + return 1 + fi + done + + typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + + # In this special case, we do not want read to perform any word splitting. + typeset oldifs="${IFS}" + IFS='' + + # Used for skipping the first matching entry - which should typically be the ID line... + # That's a very naïve way to do this. Maybe there should be a bit more magic + # to catch this more reliably. + typeset -i first="1" + + typeset line="" + while read -r line; do + if [[ "${line}" =~ ${tmp_regex} ]]; then + if [ "${first}" -ne "1" ]; then + echo "${BASH_REMATCH[1]}" + else + first="0" + fi + fi + done <<< "${raw_output}" + + IFS="${oldifs}" #set +x - return 0 + return 0 } lazy_canonical_path() { - typeset path="${1}" + typeset path="${1}" - typeset old_path="" - while [ "${old_path}" != "${path}" ]; do - old_path="${path}" - path="${path//\/\///}" - done + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done - printf "${old_path}" + printf "${old_path}" } typeset -a all_files typeset entry="" while read -r -d '' entry; do - all_files+=( "${entry}" ) + all_files+=( "${entry}" ) done < <(find "${base_dir}" -type 'f' -print0) typeset -a top_files for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" - typeset tmp_regex='^[^/]+$' - if [[ "${relative_path}" =~ ${tmp_regex} ]]; then - echo "${relative_path} is top file, adding to array." - top_files+=( "${relative_path}" ) - fi + typeset relative_path="${entry##"${base_dir}/"}" + typeset tmp_regex='^[^/]+$' + if [[ "${relative_path}" =~ ${tmp_regex} ]]; then + echo "${relative_path} is top file, adding to array." + top_files+=( "${relative_path}" ) + fi done typeset -a duplicates for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" - typeset file_name="$(basename "${entry}")" - typeset top_entry="" - for top_entry in "${top_files[@]}"; do - if [ "${top_entry}" != "${relative_path}" ]; then - if [ "${file_name}" = "${top_entry}" ]; then - echo "Adding duplicate: ${relative_path}" - duplicates+=( "${relative_path}" ) - fi - fi - done + typeset relative_path="${entry##"${base_dir}/"}" + typeset file_name="$(basename "${entry}")" + typeset top_entry="" + for top_entry in "${top_files[@]}"; do + if [ "${top_entry}" != "${relative_path}" ]; then + if [ "${file_name}" = "${top_entry}" ]; then + echo "Adding duplicate: ${relative_path}" + duplicates+=( "${relative_path}" ) + fi + fi + done done echo "duplicates array before:" for entry in "${duplicates[@]}"; do - echo "${entry}" + echo "${entry}" done typeset -i i="0" for i in "${!duplicates[@]}"; do - entry="${duplicates[${i}]}" - typeset special_file_regex="" - for special_file_regex in "${special_files_regex[@]}"; do - typeset tmp_regex='^'"${special_file_regex}"'$' - if [[ "${entry}" =~ ${tmp_regex} ]]; then - echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" - duplicates[${i}]="$(basename "${entry}")" - echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" - fi - done + entry="${duplicates[${i}]}" + typeset special_file_regex="" + for special_file_regex in "${special_files_regex[@]}"; do + typeset tmp_regex='^'"${special_file_regex}"'$' + if [[ "${entry}" =~ ${tmp_regex} ]]; then + echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" + duplicates[${i}]="$(basename "${entry}")" + echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" + fi + done done echo "duplicates array after:" for entry in "${duplicates[@]}"; do - echo "${entry}" + echo "${entry}" done for entry in "${duplicates[@]}"; do - echo "rm -v ${base_dir}/${entry}" - typeset -i i="0" - for i in "${!all_files[@]}"; do - typeset all_entry="${all_files[${i}]}" - typeset relative_path="${all_entry##"${base_dir}/"}" - if [ "${relative_path}" = "${entry}" ]; then - unset all_files[${i}] - fi - done + echo "rm -v ${base_dir}/${entry}" + typeset -i i="0" + for i in "${!all_files[@]}"; do + typeset all_entry="${all_files[${i}]}" + typeset relative_path="${all_entry##"${base_dir}/"}" + if [ "${relative_path}" = "${entry}" ]; then + unset all_files[${i}] + fi + done done echo "New value for all_files:" for entry in "${all_files[@]}"; do - echo "${entry}" + echo "${entry}" done echo "Duplicates-to-real map:" # Build complementary array to duplicates. typeset -a to_files for entry in "${duplicates[@]}"; do - typeset filename="$(basename "${entry}")" - - typeset all_entry="" - for all_entry in "${all_files[@]}"; do - typeset all_entry_filename="$(basename "${all_entry}")" - - if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then - if [ "${filename}" = "${all_entry_filename}" ]; then - typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" - to_files+=( "${dependency_format}" ) - - echo "${entry} => ${dependency_format}" - - # There should be only one entry matching, so we can save a bit of time and break out of the loop. - # Even more importantly, we only want one entry for each duplicates entry anyway... - break - fi - else - echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 - echo "ERROR: duplicate entry: \"${entry}\"" >&2 - echo "ERROR: real entry: \"${all_entry}\"" >&2 - exit 1 - fi - done + typeset filename="$(basename "${entry}")" + + typeset all_entry="" + for all_entry in "${all_files[@]}"; do + typeset all_entry_filename="$(basename "${all_entry}")" + + if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then + if [ "${filename}" = "${all_entry_filename}" ]; then + typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" + to_files+=( "${dependency_format}" ) + + echo "${entry} => ${dependency_format}" + + # There should be only one entry matching, so we can save a bit of time and break out of the loop. + # Even more importantly, we only want one entry for each duplicates entry anyway... + break + fi + else + echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 + echo "ERROR: duplicate entry: \"${entry}\"" >&2 + echo "ERROR: real entry: \"${all_entry}\"" >&2 + exit 1 + fi + done done # Try to fixup files broken by duplicates removal. for all_entry in "${all_files[@]}"; do - typeset otool_out="$(otool -L "${all_entry}")" - - # Don't merge the declaration and initialization with the real value assignment. - # We need the return value of parse_otool_output(), but running - # typeset foo="$(bar)" will give us the return value of typeset, not bar(). - typeset dependencies="" - dependencies="$(parse_otool_output "${otool_out}")" - - if [ "${?}" -eq "0" ]; then - typeset line="" - while read -r line; do - #echo "dependency of ${all_entry}: ${line}" - - typeset duplicate_entry="" - typeset -i i="0" - for i in "${!duplicates[@]}"; do - typeset duplicate_entry="${duplicates[${i}]}" - #echo "checking for duplicate ${duplicate_entry}" - typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" - - if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then - if [ "${line}" = "${duplicate_format}" ]; then - echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" - fi - else - echo "ERROR: empty file name while replacing duplicate dependencies." >&2 - echo "ERROR: for file ${all_entry}" >&2 - echo "ERROR: at dependency ${line}" >&2 - echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 - echo "ERROR: dependency: \"${line}\"" >&2 - exit 1 - fi - done - done <<< "${dependencies}" - else - echo "WARNING: otool returned error for file: ${all_entry}" >&2 - echo "WARNING: skipping." >&2 - fi + typeset otool_out="$(otool -L "${all_entry}")" + + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + dependencies="$(parse_otool_output "${otool_out}")" + + if [ "${?}" -eq "0" ]; then + typeset line="" + while read -r line; do + #echo "dependency of ${all_entry}: ${line}" + + typeset duplicate_entry="" + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" + #echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" + + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then + echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" + fi + else + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" + else + echo "WARNING: otool returned error for file: ${all_entry}" >&2 + echo "WARNING: skipping." >&2 + fi done -- 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 1e7e0e4d7ee2b580c2a60d9b365da3f1cf2857ca Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 04:18:25 2015 +0200 macbuild.sh: merge deduplicate.sh content in. Also enable the functionality "for real", not just as a dry-run. --- debian/changelog | 2 + macbuild.sh | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+) diff --git a/debian/changelog b/debian/changelog index 623ecbb..500f8a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -184,6 +184,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: remove some noisy debug output. - macbuild.sh: replace tabs with two spaces. No functional changes. - deduplicate.sh: replace tabs with two spaces. No functional changes. + - macbuild.sh: merge deduplicate.sh content in. Also enable the + functionality "for real", not just as a dry-run. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 80999bd..3fe7447 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -97,6 +97,50 @@ repeat_str() { # INPUT COUNT return 0 } +typeset -a otool_fail_str +otool_fail_str=( "is not an object file" + "can't open file" + "Archive : " ) + +parse_otool_output() { +#set -x + typeset raw_output="${@}" + + typeset fail_str="" + for fail_str in "${otool_fail_str[@]}"; do + if echo "${raw_output}" | grep -q "${fail_str}"; then + return 1 + fi + done + + typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + + # In this special case, we do not want read to perform any word splitting. + typeset oldifs="${IFS}" + IFS='' + + # Used for skipping the first matching entry - which should typically be the ID line... + # That's a very naïve way to do this. Maybe there should be a bit more magic + # to catch this more reliably. + typeset -i first="1" + + typeset line="" + while read -r line; do + if [[ "${line}" =~ ${tmp_regex} ]]; then + if [ "${first}" -ne "1" ]; then + echo "${BASH_REMATCH[1]}" + else + first="0" + fi + fi + done <<< "${raw_output}" + + IFS="${oldifs}" +#set +x + return 0 +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage @@ -130,6 +174,11 @@ PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" "pulse-6.0" "pulseaudio" ) +typeset -a special_files_regex +special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) + +typeset -r dependency_base_format='@executable_path/../Frameworks/' + : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} : ${FORCE_STDLIB:="0"} @@ -334,6 +383,153 @@ if [ "${BUNDLE}" = "1" ]; then fi done + phase "Deduplicating PulseAudio libraries and dependencies" + typeset -r base_dir="$(lazy_canonical_path "${FRAMEWORKS_DIR}")" + + typeset -a all_files + typeset entry="" + while read -r -d '' entry; do + all_files+=( "${entry}" ) + done < <(find "${base_dir}" -type 'f' -print0) + + typeset -a top_files + for entry in "${all_files[@]}"; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset tmp_regex='^[^/]+$' + if [[ "${relative_path}" =~ ${tmp_regex} ]]; then + echo "${relative_path} is top file, adding to array." + top_files+=( "${relative_path}" ) + fi + done + + typeset -a duplicates + for entry in "${all_files[@]}"; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset file_name="$(basename "${entry}")" + typeset top_entry="" + for top_entry in "${top_files[@]}"; do + if [ "${top_entry}" != "${relative_path}" ]; then + if [ "${file_name}" = "${top_entry}" ]; then + echo "Adding duplicate: ${relative_path}" + duplicates+=( "${relative_path}" ) + fi + fi + done + done + + echo "duplicates array before:" + for entry in "${duplicates[@]}"; do + echo "${entry}" + done + + typeset -i i="0" + for i in "${!duplicates[@]}"; do + entry="${duplicates[${i}]}" + typeset special_file_regex="" + for special_file_regex in "${special_files_regex[@]}"; do + typeset tmp_regex='^'"${special_file_regex}"'$' + if [[ "${entry}" =~ ${tmp_regex} ]]; then + mv -v "${base_dir}/$(basename "${entry}")" "${base_dir}/$(dirname "${special_file_regex}")/" + duplicates[${i}]="$(basename "${entry}")" + echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" + fi + done + done + + echo "duplicates array after:" + for entry in "${duplicates[@]}"; do + echo "${entry}" + done + + for entry in "${duplicates[@]}"; do + rm -v "${base_dir}/${entry}" + typeset -i i="0" + for i in "${!all_files[@]}"; do + typeset all_entry="${all_files[${i}]}" + typeset relative_path="${all_entry##"${base_dir}/"}" + if [ "${relative_path}" = "${entry}" ]; then + unset all_files[${i}] + fi + done + done + + echo "New value for all_files:" + for entry in "${all_files[@]}"; do + echo "${entry}" + done + + echo "Duplicates-to-real map:" + # Build complementary array to duplicates. + typeset -a to_files + for entry in "${duplicates[@]}"; do + typeset filename="$(basename "${entry}")" + + typeset all_entry="" + for all_entry in "${all_files[@]}"; do + typeset all_entry_filename="$(basename "${all_entry}")" + + if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then + if [ "${filename}" = "${all_entry_filename}" ]; then + typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" + to_files+=( "${dependency_format}" ) + + echo "${entry} => ${dependency_format}" + + # There should be only one entry matching, so we can save a bit of time and break out of the loop. + # Even more importantly, we only want one entry for each duplicates entry anyway... + break + fi + else + echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 + echo "ERROR: duplicate entry: \"${entry}\"" >&2 + echo "ERROR: real entry: \"${all_entry}\"" >&2 + exit 1 + fi + done + done + + # Try to fixup files broken by duplicates removal. + for all_entry in "${all_files[@]}"; do + typeset otool_out="$(otool -L "${all_entry}")" + + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + dependencies="$(parse_otool_output "${otool_out}")" + + if [ "${?}" -eq "0" ]; then + typeset line="" + while read -r line; do + #echo "dependency of ${all_entry}: ${line}" + + typeset duplicate_entry="" + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" + #echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" + + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then + install_name_tool -change "${line}" "${to_files[${i}]}" "${all_entry}" + fi + else + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" + else + echo "WARNING: otool returned error for file: ${all_entry}" >&2 + echo "WARNING: skipping." >&2 + 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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d9b51df3da7dfcb3d10785692098123f62170eb6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 04:28:15 2015 +0200 macbuild.sh: spelling fix. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 500f8a4..555b2fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -186,6 +186,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: replace tabs with two spaces. No functional changes. - macbuild.sh: merge deduplicate.sh content in. Also enable the functionality "for real", not just as a dry-run. + - macbuild.sh: spelling fix. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 3fe7447..8a2eba3 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -162,7 +162,7 @@ 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. + # Port not being found in ${PATH} doesn't necessarily mean it isn't available. # Try to guess. MACPORTS_PREFIX_SEARCH="/opt/local/" fi -- 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 d85ce3455791e0bf18a8b86a88ba3f7b36523338 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:30:48 2015 +0200 macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. --- debian/changelog | 2 ++ macbuild.sh | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2897b54..fdccaa5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -188,6 +188,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium functionality "for real", not just as a dry-run. - macbuild.sh: spelling fix. - macbuild.sh: more more debug messages and a whitespace change. + - macbuild.sh: fix removal of base prefix in deduplication if base prefix + ends in a slash. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 9e44f15..25de145 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -394,7 +394,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -a top_files for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" + typeset relative_path="${entry##"$(lazy_canonical_path "${base_dir}/")"}" typeset tmp_regex='^[^/]+$' echo "Checking ${relative_path} against regex '${tmp_regex}'" if [[ "${relative_path}" =~ ${tmp_regex} ]]; then @@ -405,7 +405,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -a duplicates for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" + typeset relative_path="${entry##"$(lazy_canonical_path "${base_dir}/")"}" typeset file_name="$(basename "${entry}")" typeset top_entry="" for top_entry in "${top_files[@]}"; do @@ -447,7 +447,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -i i="0" for i in "${!all_files[@]}"; do typeset all_entry="${all_files[${i}]}" - typeset relative_path="${all_entry##"${base_dir}/"}" + typeset relative_path="${all_entry##"$(lazy_canonical_path "${base_dir}/")"}" if [ "${relative_path}" = "${entry}" ]; then unset all_files[${i}] fi -- 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 067d109e545d6c0eeb11e5b6dd068e686081af47 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:42:01 2015 +0200 macbuild.sh: copy "special" files, so that they can be removed later on. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fdccaa5..c843dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -190,6 +190,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: more more debug messages and a whitespace change. - macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. + - macbuild.sh: copy "special" files, so that they can be removed later on. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 25de145..9bba392 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -430,7 +430,7 @@ if [ "${BUNDLE}" = "1" ]; then for special_file_regex in "${special_files_regex[@]}"; do typeset tmp_regex='^'"${special_file_regex}"'$' if [[ "${entry}" =~ ${tmp_regex} ]]; then - mv -v "${base_dir}/$(basename "${entry}")" "${base_dir}/$(dirname "${special_file_regex}")/" + cp -v "${base_dir}/$(basename "${entry}")" "${base_dir}/$(dirname "${special_file_regex}")/" duplicates[${i}]="$(basename "${entry}")" echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" fi -- 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 fe5079a4b59fa452fa6b131a438982aea300093c Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:44:30 2015 +0200 macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to be needing one, so skipping the first dependency line incidentally skips a "real" dependency for modules. --- debian/changelog | 3 +++ macbuild.sh | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index c843dda..b6af85f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -191,6 +191,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. - macbuild.sh: copy "special" files, so that they can be removed later on. + - macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to + be needing one, so skipping the first dependency line incidentally skips + a "real" dependency for modules. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 9bba392..c95955e 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -119,19 +119,26 @@ parse_otool_output() { typeset oldifs="${IFS}" IFS='' - # Used for skipping the first matching entry - which should typically be the ID line... - # That's a very naïve way to do this. Maybe there should be a bit more magic - # to catch this more reliably. - typeset -i first="1" + # Used for skipping the ID entry. + # Initialized to the empty string, but the first matching line will set it once. + # The ID filename is required for subsequent dependency discovery. + typeset id="" typeset line="" while read -r line; do if [[ "${line}" =~ ${tmp_regex} ]]; then - if [ "${first}" -ne "1" ]; then + typeset file="${BASH_REMATCH[1]}" + + if [ -z "${id}" ]; then + echo "ID unset, something is wrong" >&2 + return 1 + elif [ "$(basename "${file}")" != "${id}" ]; then echo "${BASH_REMATCH[1]}" else first="0" fi + elif [ -z "${id}" ]; then + id="$(basename "${line%":"}")" fi done <<< "${raw_output}" -- 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 2f3473477d41cd1c1146daaf458cf252fa3d8931 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:57:48 2015 +0200 pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 94 +++++++++++++++++++++++++------------------------- src/pulsemanager.h | 14 ++++---- 3 files changed, 56 insertions(+), 54 deletions(-) diff --git a/debian/changelog b/debian/changelog index b6af85f..85b147c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -194,6 +194,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to be needing one, so skipping the first dependency line incidentally skips a "real" dependency for modules. + - pulsemanager.{cpp,h}: use name and underscore for member variables, not + underscore and name. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index af1ba2b..5c38dd6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,39 +25,39 @@ #endif PulseManager::PulseManager () { - _pulse_X2Go = "/.x2go/pulse"; + 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)); + 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"); + env_ = QProcessEnvironment::systemEnvironment (); + env_.insert ("HOME", pulse_dir_.absolutePath ()); + env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); - _pulse_port = 4713; + pulse_port_ = 4713; - _state = QProcess::NotRunning; + state_ = QProcess::NotRunning; - _pulse_server = 0; + pulse_server_ = 0; - _app_dir = QApplication::applicationDirPath (); + app_dir_ = QApplication::applicationDirPath (); } PulseManager::~PulseManager () { - if (_pulse_server && is_server_running ()) + if (pulse_server_ && is_server_running ()) shutdown (); - delete (_pulse_server); + delete (pulse_server_); } void PulseManager::start () { assert (!is_server_running ()); - delete (_pulse_server); + delete (pulse_server_); - _pulse_server = new QProcess (0); - _state = QProcess::Starting; + pulse_server_ = new QProcess (0); + state_ = QProcess::Starting; #ifdef Q_OS_DARWIN start_osx (); @@ -74,27 +74,27 @@ void PulseManager::start_osx () { if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); - _pulse_server->setProcessEnvironment (_env); + pulse_server_->setProcessEnvironment (env_); QStringList args; args << "--exit-idle-time=-1" << "-n" - << "-F" << _pulse_dir.absolutePath () + "/config.pa" + << "-F" << pulse_dir_.absolutePath () + "/config.pa" << "-p" - << QDir (_app_dir + << 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); + pulse_server_->setWorkingDirectory (app_dir_ + "/../exe/"); + pulse_server_->start (app_dir_ + "/../exe/pulseaudio", args); - if (_pulse_server->waitForStarted ()) { + if (pulse_server_->waitForStarted ()) { x2goDebug << "pulse started with" << args << "waiting for finish..."; - _state = QProcess::Running; + state_ = QProcess::Running; - connect (_pulse_server, SIGNAL (finished (int)), + connect (pulse_server_, SIGNAL (finished (int)), this, SLOT (on_pulse_finished (int))); #ifdef DEBUG @@ -110,12 +110,12 @@ void PulseManager::find_port () { bool free = false; do { - tcpSocket.connectToHost ("127.0.0.1", _pulse_port); + tcpSocket.connectToHost ("127.0.0.1", pulse_port_); if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - _pulse_port++; + pulse_port_++; } else free = true; @@ -123,8 +123,8 @@ void PulseManager::find_port () { } bool PulseManager::generate_server_config () { - QString config_file_name = _pulse_dir.absolutePath () + "/config.pa"; - QTemporaryFile config_tmp_file (_pulse_dir.absolutePath () + "/tmp/tmpconfig"); + 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; @@ -136,7 +136,7 @@ bool PulseManager::generate_server_config () { QTextStream config_tmp_file_stream (&config_tmp_file); config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + - QString::number (_pulse_port) << endl; + 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"; @@ -159,9 +159,9 @@ bool PulseManager::generate_server_config () { } bool PulseManager::generate_client_config () { - QTemporaryFile client_config_tmp_file (_pulse_dir.absolutePath () + QTemporaryFile client_config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); - QString client_config_file_name (_pulse_dir.absolutePath () + "/.pulse/client.conf"); + QString client_config_file_name (pulse_dir_.absolutePath () + "/.pulse/client.conf"); bool ret = false; if (client_config_tmp_file.open ()) { @@ -169,7 +169,7 @@ bool PulseManager::generate_client_config () { config_tmp_file_stream << "autospawn=no" << endl; config_tmp_file_stream << "daemon-binary=" - << QDir (_app_dir + << QDir (app_dir_ + "/../exe/pulseaudio").absolutePath () << endl; @@ -189,7 +189,7 @@ 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/" + QDir machine_dir (pulse_dir_.absolutePath () + "/.pulse/" + QHostInfo::localHostName () + "-runtime"); if (QFile::exists (machine_dir.absolutePath () + "/pid")) @@ -202,10 +202,10 @@ void PulseManager::cleanup_client_dir () { 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"); + 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 (); @@ -215,20 +215,20 @@ 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 (); + QByteArray ba = pulse_server_->readAllStandardOutput (); char *data = ba.data (); std::cout << data; - ba = _pulse_server->readAllStandardError (); + ba = pulse_server_->readAllStandardError (); data = ba.data (); std::cout << data; - _state = QProcess::NotRunning; + state_ = QProcess::NotRunning; emit (sig_pulse_server_terminated ()); } bool PulseManager::is_server_running () { - if (_pulse_server) - return (_pulse_server->state () == QProcess::Running); + if (pulse_server_) + return (pulse_server_->state () == QProcess::Running); else return (false); } @@ -239,21 +239,21 @@ void PulseManager::shutdown () { connect (this, SIGNAL (sig_pulse_server_terminated ()), &loop, SLOT (quit ())); - _pulse_server->terminate (); + pulse_server_->terminate (); loop.exec (); } int PulseManager::get_pulse_port () { - return (_pulse_port); + return (pulse_port_); } void PulseManager::set_pulse_port (int pulse_port) { - _pulse_port = pulse_port; + pulse_port_ = pulse_port; } void PulseManager::relaunch () { - if (_pulse_server && is_server_running ()) + if (pulse_server_ && is_server_running ()) shutdown (); x2goDebug << "restarting pulse"; @@ -261,7 +261,7 @@ void PulseManager::relaunch () { } QProcess::ProcessState PulseManager::state () { - return (_state); + return (state_); } #ifdef DEBUG_UNDEF diff --git a/src/pulsemanager.h b/src/pulsemanager.h index fc0a989..939dc56 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -75,13 +75,13 @@ 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; + QString pulse_X2Go_; + QDir pulse_dir_; + QProcessEnvironment env_; + QProcess *pulse_server_; + int pulse_port_; + QProcess::ProcessState state_; + QString app_dir_; }; #ifdef NDEBUG_DEFINE -- 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 873dde770d6116a2ae654caba9ed5e8568ae1f28 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:58:54 2015 +0200 pulsemanager.cpp: minor non-behavior changing fixes. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 85b147c..53c0bea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -196,6 +196,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium a "real" dependency for modules. - pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. + - pulsemanager.cpp: minor non-behavior changing fixes. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 5c38dd6..ecf442e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -39,7 +39,7 @@ PulseManager::PulseManager () { state_ = QProcess::NotRunning; - pulse_server_ = 0; + pulse_server_ = NULL; app_dir_ = QApplication::applicationDirPath (); } @@ -115,7 +115,7 @@ void PulseManager::find_port () { if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - pulse_port_++; + ++pulse_port_; } else free = true; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9e2c0e897b000a0c22a6a849a33983fed408dcba Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:46:47 2015 +0200 pulsemanager.{cpp,h}: reformat only. --- debian/changelog | 1 + src/pulsemanager.cpp | 286 +++++++++++++++++++++++++------------------------- src/pulsemanager.h | 17 ++- 3 files changed, 152 insertions(+), 152 deletions(-) diff --git a/debian/changelog b/debian/changelog index 53c0bea..dc81a9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -197,6 +197,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. - pulsemanager.cpp: minor non-behavior changing fixes. + - pulsemanager.{cpp,h}: reformat only. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ecf442e..9e70ce6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,243 +25,243 @@ #endif PulseManager::PulseManager () { - pulse_X2Go_ = "/.x2go/pulse"; + 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)); + 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"); + env_ = QProcessEnvironment::systemEnvironment (); + env_.insert ("HOME", pulse_dir_.absolutePath ()); + env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); - pulse_port_ = 4713; + pulse_port_ = 4713; - state_ = QProcess::NotRunning; + state_ = QProcess::NotRunning; - pulse_server_ = NULL; + pulse_server_ = NULL; - app_dir_ = QApplication::applicationDirPath (); + app_dir_ = QApplication::applicationDirPath (); } PulseManager::~PulseManager () { - if (pulse_server_ && is_server_running ()) - shutdown (); + if (pulse_server_ && is_server_running ()) + shutdown (); - delete (pulse_server_); + delete (pulse_server_); } void PulseManager::start () { - assert (!is_server_running ()); + assert (!is_server_running ()); - delete (pulse_server_); + delete (pulse_server_); - pulse_server_ = new QProcess (0); - state_ = QProcess::Starting; + pulse_server_ = new QProcess (0); + state_ = QProcess::Starting; #ifdef Q_OS_DARWIN - start_osx (); + start_osx (); #elif defined (Q_OS_WIN) - start_win (); + start_win (); #elif defined (Q_OS_LINUX) - start_linux (); + start_linux (); #endif } void PulseManager::start_osx () { - find_port (); + find_port (); - if (generate_server_config () && generate_client_config ()) { - cleanup_client_dir (); + if (generate_server_config () && generate_client_config ()) { + cleanup_client_dir (); - pulse_server_->setProcessEnvironment (env_); + 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"; + 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"; + args << "--log-level=debug"; #endif - pulse_server_->setWorkingDirectory (app_dir_ + "/../exe/"); - pulse_server_->start (app_dir_ + "/../exe/pulseaudio", args); + 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; + 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))); + 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 ())); + // 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); + 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; + 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 (); + disable_input = settings.setting ()->value ("soundnoinput", + (QVariant) false).toBool (); - if (config_tmp_file.open ()) { - QTextStream config_tmp_file_stream (&config_tmp_file); + 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"; + 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"; + if (disable_input) + config_tmp_file_stream << " record=0"; - config_tmp_file_stream << endl; + config_tmp_file_stream << endl; - QFile config_file (config_file_name); - if (QFile::exists (config_file_name)) - QFile::remove (config_file_name); + 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 (); + config_tmp_file.copy (config_file_name); + config_tmp_file.remove (); - ret = true; - } + ret = true; + } - return (ret); + 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; + 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); + 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; + 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); + 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 (); + client_config_tmp_file.copy (client_config_file_name); + client_config_tmp_file.remove (); - ret = true; - } + ret = true; + } - return (ret); + 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"); + // 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 (QFile::exists (machine_dir.absolutePath () + "/pid")) + QFile::remove (machine_dir.absolutePath () + "/pid"); - if (machine_dir.exists ()) - machine_dir.remove (machine_dir.absolutePath ()); + if (machine_dir.exists ()) + machine_dir.remove (machine_dir.absolutePath ()); } void PulseManager::slot_play_startup_sound () { - QProcess play_file (0); + 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"); + 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 (); + 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 ()); + 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); + if (pulse_server_) + return (pulse_server_->state () == QProcess::Running); + else + return (false); } void PulseManager::shutdown () { - QEventLoop loop; + QEventLoop loop; - connect (this, SIGNAL (sig_pulse_server_terminated ()), - &loop, SLOT (quit ())); + connect (this, SIGNAL (sig_pulse_server_terminated ()), + &loop, SLOT (quit ())); - pulse_server_->terminate (); + pulse_server_->terminate (); - loop.exec (); + loop.exec (); } int PulseManager::get_pulse_port () { - return (pulse_port_); + return (pulse_port_); } void PulseManager::set_pulse_port (int pulse_port) { - pulse_port_ = pulse_port; + pulse_port_ = pulse_port; } void PulseManager::relaunch () { - if (pulse_server_ && is_server_running ()) - shutdown (); + if (pulse_server_ && is_server_running ()) + shutdown (); - x2goDebug << "restarting pulse"; - start (); + x2goDebug << "restarting pulse"; + start (); } QProcess::ProcessState PulseManager::state () { - return (state_); + return (state_); } #ifdef DEBUG_UNDEF diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 939dc56..e391af8 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -38,22 +38,21 @@ #include "x2gologdebug.h" #include "x2gosettings.h" -class PulseManager: public QObject -{ - Q_OBJECT; +class PulseManager: public QObject { + Q_OBJECT; -public: + public: PulseManager (); ~PulseManager (); int get_pulse_port (); void set_pulse_port (int pulse_port); QProcess::ProcessState state (); -public slots: + public slots: void start (); void relaunch (); -private: + private: PulseManager (const PulseManager &other); void start_osx (); // FIXME @@ -67,14 +66,14 @@ private: void shutdown (); bool is_server_running (); -private slots: + private slots: void on_pulse_finished (int exit_code); void slot_play_startup_sound (); -signals: + signals: void sig_pulse_server_terminated (); -private: + private: QString pulse_X2Go_; QDir pulse_dir_; QProcessEnvironment env_; -- 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 51904b9fb0f90d21e6f6cd814ebd1b7da5a11e89 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:49:47 2015 +0200 pulsemanager.cpp: use initializer list for constructor. --- debian/changelog | 1 + src/pulsemanager.cpp | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc81a9e..3b8451b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -198,6 +198,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium underscore and name. - pulsemanager.cpp: minor non-behavior changing fixes. - pulsemanager.{cpp,h}: reformat only. + - pulsemanager.cpp: use initializer list for constructor. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9e70ce6..002c9f8 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,9 +24,9 @@ #define DEBUG #endif -PulseManager::PulseManager () { - pulse_X2Go_ = "/.x2go/pulse"; - +PulseManager::PulseManager () : pulse_X2Go_("/.x2go/pulse"), pulse_port_(4713), + state_(QProcess::NotRunning), pulse_server_(NULL), + app_dir_(QApplication::applicationDirPath ()) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); @@ -34,14 +34,6 @@ PulseManager::PulseManager () { env_ = QProcessEnvironment::systemEnvironment (); env_.insert ("HOME", pulse_dir_.absolutePath ()); env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); - - pulse_port_ = 4713; - - state_ = QProcess::NotRunning; - - pulse_server_ = NULL; - - app_dir_ = QApplication::applicationDirPath (); } PulseManager::~PulseManager () { -- 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 b0f8a0cd41fb4f0a2fdf1d5db7297bcab2567a1f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:28:05 2015 +0200 pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. --- debian/changelog | 1 + src/pulsemanager.cpp | 3 ++- src/pulsemanager.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3b8451b..5adda7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -199,6 +199,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: minor non-behavior changing fixes. - pulsemanager.{cpp,h}: reformat only. - pulsemanager.cpp: use initializer list for constructor. + - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 002c9f8..c1d8d8f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -26,7 +26,8 @@ PulseManager::PulseManager () : pulse_X2Go_("/.x2go/pulse"), pulse_port_(4713), state_(QProcess::NotRunning), pulse_server_(NULL), - app_dir_(QApplication::applicationDirPath ()) { + app_dir_(QApplication::applicationDirPath ()), + pulse_version_major_(0), pulse_version_minor_(0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index e391af8..5b1fe37 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -81,6 +81,8 @@ class PulseManager: public QObject { int pulse_port_; QProcess::ProcessState state_; QString app_dir_; + uint32_t pulse_version_major_; + uint32_t pulse_version_minor_; }; #ifdef NDEBUG_DEFINE -- 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 0c0b19dd8267b7612b4db326643fbfa05b1e38d6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:17:47 2015 +0100 pulsemanager.cpp: reformat only. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5adda7c..5a36034 100644 --- a/debian/changelog +++ b/debian/changelog @@ -200,6 +200,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: reformat only. - pulsemanager.cpp: use initializer list for constructor. - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. + - pulsemanager.cpp: reformat only. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index c1d8d8f..cd390bf 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,10 +24,10 @@ #define DEBUG #endif -PulseManager::PulseManager () : pulse_X2Go_("/.x2go/pulse"), pulse_port_(4713), - state_(QProcess::NotRunning), pulse_server_(NULL), - app_dir_(QApplication::applicationDirPath ()), - pulse_version_major_(0), pulse_version_minor_(0) { +PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), + state_ (QProcess::NotRunning), pulse_server_ (NULL), + app_dir_ (QApplication::applicationDirPath ()), + pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (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 be7db93c569ebc345052a85c60499e7fd4cf80de Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:20:15 2015 +0100 pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- src/pulsemanager.h | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5a36034..812d804 100644 --- a/debian/changelog +++ b/debian/changelog @@ -201,6 +201,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: use initializer list for constructor. - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. - pulsemanager.cpp: reformat only. + - pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index cd390bf..33d77d6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -237,11 +237,11 @@ void PulseManager::shutdown () { loop.exec (); } -int PulseManager::get_pulse_port () { +std::uint16_t PulseManager::get_pulse_port () { return (pulse_port_); } -void PulseManager::set_pulse_port (int pulse_port) { +void PulseManager::set_pulse_port (std::uint16_t pulse_port) { pulse_port_ = pulse_port; } diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 5b1fe37..9252739 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -35,6 +35,7 @@ #include <QApplication> #include <QTimer> #include <assert.h> +#include <cstdint> #include "x2gologdebug.h" #include "x2gosettings.h" @@ -44,8 +45,8 @@ class PulseManager: public QObject { public: PulseManager (); ~PulseManager (); - int get_pulse_port (); - void set_pulse_port (int pulse_port); + std::uint16_t get_pulse_port (); + void set_pulse_port (std::uint16_t pulse_port); QProcess::ProcessState state (); public slots: @@ -78,7 +79,7 @@ class PulseManager: public QObject { QDir pulse_dir_; QProcessEnvironment env_; QProcess *pulse_server_; - int pulse_port_; + std::uint16_t pulse_port_; QProcess::ProcessState state_; QString app_dir_; uint32_t pulse_version_major_; -- 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 41283a88b912e04725428a1b1b7d7f06b6852dc3 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:21:17 2015 +0100 pulsemanager.h: add std:: namespace selector for uint32_t version variables. --- debian/changelog | 2 ++ src/pulsemanager.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 812d804..0c49ef0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -202,6 +202,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. - pulsemanager.cpp: reformat only. - pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. + - pulsemanager.h: add std:: namespace selector for uint32_t version + variables. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 9252739..dbafa3f 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -82,8 +82,8 @@ class PulseManager: public QObject { std::uint16_t pulse_port_; QProcess::ProcessState state_; QString app_dir_; - uint32_t pulse_version_major_; - uint32_t pulse_version_minor_; + std::uint32_t pulse_version_major_; + std::uint32_t pulse_version_minor_; }; #ifdef NDEBUG_DEFINE -- 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 043fa0f825bc7da4d742be0abf7a36b88e04d187 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:56:33 2015 +0100 pulsemanager.{cpp,h}: add ESD support. --- debian/changelog | 1 + src/pulsemanager.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++------- src/pulsemanager.h | 5 ++++- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0c49ef0..029f1ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -204,6 +204,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. - pulsemanager.h: add std:: namespace selector for uint32_t version variables. + - pulsemanager.{cpp,h}: add ESD support. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 33d77d6..c92d64f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,8 +25,8 @@ #endif PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), - state_ (QProcess::NotRunning), pulse_server_ (NULL), - app_dir_ (QApplication::applicationDirPath ()), + esd_port_ (4714), state_ (QProcess::NotRunning), + pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); @@ -62,7 +62,15 @@ void PulseManager::start () { } void PulseManager::start_osx () { - find_port (); + // Search for a free Pulse and EsounD port. + // Note that there is no way we could find + // an esd port, if the pulse port detection + // failed. Better trust your compiler to + // optimize this statement and save some + // cycles. + if ((findPort (false)) && (findPort (true))) { + find_port (); + } if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); @@ -98,21 +106,45 @@ void PulseManager::start_osx () { } } -void PulseManager::find_port () { +void PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; + std::uint16_t ret = pulse_port_; + std::uint16_t other_port = esd_port_; + + // If the search_esd parameter is true, find a free port + // for the PulseAudio emulation. + if (search_esd) { + ret = esd_port_; + other_port = pulse_port_; + } do { - tcpSocket.connectToHost ("127.0.0.1", pulse_port_); + // Skip this port, if it's reserved for the counterpart. + if (ret == other_port) { + ++ret; + continue; + } + + tcpSocket.connectToHost ("127.0.0.1", ret); if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - ++pulse_port_; + ++ret; } else free = true; - } while (!free); + } while ((!free) && (port > 1023)); + + if (!search_esd) { + pulse_port_ = ret; + } + else { + esd_port_ = ret; + } + + return (free); } bool PulseManager::generate_server_config () { @@ -131,6 +163,7 @@ bool PulseManager::generate_server_config () { 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-esound-protocol-unix" << endl; config_tmp_file_stream << "load-module module-coreaudio-detect"; if (disable_input) @@ -241,10 +274,18 @@ std::uint16_t PulseManager::get_pulse_port () { return (pulse_port_); } +std::uint16_t PulseManager::get_esd_port () { + return (esd_port_); +} + void PulseManager::set_pulse_port (std::uint16_t pulse_port) { pulse_port_ = pulse_port; } +void PulseManager::set_esd_port (std::uint16_t esd_port) { + esd_port_ = esd_port; +} + void PulseManager::relaunch () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index dbafa3f..22ab771 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -46,7 +46,9 @@ class PulseManager: public QObject { PulseManager (); ~PulseManager (); std::uint16_t get_pulse_port (); + std::uint16_t get_esd_port (); void set_pulse_port (std::uint16_t pulse_port); + void set_esd_port (std::uint16_t esd_port); QProcess::ProcessState state (); public slots: @@ -60,7 +62,7 @@ class PulseManager: public QObject { void start_win (); // FIXME void start_linux (); - void find_port (); + void find_port (bool search_esd = false); bool generate_server_config (); bool generate_client_config (); void cleanup_client_dir (); @@ -80,6 +82,7 @@ class PulseManager: public QObject { QProcessEnvironment env_; QProcess *pulse_server_; std::uint16_t pulse_port_; + std::uint16_t esd_port_; QProcess::ProcessState state_; QString app_dir_; std::uint32_t pulse_version_major_; -- 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 b370677eb197db7e695d6e4bff0b00f3d2236181 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:32:34 2015 +0100 pulsemanager.{cpp,h}: rename relaunch () to restart (). --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- src/pulsemanager.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 029f1ba..44be1e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -205,6 +205,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.h: add std:: namespace selector for uint32_t version variables. - pulsemanager.{cpp,h}: add ESD support. + - pulsemanager.{cpp,h}: rename relaunch () to restart (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index c92d64f..6999c18 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -286,7 +286,7 @@ void PulseManager::set_esd_port (std::uint16_t esd_port) { esd_port_ = esd_port; } -void PulseManager::relaunch () { +void PulseManager::restart () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 22ab771..aae71e3 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -53,7 +53,7 @@ class PulseManager: public QObject { public slots: void start (); - void relaunch (); + void restart (); private: PulseManager (const PulseManager &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 405452df570d87d1e4d2a2b622ceed1883f6aff9 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:35:35 2015 +0100 pulsemanager.cpp: reformat only. --- debian/changelog | 1 + src/pulsemanager.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 44be1e4..2d2649c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -206,6 +206,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium variables. - pulsemanager.{cpp,h}: add ESD support. - pulsemanager.{cpp,h}: rename relaunch () to restart (). + - pulsemanager.cpp: reformat only. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6999c18..d9d5710 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,10 +24,14 @@ #define DEBUG #endif -PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), - esd_port_ (4714), state_ (QProcess::NotRunning), - pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), - pulse_version_major_ (0), pulse_version_minor_ (0) { +PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), + pulse_port_ (4713), + esd_port_ (4714), + state_ (QProcess::NotRunning), + pulse_server_ (NULL), + app_dir_ (QApplication::applicationDirPath ()), + pulse_version_major_ (0), + pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (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 bea743f2f63021e7020943979ebb132ffcb5c3f3 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:40:58 2015 +0100 pulsemanager.{cpp,h}: fixup preprocessor usage. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++---- src/pulsemanager.h | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2d2649c..b40f4de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -207,6 +207,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add ESD support. - pulsemanager.{cpp,h}: rename relaunch () to restart (). - pulsemanager.cpp: reformat only. + - pulsemanager.{cpp,h}: fixup preprocessor usage. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d9d5710..9c31cca 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -22,7 +22,7 @@ #ifndef DEBUG #define DEBUG_UNDEF #define DEBUG -#endif +#endif // defined (NDEBUG) PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), @@ -62,7 +62,7 @@ void PulseManager::start () { start_win (); #elif defined (Q_OS_LINUX) start_linux (); -#endif +#endif // defined (Q_OS_DARWIN) } void PulseManager::start_osx () { @@ -105,7 +105,7 @@ void PulseManager::start_osx () { #ifdef DEBUG // Give PA a little time to come up. QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); -#endif +#endif // defined (DEBUG) } } } @@ -305,4 +305,4 @@ QProcess::ProcessState PulseManager::state () { #ifdef DEBUG_UNDEF #undef DEBUG #undef DEBUG_UNDEF -#endif +#endif // defined (DEBUG_UNDEF) diff --git a/src/pulsemanager.h b/src/pulsemanager.h index aae71e3..020556a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -23,7 +23,7 @@ #ifdef NDEBUG #define NDEBUG_DEFINE #undef NDEBUG -#endif +#endif // defined (NDEBUG) #include <iostream> #include <QDir> @@ -92,6 +92,6 @@ class PulseManager: public QObject { #ifdef NDEBUG_DEFINE #define NDEBUG #undef NDEBUG_DEFINE -#endif +#endif // defined (NDEBUG_DEFINE) #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 26b1815ebb313c926b4cddfe69cf0f70300299a0 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:05:53 2015 +0100 pulsemanager.{cpp,h}: new function create_client_dir (). --- debian/changelog | 1 + src/pulsemanager.cpp | 11 +++++++++++ src/pulsemanager.h | 1 + 3 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7060a38..37688d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -212,6 +212,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium server_working_dir_ class variables. - pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. + - pulsemanager.{cpp,h}: new function create_client_dir (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index f094019..f686dce 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -230,6 +230,17 @@ void PulseManager::cleanup_client_dir () { machine_dir.remove (machine_dir.absolutePath ()); } +void PulseManager::create_client_dir () { + QDir machine_dir (pulse_dir_.absolutePath () + "/.pulse/" + + QHostInfo::localHostName () + "-runtime"); + + if (!machine_dir.exists ()) + machine_dir.mkpath (machine_dir.absolutePath ()); + + if (QFile::exists (machine_dir.absolutePath () + "/pid")) + QFile::remove (machine_dir.absolutePath () + "/pid"); +} + void PulseManager::slot_play_startup_sound () { QProcess play_file (0); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 99b3d4a..e5f4b87 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -66,6 +66,7 @@ class PulseManager: public QObject { bool generate_server_config (); bool generate_client_config (); void cleanup_client_dir (); + void create_client_dir (); void shutdown (); bool is_server_running (); -- 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 6cc2d713b63d2195fc73598912e937ff84a38df0 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:56:30 2015 +0100 pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 3 +++ src/pulsemanager.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index b40f4de..50d5709 100644 --- a/debian/changelog +++ b/debian/changelog @@ -208,6 +208,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: rename relaunch () to restart (). - pulsemanager.cpp: reformat only. - pulsemanager.{cpp,h}: fixup preprocessor usage. + - pulsemanager.{cpp,h}: add server_args_, server_binary_ and + server_working_dir_ class variables. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9c31cca..a46ab11 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -30,6 +30,9 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), state_ (QProcess::NotRunning), pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), + server_args_ (QStringList ()), + server_binary_ (QString ("")), + server_working_dir (QString ("")), pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 020556a..99b3d4a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -85,6 +85,9 @@ class PulseManager: public QObject { std::uint16_t esd_port_; QProcess::ProcessState state_; QString app_dir_; + QStringList server_args_; + QString server_binary_; + QString server_working_dir_; std::uint32_t pulse_version_major_; std::uint32_t pulse_version_minor_; }; -- 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 b0ca4d02acb309df146aeedf70f8586c51a039ba Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:03:44 2015 +0100 pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 50d5709..7060a38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -210,6 +210,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: fixup preprocessor usage. - pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. + - pulsemanager.cpp: make start () wrap the "real" OS-specific start + functions. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index a46ab11..f094019 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -59,16 +59,6 @@ void PulseManager::start () { 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 // defined (Q_OS_DARWIN) -} - -void PulseManager::start_osx () { // Search for a free Pulse and EsounD port. // Note that there is no way we could find // an esd port, if the pulse port detection @@ -76,9 +66,17 @@ void PulseManager::start_osx () { // optimize this statement and save some // cycles. if ((findPort (false)) && (findPort (true))) { - find_port (); +#ifdef Q_OS_DARWIN + start_osx (); +#elif defined (Q_OS_WIN) + start_win (); +#elif defined (Q_OS_LINUX) + start_linux (); +#endif // defined (Q_OS_DARWIN) } +} +void PulseManager::start_osx () { if (generate_server_config () && generate_client_config ()) { cleanup_client_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 f4054fefab2cfdbdfaa130ed3d37df914e134ceb Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:14:47 2015 +0100 pulsemanager.cpp: add Windows support to shutdown (). --- debian/changelog | 1 + src/pulsemanager.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 37688d2..f1bb314 100644 --- a/debian/changelog +++ b/debian/changelog @@ -213,6 +213,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. - pulsemanager.{cpp,h}: new function create_client_dir (). + - pulsemanager.cpp: add Windows support to shutdown (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index f686dce..44b52f3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -281,7 +281,14 @@ void PulseManager::shutdown () { connect (this, SIGNAL (sig_pulse_server_terminated ()), &loop, SLOT (quit ())); + // Console applications without an event loop can only be terminated + // by QProcess::kill() on Windows (unless they handle WM_CLOSE, which + // PA obviously doesn't.) +#ifdef Q_OS_WIN + pulse_server_->kill (); +#else // defined (Q_OS_WIN) pulse_server_->terminate (); +#endif // defined (Q_OS_WIN) loop.exec (); } -- 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 ca5537f998538dd6c8af10af898cd84736287f38 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:16:52 2015 +0100 pulsemanager.cpp: add cleanup support to on_pulse_finished (). --- debian/changelog | 1 + src/pulsemanager.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index f1bb314..7276e77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -214,6 +214,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium functions. - pulsemanager.{cpp,h}: new function create_client_dir (). - pulsemanager.cpp: add Windows support to shutdown (). + - pulsemanager.cpp: add cleanup support to on_pulse_finished (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 44b52f3..de73156 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -264,6 +264,18 @@ void PulseManager::on_pulse_finished (int exit_code) { data = ba.data (); std::cout << data; + // Clean up + QDir work_dir (app_dir_); + +#ifdef Q_OS_WIN + work_dir.remove (pulse_dir_.absolutePath () + + "/pulse-pulseuser/pid"); + work_dir.rmdir (pulse_dir_.absolutePath () + + "/pulse-pulseuser"); +#endif // defined (Q_OS_WIN) + + work_dir.rmdir (pulse_dir_.absolutePath ()); + state_ = QProcess::NotRunning; emit (sig_pulse_server_terminated ()); } -- 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 3ba2663d163f0b1b08573d1f48a9b916aa8d612a Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:20:22 2015 +0100 pulsemanager.cpp: add Windows stuff to initial env in constructor. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7276e77..3d25be7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -215,6 +215,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: new function create_client_dir (). - pulsemanager.cpp: add Windows support to shutdown (). - pulsemanager.cpp: add cleanup support to on_pulse_finished (). + - pulsemanager.cpp: add Windows stuff to initial env in constructor. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index de73156..8bb901e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -42,6 +42,10 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), env_ = QProcessEnvironment::systemEnvironment (); env_.insert ("HOME", pulse_dir_.absolutePath ()); env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); +#ifdef Q_OS_WIN + env_.insert ("USERPROFILE", pulse_dir_.absolutePath ()); + env_.insert ("USERNAME", "pulseuser"); +#endif // defined (Q_OS_WIN) } PulseManager::~PulseManager () { -- 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 15c3ce05e0c873f40183d7e8540dd57906b498bc Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:31:00 2015 +0100 pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 19 +++++++++++++++++++ src/pulsemanager.h | 1 + 3 files changed, 22 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3d25be7..539aeef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -216,6 +216,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: add Windows support to shutdown (). - pulsemanager.cpp: add cleanup support to on_pulse_finished (). - pulsemanager.cpp: add Windows stuff to initial env in constructor. + - pulsemanager.{cpp,h}: add new function start_generic () to split off + common functionality. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 8bb901e..6a3e9d8 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -80,6 +80,25 @@ void PulseManager::start () { } } +void PulseManager::start_generic () { + pulse_server_->setProcessEnvironment (env_); + pulse_server_->setWorkingDirectory (server_working_dir_); + + pulse_server_->start (server_binary_, server_args_); + if (pulse_server_->waitForStarted ()) { + x2goDebug << "pulse started with arguments" << server_args_ << "; waiting for finish..."; + state_ = QProcess::Running; + + connect (pulse_server_, SIGNAL (finished (int)), + this, SLOT (slot_on_pulse_finished (int))); + +#ifdef DEBUG + // Give PA a little time to come up. + QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ())); +#endif // defined (DEBUG) + } +} + void PulseManager::start_osx () { if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index e5f4b87..be94414 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -62,6 +62,7 @@ class PulseManager: public QObject { void start_win (); // FIXME void start_linux (); + void start_generic (); void find_port (bool search_esd = false); bool generate_server_config (); bool generate_client_config (); -- 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 f24f7308cad4c1bd9e28f56bdbb625ca97f2844f Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:37:09 2015 +0100 pulsemanager.cpp: let start_osx () use start_generic (). --- debian/changelog | 1 + src/pulsemanager.cpp | 41 ++++++++++++++--------------------------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/debian/changelog b/debian/changelog index 539aeef..771827c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -218,6 +218,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: add Windows stuff to initial env in constructor. - pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. + - pulsemanager.cpp: let start_osx () use start_generic (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6a3e9d8..1041797 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -100,37 +100,24 @@ void PulseManager::start_generic () { } void PulseManager::start_osx () { - 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"; + server_args_ = QStringList (); + server_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); + server_args_ << "--log-level=debug"; +#endif // defined (DEBUG) - if (pulse_server_->waitForStarted ()) { - x2goDebug << "pulse started with" << args << "waiting for finish..."; - state_ = QProcess::Running; + server_working_dir_ = QString (app_dir_ + "/../exe/"); + server_binary_ = QString (server_working_dir_ + "/pulseaudio"); - connect (pulse_server_, SIGNAL (finished (int)), - this, SLOT (on_pulse_finished (int))); + if (generate_server_config () && generate_client_config ()) { + cleanup_client_dir (); -#ifdef DEBUG - // Give PA a little time to come up. - QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); -#endif // defined (DEBUG) - } + start_generic (); } } -- 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 1353f79a8174028549fccf0f8b95534b2e6b3e79 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:39:43 2015 +0100 pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 21 +++++++++++++++++++++ src/pulsemanager.h | 1 - 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 771827c..5bbf0bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -219,6 +219,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. - pulsemanager.cpp: let start_osx () use start_generic (). + - pulsemanager.{cpp,h}: implement start_win () as part of Windows + functionality. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1041797..a4419db 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -121,6 +121,27 @@ void PulseManager::start_osx () { } } +void PulseManager::start_win () { + server_args_ = QStringList (); + server_args_ << "--exit-idle-time=-1" << "-n" + << "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/config.pa").absolutePath ()) + << "-p" << QDir::toNativeSeparators (QDir (app_dir_ + "/pulse/lib/pulse-1.1/" + + "modules/").absolutePath ()); +#ifdef DEBUG + server_args_ << "--log-level=debug"; +#endif // defined (DEBUG) + + server_working_dir_ = QString (app_dir_ + "/pulse/"); + server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); + + if (generateServerConfig () && generateClientConfig ()) { + create_client_dir (); + + start_generic (); + } +} + void PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index be94414..8463fb5 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -58,7 +58,6 @@ class PulseManager: public QObject { private: PulseManager (const PulseManager &other); void start_osx (); - // FIXME void start_win (); // FIXME void start_linux (); -- 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 53987d2ed977fd7e88584a568651a71454a6d66f Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:42:36 2015 +0100 pulsemanager.cpp: also load module-esound-protocol-tcp module. --- debian/changelog | 1 + src/pulsemanager.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5bbf0bc..742da32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -221,6 +221,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: let start_osx () use start_generic (). - pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. + - pulsemanager.cpp: also load module-esound-protocol-tcp module. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index a4419db..d705486 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -200,6 +200,11 @@ bool PulseManager::generate_server_config () { + QString::number (pulse_port_) << endl; config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; config_tmp_file_stream << "load-module module-esound-protocol-unix" << endl; + + config_tmp_file_stream << "load-module module-esound-protocol-tcp port=" + << QString::number (esd_port_) + << endl; + config_tmp_file_stream << "load-module module-coreaudio-detect"; if (disable_input) -- 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 b4c1263225b7b525cc42b2b8dabed20130832a07 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:44:07 2015 +0100 pulsemanager.cpp: make generate_server_config () Windows-compatible. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 742da32..8b639ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -222,6 +222,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. - pulsemanager.cpp: also load module-esound-protocol-tcp module. + - pulsemanager.cpp: make generate_server_config () Windows-compatible. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d705486..3704000 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -198,14 +198,22 @@ bool PulseManager::generate_server_config () { config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + QString::number (pulse_port_) << endl; + +#ifdef Q_OS_UNIX config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; config_tmp_file_stream << "load-module module-esound-protocol-unix" << endl; +#endif // defined(Q_OS_UNIX) config_tmp_file_stream << "load-module module-esound-protocol-tcp port=" << QString::number (esd_port_) << endl; +#ifdef Q_OS_DARWIN config_tmp_file_stream << "load-module module-coreaudio-detect"; +#elif defined (Q_OS_WIN) + config_tmp_file_stream << "load-module module-waveout"; +// FIXME Linux +#endif // defined (Q_OS_DARWIN) if (disable_input) config_tmp_file_stream << " record=0"; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 578ffe972b268301781e4092dcb7e4f436e95a5d Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:44:53 2015 +0100 pulsemanager.cpp: make generate_client_config () Windows-compatible. --- debian/changelog | 1 + src/pulsemanager.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8b639ba..0bc8e85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -223,6 +223,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium functionality. - pulsemanager.cpp: also load module-esound-protocol-tcp module. - pulsemanager.cpp: make generate_server_config () Windows-compatible. + - pulsemanager.cpp: make generate_client_config () Windows-compatible. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 3704000..5e66e44 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -236,21 +236,27 @@ bool PulseManager::generate_server_config () { 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"); + 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; +#ifdef Q_OS_WIN + config_tmp_file_stream << "default-server=localhost:" << pulse_port_ << endl; +#endif // defined (Q_OS_WIN) config_tmp_file_stream << "daemon-binary=" - << QDir (app_dir_ - + "/../exe/pulseaudio").absolutePath () + << QDir::toNativeSeparators (QDir (server_binary_).absolutePath ()) << endl; if (QFile::exists (client_config_file_name)) QFile::remove (client_config_file_name); + QDir client_config_dir (pulse_dir_.absolutePath () + "/.pulse/"); + client_config_dir.mkpath (client_config_dir.absolutePath ()); + client_config_tmp_file.copy (client_config_file_name); client_config_tmp_file.remove (); -- 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 309884303c5a28f78838c5acaad203cbb5db5d95 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:45:49 2015 +0100 pulsemanager.cpp: only play startup sound if DEBUG macro is defined. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0bc8e85..02150ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -224,6 +224,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: also load module-esound-protocol-tcp module. - pulsemanager.cpp: make generate_server_config () Windows-compatible. - pulsemanager.cpp: make generate_client_config () Windows-compatible. + - pulsemanager.cpp: only play startup sound if DEBUG macro is defined. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 5e66e44..421e54b 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -292,6 +292,7 @@ void PulseManager::create_client_dir () { } void PulseManager::slot_play_startup_sound () { +#ifdef DEBUG QProcess play_file (0); play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); @@ -301,6 +302,7 @@ void PulseManager::slot_play_startup_sound () { if (play_file.waitForStarted ()) play_file.waitForFinished (); +#endif // defined (DEBUG) } void PulseManager::on_pulse_finished (int exit_code) { -- 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 6ddb068c07750c2a236dfc54b2f96fee974dfcb4 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:47:37 2015 +0100 pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 02150ac..c25d2c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -225,6 +225,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: make generate_server_config () Windows-compatible. - pulsemanager.cpp: make generate_client_config () Windows-compatible. - pulsemanager.cpp: only play startup sound if DEBUG macro is defined. + - pulsemanager.cpp: make startup sound playing via + slot_play_startup_sound () Windows-compatible. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 421e54b..512b027 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -294,11 +294,22 @@ void PulseManager::create_client_dir () { void PulseManager::slot_play_startup_sound () { #ifdef DEBUG QProcess play_file (0); + QString play_file_binary = QString (app_dir_); + QString play_file_file = play_file_binary; - play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); +#ifdef Q_OS_DARWIN + play_file_binary += "/../exe/paplay"; + play_file_file += "/../Resources/startup.wav"; +#elif defined (Q_OS_WIN) + playFileBinary += "/pulse/paplay.exe"; + playFileFile += "/startup.wav"; +#endif // defined (Q_OS_DARWIN) + + QStringList args; + args << play_file_file; + play_file.setWorkingDirectory (server_working_dir_); play_file.setProcessEnvironment (env_); - play_file.start (app_dir_ + "/../exe/paplay " - + app_dir_ + "/../Resources/startup.wav"); + play_file.start (play_file_binary, args); if (play_file.waitForStarted ()) play_file.waitForFinished (); -- 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 3d24ba5b75c37244190b8e1e510c9100c94e345a Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:35:23 2015 +0100 pulsemanager.h: whitespace only. --- src/pulsemanager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 8463fb5..a42f1ca 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -36,6 +36,7 @@ #include <QTimer> #include <assert.h> #include <cstdint> + #include "x2gologdebug.h" #include "x2gosettings.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 ef1c70f7851229e31b1600aeae510da01b755824 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:35:57 2015 +0100 pulsemanager.cpp: typo fix in member variable name server_working_dir_. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c25d2c3..cf45694 100644 --- a/debian/changelog +++ b/debian/changelog @@ -227,6 +227,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: only play startup sound if DEBUG macro is defined. - pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. + - pulsemanager.cpp: typo fix in variable name server_working_dir_. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 512b027..7dda3d2 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -32,7 +32,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), app_dir_ (QApplication::applicationDirPath ()), server_args_ (QStringList ()), server_binary_ (QString ("")), - server_working_dir (QString ("")), + server_working_dir_ (QString ("")), pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); -- 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 dee043a6b61532dc1b045c458554861744c636f0 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:39:33 2015 +0100 pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- src/pulsemanager.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cf45694..4a78268 100644 --- a/debian/changelog +++ b/debian/changelog @@ -228,6 +228,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. - pulsemanager.cpp: typo fix in variable name server_working_dir_. + - pulsemanager.{cpp,h}: find_port () actually returns a value, fix + declaration accordingly. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 7dda3d2..ae8ece9 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -142,7 +142,7 @@ void PulseManager::start_win () { } } -void PulseManager::find_port (bool search_esd) { +bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; std::uint16_t ret = pulse_port_; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index a42f1ca..e1a088a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -63,7 +63,7 @@ class PulseManager: public QObject { // FIXME void start_linux (); void start_generic (); - void find_port (bool search_esd = false); + bool find_port (bool search_esd = false); bool generate_server_config (); bool generate_client_config (); void cleanup_client_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 0ae076cff0e3e845b34aa5dc6c8c4571c71985e2 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:48:11 2015 +0100 pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a78268..0a8e7e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -230,6 +230,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: typo fix in variable name server_working_dir_. - pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. + - pulsemanager.cpp: fix compile errors in find_port () by renaming the ret + or port variable to search_port. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ae8ece9..7b0fa65 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -145,39 +145,40 @@ void PulseManager::start_win () { bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; - std::uint16_t ret = pulse_port_; + std::uint16_t search_port = pulse_port_; std::uint16_t other_port = esd_port_; // If the search_esd parameter is true, find a free port // for the PulseAudio emulation. if (search_esd) { - ret = esd_port_; + search_port = esd_port_; other_port = pulse_port_; } do { // Skip this port, if it's reserved for the counterpart. - if (ret == other_port) { - ++ret; + if (search_port == other_port) { + ++search_port; continue; } - tcpSocket.connectToHost ("127.0.0.1", ret); + tcpSocket.connectToHost ("127.0.0.1", search_port); if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - ++ret; + ++search_port; } - else + else { free = true; - } while ((!free) && (port > 1023)); + } + } while ((!free) && (search_port > 1023)); if (!search_esd) { - pulse_port_ = ret; + pulse_port_ = search_port; } else { - esd_port_ = ret; + esd_port_ = search_port; } return (free); -- 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 d4bd05da800d5476da73cafbe91b0cddd36aac4c Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:49:35 2015 +0100 pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0a8e7e7..7fc569a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -232,6 +232,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium declaration accordingly. - pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. + - pulsemanager.cpp: fix another compile error due to typo'd versions of + generate_server_config () and generate_client_config (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 7b0fa65..ecf47a3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -135,7 +135,7 @@ void PulseManager::start_win () { server_working_dir_ = QString (app_dir_ + "/pulse/"); server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); - if (generateServerConfig () && generateClientConfig ()) { + if (generate_server_config () && generate_client_config ()) { create_client_dir (); start_generic (); -- 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 a86f6a42f2fc7c61df0d18cb20affa3d0c0322f4 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:51:12 2015 +0100 pulsemanager.cpp: another typo fix: findPort -> find_port. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7fc569a..f81d9dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -234,6 +234,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium or port variable to search_port. - pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). + - pulsemanager.cpp: another typo fix: findPort -> find_port. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ecf47a3..b4f8481 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -69,7 +69,7 @@ void PulseManager::start () { // failed. Better trust your compiler to // optimize this statement and save some // cycles. - if ((findPort (false)) && (findPort (true))) { + if ((find_port (false)) && (find_port (true))) { #ifdef Q_OS_DARWIN start_osx (); #elif defined (Q_OS_WIN) -- 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 388ada27d0858c6f2ee776e0cb9cda05c6ce03eb Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:52:25 2015 +0100 pulsemanager.cpp: reorder member variables in initialization list. Compile warning fix. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f81d9dc..30aeeb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -235,6 +235,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). - pulsemanager.cpp: another typo fix: findPort -> find_port. + - pulsemanager.cpp: reorder member varibles in initialization list. + Compile warning fix. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index b4f8481..3d01cde 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,10 +25,10 @@ #endif // defined (NDEBUG) PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), + pulse_server_ (NULL), pulse_port_ (4713), esd_port_ (4714), state_ (QProcess::NotRunning), - pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), server_args_ (QStringList ()), server_binary_ (QString ("")), -- 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 2ddb2cb94960e43b90e473b6c19bd01e910cb2ca Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:53:38 2015 +0100 pulsemanager.cpp: add "dummy" start_linux () function. --- debian/changelog | 3 ++- src/pulsemanager.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 30aeeb1..882c3f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -235,8 +235,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). - pulsemanager.cpp: another typo fix: findPort -> find_port. - - pulsemanager.cpp: reorder member varibles in initialization list. + - pulsemanager.cpp: reorder member variables in initialization list. Compile warning fix. + - pulsemanager.cpp: add "dummy" start_linux () function. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 3d01cde..9c6de0d 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -142,6 +142,10 @@ void PulseManager::start_win () { } } +void PulseManager::start_linux () { + /* Do nothing - assumed to be already running. */ +} + bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = 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 54f9a069e1ac237109a444bd1cf200c6862a51fd Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:55:25 2015 +0100 pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. We need them right away. --- debian/changelog | 3 +++ src/pulsemanager.cpp | 46 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 882c3f9..b6c0e22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -238,6 +238,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: reorder member variables in initialization list. Compile warning fix. - pulsemanager.cpp: add "dummy" start_linux () function. + - pulsemanager.cpp: generate platform-dependent values for member + variables server_working_dir_ and server_binary_ in constructor. We need + them right away. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9c6de0d..bb0bf73 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -17,6 +17,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <unistd.h> +#include <stdlib.h> + #include "pulsemanager.h" #ifndef DEBUG @@ -46,6 +49,43 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), env_.insert ("USERPROFILE", pulse_dir_.absolutePath ()); env_.insert ("USERNAME", "pulseuser"); #endif // defined (Q_OS_WIN) + + /* Set server binary and working dir paths. */ +#ifdef Q_OS_DARWIN + server_working_dir_ = QString (app_dir_ + "/../exe/"); + server_binary_ = QString (server_working_dir_ + "/pulseaudio"); +#elif defined (Q_OS_WIN) + server_working_dir_ = QString (app_dir_ + "/pulse/"); + server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); +#elif defined (Q_OS_LINUX) + std::size_t path_len = pathconf (".", _PC_PATH_MAX); + + if (-1 == path_len) { + path_len = 1024; + } + + char *buf, *ptr; + + for (buf = ptr = NULL; ptr == NULL; path_len += 20) { + if (NULL == (buf = realloc (buf, path_len))) { + x2goErrorf (16) << "Could not allocate buffer for getting current working directory!" << std::endl; + abort (); + } + + ptr = getcwd (buf, path_len); + + if ((NULL == ptr) && (ERANGE != erange)) { + x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)) << std::endl; + abort (); + } + } + + server_working_dir_ = QString (buf); + server_binary_ = QString ("pulseaudio"); + + free (buf); + buf = ptr = NULL; +#endif // defined (Q_OS_DARWIN) } PulseManager::~PulseManager () { @@ -111,9 +151,6 @@ void PulseManager::start_osx () { server_args_ << "--log-level=debug"; #endif // defined (DEBUG) - server_working_dir_ = QString (app_dir_ + "/../exe/"); - server_binary_ = QString (server_working_dir_ + "/pulseaudio"); - if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); @@ -132,9 +169,6 @@ void PulseManager::start_win () { server_args_ << "--log-level=debug"; #endif // defined (DEBUG) - server_working_dir_ = QString (app_dir_ + "/pulse/"); - server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); - if (generate_server_config () && generate_client_config ()) { create_client_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 206bb560e474331f7e4323d6e674b23f6363bdf2 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:58:52 2015 +0100 pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. Call it in the constructor. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 9 +++++++++ src/pulsemanager.h | 1 + 3 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index b6c0e22..031a746 100644 --- a/debian/changelog +++ b/debian/changelog @@ -241,6 +241,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. We need them right away. + - pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () + with first skeleton. Call it in the constructor. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index bb0bf73..ade1ec6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -86,6 +86,8 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), free (buf); buf = ptr = NULL; #endif // defined (Q_OS_DARWIN) + + fetch_pulseaudio_version (); } PulseManager::~PulseManager () { @@ -180,6 +182,13 @@ void PulseManager::start_linux () { /* Do nothing - assumed to be already running. */ } +void PulseManager::fetch_pulseaudio_version () { + QStringList args = "--version"; + QProcess tmp_server (this); + + tmp_server->setWorkingDirectory (server_working_dir_); +} + bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index e1a088a..fb21992 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -58,6 +58,7 @@ class PulseManager: public QObject { private: PulseManager (const PulseManager &other); + void fetch_pulseaudio_version (); void start_osx (); void start_win (); // FIXME -- 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 63ee944a0da1ead9bdeee13158eeedd31cfc6005 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 30 21:37:22 2015 +0100 pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 031a746..ac0bde9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -243,6 +243,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium them right away. - pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. Call it in the constructor. + - pulsemanager.cpp: re-initialize buffer string on each run while getting + CWD on Linux. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ade1ec6..06ef766 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -72,6 +72,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), abort (); } + memset (buf, 0, path_len); ptr = getcwd (buf, path_len); if ((NULL == ptr) && (ERANGE != erange)) { -- 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 3a941121aad2348e5580a72ba3993787c40c32a4 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 30 21:39:19 2015 +0100 pulsemanager.cpp: fix some error messages by removing redundant newlines. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ac0bde9..8b2dc0b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -245,6 +245,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium with first skeleton. Call it in the constructor. - pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. + - pulsemanager.cpp: fix some error messages by removing redundant + newlines. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 06ef766..3f7256a 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -68,7 +68,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), for (buf = ptr = NULL; ptr == NULL; path_len += 20) { if (NULL == (buf = realloc (buf, path_len))) { - x2goErrorf (16) << "Could not allocate buffer for getting current working directory!" << std::endl; + x2goErrorf (16) << "Could not allocate buffer for getting current working directory!"; abort (); } @@ -76,7 +76,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), ptr = getcwd (buf, path_len); if ((NULL == ptr) && (ERANGE != erange)) { - x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)) << std::endl; + x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)); abort (); } } -- 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 ccd5bf2f630e6b8aa069d3bbd4e1c18111622fd5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 30 23:11:44 2015 +0100 pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. Add new member variables for this and initialize them correctly. --- debian/changelog | 3 +++ src/pulsemanager.cpp | 4 +++- src/pulsemanager.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8b2dc0b..16aeb1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -247,6 +247,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium CWD on Linux. - pulsemanager.cpp: fix some error messages by removing redundant newlines. + - pulsemanager.{cpp,h}: some older PA versions used the major, minor and + micro numbering scheme together with a descriptive string. Add new + member variables for this and initialize them correctly. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 3f7256a..bdf7f62 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -37,7 +37,9 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), server_binary_ (QString ("")), server_working_dir_ (QString ("")), pulse_version_major_ (0), - pulse_version_minor_ (0) { + pulse_version_minor_ (0), + pulse_version_micro_ (0), + pulse_version_misc_ ("") { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index fb21992..52c4dfa 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -93,6 +93,8 @@ class PulseManager: public QObject { QString server_working_dir_; std::uint32_t pulse_version_major_; std::uint32_t pulse_version_minor_; + std::uint32_t pulse_version_micro_; + QString pulse_version_misc_; }; #ifdef NDEBUG_DEFINE -- 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 0e95703bafb796e137c03bf030e461acf4010007 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 00:38:16 2015 +0100 pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. --- debian/changelog | 2 ++ src/pulsemanager.h | 34 ++++++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 16aeb1e..9d6c8ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -250,6 +250,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. Add new member variables for this and initialize them correctly. + - pulsemanager.h: reformat a bit by adding newlines and moving lines in a + (hopefully) logical fashion. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 52c4dfa..ec5e27c 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -46,51 +46,69 @@ class PulseManager: public QObject { public: PulseManager (); ~PulseManager (); + + QProcess::ProcessState state (); + std::uint16_t get_pulse_port (); std::uint16_t get_esd_port (); + void set_pulse_port (std::uint16_t pulse_port); void set_esd_port (std::uint16_t esd_port); - QProcess::ProcessState state (); + public slots: void start (); void restart (); + private: PulseManager (const PulseManager &other); - void fetch_pulseaudio_version (); + void start_osx (); void start_win (); // FIXME void start_linux (); void start_generic (); + + void fetch_pulseaudio_version (); + bool find_port (bool search_esd = false); + bool generate_server_config (); bool generate_client_config (); - void cleanup_client_dir (); + void create_client_dir (); + 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 app_dir_; QString pulse_X2Go_; QDir pulse_dir_; + QStringList server_args_; + QString server_binary_; + QString server_working_dir_; + QProcessEnvironment env_; QProcess *pulse_server_; + QProcess::ProcessState state_; + std::uint16_t pulse_port_; std::uint16_t esd_port_; - QProcess::ProcessState state_; - QString app_dir_; - QStringList server_args_; - QString server_binary_; - QString server_working_dir_; + std::uint32_t pulse_version_major_; std::uint32_t pulse_version_minor_; std::uint32_t pulse_version_micro_; -- 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 3167742405f387964cdc86aa89a3750d176eacba Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 00:39:34 2015 +0100 pulsemanager.cpp: add algorithm for actually extracting PA version number. --- debian/changelog | 2 + src/pulsemanager.cpp | 129 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9d6c8ec..ebbd66c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -252,6 +252,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium member variables for this and initialize them correctly. - pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. + - pulsemanager.cpp: add algorithm for actually extracting PA version + number. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index bdf7f62..09fb791 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -189,7 +189,134 @@ void PulseManager::fetch_pulseaudio_version () { QStringList args = "--version"; QProcess tmp_server (this); - tmp_server->setWorkingDirectory (server_working_dir_); + /* Start PA with --version argument. */ + tmp_server.setWorkingDirectory (server_working_dir_); + tmp_server.start (server_binary_, args); + + /* Wait until the process exited again. */ + if (tmp_server->waitForFinished ()) { + /* Read stdout and split it up on newlines. */ + QByteArray ba = pulse_server_->readAllStandardOutput (); + QString stdout_data (ba.data ()); + QStringList stdout_list (stdout_data.split ("\n")); + + bool found = false; + for (QStringList::const_iterator cit = stdout_list.begin (); cit != stdout_list.end (); ++cit) { + /* Remove trailing whitespace, mostly carriage returns on Windows. */ + QString tmp_str (*cit); + tmp_str = tmp_str.trimmed (); + + QString needle ("pulseaudio "); + + if (tmp_str.startsWith (needle)) { + /* Drop first part. */ + tmp_str = tmp_str.mid (needle.size ()); + + /* We should be at a digit now. */ + bool numbers_found[3] = { false, false, false }; + QString tmp_str = QString (""); + for (QString::const_iterator cit = tmp_str.begin (); cit != tmp_str.end (); ++cit) { + if (!(numbers_found[0])) { + if (((*cit) >= '0') && ((*cit) <= '9')) { + tmp_str.append (*cit); + } + else if ((*cit) == '.') { + /* First number part complete, let's convert the string and skip the period. */ + numbers_found[0] = true; + bool convert_success = false; + pulse_version_major_ = tmp_str.toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (20) << "Unable to convert major version number string to integer."; + abort (); + } + + tmp_str = QString (""); + } + else { + x2goErrorf (21) << "Unexpected character found when parsing version string for major version number: '" << QString (*cit) << "'."; + abort (); + } + } + else if (!(numbers_found[1])) { + if (((*cit) >= '0') && ((*cit) <= '9')) { + tmp_str.append (*cit); + } + else if (((*cit) == '.') || ((*cit) == '-')) { + /* + * Second number part complete, let's convert the string and then check whether + * we stopped at a period or a dash character. + */ + numbers_found[1] = true; + bool convert_success = false; + pulse_version_minor_ = tmp_str.toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (22) << "Unable to convert minor version number string to integer."; + abort (); + } + + tmp_str = QString (""); + + if ((*cit) == '-') { + /* + * There will be no micro version, skip it entirely and assume the default + * value of zero. + */ + numbers_found[2] = true; + } + } + else { + x2goErrorf (23) << "Unexpected character found when parsing version string for minor version number: '" << QString (*cit) << "'."; + abort (); + } + } + else if (!(numbers_found[2])) { + if (((*cit) >= '0') && ((*cit) <= '9')) { + tmp_str.append (*cit); + } + else if ((*cit) == '-') { + /* Third number part complete, let's convert the string and skip the period. */ + numbers_found[2] = true; + bool convert_success = false; + pulse_version_micro_ = tmp_str.toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (24) << "Unable to convert micro version number string to integer."; + abort (); + } + + tmp_str = QString (""); + } + else { + x2goErrorf (25) << "Unexpected character found when parsing version string for micro version number: '" << QString (*cit) << "'."; + abort (); + } + } + else { + /* Numbers should be good by now, let's fetch everything else. */ + tmp_str.append (*cit); + } + } + + /* Misc version part will be set to the trailing string. */ + pulse_version_misc_ = tmp_str; + } + else { + /* No need to look any further. */ + continue; + } + } + + if (!found) { + x2goErrorf (19) << "Unable to fetch PulseAudio version - unexpected format. Exiting."; + abort (); + } + } + else { + x2goErrorf (18) << "Unable to start PulseAudio to fetch its version number. Exiting."; + abort (); + } } bool PulseManager::find_port (bool search_esd) { -- 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 92f25f53d87f7ebadd1a2a298a933d5c26f66edb Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 00:55:17 2015 +0100 pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 22 ++++++++++++++++++---- src/pulsemanager.h | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index ebbd66c..0720ee5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -254,6 +254,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium (hopefully) logical fashion. - pulsemanager.cpp: add algorithm for actually extracting PA version number. + - pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is + not currently running. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 09fb791..7ffdfcf 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -554,12 +554,26 @@ std::uint16_t PulseManager::get_esd_port () { return (esd_port_); } -void PulseManager::set_pulse_port (std::uint16_t pulse_port) { - pulse_port_ = pulse_port; +bool PulseManager::set_pulse_port (std::uint16_t pulse_port) { + bool ret = false; + + if (!(is_server_running ())) { + pulse_port_ = pulse_port; + ret = true; + } + + return (ret); } -void PulseManager::set_esd_port (std::uint16_t esd_port) { - esd_port_ = esd_port; +bool PulseManager::set_esd_port (std::uint16_t esd_port) { + bool ret = false; + + if (!(is_server_running ())) { + esd_port_ = esd_port; + ret = true; + } + + return (ret); } void PulseManager::restart () { diff --git a/src/pulsemanager.h b/src/pulsemanager.h index ec5e27c..3dbd94f 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -52,8 +52,8 @@ class PulseManager: public QObject { std::uint16_t get_pulse_port (); std::uint16_t get_esd_port (); - void set_pulse_port (std::uint16_t pulse_port); - void set_esd_port (std::uint16_t esd_port); + bool set_pulse_port (std::uint16_t pulse_port); + bool set_esd_port (std::uint16_t esd_port); public slots: -- 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 89c439e969b5bc05784f700428230f01b8538e98 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 01:03:00 2015 +0100 pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 34 +++++++++++++++++++++++++++++++++- src/pulsemanager.h | 7 +++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0720ee5..1b5170c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -256,6 +256,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium number. - pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. + - pulsemanager.{cpp,h}: add record and playback private members, as well + as getters and setters. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 7ffdfcf..ea8124e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -39,7 +39,9 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_version_major_ (0), pulse_version_minor_ (0), pulse_version_micro_ (0), - pulse_version_misc_ ("") { + pulse_version_misc_ (""), + record_ (true), + playback_ (true) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); @@ -554,6 +556,14 @@ std::uint16_t PulseManager::get_esd_port () { return (esd_port_); } +bool PulseManager::get_record () { + return (record_); +} + +bool PulseManager::get_playback () { + return (playback_); +} + bool PulseManager::set_pulse_port (std::uint16_t pulse_port) { bool ret = false; @@ -576,6 +586,28 @@ bool PulseManager::set_esd_port (std::uint16_t esd_port) { return (ret); } +bool PulseManager::set_record (bool record) { + bool ret = false; + + if (!(is_server_running ())) { + record_ = record; + ret = true; + } + + return (ret); +} + +bool PulseManager::set_playback (bool playback) { + bool ret = false; + + if (!(is_server_running ())) { + playback_ = playback; + ret = true; + } + + return (ret); +} + void PulseManager::restart () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 3dbd94f..57b80bd 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -51,9 +51,13 @@ class PulseManager: public QObject { std::uint16_t get_pulse_port (); std::uint16_t get_esd_port (); + bool get_record (); + bool get_playback (); bool set_pulse_port (std::uint16_t pulse_port); bool set_esd_port (std::uint16_t esd_port); + bool set_record (bool record); + bool set_playback (bool playback); public slots: @@ -113,6 +117,9 @@ class PulseManager: public QObject { std::uint32_t pulse_version_minor_; std::uint32_t pulse_version_micro_; QString pulse_version_misc_; + + bool record_; + bool playback_; }; #ifdef NDEBUG_DEFINE -- 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 ec8830b426d91bc3c3717cfe750ec0c9f8899a9f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 01:41:54 2015 +0100 pulsemanager.cpp: reorder member variables in initializer list. --- debian/changelog | 1 + src/pulsemanager.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1b5170c..15b01cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -258,6 +258,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium not currently running. - pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. + - pulsemanager.cpp: reorder member variables in initializer list. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ea8124e..b3235a0 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -27,15 +27,15 @@ #define DEBUG #endif // defined (NDEBUG) -PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), +PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), + pulse_X2Go_ ("/.x2go/pulse"), + server_binary_ (QString ("")), + server_working_dir_ (QString ("")), + server_args_ (QStringList ()), pulse_server_ (NULL), + state_ (QProcess::NotRunning), pulse_port_ (4713), esd_port_ (4714), - state_ (QProcess::NotRunning), - app_dir_ (QApplication::applicationDirPath ()), - server_args_ (QStringList ()), - server_binary_ (QString ("")), - server_working_dir_ (QString ("")), pulse_version_major_ (0), pulse_version_minor_ (0), pulse_version_micro_ (0), -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b8b84f7e8fca9c6e84d2565f344aab846b3edf5d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 01:46:04 2015 +0100 pulsemanager.cpp: fix compile error in startup sound function. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 15b01cb..9e16fe1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -259,6 +259,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. - pulsemanager.cpp: reorder member variables in initializer list. + - pulsemanager.cpp: fix compile error in startup sound function. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index b3235a0..63ebf11 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -196,7 +196,7 @@ void PulseManager::fetch_pulseaudio_version () { tmp_server.start (server_binary_, args); /* Wait until the process exited again. */ - if (tmp_server->waitForFinished ()) { + if (tmp_server.waitForFinished ()) { /* Read stdout and split it up on newlines. */ QByteArray ba = pulse_server_->readAllStandardOutput (); QString stdout_data (ba.data ()); -- 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 712db791308df0af6a2e247d7bd53229530a83dd Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 02:11:16 2015 +0100 pulsemanager.h: more moving around. --- debian/changelog | 1 + src/pulsemanager.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9e16fe1..6f59385 100644 --- a/debian/changelog +++ b/debian/changelog @@ -260,6 +260,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium as getters and setters. - pulsemanager.cpp: reorder member variables in initializer list. - pulsemanager.cpp: fix compile error in startup sound function. + - pulsemanager.h: more moving around. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 57b80bd..6d94e34 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -102,11 +102,11 @@ class PulseManager: public QObject { QString app_dir_; QString pulse_X2Go_; QDir pulse_dir_; - QStringList server_args_; QString server_binary_; QString server_working_dir_; QProcessEnvironment env_; + QStringList server_args_; QProcess *pulse_server_; QProcess::ProcessState state_; -- 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 f6ccf5f68e35b62a19af78ec90523b1408a809e5 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 02:12:59 2015 +0100 pulsemanager.cpp: use record and playback member variables. --- debian/changelog | 1 + src/pulsemanager.cpp | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6f59385..315aa66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -261,6 +261,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: reorder member variables in initializer list. - pulsemanager.cpp: fix compile error in startup sound function. - pulsemanager.h: more moving around. + - pulsemanager.cpp: use record and playback member variables. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 63ebf11..25f8f50 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -366,13 +366,8 @@ bool PulseManager::find_port (bool search_esd) { 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); @@ -395,9 +390,22 @@ bool PulseManager::generate_server_config () { // FIXME Linux #endif // defined (Q_OS_DARWIN) - if (disable_input) - config_tmp_file_stream << " record=0"; + config_tmp_file_stream << " record="; + if (!record_) { + config_tmp_file_stream << "0"; + } + else { + config_tmp_file_stream << "1"; + } + config_tmp_file_stream << endl; + config_tmp_file_stream << " playback="; + if (!playback_) { + config_tmp_file_stream << "0"; + } + else { + config_tmp_file_stream << "1"; + } config_tmp_file_stream << endl; QFile config_file (config_file_name); -- 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 4decb750a97c3475be104cf77461e3035d369ece Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 02:14:10 2015 +0100 pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 315aa66..0881e96 100644 --- a/debian/changelog +++ b/debian/changelog @@ -262,6 +262,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: fix compile error in startup sound function. - pulsemanager.h: more moving around. - pulsemanager.cpp: use record and playback member variables. + - pulsemanager.cpp: cleanup, don't use copy assignment operator when we + just need to construct a new object. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 25f8f50..9a70e5d 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -188,7 +188,7 @@ void PulseManager::start_linux () { } void PulseManager::fetch_pulseaudio_version () { - QStringList args = "--version"; + QStringList args (QString ("--version")); QProcess tmp_server (this); /* Start PA with --version argument. */ @@ -198,7 +198,7 @@ void PulseManager::fetch_pulseaudio_version () { /* Wait until the process exited again. */ if (tmp_server.waitForFinished ()) { /* Read stdout and split it up on newlines. */ - QByteArray ba = pulse_server_->readAllStandardOutput (); + QByteArray ba (pulse_server_->readAllStandardOutput ()); QString stdout_data (ba.data ()); QStringList stdout_list (stdout_data.split ("\n")); @@ -364,7 +364,7 @@ bool PulseManager::find_port (bool search_esd) { } bool PulseManager::generate_server_config () { - QString config_file_name = pulse_dir_.absolutePath () + "/config.pa"; + QString config_file_name (pulse_dir_.absolutePath () + "/config.pa"); QTemporaryFile config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); bool ret = false; @@ -482,8 +482,8 @@ void PulseManager::create_client_dir () { void PulseManager::slot_play_startup_sound () { #ifdef DEBUG QProcess play_file (0); - QString play_file_binary = QString (app_dir_); - QString play_file_file = play_file_binary; + QString play_file_binary (app_dir_); + QString play_file_file (play_file_binary); #ifdef Q_OS_DARWIN play_file_binary += "/../exe/paplay"; @@ -493,8 +493,7 @@ void PulseManager::slot_play_startup_sound () { playFileFile += "/startup.wav"; #endif // defined (Q_OS_DARWIN) - QStringList args; - args << play_file_file; + QStringList args (play_file_file); play_file.setWorkingDirectory (server_working_dir_); play_file.setProcessEnvironment (env_); play_file.start (play_file_binary, args); @@ -508,7 +507,7 @@ 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 (); + QByteArray ba (pulse_server_->readAllStandardOutput ()); char *data = ba.data (); std::cout << data; ba = pulse_server_->readAllStandardError (); -- 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 04927c999d0e7726b3bf0b994fd040dd674a2d8d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 31 22:54:47 2016 +0200 pulsemanager.cpp: remove config.pa while doing post-exit cleanups. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index de7a74b..2135318 100644 --- a/debian/changelog +++ b/debian/changelog @@ -267,6 +267,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. - macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". + - pulsemanager.cpp: remove config.pa while doing post-exit cleanups. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9a70e5d..0d20ed1 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -524,6 +524,14 @@ void PulseManager::on_pulse_finished (int exit_code) { + "/pulse-pulseuser"); #endif // defined (Q_OS_WIN) +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + // Remove server config file, otherwise the directory won't be empty. + work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/config.pa").absolutePath ())); +#else // Linux + // FIXME. +#endif + work_dir.rmdir (pulse_dir_.absolutePath ()); state_ = QProcess::NotRunning; -- 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 639e5e226dd62fb2c1654138a9cd068d77e29200 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 31 21:11:46 2016 +0200 macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0881e96..da08688 100644 --- a/debian/changelog +++ b/debian/changelog @@ -264,6 +264,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: use record and playback member variables. - pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. + - macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index c95955e..eb128c0 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -177,7 +177,7 @@ NXPROXY="nxproxy" PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" "pamon" "paplay" "parec" "parecord" "pasuspender" ) PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" - "pulse-6.0" + "pulse-8.0" "pulseaudio" ) typeset -a special_files_regex -- 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 0a750a903631c6bd3e231e1a894bc19783ebb47a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 31 22:21:37 2016 +0200 macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". --- debian/changelog | 2 ++ macbuild.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index da08688..de7a74b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -265,6 +265,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. - macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. + - macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio + subdirectory now, adding it to "special files workaround". [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index eb128c0..d5aadfe 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -181,7 +181,8 @@ PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" "pulseaudio" ) typeset -a special_files_regex -special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) +special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" + "pulseaudio/libpulsecore-[0-9]\.[0-9]\.dylib" ) typeset -r dependency_base_format='@executable_path/../Frameworks/' -- 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 59f0ab1482d32313f74394e77e4f05cd72727f8e Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 00:55:28 2016 +0200 src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 4 ++++ src/pulsemanager.h | 1 + 3 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2135318..6abae14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -268,6 +268,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". - pulsemanager.cpp: remove config.pa while doing post-exit cleanups. + - src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the + (OS-dependent) PulseAudio config and cookie directory. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 0d20ed1..4ac7ba5 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -579,6 +579,10 @@ bool PulseManager::get_playback () { return (playback_); } +QDir PulseManager::get_pulse_dir () { + return (pulse_dir_); +} + bool PulseManager::set_pulse_port (std::uint16_t pulse_port) { bool ret = false; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 6d94e34..af7ae77 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -53,6 +53,7 @@ class PulseManager: public QObject { std::uint16_t get_esd_port (); bool get_record (); bool get_playback (); + QDir get_pulse_dir (); bool set_pulse_port (std::uint16_t pulse_port); bool set_esd_port (std::uint16_t esd_port); -- 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 ac3dc22ec356626370d31d7619e787747254dd2f Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 01:17:09 2016 +0200 src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6abae14..40b2380 100644 --- a/debian/changelog +++ b/debian/changelog @@ -270,6 +270,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: remove config.pa while doing post-exit cleanups. - src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. + - src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones + depending on the detected PA version. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 4ac7ba5..9f57525 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -152,7 +152,11 @@ void PulseManager::start_osx () { << "-F" << pulse_dir_.absolutePath () + "/config.pa" << "-p" << QDir (app_dir_ - + "/../Frameworks/pulse-2.0/modules").absolutePath () + + "/../Frameworks/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules").absolutePath () << "--high-priority"; #ifdef DEBUG server_args_ << "--log-level=debug"; @@ -170,8 +174,11 @@ void PulseManager::start_win () { server_args_ << "--exit-idle-time=-1" << "-n" << "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + "/config.pa").absolutePath ()) - << "-p" << QDir::toNativeSeparators (QDir (app_dir_ + "/pulse/lib/pulse-1.1/" - + "modules/").absolutePath ()); + << "-p" << QDir::toNativeSeparators (QDir (app_dir_ + "/pulse/lib/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules/").absolutePath ()); #ifdef DEBUG server_args_ << "--log-level=debug"; #endif // defined (DEBUG) -- 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 617081f27f6cd07211604a3ca8c2a76e4aba279f Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 01:39:02 2016 +0200 src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) --- debian/changelog | 1 + src/pulsemanager.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 40b2380..4b3912c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -272,6 +272,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium (OS-dependent) PulseAudio config and cookie directory. - src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. + - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9f57525..03e321f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -159,7 +159,9 @@ void PulseManager::start_osx () { + "/modules").absolutePath () << "--high-priority"; #ifdef DEBUG - server_args_ << "--log-level=debug"; + server_args_ << "--log-level=debug" + << "--verbose" + << "--log-target=file:" pulse_dir_.absolutePath () + "/pulse.log"; #endif // defined (DEBUG) if (generate_server_config () && generate_client_config ()) { @@ -180,7 +182,10 @@ void PulseManager::start_win () { + QString::number (pulse_version_minor_) + "/modules/").absolutePath ()); #ifdef DEBUG - server_args_ << "--log-level=debug"; + /* FIXME: need a way to request debugging. */ + server_args_ << "--log-level=debug" + << "--verbose" + << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; #endif // defined (DEBUG) if (generate_server_config () && generate_client_config ()) { @@ -535,6 +540,8 @@ void PulseManager::on_pulse_finished (int exit_code) { // Remove server config file, otherwise the directory won't be empty. work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + "/config.pa").absolutePath ())); + work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/pulse.log").absolutePath ())); #else // Linux // FIXME. #endif -- 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 0bedbd5ef7623c162c42ef4e2c81f9bf94f389ae Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 01:47:43 2016 +0200 src/pulsemanager.cpp: backport fix for 526. --- debian/changelog | 1 + src/pulsemanager.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4b3912c..d209358 100644 --- a/debian/changelog +++ b/debian/changelog @@ -273,6 +273,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) + - src/pulsemanager.cpp: backport fix for 526. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 03e321f..c8fc7cd 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -19,6 +19,7 @@ #include <unistd.h> #include <stdlib.h> +#include <QSysInfo> #include "pulsemanager.h" @@ -188,6 +189,24 @@ void PulseManager::start_win () { << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; #endif // defined (DEBUG) + /* + * Fix for x2goclient bug #526. + * Works around PulseAudio bug #80772. + * Tested with PulseAudio 5.0. + * This argument will not cause PulseAudio 0.9.6 or 1.1 (the legacy versions) + * to fail to launch. + * However, 0.9.6 defaults to normal priority anyway, + * and 1.1 ignores it for some reason. + * So yes, the fact that 1.1 ignores it would be a bug in x2goclient if we + * ever ship 1.1 again. + */ + if ((QSysInfo::WindowsVersion == QSysInfo::WV_XP) || (QSysInfo::WindowsVersion == QSysInfo::WV_2003)) { + x2goDebug << "Windows XP or Server 2003 (R2) detected." + << "Setting PulseAudio to \"normal\" CPU priority."; + + server_args_ << "--high-priority=no"; + } + if (generate_server_config () && generate_client_config ()) { create_client_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 d73fc1f89c2fcf170e96310f6ade8bdd0418cec9 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 02:16:49 2016 +0200 src/pulsemanager.cpp: backport fix for 422. --- debian/changelog | 1 + src/pulsemanager.cpp | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d209358..50b0685 100644 --- a/debian/changelog +++ b/debian/changelog @@ -274,6 +274,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium depending on the detected PA version. - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) - src/pulsemanager.cpp: backport fix for 526. + - src/pulsemanager.cpp: backport fix for 422. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index c8fc7cd..fb0d5eb 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -403,7 +403,29 @@ bool PulseManager::generate_server_config () { QTextStream config_tmp_file_stream (&config_tmp_file); config_tmp_file_stream << "load-module module-native-protocol-tcp port=" - + QString::number (pulse_port_) << endl; + + QString::number (pulse_port_); + + /* + * Reference: + * http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modul... + * + * Setting auth-cookie fixes bug #422. + * + * PulseAudio 6.0 changed the path that auth-cookie is relative to, so + * Tanu Kaskinen recommended we specify the absolute path instead. + * The absolute path works with at least 5.0 and 6.0. + */ + if (pulse_version_major_ > 2) { + QString tmp_auth_cookie = QDir::toNativeSeparators (wapiShortFileName (pulse_dir_.absolutePath ())) + + "\\.pulse-cookie"; + + /* Double backslashes are required in config.pa. */ + tmp_auth_cookie.replace ("\\", "\\\\"); + + config_tmp_file_stream << " auth-cookie=" + tmp_auth_cookie; + } + + config_tmp_file_stream << endl; #ifdef Q_OS_UNIX config_tmp_file_stream << "load-module module-native-protocol-unix" << 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 34dbda2303cc68e74d11fd00a9c980b44d7eb454 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 29 02:00:42 2016 +0200 src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) --- debian/changelog | 2 ++ src/configdialog.cpp | 31 ++++++++++++++++--------------- src/configdialog.h | 4 ++-- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index 50b0685..bced624 100644 --- a/debian/changelog +++ b/debian/changelog @@ -275,6 +275,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) - src/pulsemanager.cpp: backport fix for 526. - src/pulsemanager.cpp: backport fix for 422. + - src/configdialog.{cpp,h}: add "no record" support for OS X (through + PulseManager.) [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 2f70a13..93c0225 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -352,18 +352,16 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f ) tabWidg->addTab(xsetWidg, tr("X.Org Server settings")); #endif -#ifdef Q_OS_WIN - QFrame* frp=new QFrame(this); - tabWidg->addTab(frp, tr("Pulseaudio settings")); - QVBoxLayout* l=new QVBoxLayout(frp); - cbNoRecord=new QCheckBox(tr("Disable audio input"),frp); - QLabel* lw=new QLabel(tr("<font size=\"5\">You must restart the X2Go Client for the changes to take effect</font><br><br>"),frp); - lw->setWordWrap(true); - l->addWidget(lw); - l->addWidget(cbNoRecord); - l->addStretch(1); - cbNoRecord->setChecked ( st.setting()->value ( "pulse/norecord", false ).toBool() ); -#endif +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + QFrame* frp = new QFrame (this); + tabWidg->addTab (frp, tr ("PulseAudio settings")); + QVBoxLayout* l = new QVBoxLayout (frp); + cbNoRecord = new QCheckBox (tr ("Disable sound input"), frp); + lw->setWordWrap (true); + l->addWidget (cbNoRecord); + l->addStretch (1); + cbNoRecord->setChecked (st.setting ()->value ("pulse/norecord", false).toBool ()); +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ } @@ -381,9 +379,9 @@ void ConfigDialog::slot_accepted() st.setting()->setValue ( "trayicon/mincon", cbMinimizeTray->isChecked() ); st.setting()->setValue ( "trayicon/maxdiscon", cbMaxmizeTray->isChecked() ); #endif -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) st.setting()->setValue ( "pulse/norecord", cbNoRecord->isChecked() ); -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ #ifdef USELDAP if ( !embedMode ) { @@ -661,12 +659,15 @@ void ConfigDialog::slotDefaults() cbNoRecord->setChecked(false); } break; -#endif +#endif /* defined (Q_OS_WIN) */ case 0: { if ( embedMode ) cbStartEmbed->setChecked ( true ); clientSshPort->setValue ( 22 ); +#ifdef Q_OS_DARWIN + cbNoRecord->setChecked (false); +#endif /* defined (Q_OS_DARWIN) */ #ifndef CFGPLUGIN gbTrayIcon->setChecked (false); cbMinimizeTray->setChecked (false); diff --git a/src/configdialog.h b/src/configdialog.h index e9b6582..5b55454 100644 --- a/src/configdialog.h +++ b/src/configdialog.h @@ -93,9 +93,9 @@ private: XSettingsWidget* xsetWidg; #endif -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) QCheckBox *cbNoRecord; -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ QGroupBox *gbTrayIcon; QCheckBox *cbMinimizeTray; -- 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 b058a2a8b7b4d61eea85ab1891addb392ddebb3d Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 29 02:08:03 2016 +0200 src/configdialog.cpp: whitespace only. --- debian/changelog | 1 + src/configdialog.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index bced624..8e6e05b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -277,6 +277,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: backport fix for 422. - src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) + - src/configdialog.cpp: whitespace only. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 93c0225..2dfcf397 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -263,6 +263,7 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f ) sshLay->addStretch(); frLay->addLayout ( sshLay ); #endif + if ( embedMode ) { cbStartEmbed=new QCheckBox ( @@ -415,6 +416,7 @@ void ConfigDialog::slot_accepted() st.setting()->setValue ( "clientport", ( QVariant ) clientSshPort->value() ); #endif + pwid->saveSettings(); if ( embedMode ) { -- 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 84d802958e4aa34c3db3581a75cc96b3ea16c2d3 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:23:07 2016 +0200 src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. --- debian/changelog | 2 + src/onmainwindow.cpp | 349 ++++++++++++++------------------------------------ src/onmainwindow.h | 38 +++--- 3 files changed, 117 insertions(+), 272 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8e6e05b..3034a4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -278,6 +278,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) - src/configdialog.cpp: whitespace only. + - src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and + Windows. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index c5f0798..c632a93 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -148,10 +148,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN clientSshPort="7022"; - pulsePort=4713; - pulseStarted=false; X2goSettings st ( "settings" ); - pulseNoRecord=st.setting()->value ( "pulse/norecord", false ).toBool(); winSshdStarted=false; #else userSshd=false; @@ -174,7 +171,6 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN pulseVersionTest=0l; - pulseServer=0l; xorg=0l; xDisplay=0; #endif @@ -462,6 +458,10 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) QTimer::singleShot ( 500, this, SLOT ( startWinServers() ) ); #endif + /* FIXME: add Linux. */ +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + QTimer::singleShot (500, this, SLOT (pulseManagerWrapper ())); +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ mainL->setSpacing ( 0 ); mainL->setMargin ( 0 ); @@ -1488,24 +1488,6 @@ void ONMainWindow::closeClient() } #endif #ifdef Q_OS_WIN - if ( pulseServer && pulseStarted ) - { - x2goDebug<<"Deleting the pulse timer ..."; - delete pulseTimer; - x2goDebug<<"Deleted the pulse timer."; - x2goDebug<<"Killing the PulseAudio sound server ..."; - pulseServer->kill(); - x2goDebug<<"Killed the PulseAudio sound server."; - x2goDebug<<"Deleting the PulseAudio process ..."; - delete pulseServer; - x2goDebug<<"Deleted the PulseAudio process."; - - QDir dr ( homeDir ); - dr.remove ( pulseDir+"/config.pa" ); - dr.remove ( pulseDir+"/pulse-pulseuser/pid" ); - dr.rmdir ( pulseDir+"/pulse-pulseuser" ); - dr.rmdir ( pulseDir ); - } if ( xorg ) { x2goDebug<<"Terminating the X.Org Server ..."; @@ -1522,7 +1504,20 @@ void ONMainWindow::closeClient() CloseHandle ( sshd.hProcess ); CloseHandle ( sshd.hThread ); } -#else +#endif /* defined (Q_OS_WIN) */ + +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + if (pulseManager) { + delete (pulseManager); + + pulseManagerThread->quit (); + pulseManagerThread->wait (); + + delete (pulseManagerThread); + } +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + +#ifndef (Q_OS_WIN) if ( userSshd && sshd ) { x2goDebug<<"Terminating the OpenSSH server ..."; @@ -1530,8 +1525,8 @@ void ONMainWindow::closeClient() x2goDebug<<"Terminated the OpenSSH server."; delete sshd; } +#endif /* !defined (Q_OS_WIN) */ -#endif if ( embedMode ) { passForm->close(); @@ -2147,11 +2142,31 @@ void ONMainWindow::slotConfig() delete ld; ld=0; +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + bool oldDisableInput = false; + { + X2goSettings st ("settings"); + oldDisableInput = st.setting ()->value ("pulse/norecord", + (QVariant) false).toBool (); + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ + ConfigDialog dlg ( this ); if ( dlg.exec() ==QDialog::Accepted ) { int i; +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + X2goSettings st ("settings"); + bool newDisableInput = st.setting ()->value ("pulse/norecord", + (QVariant) false).toBool (); + + if (oldDisableInput != newDisableInput) { + pulseManager->set_record (!newDisableInput); + pulseManager->restart (); + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ + if ( passForm->isVisible() && !embedMode ) slotClosePass(); if ( sessionStatusDlg->isVisible() || embedMode ) @@ -5013,9 +5028,9 @@ void ONMainWindow::slotRetResumeSess ( bool result, bool sound=true; int sndSystem=PULSE; QString sndPort; -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) sndPort="4713"; -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ bool startSoundServer=true; bool sshSndTunnel=true; @@ -5052,9 +5067,9 @@ void ONMainWindow::slotRetResumeSess ( bool result, sndSystem=ARTS; if ( sndsys=="esd" ) sndSystem=ESD; -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) sndPort=st->setting()->value ( sid+"/sndport" ).toString(); -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ startSoundServer=st->setting()->value ( sid+"/startsoundsystem", true ).toBool(); @@ -5065,7 +5080,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, } -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) bool defPort=st->setting()->value ( sid+ "/defsndport",true ).toBool(); if ( defPort ) @@ -5080,25 +5095,24 @@ void ONMainWindow::slotRetResumeSess ( bool result, break; } } -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ sshSndTunnel=st->setting()->value ( sid+"/soundtunnel", true ).toBool(); -#ifdef Q_OS_WIN - switch ( sndSystem ) - { - case PULSE: - if(!pulseStarted && sound) - { - startPulsed(); - } - sndPort=QString::number ( pulsePort ); - break; - case ESD: - sndPort=QString::number ( esdPort ); - break; +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + if ((sound) && (!(pulseManager->is_server_running ()))) { + pulseManager->start (); } -#endif + + switch (sndSystem) { + case PULSE: + sndPort = QString::number (pulseManager->getPulsePort ()); + break; + case ESD: + sndPort = QString::number (pulseManager->getEsdPort ()); + break; + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ delete st; @@ -5309,7 +5323,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, } else { -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) if ( QFile::exists(homeDir+"/.config/pulse/cookie") ) { pulsecookie_filename = homeDir+"/.config/pulse/cookie"; } @@ -5323,49 +5337,37 @@ void ONMainWindow::slotRetResumeSess ( bool result, resumingSession.sessionId+ "/.pulse-cookie", this, SLOT ( slotPCookieReady ( bool, QString,int ))); } -#else - QString cooFile= - wapiShortFileName ( homeDir ) + - "/.x2go/pulse/.pulse-cookie"; +#else /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ + QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir () + + "/.pulse-cookie").absolutePath ()); QString destFile="$HOME/.x2go/C-"+ resumingSession.sessionId+ "/.pulse-cookie"; sshConnection->copyFile(cooFile, destFile, this, SLOT ( slotPCookieReady ( bool, QString,int ))); parecTunnelOk=true; -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ } } if ( sndSystem==ESD ) { -#ifndef Q_OS_WIN +#ifdef Q_OS_LINUX sshConnection->copyFile(homeDir+"/.esd_auth", "$HOME/.esd_auth" ); -#else - QString cooFile= - wapiShortFileName ( homeDir ) + - "/.x2go/pulse/.esd_auth"; +#else /* defined (Q_OS_LINUX) */ + QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir () + + "/.esd_auth").absolutePath ()); QString destFile="$HOME/.esd_auth"; sshConnection->copyFile(cooFile, destFile ); - -#endif +#endif /* defined (Q_OS_LINUX) */ } -#ifndef Q_OS_WIN +/* Windows and Darwin are covered by PulseManager. */ +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) if ( startSoundServer ) { soundServer=new QProcess ( this ); QString acmd="artsd",ecmd="esd"; -#ifdef Q_OS_DARWIN - QStringList env = soundServer->environment(); - QDir dir ( appDir ); - dir.cdUp(); - dir.cd ( "esd" ); - env.insert ( 0,"DYLD_LIBRARY_PATH="+ - dir.absolutePath() ); - soundServer->setEnvironment ( env ); - ecmd="\""+dir.absolutePath() +"\"/esd"; -#endif //Q_OS_DARWIN if ( sndSystem==ESD ) soundServer->start ( ecmd+ @@ -5376,11 +5378,11 @@ void ONMainWindow::slotRetResumeSess ( bool result, resumingSession.sndPort ); sndPort=resumingSession.sndPort; } -#endif //Q_OS_WIN +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ if ( sshSndTunnel ) { const char* okSlot=0; -#ifdef Q_OS_WIN +#ifdef Q_OS_WIN /* FIXME: Do we need explicit parec support in PulseManager? */ if ( sndSystem==PULSE ) { parecTunnelOk=false; @@ -6514,6 +6516,29 @@ x2goSession ONMainWindow::getNewSessionFromString ( const QString& string ) return s; } +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) +void ONMainWindow::pulseManagerWrapper () { +#ifdef Q_OS_WIN + if (!embedMode || !config.confSnd || + (config.confSnd && config.useSnd)) +#endif /* defined (Q_OS_WIN) */ + { + pulseManagerThread = new QThread (0); + pulseManager = new PulseManager (); + + pulseManager->moveToThread (pulseManagerThread); + + /* + * Spawn PulseManager::start() once the thread started up successfully. + * Another means of doing that would be via + * QMetaObject::invokeMethod (pulseManager, "start", Qt::QueuedConnection); + */ + connect (pulseManagerThread, SIGNAL (started ()), pulseManager, SLOT (start ())); + + pulseManagerThread->start (); + } +} +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ void ONMainWindow::slotAppDialog() { @@ -10083,15 +10108,11 @@ void ONMainWindow::startWinServers() QString etcDir=homeDir+"/.x2go/etc"; QDir dr ( homeDir ); - pulseServer=0l; - WinServerStarter* xStarter = new WinServerStarter ( WinServerStarter::X, this ); WinServerStarter* sshStarter = new WinServerStarter ( WinServerStarter::SSH, this ); - - if ( !embedMode || !config.confFS || ( config.confFS && config.useFs ) ) { @@ -10100,14 +10121,7 @@ void ONMainWindow::startWinServers() generateEtcFiles(); sshStarter->start(); } - if(embedMode) - { - if ( !config.confSnd || - ( config.confSnd && config.useSnd ) ) - { - startPulsed(); - } - } + // #ifdef CFGCLIENT //x2goDebug<<"Xorg settings: "<< startXorgOnStart <<" useXming: "<< useXming; @@ -10181,177 +10195,6 @@ void ONMainWindow::removeCygwinEntry() } -void ONMainWindow::startPulsed() -{ -#ifdef Q_OS_WIN - if(pulseStarted) - { - return; - } - pulseVersionTest=new QProcess ( 0 ); - pulseVersionTest->start ( "pulse\\pulseaudio.exe --version" ); - - pulseVersionTest->waitForFinished(); - QString pulseVersionLine= - pulseVersionTest->readAllStandardOutput().replace("\n"," ").simplified(); - - x2goDebug <<"PulseAudio version line: "<<pulseVersionLine; - if (pulseVersionLine.contains("pulseaudio 0.", Qt::CaseInsensitive)) - pulseVersionIsLegacy = true; - if (pulseVersionLine.contains("pulseaudio 1.", Qt::CaseInsensitive)) - pulseVersionIsLegacy = true; - if (pulseVersionLine.contains("pulseaudio 2.", Qt::CaseInsensitive)) - pulseVersionIsLegacy = true; - - if (pulseVersionIsLegacy) - { - x2goDebug <<"PulseAudio <= 2.1 detected. PulseAudio will automatically use .pulse-cookie"; - } - else - { - x2goDebug <<"PulseAudio >= 3.0 detected. X2Go Client will tell PulseAudio to use .pulse-cookie."; - } -#endif - while ( isServerRunning ( pulsePort ) ) - ++pulsePort; - esdPort=pulsePort+1; - while ( isServerRunning ( esdPort ) ) - ++esdPort; - - // The permanent dir for the pulse auth cookie - pulseBaseDir=homeDir+"/.x2go/pulse"; - QDir dr ( homeDir ); - dr.mkpath ( pulseBaseDir ); - - // The tempoerary dir for config.pa (and pulse.log if it exists) - pulseDir=pulseBaseDir; - pulseDir=wapiShortFileName ( pulseDir ); - x2goDebug<<"PulseAudio template: "<<pulseDir+"/tmp"; - QTemporaryFile* fl=new QTemporaryFile ( pulseDir+"/tmp" ); - fl->open(); - pulseDir=fl->fileName(); - fl->close(); - delete fl; - QFile::remove ( pulseDir ); - dr.mkpath ( pulseDir ); - - x2goDebug<<"PulseAudio tmp file: "<<pulseDir; - - QStringList pEnv=QProcess::systemEnvironment(); - for ( int i=0; i<pEnv.size(); ++i ) - { - if ( pEnv[i].indexOf ( "USERPROFILE=" ) !=-1 ) - pEnv[i]="USERPROFILE="+ - QDir::toNativeSeparators( wapiShortFileName( pulseBaseDir )); - if ( pEnv[i].indexOf ( "TEMP=" ) !=-1 ) - pEnv[i]="TEMP="+pulseDir; - if ( pEnv[i].indexOf ( "USERNAME=" ) !=-1 ) - pEnv[i]="USERNAME=pulseuser"; - } - - QFile file ( pulseDir+"/config.pa" ); - if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) ) - return; - QTextStream out ( &file ); - /* - Reference: - http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modul... - - Setting auth-cookie fixes bug #422 - - PulseAudio 6.0 changed the path that auth-cookie is relative to, so - Tanu Kaskinen recommended we specify the absolute path instead. - The abs path works with at least 5.0 and 6.0 - */ - if (pulseVersionIsLegacy) - { - out << "load-module module-native-protocol-tcp port="+ - QString::number ( pulsePort ) <<endl; - } - else - { - pulseCookieArg="auth-cookie="+ - QDir::toNativeSeparators (wapiShortFileName( pulseBaseDir))+ - "\\.pulse-cookie"; - // Double backslashes are required in config.pa - pulseCookieArg.replace("\\", "\\\\"); - out << "load-module module-native-protocol-tcp port="+ - QString::number ( pulsePort )+" "+pulseCookieArg <<endl; - } - out << "load-module module-esound-protocol-tcp port="+ - QString::number ( esdPort ) <<endl; - out << "load-module module-waveout"; -#ifdef Q_OS_WIN - if(pulseNoRecord) - out << " record=0"; -#endif - out << endl; - file.close(); - pulseServer=new QProcess ( 0 ); - pulseServer->setEnvironment ( pEnv ); - pulseArgs.clear(); -#ifdef Q_OS_WIN - // FIXME: Explain why this dir needs to be created. - pulseRuntimeDir=pulseBaseDir+"/.pulse/"+QHostInfo::localHostName ()+"-runtime"; - QDir drr(pulseRuntimeDir); - if (!drr.exists()) - drr.mkpath(drr.path()); - if (QFile::exists(pulseRuntimeDir+"/pid")) - QFile::remove(pulseRuntimeDir+"/pid"); - - pulseDir=QDir::toNativeSeparators( pulseDir ); - pulseArgs<<"--exit-idle-time=-1"<<"-n"<<"-F"<<pulseDir+"\\config.pa"; - if (debugging) - pulseArgs<<"--log-level=debug"<<"--verbose"<<"--log-target=file:"+pulseDir+"\\pulse.log"; - /* - Fix for x2goclient bug #526. - Works Around PulseAudio bug #80772. - Tested with PulseAudio 5.0. - This argument will not cause PulseAudio 0.9.6 or 1.1 (the legacy versions) - to fail to launch. - However, 0.9.6 defaults to normal priority anyway, - and 1.1 ignores it for some reason. - So yes, the fact that 1.1 ignores it would be a bug in x2goclient if we - ever ship 1.1 again. - */ - if (QSysInfo::WindowsVersion == QSysInfo::WV_XP || - QSysInfo::WindowsVersion == QSysInfo::WV_2003 ) - { - x2goDebug<<"Windows XP or Server 2003 (R2) detected."; - x2goDebug<<"Setting PulseAudio to \"normal\" CPU priority."; - pulseArgs<<"--high-priority=no"; - } -#else - pulseArgs<<"--exit-idle-time=-1"<<"-n"<<"-F"<<pulseDir+"/config.pa"; -#endif - pulseServer->setWorkingDirectory ( QDir::toNativeSeparators ( - wapiShortFileName ( appDir+"/pulse/" ) ) ); - pulseServer->start ( "pulse\\pulseaudio.exe",pulseArgs ); - - x2goDebug<<"Starting pulse\\pulseaudio.exe "<<pulseArgs.join ( " " ) << - " working dir: "<< - QDir::toNativeSeparators ( wapiShortFileName ( appDir+"/pulse" ) ); - - pulseTimer=new QTimer(this); - - connect (pulseTimer, SIGNAL(timeout()), this, SLOT(slotCheckPulse())); - x2goDebug<<"Connected timer."; - pulseTimer->start(2000); - pulseStarted=true; -} - -void ONMainWindow::slotCheckPulse() -{ - //restart pulse server - if(pulseServer->state()!=QProcess::Running) - { - pulseServer->start ( "pulse\\pulseaudio.exe",pulseArgs ); - - x2goDebug<<"Restarting pulse\\pulseaudio.exe "<<pulseArgs.join ( " " ); - - } -} - // #ifdef CFGCLIENT void ONMainWindow::xorgSettings() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 45c096d..1fb1e8e 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -52,6 +52,11 @@ #include <windows.h> #include <QSysInfo> #endif + +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) +#include "pulsemanager.h" +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + /** @author Oleksandr Shneyder */ @@ -248,7 +253,7 @@ class ONMainWindow; class WinServerStarter: public QThread { public: - enum daemon {X,SSH,PULSE}; + enum daemon {X,SSH}; WinServerStarter ( daemon server, ONMainWindow * par ); void run(); private: @@ -584,7 +589,6 @@ public: #ifdef Q_OS_WIN static QString cygwinPath ( const QString& winPath ); void startXOrg(); - void startPulsed(); static bool haveCygwinEntry(); static void removeCygwinEntry(); static QString U3DevicePath() @@ -840,14 +844,7 @@ private: PROCESS_INFORMATION sshd; bool winSshdStarted; static QString u3Device; - bool pulseStarted; - - QString pulseVersionTestOutput; - QProcess* pulseVersionTest; - bool pulseVersionIsLegacy; - QProcess* pulseServer; - QStringList pulseArgs; - QTimer* pulseTimer; + int xDisplay; int sshdPort; bool winServersReady; @@ -857,14 +854,6 @@ private: bool cyEntry; - QString pulseDir; - QString pulseBaseDir; - QString pulseRuntimeDir; - QString pulseCookieArg; - int pulsePort; - bool pulseNoRecord; - - int esdPort; bool maximizeProxyWin; int proxyWinWidth; int proxyWinHeight; @@ -877,6 +866,12 @@ private: QTextEdit* stInfo; int localDisplayNumber; +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + QThread *pulseManagerThread; + PulseManager *pulseManager; +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + + SVGFrame* ln; int tunnel; int sndTunnel; @@ -1020,9 +1015,14 @@ private slots: void startWinServers(); void slotCheckXOrgLog(); void slotCheckXOrgConnection(); - void slotCheckPulse(); void slotStartParec (); #endif + +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) +private slots: + void pulseManagerWrapper (); +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + private slots: void slotAppDialog(); void slotShowPassForm(); -- 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 4d597c366c063359e44fe6dadff8acd2c1693778 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:24:43 2016 +0200 src/mediawidget.cpp: reflect new capabilities through PulseManager. --- debian/changelog | 1 + src/mediawidget.cpp | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3034a4e..0be6f36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -280,6 +280,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/configdialog.cpp: whitespace only. - src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. + - src/mediawidget.cpp: reflect new capabilities through PulseManager. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/mediawidget.cpp b/src/mediawidget.cpp index 03b952f..c937ba4 100644 --- a/src/mediawidget.cpp +++ b/src/mediawidget.cpp @@ -71,7 +71,7 @@ MediaWidget::MediaWidget ( QString id, ONMainWindow * mw, cbDefSndPort=new QCheckBox ( tr ( "Use default sound port" ),sbgr ); sbSndPort=new QSpinBox ( sbgr ); sbSndPort->setMinimum ( 1 ); - sbSndPort->setMaximum ( 99999999 ); + sbSndPort->setMaximum ( 65535 ); QHBoxLayout *sndPortLay = new QHBoxLayout(); @@ -93,22 +93,17 @@ MediaWidget::MediaWidget ( QString id, ONMainWindow * mw, sLay_opt->addLayout ( sndPortLay ); sndLay->addWidget ( sound ); sndLay->addLayout ( sLay ); -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) arts->hide(); hl->hide(); cbDefSndPort->hide(); lSndPort->hide(); sbSndPort->hide(); -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ cbClientPrint=new QCheckBox ( tr ( "Client side printing support" ), this ); -#ifdef Q_OS_DARWIN - arts->hide(); - pulse->hide(); - esd->setChecked ( true ); -#endif setLay->addWidget(sbgr); setLay->addWidget ( cbClientPrint ); setLay->addStretch(); @@ -166,7 +161,12 @@ void MediaWidget::slot_sndSysSelected ( int system ) cbSndSshTun->show(); cbSndSshTun->setEnabled ( false ); cbSndSshTun->setChecked ( true ); -#endif +#elif defined (Q_OS_DARWIN) + rbStartSnd->hide (); + rbNotStartSnd->hide (); + cbSndSshTun->show (); + cbSndSshTun->setEnabled (true); +#endif /* defined (Q_OS_WIN) */ sbSndPort->setValue ( 16001 ); break; } @@ -184,8 +184,16 @@ void MediaWidget::slot_sndToggled ( bool val ) rbNotStartSnd->setEnabled ( val ); cbSndSshTun->setEnabled ( false ); - if ( pulse->isChecked() ) + /* ESD is also handled by PA on Windows and OS X. */ +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + if ((pulse->isChecked ()) || (esd->isChecked ())) { + cbSndSshTun->setEnabled (val); + } +#else + if (pulse->isChecked ()) { cbSndSshTun->setEnabled ( val ); + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ lSndPort->setEnabled ( val ); if ( !arts->isChecked() ) cbDefSndPort->setEnabled ( val ); @@ -261,20 +269,17 @@ void MediaWidget::readConfig() pulse->setChecked ( true ); slot_sndSysSelected ( PULSE ); -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) if ( sndsys=="arts" ) { sndsys="pulse"; } -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ if ( sndsys=="arts" ) { arts->setChecked ( true ); slot_sndSysSelected ( ARTS ); } -#ifdef Q_OS_DARWIN - sndsys="esd"; -#endif if ( sndsys=="esd" ) { esd->setChecked ( true ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5d9551602102cf1577767736717b0fa0dfb52b8e Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:42:24 2016 +0200 src/pulsemanager.h: move x2gologdebug.h inclusion into implementation file. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 1 + src/pulsemanager.h | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0be6f36..f4d41a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -281,6 +281,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. - src/mediawidget.cpp: reflect new capabilities through PulseManager. + - src/pulsemanager.h: move x2gologdebug.h inclusion into implementation + file. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index fb0d5eb..6f200a2 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -22,6 +22,7 @@ #include <QSysInfo> #include "pulsemanager.h" +#include "x2gologdebug.h" #ifndef DEBUG #define DEBUG_UNDEF diff --git a/src/pulsemanager.h b/src/pulsemanager.h index af7ae77..4c82f19 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -37,7 +37,6 @@ #include <assert.h> #include <cstdint> -#include "x2gologdebug.h" #include "x2gosettings.h" class PulseManager: public QObject { -- 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 6ca4a2b78f68df33fbe7bc72f1468563171f9f7c Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:43:22 2016 +0200 src/pulsemanager.cpp: output PA stdout/stderr via x2goDebug, not plainly to stdout. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f4d41a8..d8616f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -283,6 +283,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/mediawidget.cpp: reflect new capabilities through PulseManager. - src/pulsemanager.h: move x2gologdebug.h inclusion into implementation file. + - src/pulsemanager.cpp: output PA stdout/stderr via x2goDebug, not plainly + to stdout. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6f200a2..93b9edb 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -563,10 +563,10 @@ void PulseManager::on_pulse_finished (int exit_code) { QByteArray ba (pulse_server_->readAllStandardOutput ()); char *data = ba.data (); - std::cout << data; + x2goDebug << data; ba = pulse_server_->readAllStandardError (); data = ba.data (); - std::cout << data; + x2goDebug << data; // Clean up QDir work_dir (app_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 8570d3176c8de5cac263a5a8524accad8cbbd0eb Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:53:28 2016 +0200 src/configdialog.cpp: fix compile error by removing obsolete (and now faulty) line for removed restart message. --- debian/changelog | 2 ++ src/configdialog.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d8616f8..c7656e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -285,6 +285,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium file. - src/pulsemanager.cpp: output PA stdout/stderr via x2goDebug, not plainly to stdout. + - src/configdialog.cpp: fix compile error by removing obsolete (and now + faulty) line for removed restart message. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 2dfcf397..d1973d0 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -358,7 +358,6 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f ) tabWidg->addTab (frp, tr ("PulseAudio settings")); QVBoxLayout* l = new QVBoxLayout (frp); cbNoRecord = new QCheckBox (tr ("Disable sound input"), frp); - lw->setWordWrap (true); l->addWidget (cbNoRecord); l->addStretch (1); cbNoRecord->setChecked (st.setting ()->value ("pulse/norecord", false).toBool ()); -- 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 b6ed557a735b8f18d1545f2e9cdaacd44e8d0930 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:54:20 2016 +0200 src/onmainwindow.cpp: fix compile errors due to misspelled function names. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c7656e9..2e07150 100644 --- a/debian/changelog +++ b/debian/changelog @@ -287,6 +287,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium to stdout. - src/configdialog.cpp: fix compile error by removing obsolete (and now faulty) line for removed restart message. + - src/onmainwindow.cpp: fix compile errors due to misspelled function + names. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index c632a93..b215aa2 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -5106,10 +5106,10 @@ void ONMainWindow::slotRetResumeSess ( bool result, switch (sndSystem) { case PULSE: - sndPort = QString::number (pulseManager->getPulsePort ()); + sndPort = QString::number (pulseManager->get_pulse_port ()); break; case ESD: - sndPort = QString::number (pulseManager->getEsdPort ()); + sndPort = QString::number (pulseManager->get_esd_port ()); break; } #endif /* defined (Q_OS_WIN) || 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 2c431cf531c0c7a245730b0db743e3cd04849521 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:59:53 2016 +0200 src/pulsemanager.cpp: let start () act as a wrapper and do nothing if the PA server is already running. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2e07150..14de0c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -289,6 +289,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium faulty) line for removed restart message. - src/onmainwindow.cpp: fix compile errors due to misspelled function names. + - src/pulsemanager.cpp: let start () act as a wrapper and do nothing if + the PA server is already running. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 93b9edb..98f2a97 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -105,7 +105,9 @@ PulseManager::~PulseManager () { } void PulseManager::start () { - assert (!is_server_running ()); + if (is_server_running ()) { + return; + } delete (pulse_server_); -- 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 352bf7a63d9018b558cc5bffc9e0dd3aaafc3a13 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 6 23:41:52 2016 +0200 src/onmainwindow.cpp: fix compile error due to misuse of #ifdef. --- debian/changelog | 1 + src/onmainwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 14de0c7..54e6e04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -291,6 +291,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium names. - src/pulsemanager.cpp: let start () act as a wrapper and do nothing if the PA server is already running. + - src/onmainwindow.cpp: fix compile error due to misuse of #ifdef. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index b215aa2..a894de9 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -1517,7 +1517,7 @@ void ONMainWindow::closeClient() } #endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ -#ifndef (Q_OS_WIN) +#ifndef Q_OS_WIN if ( userSshd && sshd ) { x2goDebug<<"Terminating the OpenSSH server ..."; -- 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 715423f1f75d8f5b50a13476f4ae94befbda73a1 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 6 23:44:00 2016 +0200 src/onmainwindow.cpp: convert QDir object to QString for further processing. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 54e6e04..d171d1f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -292,6 +292,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: let start () act as a wrapper and do nothing if the PA server is already running. - src/onmainwindow.cpp: fix compile error due to misuse of #ifdef. + - src/onmainwindow.cpp: convert QDir object to QString for further + processing. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index a894de9..b58564b 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -5338,7 +5338,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, "/.pulse-cookie", this, SLOT ( slotPCookieReady ( bool, QString,int ))); } #else /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ - QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir () + + QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir ().absolutePath () + "/.pulse-cookie").absolutePath ()); QString destFile="$HOME/.x2go/C-"+ resumingSession.sessionId+ @@ -5355,7 +5355,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, sshConnection->copyFile(homeDir+"/.esd_auth", "$HOME/.esd_auth" ); #else /* defined (Q_OS_LINUX) */ - QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir () + + QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir ().absolutePath () + "/.esd_auth").absolutePath ()); QString destFile="$HOME/.esd_auth"; sshConnection->copyFile(cooFile, -- 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 93e00db02852ad92aaef20869ce79cb9f0ca9ed3 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 6 23:45:55 2016 +0200 src/onmainwindow.cpp: make use of new PulseManager::start () behavior and always use it, no matter whether server is up already or not. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d171d1f..64ef59a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -294,6 +294,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: fix compile error due to misuse of #ifdef. - src/onmainwindow.cpp: convert QDir object to QString for further processing. + - src/onmainwindow.cpp: make use of new PulseManager::start () behavior + and always use it, no matter whether server is up already or not. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index b58564b..f7802ca 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -5100,7 +5100,11 @@ void ONMainWindow::slotRetResumeSess ( bool result, true ).toBool(); #if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) - if ((sound) && (!(pulseManager->is_server_running ()))) { + if (sound) { + /* + * PulseManager::start () can be called even if the server + * is already started. In this case, it will do nothing. + */ pulseManager->start (); } -- 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 5e35802fa75f0fa9ae1130226080ff8ebecbb03c Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 6 23:47:53 2016 +0200 src/pulsemanager.cpp: fix compile error due to typo. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 64ef59a..352f9dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -296,6 +296,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium processing. - src/onmainwindow.cpp: make use of new PulseManager::start () behavior and always use it, no matter whether server is up already or not. + - src/pulsemanager.cpp: fix compile error due to typo. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 98f2a97..ca7926c 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -165,7 +165,7 @@ void PulseManager::start_osx () { #ifdef DEBUG server_args_ << "--log-level=debug" << "--verbose" - << "--log-target=file:" pulse_dir_.absolutePath () + "/pulse.log"; + << "--log-target=file:" + pulse_dir_.absolutePath () + "/pulse.log"; #endif // defined (DEBUG) if (generate_server_config () && generate_client_config ()) { -- 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 9f33919dbaa54a41b9ee4ca19f27022d2866aa64 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 6 23:49:35 2016 +0200 src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. Otherwise we'll get compile failures on non-Windows platforms. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 352f9dd..e949cc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -297,6 +297,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: make use of new PulseManager::start () behavior and always use it, no matter whether server is up already or not. - src/pulsemanager.cpp: fix compile error due to typo. + - src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. Otherwise + we'll get compile failures on non-Windows platforms. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ca7926c..21049ca 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -176,6 +176,11 @@ void PulseManager::start_osx () { } void PulseManager::start_win () { +/* + * Some code in here is Windows-specific and will lead to compile + * failures on other platforms. Make this a stub for everything non-Windows. + */ +#ifdef Q_OS_WIN server_args_ = QStringList (); server_args_ << "--exit-idle-time=-1" << "-n" << "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () @@ -215,6 +220,7 @@ void PulseManager::start_win () { start_generic (); } +#endif /* defined (Q_OS_WIN) */ } void PulseManager::start_linux () { @@ -419,11 +425,18 @@ bool PulseManager::generate_server_config () { * The absolute path works with at least 5.0 and 6.0. */ if (pulse_version_major_ > 2) { - QString tmp_auth_cookie = QDir::toNativeSeparators (wapiShortFileName (pulse_dir_.absolutePath ())) - + "\\.pulse-cookie"; + QString clean_pulse_dir = pulse_dir_.absolutePath (); + +#ifdef Q_OS_WIN + clean_pulse_dir = wapiShortFileName (clean_pulse_dir); +#endif /* defined (Q_OS_WIN) */ + QString tmp_auth_cookie = QDir::toNativeSeparators (clean_pulse_dir + "/.pulse-cookie"); + +#ifdef Q_OS_WIN /* Double backslashes are required in config.pa. */ tmp_auth_cookie.replace ("\\", "\\\\"); +#endif /* defined (Q_OS_WIN) */ config_tmp_file_stream << " auth-cookie=" + tmp_auth_cookie; } -- 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 a69a35660c8bcd176ad8346fed4594e55b1a73ff Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 02:58:01 2016 +0200 src/pulsemanager.{cpp,h}: add debugging setter and private variable. --- debian/changelog | 1 + src/pulsemanager.cpp | 7 ++++++- src/pulsemanager.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e949cc0..99bce7d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -299,6 +299,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix compile error due to typo. - src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. Otherwise we'll get compile failures on non-Windows platforms. + - src/pulsemanager.{cpp,h}: add debugging setter and private variable. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 21049ca..6fe8418 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -43,7 +43,8 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), pulse_version_micro_ (0), pulse_version_misc_ (""), record_ (true), - playback_ (true) { + playback_ (true), + debug_ (false) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); @@ -698,6 +699,10 @@ bool PulseManager::set_playback (bool playback) { return (ret); } +void PulseManager::set_debug (bool debug) { + debug_ = debug; +} + void PulseManager::restart () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 4c82f19..1d06de0 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -58,6 +58,7 @@ class PulseManager: public QObject { bool set_esd_port (std::uint16_t esd_port); bool set_record (bool record); bool set_playback (bool playback); + bool set_debug (bool debug); public slots: @@ -120,6 +121,7 @@ class PulseManager: public QObject { bool record_; bool playback_; + bool debug_; }; #ifdef NDEBUG_DEFINE -- 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 fdd59e2b47c6ef3ee3efbc8097de3753cdbe8095 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 03:02:26 2016 +0200 src/pulsemanager.{cpp,h}: port to new debugging feature. --- debian/changelog | 1 + src/pulsemanager.cpp | 69 +++++++++++++++++++++----------------------------- src/pulsemanager.h | 11 +------- 3 files changed, 31 insertions(+), 50 deletions(-) diff --git a/debian/changelog b/debian/changelog index 99bce7d..7fe21c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -300,6 +300,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. Otherwise we'll get compile failures on non-Windows platforms. - src/pulsemanager.{cpp,h}: add debugging setter and private variable. + - src/pulsemanager.{cpp,h}: port to new debugging feature. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6fe8418..ed841eb 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,11 +24,6 @@ #include "pulsemanager.h" #include "x2gologdebug.h" -#ifndef DEBUG -#define DEBUG_UNDEF -#define DEBUG -#endif // defined (NDEBUG) - PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), pulse_X2Go_ ("/.x2go/pulse"), server_binary_ (QString ("")), @@ -144,10 +139,10 @@ void PulseManager::start_generic () { connect (pulse_server_, SIGNAL (finished (int)), this, SLOT (slot_on_pulse_finished (int))); -#ifdef DEBUG - // Give PA a little time to come up. - QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ())); -#endif // defined (DEBUG) + if (debug_) { + // Give PA a little time to come up. + QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ())); + } } } @@ -163,11 +158,11 @@ void PulseManager::start_osx () { + QString::number (pulse_version_minor_) + "/modules").absolutePath () << "--high-priority"; -#ifdef DEBUG - server_args_ << "--log-level=debug" - << "--verbose" - << "--log-target=file:" + pulse_dir_.absolutePath () + "/pulse.log"; -#endif // defined (DEBUG) + if (debug_) { + server_args_ << "--log-level=debug" + << "--verbose" + << "--log-target=file:" + pulse_dir_.absolutePath () + "/pulse.log"; + } if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); @@ -191,12 +186,11 @@ void PulseManager::start_win () { + "." + QString::number (pulse_version_minor_) + "/modules/").absolutePath ()); -#ifdef DEBUG - /* FIXME: need a way to request debugging. */ - server_args_ << "--log-level=debug" - << "--verbose" - << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; -#endif // defined (DEBUG) + if (debug_) { + server_args_ << "--log-level=debug" + << "--verbose" + << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; + } /* * Fix for x2goclient bug #526. @@ -550,27 +544,27 @@ void PulseManager::create_client_dir () { } void PulseManager::slot_play_startup_sound () { -#ifdef DEBUG - QProcess play_file (0); - QString play_file_binary (app_dir_); - QString play_file_file (play_file_binary); + if (!debug_) { + QProcess play_file (0); + QString play_file_binary (app_dir_); + QString play_file_file (play_file_binary); #ifdef Q_OS_DARWIN - play_file_binary += "/../exe/paplay"; - play_file_file += "/../Resources/startup.wav"; + play_file_binary += "/../exe/paplay"; + play_file_file += "/../Resources/startup.wav"; #elif defined (Q_OS_WIN) - playFileBinary += "/pulse/paplay.exe"; - playFileFile += "/startup.wav"; + playFileBinary += "/pulse/paplay.exe"; + playFileFile += "/startup.wav"; #endif // defined (Q_OS_DARWIN) - QStringList args (play_file_file); - play_file.setWorkingDirectory (server_working_dir_); - play_file.setProcessEnvironment (env_); - play_file.start (play_file_binary, args); + QStringList args (play_file_file); + play_file.setWorkingDirectory (server_working_dir_); + play_file.setProcessEnvironment (env_); + play_file.start (play_file_binary, args); - if (play_file.waitForStarted ()) - play_file.waitForFinished (); -#endif // defined (DEBUG) + if (play_file.waitForStarted ()) + play_file.waitForFinished (); + } } void PulseManager::on_pulse_finished (int exit_code) { @@ -714,8 +708,3 @@ void PulseManager::restart () { QProcess::ProcessState PulseManager::state () { return (state_); } - -#ifdef DEBUG_UNDEF -#undef DEBUG -#undef DEBUG_UNDEF -#endif // defined (DEBUG_UNDEF) diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 1d06de0..9d6cec5 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -20,11 +20,6 @@ #ifndef PULSEMANAGER_H #define PULSEMANAGER_H -#ifdef NDEBUG -#define NDEBUG_DEFINE -#undef NDEBUG -#endif // defined (NDEBUG) - #include <iostream> #include <QDir> #include <QTcpSocket> @@ -121,12 +116,8 @@ class PulseManager: public QObject { bool record_; bool playback_; + bool debug_; }; -#ifdef NDEBUG_DEFINE -#define NDEBUG -#undef NDEBUG_DEFINE -#endif // defined (NDEBUG_DEFINE) - #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 6e849572783c14119a6bb9ca38cebe1bd734936f Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 03:10:34 2016 +0200 src/onmainwindow.cpp: port to new debugging feature of PulseManager. --- debian/changelog | 1 + src/onmainwindow.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7fe21c4..9b4836f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -301,6 +301,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium we'll get compile failures on non-Windows platforms. - src/pulsemanager.{cpp,h}: add debugging setter and private variable. - src/pulsemanager.{cpp,h}: port to new debugging feature. + - src/onmainwindow.cpp: port to new debugging feature of PulseManager. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index f7802ca..bcef2bc 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -2162,7 +2162,12 @@ void ONMainWindow::slotConfig() (QVariant) false).toBool (); if (oldDisableInput != newDisableInput) { - pulseManager->set_record (!newDisableInput); + bool ret = pulseManager->set_record (!newDisableInput); + + if (!ret) { + x2goDebug << "Failed to change recording status of PulseManager. PulseAudio not started?" << endl; + } + pulseManager->restart (); } #endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ @@ -6530,6 +6535,8 @@ void ONMainWindow::pulseManagerWrapper () { pulseManagerThread = new QThread (0); pulseManager = new PulseManager (); + pulseManager->set_debug (debugging); + pulseManager->moveToThread (pulseManagerThread); /* -- 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 aa6bec866eb3be37593438009d45d8fb498ae01c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 03:22:13 2016 +0200 src/pulsemanager.h: fix compile error due to mismatching function declaration for set_debug (). --- debian/changelog | 2 ++ src/pulsemanager.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9b4836f..bc427cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -302,6 +302,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.{cpp,h}: add debugging setter and private variable. - src/pulsemanager.{cpp,h}: port to new debugging feature. - src/onmainwindow.cpp: port to new debugging feature of PulseManager. + - src/pulsemanager.h: fix compile error due to mismatching function + declaration for set_debug (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 9d6cec5..b3b7421 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -53,7 +53,7 @@ class PulseManager: public QObject { bool set_esd_port (std::uint16_t esd_port); bool set_record (bool record); bool set_playback (bool playback); - bool set_debug (bool debug); + void set_debug (bool debug); public slots: -- 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 3edbfc7754e504b80b8a1b89752af65b1892bc15 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 22:28:38 2016 +0200 src/pulsemanager.cpp: don't time out while trying to start PA or paplay. "Handle" errors by printing out debug messages. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6003300..a72e0e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -306,6 +306,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium declaration for set_debug (). - res/sound: add startup.wav sound to be played back when starting the PA daemon in debug mode. + - src/pulsemanager.cpp: don't time out while trying to start PA or paplay. + "Handle" errors by printing out debug messages. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ed841eb..ee6c63c 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -132,7 +132,12 @@ void PulseManager::start_generic () { pulse_server_->setWorkingDirectory (server_working_dir_); pulse_server_->start (server_binary_, server_args_); - if (pulse_server_->waitForStarted ()) { + + /* + * We may wait here, because PulseManager runs in a separate thread. + * Otherwise, we'd better use signals and slots to not block the main thread. + */ + if (pulse_server_->waitForStarted (-1)) { x2goDebug << "pulse started with arguments" << server_args_ << "; waiting for finish..."; state_ = QProcess::Running; @@ -144,6 +149,9 @@ void PulseManager::start_generic () { QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ())); } } + else { + x2goErrorf (27) << "PulseAudio failed to start! Sound support will not be available."; + } } void PulseManager::start_osx () { @@ -562,8 +570,12 @@ void PulseManager::slot_play_startup_sound () { play_file.setProcessEnvironment (env_); play_file.start (play_file_binary, args); - if (play_file.waitForStarted ()) + if (play_file.waitForStarted (-1)) { play_file.waitForFinished (); + } + else { + x2goErrorf (26) << "Unable to play startup sound! Something may be wrong."; + } } } -- 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 98ffc89cbff93b20535ae52a11a3d5a85dc2c335 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 22:04:25 2016 +0200 res/sound: add startup.wav sound to be played back when starting the PA daemon in debug mode. --- debian/changelog | 2 ++ res/sound/startup.wav | Bin 0 -> 211244 bytes 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index bc427cd..6003300 100644 --- a/debian/changelog +++ b/debian/changelog @@ -304,6 +304,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: port to new debugging feature of PulseManager. - src/pulsemanager.h: fix compile error due to mismatching function declaration for set_debug (). + - res/sound: add startup.wav sound to be played back when starting the PA + daemon in debug mode. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/res/sound/startup.wav b/res/sound/startup.wav new file mode 100644 index 0000000..f6b4ff2 Binary files /dev/null and b/res/sound/startup.wav differ -- 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 b30aae5b8b802aa4bdda94a05cd87c45fa1964d8 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 22:38:37 2016 +0200 macbuild.sh: add support for copying resource files. Currently only used for startup.wav. --- debian/changelog | 2 ++ macbuild.sh | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index a72e0e1..0892bf7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -308,6 +308,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium daemon in debug mode. - src/pulsemanager.cpp: don't time out while trying to start PA or paplay. "Handle" errors by printing out debug messages. + - macbuild.sh: add support for copying resource files. Currently only used + for startup.wav. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index d5aadfe..f57d43c 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -158,6 +158,7 @@ BUILD_DIR="${TOP_DIR}/client_build" APPBUNDLE="${BUILD_DIR}/${NAME}.app" EXE_DIR="${APPBUNDLE}/Contents/exe/" FRAMEWORKS_DIR="${APPBUNDLE}/Contents/Frameworks/" +RESOURCES_DIR="${APPBUNDLE}/Contents/Resources/" DMGFILE="${BUILD_DIR}/${NAME}.dmg" PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" @@ -179,6 +180,7 @@ PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" "pulse-8.0" "pulseaudio" ) +RESOURCE_FILES=( "audio/startup.wav" ) typeset -a special_files_regex special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" @@ -328,6 +330,12 @@ mkdir -p "${FRAMEWORKS_DIR}/" phase "Copying nxproxy" cp -av "${NXPROXY}" "${EXE_DIR}/" +phase "Copying misc resources" +typeset cur_res_file +for cur_res_file in ${RESOURCE_FILES[@]}; do + cp -av "res/${cur_res_file}" "${RESOURCES_DIR}/" +done + phase "Copying PulseAudio" for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do cp -av "${cur_binary}" "${EXE_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 d3bdae152f1f9be8fcc4084b3944a5f73dac8be6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 22:46:06 2016 +0200 res: rename "sound" to "audio". --- debian/changelog | 1 + res/{sound => audio}/startup.wav | Bin 211244 -> 211244 bytes 2 files changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 0892bf7..04b732e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -310,6 +310,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium "Handle" errors by printing out debug messages. - macbuild.sh: add support for copying resource files. Currently only used for startup.wav. + - res: rename "sound" to "audio". [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/res/sound/startup.wav b/res/audio/startup.wav similarity index 100% rename from res/sound/startup.wav rename to res/audio/startup.wav -- 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 02d9402414a2a70e72423b2c6eaae6624ad5f4b0 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 7 22:55:50 2016 +0200 macbuild.sh: fix copying of resource files. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 04b732e..4421063 100644 --- a/debian/changelog +++ b/debian/changelog @@ -311,6 +311,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add support for copying resource files. Currently only used for startup.wav. - res: rename "sound" to "audio". + - macbuild.sh: fix copying of resource files. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index f57d43c..6e36348 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -333,7 +333,7 @@ cp -av "${NXPROXY}" "${EXE_DIR}/" phase "Copying misc resources" typeset cur_res_file for cur_res_file in ${RESOURCE_FILES[@]}; do - cp -av "res/${cur_res_file}" "${RESOURCES_DIR}/" + cp -av "${TOP_DIR}/res/${cur_res_file}" "${RESOURCES_DIR}/" done phase "Copying PulseAudio" -- 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 9898f33ad38819bb43d497670eb86b85a83bbc54 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 12 23:18:23 2016 +0200 macbuild.sh: also add PA binaries to deduplication fixup list. --- debian/changelog | 1 + macbuild.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4421063..b9a560e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -312,6 +312,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium for startup.wav. - res: rename "sound" to "audio". - macbuild.sh: fix copying of resource files. + - macbuild.sh: also add PA binaries to deduplication fixup list. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 6e36348..f580d44 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -505,6 +505,13 @@ if [ "${BUNDLE}" = "1" ]; then done done + # Add binaries to all_files as well. + typeset entry="" + while read -r -d '' entry; do + echo "Adding ${entry} to all files" + all_files+=( "${entry}" ) + done < <(find "${EXE_DIR}" -type 'f' -executable -print0) + # Try to fixup files broken by duplicates removal. for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" -- 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 4754cb3b0c9308d31dffcc25ccfcf7c5868f6c46 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 12 23:22:13 2016 +0200 macbuild.sh: don't error out while executing parse_otool_output (). --- debian/changelog | 1 + macbuild.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index b9a560e..c16e17a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -313,6 +313,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - res: rename "sound" to "audio". - macbuild.sh: fix copying of resource files. - macbuild.sh: also add PA binaries to deduplication fixup list. + - macbuild.sh: don't error out while executing parse_otool_output (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index f580d44..62afe22 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -520,7 +520,9 @@ if [ "${BUNDLE}" = "1" ]; then # We need the return value of parse_otool_output(), but running # typeset foo="$(bar)" will give us the return value of typeset, not bar(). typeset dependencies="" + set +e dependencies="$(parse_otool_output "${otool_out}")" + set -e if [ "${?}" -eq "0" ]; then typeset line="" -- 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 3559f5fe3e98f56005cc67e12e1b30ab435fa9d6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 12 23:24:03 2016 +0200 macbuild.sh: save return value of parse_otool_output (). Otherwise we'll fetch the return value of "set", which is not really what we need. --- debian/changelog | 2 ++ macbuild.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c16e17a..26944fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -314,6 +314,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: fix copying of resource files. - macbuild.sh: also add PA binaries to deduplication fixup list. - macbuild.sh: don't error out while executing parse_otool_output (). + - macbuild.sh: save return value of parse_otool_output (). Otherwise we'll + fetch the return value of "set", which is not really what we need. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 62afe22..5e7b336 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -515,6 +515,7 @@ if [ "${BUNDLE}" = "1" ]; then # Try to fixup files broken by duplicates removal. for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" + typeset -i tmp_ret="0" # Don't merge the declaration and initialization with the real value assignment. # We need the return value of parse_otool_output(), but running @@ -522,9 +523,10 @@ if [ "${BUNDLE}" = "1" ]; then typeset dependencies="" set +e dependencies="$(parse_otool_output "${otool_out}")" + tmp_ret="${?}" set -e - if [ "${?}" -eq "0" ]; then + if [ "${tmp_ret}" -eq "0" ]; then typeset line="" while read -r line; do #echo "dependency of ${all_entry}: ${line}" -- 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 9b591aceeb0d544db1df2cf325b34ce3b7cc205b Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 12 23:45:16 2016 +0200 src/pulsemanager.cpp: fix typo in fetch_pulseaudio_version (). Read standard output from temporary process, not our "main" server process (which at this point is not even started yet.) --- debian/changelog | 3 +++ src/pulsemanager.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 26944fb..b442915 100644 --- a/debian/changelog +++ b/debian/changelog @@ -316,6 +316,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: don't error out while executing parse_otool_output (). - macbuild.sh: save return value of parse_otool_output (). Otherwise we'll fetch the return value of "set", which is not really what we need. + - src/pulsemanager.cpp: fix typo in fetch_pulseaudio_version (). Read + standard output from temporary process, not our "main" server process + (which at this point is not even started yet.) [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ee6c63c..d19494d 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -241,7 +241,7 @@ void PulseManager::fetch_pulseaudio_version () { /* Wait until the process exited again. */ if (tmp_server.waitForFinished ()) { /* Read stdout and split it up on newlines. */ - QByteArray ba (pulse_server_->readAllStandardOutput ()); + QByteArray ba (tmp_server.readAllStandardOutput ()); QString stdout_data (ba.data ()); QStringList stdout_list (stdout_data.split ("\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 83659a905b5f5d806eff43e6de438ac9cbb9f94d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 2 00:46:20 2016 +0200 src/pulsemanager.cpp: don't overwrite the temporary string variable for the current line with what was supposed to hold new data in fetch_pulseaudio_version (). --- debian/changelog | 3 +++ src/pulsemanager.cpp | 31 ++++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index b442915..0284fd1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -319,6 +319,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix typo in fetch_pulseaudio_version (). Read standard output from temporary process, not our "main" server process (which at this point is not even started yet.) + - src/pulsemanager.cpp: don't overwrite the temporary string variable for + the current line with what was supposed to hold new data in + fetch_pulseaudio_version (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d19494d..032c018 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -259,24 +259,24 @@ void PulseManager::fetch_pulseaudio_version () { /* We should be at a digit now. */ bool numbers_found[3] = { false, false, false }; - QString tmp_str = QString (""); + QString tmp_ret_str = QString (""); for (QString::const_iterator cit = tmp_str.begin (); cit != tmp_str.end (); ++cit) { if (!(numbers_found[0])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_str.append (*cit); + tmp_ret_str.append (*cit); } else if ((*cit) == '.') { /* First number part complete, let's convert the string and skip the period. */ numbers_found[0] = true; bool convert_success = false; - pulse_version_major_ = tmp_str.toUInt (&convert_success, 10); + pulse_version_major_ = tmp_ret_str.toUInt (&convert_success, 10); if (!convert_success) { x2goErrorf (20) << "Unable to convert major version number string to integer."; abort (); } - tmp_str = QString (""); + tmp_ret_str = QString (""); } else { x2goErrorf (21) << "Unexpected character found when parsing version string for major version number: '" << QString (*cit) << "'."; @@ -285,7 +285,7 @@ void PulseManager::fetch_pulseaudio_version () { } else if (!(numbers_found[1])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_str.append (*cit); + tmp_ret_str.append (*cit); } else if (((*cit) == '.') || ((*cit) == '-')) { /* @@ -294,14 +294,14 @@ void PulseManager::fetch_pulseaudio_version () { */ numbers_found[1] = true; bool convert_success = false; - pulse_version_minor_ = tmp_str.toUInt (&convert_success, 10); + pulse_version_minor_ = tmp_ret_str.toUInt (&convert_success, 10); if (!convert_success) { x2goErrorf (22) << "Unable to convert minor version number string to integer."; abort (); } - tmp_str = QString (""); + tmp_ret_str = QString (""); if ((*cit) == '-') { /* @@ -318,20 +318,20 @@ void PulseManager::fetch_pulseaudio_version () { } else if (!(numbers_found[2])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_str.append (*cit); + tmp_ret_str.append (*cit); } else if ((*cit) == '-') { /* Third number part complete, let's convert the string and skip the period. */ numbers_found[2] = true; bool convert_success = false; - pulse_version_micro_ = tmp_str.toUInt (&convert_success, 10); + pulse_version_micro_ = tmp_ret_str.toUInt (&convert_success, 10); if (!convert_success) { x2goErrorf (24) << "Unable to convert micro version number string to integer."; abort (); } - tmp_str = QString (""); + tmp_ret_str = QString (""); } else { x2goErrorf (25) << "Unexpected character found when parsing version string for micro version number: '" << QString (*cit) << "'."; @@ -340,12 +340,17 @@ void PulseManager::fetch_pulseaudio_version () { } else { /* Numbers should be good by now, let's fetch everything else. */ - tmp_str.append (*cit); + tmp_ret_str.append (*cit); } } - /* Misc version part will be set to the trailing string. */ - pulse_version_misc_ = tmp_str; + found = ((numbers_found[0]) && (numbers_found[1]) && (numbers_found[2])); + + if (found) { + /* Misc version part will be set to the trailing string. */ + pulse_version_misc_ = tmp_ret_str; + break; + } } else { /* No need to look any further. */ -- 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 813d47b0c196ee28403c2ab6fbaee96f5f85db13 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 2 01:08:50 2016 +0200 src/pulsemanager.{cpp,h}: rename on_pulse_finished () to slot_on_pulse_finished (). Oops... --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- src/pulsemanager.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0284fd1..d5f6f2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -322,6 +322,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: don't overwrite the temporary string variable for the current line with what was supposed to hold new data in fetch_pulseaudio_version (). + - src/pulsemanager.{cpp,h}: rename on_pulse_finished () to + slot_on_pulse_finished (). Oops... [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 032c018..ec08e6f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -584,7 +584,7 @@ void PulseManager::slot_play_startup_sound () { } } -void PulseManager::on_pulse_finished (int exit_code) { +void PulseManager::slot_on_pulse_finished (int exit_code) { if (!exit_code) x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index b3b7421..4cd49e4 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -86,7 +86,7 @@ class PulseManager: public QObject { private slots: - void on_pulse_finished (int exit_code); + void slot_on_pulse_finished (int exit_code); void slot_play_startup_sound (); -- 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 cb65ba64cde11d5e72d997f260dbb935acd3fb1f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 2 04:20:10 2016 +0200 src/pulsemanager.cpp: actually only play startup sound if debugging is enabled. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d5f6f2a..b10147f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -324,6 +324,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium fetch_pulseaudio_version (). - src/pulsemanager.{cpp,h}: rename on_pulse_finished () to slot_on_pulse_finished (). Oops... + - src/pulsemanager.cpp: actually only play startup sound if debugging is + enabled. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ec08e6f..eec54a0 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -557,7 +557,7 @@ void PulseManager::create_client_dir () { } void PulseManager::slot_play_startup_sound () { - if (!debug_) { + if (debug_) { QProcess play_file (0); QString play_file_binary (app_dir_); QString play_file_file (play_file_binary); -- 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 482afb7dfe01730450494906864dfa4873628ffa Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 2 04:21:02 2016 +0200 src/pulsemanager.cpp: don't insert stray newline into config.pa. --- debian/changelog | 1 + src/pulsemanager.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b10147f..e5f5536 100644 --- a/debian/changelog +++ b/debian/changelog @@ -326,6 +326,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium slot_on_pulse_finished (). Oops... - src/pulsemanager.cpp: actually only play startup sound if debugging is enabled. + - src/pulsemanager.cpp: don't insert stray newline into config.pa. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index eec54a0..78fed24 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -474,7 +474,6 @@ bool PulseManager::generate_server_config () { else { config_tmp_file_stream << "1"; } - config_tmp_file_stream << endl; config_tmp_file_stream << " playback="; if (!playback_) { -- 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 86ab7a715c32b02db743b5033c66dfc3f4831f41 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 2 04:23:05 2016 +0200 src/pulsemanager.cpp: insert PULSE_SERVER and PULSE_COOKIE variables into environment as used by PulseManager. Otherwise we won't be able to start binaries like paplay. --- debian/changelog | 3 +++ src/pulsemanager.cpp | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index e5f5536..64d218d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -327,6 +327,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: actually only play startup sound if debugging is enabled. - src/pulsemanager.cpp: don't insert stray newline into config.pa. + - src/pulsemanager.cpp: insert PULSE_SERVER and PULSE_COOKIE variables + into environment as used by PulseManager. Otherwise we won't be able to + start binaries like paplay. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 78fed24..539b85b 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -144,6 +144,19 @@ void PulseManager::start_generic () { connect (pulse_server_, SIGNAL (finished (int)), this, SLOT (slot_on_pulse_finished (int))); + env_.insert ("PULSE_SERVER", "127.0.0.1:" + QString::number (pulse_port_)); + + + QString clean_pulse_dir = pulse_dir_.absolutePath (); + +#ifdef Q_OS_WIN + clean_pulse_dir = wapiShortFileName (clean_pulse_dir); +#endif /* defined (Q_OS_WIN) */ + + QString tmp_auth_cookie = QDir::toNativeSeparators (clean_pulse_dir + "/.pulse-cookie"); + + env_.insert ("PULSE_COOKIE", tmp_auth_cookie); + if (debug_) { // Give PA a little time to come up. QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ())); -- 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 59737038806e2b5a77ebcc32587842471be84dc6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 2 04:24:38 2016 +0200 src/pulsemanager.cpp: don't remove PA config and log file in ~/.x2go/pulse on PA shutdown if debugging has been requested. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 64d218d..aad5737 100644 --- a/debian/changelog +++ b/debian/changelog @@ -330,6 +330,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: insert PULSE_SERVER and PULSE_COOKIE variables into environment as used by PulseManager. Otherwise we won't be able to start binaries like paplay. + - src/pulsemanager.cpp: don't remove PA config and log file in + ~/.x2go/pulse on PA shutdown if debugging has been requested. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 539b85b..ce7ba24 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -619,10 +619,12 @@ void PulseManager::slot_on_pulse_finished (int exit_code) { #if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) // Remove server config file, otherwise the directory won't be empty. - work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () - + "/config.pa").absolutePath ())); - work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () - + "/pulse.log").absolutePath ())); + if (!debug_) { + work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/config.pa").absolutePath ())); + work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/pulse.log").absolutePath ())); + } #else // Linux // FIXME. #endif -- 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 66911944ee4192d1a4a342d510467f8d0ff13b8c Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jun 20 23:52:40 2016 +0200 src/x2goutils.{cpp,h}: add new function find_binary (). Searches for a specific binary in a colon-separated list of paths. Really just a compat function, as Qt 5 includes QStandardPaths::findExecutable (). --- debian/changelog | 3 +++ src/x2goutils.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/x2goutils.h | 8 ++++++++ 3 files changed, 48 insertions(+) diff --git a/debian/changelog b/debian/changelog index aad5737..ef37a95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -332,6 +332,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium start binaries like paplay. - src/pulsemanager.cpp: don't remove PA config and log file in ~/.x2go/pulse on PA shutdown if debugging has been requested. + - src/x2goutils.{cpp,h}: add new function find_binary (). Searches for a + specific binary in a colon-separated list of paths. Really just a compat + function, as Qt 5 includes QStandardPaths::findExecutable (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 9f3b382..f6978c5 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -24,6 +24,7 @@ #include <QFont> #include <QFontInfo> #include <QObject> +#include <QStringList> #include "x2goutils.h" #include "onmainwindow.h" @@ -287,4 +288,40 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo return (ret); } + +QString find_binary (const QString &path, const QString &binary_name) { + QString ret = ""; + + if (!(binary_name.isEmpty ())) { + QString cur_path = ""; + QString tmp_path = path; + + if (!(path.isEmpty ())) { + tmp_path = "./"; + } + + QStringList path_list = tmp_path.split (":"); + + for (QStringList const_it = path_list.constBegin (); const_it != path_list.constEnd (); ++const_it) { + cur_path = *const_it; + + if (cur_path.isEmpty ()) { + cur_path = "./"; + } + + cur_path = QDir (cur_path).absolutePath (); + + cur_path += "/" + binary_name; + + QFileInfo tmp_file_info = QFileInfo (cur_path); + + if ((tmp_file_info.exists ()) && (tmp_file_info.isExecutable ())) { + ret = tmp_file_info.canonicalFilePath (); + break; + } + } + } + + return (ret); +} #endif /* defined (Q_OS_DARWIN) */ diff --git a/src/x2goutils.h b/src/x2goutils.h index e36203e..4159d39 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -57,6 +57,14 @@ void show_XQuartz_generic_error (const QString &main_error, const QString &addit * Ex.: <add_entry1>:<add_entry2>:...:<orig_path> */ QString add_to_path (const QString &orig_path, const QStringList &add, const bool back = true); + +/* + * Returns the first existing path that contains binary_name. + * Iff no component contains a binary called binary_name, an empty path is returned. + * + * Iff path is empty, (only) the current working dir is searched. + */ +QString find_binary (const QString &path, const QString &binary_name); #endif /* defined (Q_OS_DARWIN) */ #endif /* !defined (X2GOUTILS_H) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9d2b38a5295250daa90f0515407e5d2a5ae1cd56 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jun 20 23:58:12 2016 +0200 src/pulsemanager.cpp: auto-detect PA binary in $PATH and MacPorts default prefix as well on OS X. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/debian/changelog b/debian/changelog index ef37a95..146112e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -335,6 +335,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/x2goutils.{cpp,h}: add new function find_binary (). Searches for a specific binary in a colon-separated list of paths. Really just a compat function, as Qt 5 includes QStandardPaths::findExecutable (). + - src/pulsemanager.cpp: auto-detect PA binary in $PATH and MacPorts + default prefix as well on OS X. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ce7ba24..1e23d89 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -21,6 +21,12 @@ #include <stdlib.h> #include <QSysInfo> +#if QT_VERSION < 0x050000 +#include "x2goutils.h" +#else /* QT_VERSION < 0x050000 */ +#include <QStandardPaths> +#endif /* QT_VERSION < 0x050000 */ + #include "pulsemanager.h" #include "x2gologdebug.h" @@ -54,8 +60,69 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), /* Set server binary and working dir paths. */ #ifdef Q_OS_DARWIN + /* Assume bundled PA first. */ server_working_dir_ = QString (app_dir_ + "/../exe/"); server_binary_ = QString (server_working_dir_ + "/pulseaudio"); + +#if QT_VERSION < 0x050000 + QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); + QString path_val = tmp_env.value ("PATH"); + + QStringList to_front, to_back; + to_front << "/opt/local/bin"; + to_back << "/usr/local/bin"; + + add_to_path (path_val, to_back); + add_to_path (path_val, to_front, false); + + server_binary_ = find_binary (server_working_dir_, "pulseaudio"); + + if (server_binary_.isEmpty ()) { + server_binary_ = find_binary (path_val, "pulseaudio"); + + if (server_binary_.isEmpty ()) { + x2goErrorf (29) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; + abort (); + } + } +#else /* QT_VERSION < 0x050000 */ + QStringList search_paths; + search_paths << server_working_dir_; + + server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); + + if (server_binary_.isEmpty ()) { + search_paths = QStringList (); + search_paths << "/opt/local/bin"; /* MacPorts default prefix, FIXME: might need to make that configurable. */ + + server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); + + if (server_binary_.isEmpty ()) { + search_paths = QStringList (); + + server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); + + if (server_binary_.isEmpty ()) { + search_paths = QStringList (); + search_paths << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ + + server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); + + if (server_binary_.isEmpty ()) { + x2goErrorf (28) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; + abort (); + } + } + } + } +#endif /* QT_VERSION < 0x050000 */ + + QFileInfo tmp_file_info = QFileInfo (server_binary_); + server_working_dir_ = tmp_file_info.canonicalPath (); + + x2goDebug << "Found PA binary as " << server_binary_ << endl; + x2goDebug << "Corresponding working dir: " << server_working_dir_ << endl; + #elif defined (Q_OS_WIN) server_working_dir_ = QString (app_dir_ + "/pulse/"); server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); -- 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 d3038b8d686274859caa8a607eeb5873e507bb4d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 02:20:22 2016 +0200 src/pulsemanager.cpp: add comments to Qt 4 code part. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 146112e..5d0d349 100644 --- a/debian/changelog +++ b/debian/changelog @@ -337,6 +337,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium function, as Qt 5 includes QStandardPaths::findExecutable (). - src/pulsemanager.cpp: auto-detect PA binary in $PATH and MacPorts default prefix as well on OS X. + - src/pulsemanager.cpp: add comments to Qt 4 code part. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1e23d89..47e1b7c 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -69,8 +69,8 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), QString path_val = tmp_env.value ("PATH"); QStringList to_front, to_back; - to_front << "/opt/local/bin"; - to_back << "/usr/local/bin"; + to_front << "/opt/local/bin"; /* MacPorts default prefix, FIXME: might need to make that configurable. */ + to_back << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ add_to_path (path_val, to_back); add_to_path (path_val, to_front, 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 2e4da1cd36596807a7068414c7f674b3ec83c655 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 02:21:10 2016 +0200 src/pulsemanager.cpp: add reminder for Linux-implementation in play_startup_sound (). --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5d0d349..89a97ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -338,6 +338,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: auto-detect PA binary in $PATH and MacPorts default prefix as well on OS X. - src/pulsemanager.cpp: add comments to Qt 4 code part. + - src/pulsemanager.cpp: add reminder for Linux-implementation in + play_startup_sound (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 47e1b7c..8e25b77 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -647,6 +647,8 @@ void PulseManager::slot_play_startup_sound () { #elif defined (Q_OS_WIN) playFileBinary += "/pulse/paplay.exe"; playFileFile += "/startup.wav"; +#else + /* FIXME: implement Linux section. */ #endif // defined (Q_OS_DARWIN) QStringList args (play_file_file); -- 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 b3c2308bf777ec75f6d555fd03adb0288cab57b9 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 02:28:40 2016 +0200 src/x2goutils.cpp: fix compile error. --- debian/changelog | 1 + src/x2goutils.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 89a97ce..a8fd1b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -340,6 +340,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: add comments to Qt 4 code part. - src/pulsemanager.cpp: add reminder for Linux-implementation in play_startup_sound (). + - src/x2goutils.cpp: fix compile error. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index f6978c5..1861443 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -302,7 +302,7 @@ QString find_binary (const QString &path, const QString &binary_name) { QStringList path_list = tmp_path.split (":"); - for (QStringList const_it = path_list.constBegin (); const_it != path_list.constEnd (); ++const_it) { + for (QStringList::const_iterator const_it = path_list.constBegin (); const_it != path_list.constEnd (); ++const_it) { cur_path = *const_it; if (cur_path.isEmpty ()) { -- 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 f5cc1929ce0f18af92f18c33568e7940cde2ae54 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 02:31:32 2016 +0200 src/pulsemanager.h: add new system_pulse_ variable to indicate that a system PA binary shall be used. --- debian/changelog | 2 ++ src/pulsemanager.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index a8fd1b6..2cf4fed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -341,6 +341,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: add reminder for Linux-implementation in play_startup_sound (). - src/x2goutils.cpp: fix compile error. + - src/pulsemanager.h: add new system_pulse_ variable to indicate that + a system PA binary shall be used. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 4cd49e4..6e39b9a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -118,6 +118,8 @@ class PulseManager: public QObject { bool playback_; bool debug_; + + bool system_pulse_; }; #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 3c8c60c213f0b88060542911745f3ad857a69b14 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 02:33:27 2016 +0200 src/pulsemanager.cpp: correctly initialize and set system_pulse_ when required. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2cf4fed..79e1c0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -343,6 +343,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/x2goutils.cpp: fix compile error. - src/pulsemanager.h: add new system_pulse_ variable to indicate that a system PA binary shall be used. + - src/pulsemanager.cpp: correctly initialize and set system_pulse_ when + required. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 8e25b77..9ec2da8 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -45,7 +45,8 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), pulse_version_misc_ (""), record_ (true), playback_ (true), - debug_ (false) { + debug_ (false), + system_pulse_ (false) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); @@ -84,6 +85,9 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), x2goErrorf (29) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; abort (); } + else { + system_pulse_ = true; + } } #else /* QT_VERSION < 0x050000 */ QStringList search_paths; @@ -114,6 +118,14 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), } } } + + /* + * The detection above either failed or succeeded. + * Failure means that the program already stopped, + * success means that all code reaches this point. + * Be careful when refactoring this code. + */ + system_pulse_ = true; } #endif /* QT_VERSION < 0x050000 */ -- 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 29cdb876ee38370ebe02f6270cd3eea26a69e47d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 02:45:45 2016 +0200 src/x2goutils.{cpp,h}: add application modality parameter to show_RichText_Generic_MsgBox () and its wrappers. --- debian/changelog | 2 ++ src/x2goutils.cpp | 19 +++++++++++++------ src/x2goutils.h | 6 +++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 79e1c0c..0eb1711 100644 --- a/debian/changelog +++ b/debian/changelog @@ -345,6 +345,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium a system PA binary shall be used. - src/pulsemanager.cpp: correctly initialize and set system_pulse_ when required. + - src/x2goutils.{cpp,h}: add application modality parameter to + show_RichText_Generic_MsgBox () and its wrappers. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 1861443..f58a436 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -99,7 +99,7 @@ QString convert_to_rich_text (const QString &text, bool force) { return (fixup_text); } -void show_RichText_Generic_MsgBox (QMessageBox::Icon icon, const QString &main_text, const QString &informative_text) { +void show_RichText_Generic_MsgBox (QMessageBox::Icon icon, const QString &main_text, const QString &informative_text, bool app_modal) { QString fixup_main_text (convert_to_rich_text (main_text)); QString fixup_informative_text (convert_to_rich_text (informative_text, true)); @@ -107,16 +107,23 @@ void show_RichText_Generic_MsgBox (QMessageBox::Icon icon, const QString &main_t msg_box.setTextFormat (Qt::RichText); msg_box.setInformativeText (fixup_informative_text); - msg_box.setWindowModality (Qt::WindowModal); + + if (app_modal) { + msg_box.setWindowModality (Qt::ApplicationModal); + } + else { + msg_box.setWindowModality (Qt::WindowModal); + } + msg_box.exec (); } -void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text) { - show_RichText_Generic_MsgBox (QMessageBox::Warning, main_text, informative_text); +void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text bool app_modal) { + show_RichText_Generic_MsgBox (QMessageBox::Warning, main_text, informative_text, app_modal); } -void show_RichText_ErrorMsgBox (const QString &main_text, const QString &informative_text) { - show_RichText_Generic_MsgBox (QMessageBox::Critical, main_text, informative_text); +void show_RichText_ErrorMsgBox (const QString &main_text, const QString &informative_text, bool app_modal) { + show_RichText_Generic_MsgBox (QMessageBox::Critical, main_text, informative_text, app_modal); } QString git_changelog_extract_commit_sha (const QString &gitlog) { diff --git a/src/x2goutils.h b/src/x2goutils.h index 4159d39..dd7613c 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -33,9 +33,9 @@ QString wrap_legacy_resource_URIs (const QString &res_path); QString convert_to_rich_text (const QString &text, bool force = false); -void show_RichText_Generic_MsgBox (QMessageBox::Icon icon, const QString &main_text, const QString &informative_text); -void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text = ""); -void show_RichText_ErrorMsgBox (const QString &main_text, const QString &informative_text = ""); +void show_RichText_Generic_MsgBox (QMessageBox::Icon icon, const QString &main_text, const QString &informative_text, bool app_modal = false); +void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text = "", bool app_modal = false); +void show_RichText_ErrorMsgBox (const QString &main_text, const QString &informative_text = "", bool app_modal = false); QString git_changelog_extract_commit_sha (const QString &gitlog); -- 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 30f4aa645f16b412a42944fc79f043b5aec87b36 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 03:14:20 2016 +0200 src/pulsemanager.cpp: add error message boxes throughout PulseManager. Don't just abort () the program. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0eb1711..318cd1a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -347,6 +347,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium required. - src/x2goutils.{cpp,h}: add application modality parameter to show_RichText_Generic_MsgBox () and its wrappers. + - src/pulsemanager.cpp: add error message boxes throughout PulseManager. + Don't just abort () the program. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9ec2da8..1cb7a7e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -21,14 +21,13 @@ #include <stdlib.h> #include <QSysInfo> -#if QT_VERSION < 0x050000 -#include "x2goutils.h" -#else /* QT_VERSION < 0x050000 */ +#if QT_VERSION >= 0x050000 #include <QStandardPaths> -#endif /* QT_VERSION < 0x050000 */ +#endif /* QT_VERSION >= 0x050000 */ #include "pulsemanager.h" #include "x2gologdebug.h" +#include "x2goutils.h" PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), pulse_X2Go_ ("/.x2go/pulse"), @@ -83,6 +82,13 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), if (server_binary_.isEmpty ()) { x2goErrorf (29) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; + show_RichText_ErrorMsgBox (tr ("Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), + tr ("If you downloaded the bundled, pre-compiled version from the official home page, " + "please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); abort (); } else { @@ -114,6 +120,13 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), if (server_binary_.isEmpty ()) { x2goErrorf (28) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; + show_RichText_ErrorMsgBox (tr ("Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), + tr ("If you downloaded the bundled, pre-compiled version from the official home page, " + "please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); abort (); } } @@ -150,6 +163,9 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), for (buf = ptr = NULL; ptr == NULL; path_len += 20) { if (NULL == (buf = realloc (buf, path_len))) { x2goErrorf (16) << "Could not allocate buffer for getting current working directory!"; + show_RichText_ErrorMsgBox (tr ("Could not allocate buffer for getting current working directory!"), + QString (), + true); abort (); } @@ -157,7 +173,11 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), ptr = getcwd (buf, path_len); if ((NULL == ptr) && (ERANGE != erange)) { - x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)); + int saved_errno = errno; + x2goErrorf (17) << "getcwd() failed: " << QString (strerror (saved_errno)); + show_RichText_ErrorMsgBox (tr ("getcwd() failed!"), + QString (strerror (saved_errno)), + true); abort (); } } @@ -365,6 +385,9 @@ void PulseManager::fetch_pulseaudio_version () { if (!convert_success) { x2goErrorf (20) << "Unable to convert major version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert major version number string to integer."), + true); abort (); } @@ -372,6 +395,10 @@ void PulseManager::fetch_pulseaudio_version () { } else { x2goErrorf (21) << "Unexpected character found when parsing version string for major version number: '" << QString (*cit) << "'."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unexpected character found when parsing version string for major version number") + + ": '" + QString (*cit) + "'.", + true); abort (); } } @@ -390,6 +417,9 @@ void PulseManager::fetch_pulseaudio_version () { if (!convert_success) { x2goErrorf (22) << "Unable to convert minor version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert minor version number string to integer."), + true); abort (); } @@ -405,6 +435,10 @@ void PulseManager::fetch_pulseaudio_version () { } else { x2goErrorf (23) << "Unexpected character found when parsing version string for minor version number: '" << QString (*cit) << "'."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unexpected character found when parsing version string for minor version number") + + ": '" + QString (*cit) + "'.", + true); abort (); } } @@ -420,6 +454,9 @@ void PulseManager::fetch_pulseaudio_version () { if (!convert_success) { x2goErrorf (24) << "Unable to convert micro version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert micro version number string to integer."), + true); abort (); } @@ -427,6 +464,10 @@ void PulseManager::fetch_pulseaudio_version () { } else { x2goErrorf (25) << "Unexpected character found when parsing version string for micro version number: '" << QString (*cit) << "'."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unexpected character found when parsing version string for micro version number") + + ": '" + QString (*cit) + "'.", + true); abort (); } } @@ -452,11 +493,17 @@ void PulseManager::fetch_pulseaudio_version () { if (!found) { x2goErrorf (19) << "Unable to fetch PulseAudio version - unexpected format. Exiting."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unexpected format encountered."), + true); abort (); } } else { x2goErrorf (18) << "Unable to start PulseAudio to fetch its version number. Exiting."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to start PulseAudio binary."), + true); abort (); } } -- 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 c894ba5644489cd5bdddb9a821331d92b677f472 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 03:21:11 2016 +0200 src/x2goutils.h: fix compile error due to typo. --- debian/changelog | 1 + src/x2goutils.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 318cd1a..3ebc83d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -349,6 +349,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium show_RichText_Generic_MsgBox () and its wrappers. - src/pulsemanager.cpp: add error message boxes throughout PulseManager. Don't just abort () the program. + - src/x2goutils.h: fix compile error due to typo. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index f58a436..99739e2 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -118,7 +118,7 @@ void show_RichText_Generic_MsgBox (QMessageBox::Icon icon, const QString &main_t msg_box.exec (); } -void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text bool app_modal) { +void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text, bool app_modal) { show_RichText_Generic_MsgBox (QMessageBox::Warning, main_text, informative_text, app_modal); } -- 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 d6b4cc2572ae8d101ff30ad613d0dabce90edf24 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 03:59:51 2016 +0200 debian/changelog: fix typo in function name. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3ebc83d..4f0085f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -339,7 +339,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium default prefix as well on OS X. - src/pulsemanager.cpp: add comments to Qt 4 code part. - src/pulsemanager.cpp: add reminder for Linux-implementation in - play_startup_sound (). + slot_play_startup_sound (). - src/x2goutils.cpp: fix compile error. - src/pulsemanager.h: add new system_pulse_ variable to indicate that a system PA binary shall be used. -- 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 a941232dca9c03bd7e91af5b5b791726e6b28535 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:04:10 2016 +0200 src/pulsemanager.cpp: fix compile error on Windows. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4f0085f..0b7aec0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -350,6 +350,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: add error message boxes throughout PulseManager. Don't just abort () the program. - src/x2goutils.h: fix compile error due to typo. + - src/pulsemanager.cpp: fix compile error on Windows. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1cb7a7e..1de1cc7 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -704,8 +704,8 @@ void PulseManager::slot_play_startup_sound () { play_file_binary += "/../exe/paplay"; play_file_file += "/../Resources/startup.wav"; #elif defined (Q_OS_WIN) - playFileBinary += "/pulse/paplay.exe"; - playFileFile += "/startup.wav"; + play_file_binary += "/pulse/paplay.exe"; + play_file_file += "/startup.wav"; #else /* FIXME: implement Linux section. */ #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 ad5681f43493b2c648b9cb701ab2d58acbbf3c89 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:13:44 2016 +0200 src/pulsemanager.cpp: fix startup when using the system-PA version. --- debian/changelog | 1 + src/pulsemanager.cpp | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b7aec0..0e667ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -351,6 +351,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium Don't just abort () the program. - src/x2goutils.h: fix compile error due to typo. - src/pulsemanager.cpp: fix compile error on Windows. + - src/pulsemanager.cpp: fix startup when using the system-PA version. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1de1cc7..9582027 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -269,15 +269,20 @@ void PulseManager::start_generic () { void PulseManager::start_osx () { server_args_ = QStringList (); server_args_ << "--exit-idle-time=-1" << "-n" - << "-F" << pulse_dir_.absolutePath () + "/config.pa" - << "-p" - << QDir (app_dir_ - + "/../Frameworks/pulse-" - + QString::number (pulse_version_major_) - + "." - + QString::number (pulse_version_minor_) - + "/modules").absolutePath () - << "--high-priority"; + << "-F" << pulse_dir_.absolutePath () + "/config.pa"; + + if (!system_pulse_) { + server_args_ << "-p" + << QDir (app_dir_ + + "/../Frameworks/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules").absolutePath (); + } + + server_args_ << "--high-priority"; + if (debug_) { server_args_ << "--log-level=debug" << "--verbose" -- 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 c7985391b3a47b39b1a449aa6979fa0434f7d3db Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:15:03 2016 +0200 src/pulsemanager.cpp: fix startup sound playback when using the system-PA version. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0e667ed..ad6f4da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -352,6 +352,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/x2goutils.h: fix compile error due to typo. - src/pulsemanager.cpp: fix compile error on Windows. - src/pulsemanager.cpp: fix startup when using the system-PA version. + - src/pulsemanager.cpp: fix startup sound playback when using the + system-PA version. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9582027..e837a97 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -702,14 +702,20 @@ void PulseManager::create_client_dir () { void PulseManager::slot_play_startup_sound () { if (debug_) { QProcess play_file (0); - QString play_file_binary (app_dir_); - QString play_file_file (play_file_binary); + + /* + * Assume paplay is located at the same place as + * the pulseaudio binary. + */ + QString play_file_binary (server_working_dir_); + + QString play_file_file (app_dir_); #ifdef Q_OS_DARWIN - play_file_binary += "/../exe/paplay"; + play_file_binary += "/paplay"; play_file_file += "/../Resources/startup.wav"; #elif defined (Q_OS_WIN) - play_file_binary += "/pulse/paplay.exe"; + play_file_binary += "/paplay.exe"; play_file_file += "/startup.wav"; #else /* FIXME: implement Linux section. */ -- 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 2769efb799c55263910ff65c0f9588b315f87c8f Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:19:27 2016 +0200 src/pulsemanager.cpp: add warning message boxes where appropriate. --- debian/changelog | 1 + src/pulsemanager.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index ad6f4da..ef8c981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -354,6 +354,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix startup when using the system-PA version. - src/pulsemanager.cpp: fix startup sound playback when using the system-PA version. + - src/pulsemanager.cpp: add warning message boxes where appropriate. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index e837a97..223b7df 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -263,6 +263,14 @@ void PulseManager::start_generic () { } else { x2goErrorf (27) << "PulseAudio failed to start! Sound support will not be available."; + show_RichText_WarningMsgBox (tr ("PulseAudio failed to start!"), + tr ("Sound support will not be available.\n\n" + "If you downloaded the bundled, pre-compiled version from the official home page, " + "please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); } } @@ -731,6 +739,14 @@ void PulseManager::slot_play_startup_sound () { } else { x2goErrorf (26) << "Unable to play startup sound! Something may be wrong."; + show_RichText_WarningMsgBox (tr ("Unable to play startup sound."), + tr ("If you downloaded the bundled, pre-compiled version from the official home page " + "or the upstream Linux packages, " + "please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); } } } -- 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 936cdba368ddfd0392b4b6dd717bfc357f7a2d74 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:49:16 2016 +0200 src/pulsemanager.cpp: remove extraneous newlines from debug output. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ef8c981..51612ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -355,6 +355,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix startup sound playback when using the system-PA version. - src/pulsemanager.cpp: add warning message boxes where appropriate. + - src/pulsemanager.cpp: remove extraneous newlines from debug output. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 223b7df..1fff171 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -145,8 +145,8 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), QFileInfo tmp_file_info = QFileInfo (server_binary_); server_working_dir_ = tmp_file_info.canonicalPath (); - x2goDebug << "Found PA binary as " << server_binary_ << endl; - x2goDebug << "Corresponding working dir: " << server_working_dir_ << endl; + x2goDebug << "Found PA binary as " << server_binary_; + x2goDebug << "Corresponding working dir: " << server_working_dir_; #elif defined (Q_OS_WIN) server_working_dir_ = QString (app_dir_ + "/pulse/"); -- 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 c26042ec708718130fdf15ffda7f87e580c21d33 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:51:28 2016 +0200 src/x2goutils.cpp: fix faulty logic in find_binary (): only reset the given path to CWD iff it's actually empty. Not the other way around. --- debian/changelog | 2 ++ src/x2goutils.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 51612ad..e23fe58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -356,6 +356,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium system-PA version. - src/pulsemanager.cpp: add warning message boxes where appropriate. - src/pulsemanager.cpp: remove extraneous newlines from debug output. + - src/x2goutils.cpp: fix faulty logic in find_binary (): only reset the + given path to CWD iff it's actually empty. Not the other way around. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 99739e2..74b2918 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -303,7 +303,7 @@ QString find_binary (const QString &path, const QString &binary_name) { QString cur_path = ""; QString tmp_path = path; - if (!(path.isEmpty ())) { + if (path.isEmpty ()) { tmp_path = "./"; } -- 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 cfad22602d788785669d33cd485926dc5f68e6f3 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jun 22 04:53:13 2016 +0200 src/x2goutils.cpp: add some debug logging to find_binary (). --- debian/changelog | 1 + src/x2goutils.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index e23fe58..c8cea1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -358,6 +358,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: remove extraneous newlines from debug output. - src/x2goutils.cpp: fix faulty logic in find_binary (): only reset the given path to CWD iff it's actually empty. Not the other way around. + - src/x2goutils.cpp: add some debug logging to find_binary (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 74b2918..f218355 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -326,6 +326,10 @@ QString find_binary (const QString &path, const QString &binary_name) { ret = tmp_file_info.canonicalFilePath (); break; } + else { + x2goDebug << "Binary at " << cur_path << " either does not exist (" << !(tmp_file_info.exists ()) + << ") or is not executable (" << tmp_file_info.isExecutable () << ")"; + } } } -- 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 dc47754cc3b47b6dfd3dde267169ea039a4ec193 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 30 23:56:08 2016 +0200 nsis/x2goclient.nsi: add startup.wav to installer package. --- debian/changelog | 1 + nsis/x2goclient.nsi | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index c8cea1e..a940d2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -359,6 +359,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/x2goutils.cpp: fix faulty logic in find_binary (): only reset the given path to CWD iff it's actually empty. Not the other way around. - src/x2goutils.cpp: add some debug logging to find_binary (). + - nsis/x2goclient.nsi: add startup.wav to installer package. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/nsis/x2goclient.nsi b/nsis/x2goclient.nsi index 77d141d..461f002 100644 --- a/nsis/x2goclient.nsi +++ b/nsis/x2goclient.nsi @@ -128,6 +128,7 @@ Section "X2Go Client (required)" base File /a /x x2goclient.debug.exe /x pageant.exe /x puttygen.exe "x2goclient\*.*" File /r "x2goclient\pulse" File /r /x "fonts" "x2goclient\VcXsrv" + File "..\res\audio\startup.wav" ;Store installation folder WriteRegStr HKLM "Software\x2goclient" "" $INSTDIR -- 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 3619d2f2fbf74943176e24a202ccd687d94f5f43 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:05:05 2016 +0200 src/: new file windows_stdint.h for Windows-compatibility when using std::(u)int*_t types. These are only available with GCC in C++11 mode on Windows for some reason. --- debian/changelog | 3 +++ src/windows_stdint.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/debian/changelog b/debian/changelog index a940d2d..7f218ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -360,6 +360,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium given path to CWD iff it's actually empty. Not the other way around. - src/x2goutils.cpp: add some debug logging to find_binary (). - nsis/x2goclient.nsi: add startup.wav to installer package. + - src/: new file windows_stdint.h for Windows-compatibility when using + std::(u)int*_t types. These are only available with GCC in C++11 mode on + Windows for some reason. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/windows_stdint.h b/src/windows_stdint.h new file mode 100644 index 0000000..74b2681 --- /dev/null +++ b/src/windows_stdint.h @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2012-2016 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 WINDOWS_STDINT_H +#define WINDOWS_STDINT_H + +#ifdef Q_OS_WIN + +/* We need this ugly hack because Windows doesn't know about std::(u)int*_t types. */ +namespace std { + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef signed long long int int64_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long int uint64_t; +} + +#endif /* defined (Q_OS_WIN) */ + + +#endif /* !defined (WINDOWS_STDINT_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 c1d7d29cb57e4398e187744ab70644a105c3783d Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:06:28 2016 +0200 src/pulsemanager.h: use windows_stdint.h header on Windows, cstdint otherwise. --- debian/changelog | 2 ++ src/pulsemanager.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7f218ee..2496023 100644 --- a/debian/changelog +++ b/debian/changelog @@ -363,6 +363,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/: new file windows_stdint.h for Windows-compatibility when using std::(u)int*_t types. These are only available with GCC in C++11 mode on Windows for some reason. + - src/pulsemanager.h: use windows_stdint.h header on Windows, cstdint + otherwise. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 6e39b9a..ff541cb 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -30,7 +30,12 @@ #include <QApplication> #include <QTimer> #include <assert.h> + +#ifdef Q_OS_WIN +#include "windows_stdint.h" +#else /* defined (Q_OS_WIN) */ #include <cstdint> +#endif /* defined (Q_OS_WIN) */ #include "x2gosettings.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 8ad80877afc8659755fe4c1e5a306f07fb68a2b8 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:24:49 2016 +0200 src/onmainwindow.cpp: short out code parts unconditionally checking for the userSshd variable. We don't need it on Windows (and don't define it on purpose) because using an user-mode SSH daemon is implied there (for now.) --- debian/changelog | 4 ++++ src/onmainwindow.cpp | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2496023..be850d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -365,6 +365,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium Windows for some reason. - src/pulsemanager.h: use windows_stdint.h header on Windows, cstdint otherwise. + - src/onmainwindow.cpp: short out code parts unconditionally checking for + the userSshd variable. We don't need it on Windows (and don't define it + on purpose) because using an user-mode SSH daemon is implied there (for + now.) [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index bcef2bc..186f90d 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8320,8 +8320,13 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, /* * Do the user SSHD/global SSHD dance here and either use the * private .x2go/.ssh or the global .ssh dir. + * + * Note: Windows is implicitly always using an user-mode SSH server. */ - if (userSshd) { +#ifndef Q_OS_WIN + if (userSshd) +#endif /* !defined (Q_OS_WIN) */ + { authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/"); } @@ -9598,15 +9603,23 @@ void ONMainWindow::startX2goMount() /* * Do the user SSHD/global SSHD dance here and either use the * private .x2go/.ssh or the global .ssh dir. + * + * Note: Windows is implicitly always using an user-mode SSH server. */ - if (userSshd) { +#ifndef Q_OS_WIN + if (userSshd) +#endif /* !defined (Q_OS_WIN) */ + { 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"); - if (userSshd) { +#ifndef Q_OS_WIN + if (userSshd) +#endif /* !defined (Q_OS_WIN) */ + { x2goDebug << "Creating dir " << authorized_keys_dir.absolutePath (); authorized_keys_dir.mkpath (authorized_keys_dir.absolutePath ()); } -- 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 b26d82b579fe9e1281eeddae66fb83d3785fd51e Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:34:34 2016 +0200 src/onmainwindow.cpp: drop obsolete pulseVersionTest variable initialization in Windows-only code. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index be850d5..c5875d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -369,6 +369,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium the userSshd variable. We don't need it on Windows (and don't define it on purpose) because using an user-mode SSH daemon is implied there (for now.) + - src/onmainwindow.cpp: drop obsolete pulseVersionTest variable + initialization in Windows-only code. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 186f90d..30522b1 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -170,7 +170,6 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) homeDir=QDir::homePath(); #ifdef Q_OS_WIN - pulseVersionTest=0l; xorg=0l; xDisplay=0; #endif -- 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 afe920ca3c1a4ca9ca6f548fc1a1602ee7a0165b Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:35:11 2016 +0200 src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c5875d2..f4f93e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -371,6 +371,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium now.) - src/onmainwindow.cpp: drop obsolete pulseVersionTest variable initialization in Windows-only code. + - src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable + initialization in Windows-only code. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 30522b1..73d1141 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -435,7 +435,6 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN winServersReady=false; saveCygnusSettings(); - pulseVersionIsLegacy=false; #endif initPassDlg(); initSelectSessDlg(); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 79e4720bbb78ae7cd9890d7fb465944993217b99 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 05:40:33 2016 +0200 src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f4f93e6..7511f03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -373,6 +373,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium initialization in Windows-only code. - src/onmainwindow.cpp: drop obsolete pulseVersionIsLegacy variable initialization in Windows-only code. + - src/onmainwindow.cpp: add another pair of braces to in_addr-type + variable initialization on Windows to silence compiler warning. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 73d1141..3079ac8 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9862,7 +9862,7 @@ bool ONMainWindow::isServerRunning ( int port ) int iResult; WSADATA wsaData; - struct in_addr addr = { 0 }; + struct in_addr addr = {{ 0 }}; iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); if (iResult != 0) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 3635837390d28d8434a27943d9edc3a375b3b6eb Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 23:03:57 2016 +0200 src/onmainwindow.cpp: fix compile error on Windows after moving some code around. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7511f03..a7c6b04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -375,6 +375,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium initialization in Windows-only code. - src/onmainwindow.cpp: add another pair of braces to in_addr-type variable initialization on Windows to silence compiler warning. + - src/onmainwindow.cpp: fix compile error on Windows after moving some + code around. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 3079ac8..2867f23 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10301,7 +10301,7 @@ void ONMainWindow::generateEtcFiles() "AuthorizedKeysFile \"" << authKeyPath << "\"\n" << #ifdef Q_OS_WIN "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< - "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"<< + "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"; #else "Subsystem sftp " /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit f73d3070a60deac4dfa95ab10f492e85d8fd1eb5 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 23:16:59 2016 +0200 src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a7c6b04..26780f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -377,6 +377,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium variable initialization on Windows to silence compiler warning. - src/onmainwindow.cpp: fix compile error on Windows after moving some code around. + - src/onmainwindow.cpp: use correct C++ universal initializer for + initializing in_addr-type variable, the C-style universal zero + initializer won't cut it here. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 2867f23..9eb6986 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9862,7 +9862,7 @@ bool ONMainWindow::isServerRunning ( int port ) int iResult; WSADATA wsaData; - struct in_addr addr = {{ 0 }}; + struct in_addr addr = {{ }}; iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); if (iResult != 0) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit c23500ba9cd59d7f65f34aa88bb05db280330026 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 4 23:19:13 2016 +0200 src/pulsemanager.h: include accidentally omitted wapi.h header file. --- debian/changelog | 1 + src/pulsemanager.h | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 26780f6..5da4078 100644 --- a/debian/changelog +++ b/debian/changelog @@ -380,6 +380,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: use correct C++ universal initializer for initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. + - src/pulsemanager.h: include accidentally omitted wapi.h header file. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index ff541cb..0b1ae3c 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -38,6 +38,7 @@ #endif /* defined (Q_OS_WIN) */ #include "x2gosettings.h" +#include "wapi.h" class PulseManager: public QObject { Q_OBJECT; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 371010e665239548182fd23b6d0cfcaedeb8139b Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 11 05:22:09 2016 +0200 src/pulsemanager.cpp: make PA version parsing function more generic and don't expect that a number is always terminated with a period or dash. Especially on Windows, with a PA version number of "6.0", this lead to errors. OS X was fine with its "8.0.0-something" version number, but the optional part at the end or even the micro version number could be missing any time. --- debian/changelog | 6 ++ src/pulsemanager.cpp | 165 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 105 insertions(+), 66 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5da4078..6650e85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -381,6 +381,12 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium initializing in_addr-type variable, the C-style universal zero initializer won't cut it here. - src/pulsemanager.h: include accidentally omitted wapi.h header file. + - src/pulsemanager.cpp: make PA version parsing function more generic and + don't expect that a number is always terminated with a period or dash. + Especially on Windows, with a PA version number of "6.0", this lead to + errors. OS X was fine with its "8.0.0-something" version number, but the + optional part at the end or even the micro version number could be + missing any time. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1fff171..1da7ea4 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -383,28 +383,32 @@ void PulseManager::fetch_pulseaudio_version () { tmp_str = tmp_str.mid (needle.size ()); /* We should be at a digit now. */ - bool numbers_found[3] = { false, false, false }; - QString tmp_ret_str = QString (""); + bool numbers_started[3] = { false, false, false }; + bool numbers_finished[3] = { false, false, false }; + bool numbers_skip[3] = { false, false, false }; + QString tmp_remaining_str = QString (""); + QString numbers[3] = { }; for (QString::const_iterator cit = tmp_str.begin (); cit != tmp_str.end (); ++cit) { - if (!(numbers_found[0])) { + if (!(numbers_finished[0])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_ret_str.append (*cit); + numbers[0].append (*cit); + numbers_started[0] = true; } else if ((*cit) == '.') { - /* First number part complete, let's convert the string and skip the period. */ - numbers_found[0] = true; - bool convert_success = false; - pulse_version_major_ = tmp_ret_str.toUInt (&convert_success, 10); - - if (!convert_success) { - x2goErrorf (20) << "Unable to convert major version number string to integer."; - show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), - tr ("Unable to convert major version number string to integer."), - true); - abort (); - } - - tmp_ret_str = QString (""); + /* First number part complete and more to come, mark as done. */ + numbers_finished[0] = true; + } + else if ((*cit) == '-') { + /* First number part complete and no more numbers, mark as done, and... */ + numbers_finished[0] = true; + + /* + * Skip all the other numbers (i.e., assume the default value.) + * This doesn't make a huge lot of sense for the first number, + * but let's make this robust... + */ + numbers_skip[1] = true; + numbers_skip[2] = true; } else { x2goErrorf (21) << "Unexpected character found when parsing version string for major version number: '" << QString (*cit) << "'."; @@ -415,36 +419,21 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_found[1])) { + else if (!(numbers_finished[1])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_ret_str.append (*cit); + numbers[1].append (*cit); + numbers_started[1] = true; } - else if (((*cit) == '.') || ((*cit) == '-')) { - /* - * Second number part complete, let's convert the string and then check whether - * we stopped at a period or a dash character. - */ - numbers_found[1] = true; - bool convert_success = false; - pulse_version_minor_ = tmp_ret_str.toUInt (&convert_success, 10); - - if (!convert_success) { - x2goErrorf (22) << "Unable to convert minor version number string to integer."; - show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), - tr ("Unable to convert minor version number string to integer."), - true); - abort (); - } - - tmp_ret_str = QString (""); - - if ((*cit) == '-') { - /* - * There will be no micro version, skip it entirely and assume the default - * value of zero. - */ - numbers_found[2] = true; - } + else if ((*cit) == '.') { + /* Second number part complete and more to come, mark as done. */ + numbers_finished[1] = true; + } + else if ((*cit) == '-') { + /* Second number part complete and no more numbers, mark as done, and... */ + numbers_finished[1] = true; + + /* Skip all the other numbers (i.e., assume the default value.) */ + numbers_skip[2] = true; } else { x2goErrorf (23) << "Unexpected character found when parsing version string for minor version number: '" << QString (*cit) << "'."; @@ -455,25 +444,14 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_found[2])) { + else if (!(numbers_finished[2])) { if (((*cit) >= '0') && ((*cit) <= '9')) { - tmp_ret_str.append (*cit); + numbers[2].append (*cit); + numbers_started[2] = true; } else if ((*cit) == '-') { - /* Third number part complete, let's convert the string and skip the period. */ - numbers_found[2] = true; - bool convert_success = false; - pulse_version_micro_ = tmp_ret_str.toUInt (&convert_success, 10); - - if (!convert_success) { - x2goErrorf (24) << "Unable to convert micro version number string to integer."; - show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), - tr ("Unable to convert micro version number string to integer."), - true); - abort (); - } - - tmp_ret_str = QString (""); + /* Third number part complete and no more numbers, mark as done. */ + numbers_finished[2] = true; } else { x2goErrorf (25) << "Unexpected character found when parsing version string for micro version number: '" << QString (*cit) << "'."; @@ -486,15 +464,70 @@ void PulseManager::fetch_pulseaudio_version () { } else { /* Numbers should be good by now, let's fetch everything else. */ - tmp_ret_str.append (*cit); + tmp_remaining_str.append (*cit); + } + } + + bool numbers_done[3] = { false, false, false }; + + if (numbers_skip[0]) { + x2goErrorf (30) << "Supposed to skip major version number. Something is wrong."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Supposed to skip major version number. " + "Something is wrong."), + true); + abort (); + } + + /* not skipping and ((met period or dash) or (have something to convert and met EOL)) */ + if ((!numbers_skip[0]) && ((numbers_finished[0]) || (numbers_started[0]))) { + bool convert_success = false; + pulse_version_major_ = numbers[0].toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (20) << "Unable to convert major version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert major version number string to integer."), + true); + abort (); + } + else { + /* First number is enough to satisfy the "found" criterion. */ + found = true; + } + } + + /* not skipping and ((met period or dash) or (have something to convert and met EOL)) */ + if ((!numbers_skip[1]) && ((numbers_finished[1]) || (numbers_started[1]))) { + bool convert_success = false; + pulse_version_minor_ = numbers[1].toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (22) << "Unable to convert minor version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert minor version number string to integer."), + true); + abort (); } } - found = ((numbers_found[0]) && (numbers_found[1]) && (numbers_found[2])); + /* not skipping and ((met period or dash) or (have something to convert and met EOL)) */ + if ((!numbers_skip[2]) && ((numbers_finished[2]) || (numbers_started[2]))) { + bool convert_success = false; + pulse_version_micro_ = numbers[2].toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (24) << "Unable to convert micro version number string to integer."; + show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), + tr ("Unable to convert micro version number string to integer."), + true); + abort (); + } + } + /* Misc version part will be set to the trailing string. */ if (found) { - /* Misc version part will be set to the trailing string. */ - pulse_version_misc_ = tmp_ret_str; + pulse_version_misc_ = tmp_remaining_str; break; } } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5a5971188c5bf8ead17a9b8c66b6403b38bb4d7d Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jul 11 05:34:22 2016 +0200 src/pulsemanager.cpp: make sure that wherever we interface with non-Qt functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) Should fix a PA startup issue on Windows. --- debian/changelog | 4 ++++ src/pulsemanager.cpp | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6650e85..48a433c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -387,6 +387,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium errors. OS X was fine with its "8.0.0-something" version number, but the optional part at the end or even the micro version number could be missing any time. + - src/pulsemanager.cpp: make sure that wherever we interface with non-Qt + functions, paths are in native form (i.e., containing empty separators, + instead of the "generic" slash UNIX-style separator.) Should fix a PA + startup issue on Windows. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1da7ea4..6170634 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -51,10 +51,10 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), pulse_dir_.cd (pulse_X2Go_.mid (1)); env_ = QProcessEnvironment::systemEnvironment (); - env_.insert ("HOME", pulse_dir_.absolutePath ()); - env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); + env_.insert ("HOME", QDir::toNativeSeparators (pulse_dir_.absolutePath ())); + env_.insert ("TEMP", QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/tmp")); #ifdef Q_OS_WIN - env_.insert ("USERPROFILE", pulse_dir_.absolutePath ()); + env_.insert ("USERPROFILE", QDir::toNativeSeparators (pulse_dir_.absolutePath ())); env_.insert ("USERNAME", "pulseuser"); #endif // defined (Q_OS_WIN) @@ -277,16 +277,16 @@ void PulseManager::start_generic () { void PulseManager::start_osx () { server_args_ = QStringList (); server_args_ << "--exit-idle-time=-1" << "-n" - << "-F" << pulse_dir_.absolutePath () + "/config.pa"; + << "-F" << QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/config.pa"); if (!system_pulse_) { server_args_ << "-p" - << QDir (app_dir_ - + "/../Frameworks/pulse-" - + QString::number (pulse_version_major_) - + "." - + QString::number (pulse_version_minor_) - + "/modules").absolutePath (); + << QDir::toNativeSeparators (QDir (app_dir_ + + "/../Frameworks/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules").absolutePath ()); } server_args_ << "--high-priority"; @@ -294,7 +294,7 @@ void PulseManager::start_osx () { if (debug_) { server_args_ << "--log-level=debug" << "--verbose" - << "--log-target=file:" + pulse_dir_.absolutePath () + "/pulse.log"; + << "--log-target=file:" + QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/pulse.log"); } if (generate_server_config () && generate_client_config ()) { @@ -322,7 +322,7 @@ void PulseManager::start_win () { if (debug_) { server_args_ << "--log-level=debug" << "--verbose" - << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; + << "--log-target=file:" + QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/pulse.log"); } /* -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit cfccb8aa509f792e5578c059f81231750c830338 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 08:55:34 2016 +0200 src/pulsemanager.cpp: fix PA version fetching on OS X again. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 48a433c..c0cadf8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -391,6 +391,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium functions, paths are in native form (i.e., containing empty separators, instead of the "generic" slash UNIX-style separator.) Should fix a PA startup issue on Windows. + - src/pulsemanager.cpp: fix PA version fetching on OS X again. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6170634..01677dd 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -419,7 +419,7 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_finished[1])) { + else if ((!(numbers_finished[1])) && (!(numbers_skip[1]))) { if (((*cit) >= '0') && ((*cit) <= '9')) { numbers[1].append (*cit); numbers_started[1] = true; @@ -444,7 +444,7 @@ void PulseManager::fetch_pulseaudio_version () { abort (); } } - else if (!(numbers_finished[2])) { + else if ((!(numbers_finished[2])) && (!(numbers_skip[2]))) { if (((*cit) >= '0') && ((*cit) <= '9')) { numbers[2].append (*cit); numbers_started[2] = true; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bec2e92e583035b5c8fb57cf11e80a4cab2807ea Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:04:42 2016 +0200 src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. --- debian/changelog | 1 + src/unixhelper.cpp | 2 +- src/unixhelper.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c0cadf8..c6de400 100644 --- a/debian/changelog +++ b/debian/changelog @@ -392,6 +392,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium instead of the "generic" slash UNIX-style separator.) Should fix a PA startup issue on Windows. - src/pulsemanager.cpp: fix PA version fetching on OS X again. + - src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d5aa67d..4488786 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -34,7 +34,7 @@ /* For documentation please see unixhelper.h. */ namespace unixhelper { - void kill_pgroup (int signal) { + void kill_pgroup (const int signal) { if (SIGHUP == signal) { /* Try to kill via SIGTERM first. */ if (0 != killpg (getpgrp (), SIGTERM)) { diff --git a/src/unixhelper.h b/src/unixhelper.h index a34456e..3c2798f 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -61,7 +61,7 @@ namespace unixhelper { * (we cannot rely that this always happens, though, * so a polling solution is needed, see unix_cleanup().) */ - void kill_pgroup (int signal); + void kill_pgroup (const int signal); } #endif /* defined (Q_OS_UNIX) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 83cb2637d58c4e0a943a571054ac16ed7a20dca8 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:06:32 2016 +0200 src/unixhelper.h: style and general fixes within comments. --- debian/changelog | 1 + src/unixhelper.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c6de400..e149113 100644 --- a/debian/changelog +++ b/debian/changelog @@ -393,6 +393,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium startup issue on Windows. - src/pulsemanager.cpp: fix PA version fetching on OS X again. - src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. + - src/unixhelper.h: style and general fixes within comments. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.h b/src/unixhelper.h index 3c2798f..d67f3ed 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -29,7 +29,7 @@ namespace unixhelper { /* * Unblocks all signals and installs a signal handler for SIGHUP, - * which calls kill_pgroup(). + * which calls kill_pgroup (). * * Should signal unblocking or installing the signal handler fail, * an emergency exit is performed and @@ -42,7 +42,7 @@ namespace unixhelper { * * In this loop, the current parent PID is polled and compared against * the original value passed via parameter parent. - * Should they mismatch, the parent died and kill_pgroup() is called. + * Should they mismatch, the parent died and kill_pgroup () is called. */ int unix_cleanup (const pid_t parent); @@ -60,6 +60,7 @@ namespace unixhelper { * group leader dies under specific circumstances * (we cannot rely that this always happens, though, * so a polling solution is needed, see unix_cleanup().) + * Other values are not handled. */ void kill_pgroup (const int signal); } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 48b054fdc538e6e5878de8c3c2135d2b98cb7274 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:00:41 2016 +0200 src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). --- debian/changelog | 2 ++ src/unixhelper.cpp | 37 +++++++++++++++++++++++++++---------- src/unixhelper.h | 12 ++++++++++++ 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index e149113..daebd35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -394,6 +394,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix PA version fetching on OS X again. - src/unixhelper.{cpp,h}: make argument of kill_pgroup () const. - src/unixhelper.h: style and general fixes within comments. + - src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () + into a new function called real_kill_pgroup (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 4488786..4d9c56f 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,25 +30,42 @@ #include <cerrno> #include <vector> #include <cstdlib> +#include <stdio.h> +#include <string.h> /* For documentation please see unixhelper.h. */ namespace unixhelper { void kill_pgroup (const int signal) { - if (SIGHUP == signal) { - /* Try to kill via SIGTERM first. */ - if (0 != killpg (getpgrp (), SIGTERM)) { - std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; - } + } + + void real_kill_pgroup (const pid_t pgid) { + /* Try to kill via SIGTERM first. */ + if (0 != killpg (pgid, SIGTERM)) { + std::cerr << "WARNING: unable to send SIGTERM to process group '" << pgid << "': " << std::strerror (errno) << std::endl; + } + + /* Grant a grace period of (at least) 10 seconds. */ + sleep (10); - /* Grant a grace period of (at least) 10 seconds. */ - sleep (10); + int kill_ret = killpg (pgid, SIGKILL); - /* Don't handle any errors here, because we die anyway. */ - killpg (getpgrp (), SIGKILL); + /* + * Might be unreachable. + * Depending upon which pgroup we just killed, this + * code is either unreachable (because killpg () killed + * itself already), or being executed. + * Let's handle errors and exit, if necessary. + */ + if (0 != kill_ret) { + char err_str[512] = { }; + snprintf (err_str, 512, "WARNING: failed to kill process group '%d'", pgid); + + perror (err_str); } - } + exit (EXIT_SUCCESS); + } int unix_cleanup (const pid_t parent) { /* diff --git a/src/unixhelper.h b/src/unixhelper.h index d67f3ed..662b3be 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -63,6 +63,18 @@ namespace unixhelper { * Other values are not handled. */ void kill_pgroup (const int signal); + + /* + * Kills the whole process group. + * First, SIGTERM is sent to the group. + * A 10 seconds grace period is granted to make sure + * processes exit cleanly on their own. + * Lastly, SIGKILL is sent to the group -- which also + * implies the demise of this program. + * + * pgid is the process group ID to be killed. + */ + void real_kill_pgroup (const pid_t pgid); } #endif /* defined (Q_OS_UNIX) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ef305a4111b81f21738471739804764b0b2d7306 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Aug 12 09:11:16 2016 +0200 src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper around real_kill_pgroup (). Adjust comment. We need to do this so the cleanup process doesn't kill itself before all other processes in the process group are killed. --- debian/changelog | 4 ++++ src/unixhelper.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/unixhelper.h | 12 ++++++------ 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index daebd35..ce03b6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -396,6 +396,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/unixhelper.h: style and general fixes within comments. - src/unixhelper.{cpp,h}: split off core functionality of kill_pgroup () into a new function called real_kill_pgroup (). + - src/unixhelper.{cpp,h}: rewrite kill_pgroup () to act as a wrapper + around real_kill_pgroup (). Adjust comment. We need to do this so the + cleanup process doesn't kill itself before all other processes in the + process group are killed. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 4d9c56f..82e4374 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -37,6 +37,44 @@ namespace unixhelper { void kill_pgroup (const int signal) { + pid_t pgid_to_kill = getpgrp (); + + if ((SIGHUP == signal) || (-1 == signal)) { + /* + * In order to not kill ourselves, we need to run this + * code in a new process group. + */ + pid_t tmp_pid = fork (); + + /* Child. */ + if (0 == tmp_pid) { + /* Create new pgid. */ + int err = setpgid (0, 0); + + if (0 != err) { + std::perror ("WARNING: unable to change PGID"); + std::cerr << "Continuing with normal operation, but process might kill itself before tree vanishes." << std::endl; + } + + real_kill_pgroup (pgid_to_kill); + } + /* Error. */ + else if (-1 == tmp_pid) { + perror ("WARNING: unable to fork off another process to kill original process group"); + std::cerr << "Proceeding with normal operation, but process might kill itself before tree vanishes." << std::endl; + + real_kill_pgroup (pgid_to_kill); + } + /* Parent. */ + else { + /* + * No need to do anything, just exit here in order to not + * spawn a bunch of new processes due to subsequent calls + * to kill_pgroup () from unix_cleanup (). + */ + exit (EXIT_SUCCESS); + } + } } void real_kill_pgroup (const pid_t pgid) { diff --git a/src/unixhelper.h b/src/unixhelper.h index 662b3be..7d30bcf 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -47,12 +47,12 @@ namespace unixhelper { int unix_cleanup (const pid_t parent); /* - * Kills the whole process group. - * First, SIGTERM is sent to the group. - * A 10 seconds grace period is granted to make sure - * processes exit cleanly on their own. - * Lastly, SIGKILL is sent to the group -- which also - * implies the demise of this program. + * Wrapper for killing a whole process group. + * The "real" killing work is done by real_kill_pgroup (). + * This function tries to fork off another process and change + * the new function's process group ID. + * If any of these operations fail, killing the original process + * group ID will still continue, albeit with warning messages. * * signal may be any of: * * -1 to indicate an error leading to emergency termination -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 64d9a0669ebb9bc2dc1c123c97fa2e41f3ab5247 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Aug 13 23:27:42 2016 +0200 src/pulsemanager.cpp: remove unused variables. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ce03b6e..262f297 100644 --- a/debian/changelog +++ b/debian/changelog @@ -400,6 +400,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium around real_kill_pgroup (). Adjust comment. We need to do this so the cleanup process doesn't kill itself before all other processes in the process group are killed. + - src/pulsemanager.cpp: remove unused variables. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 01677dd..93c83b3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -468,8 +468,6 @@ void PulseManager::fetch_pulseaudio_version () { } } - bool numbers_done[3] = { false, false, false }; - if (numbers_skip[0]) { x2goErrorf (30) << "Supposed to skip major version number. Something is wrong."; show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"), -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 009384daf9ba0d30e2081fba8d619c5142ce6012 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Aug 13 23:33:15 2016 +0200 src/unixhelper.cpp: code cleanup. --- debian/changelog | 1 + src/unixhelper.cpp | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 262f297..2908c2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -401,6 +401,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium cleanup process doesn't kill itself before all other processes in the process group are killed. - src/pulsemanager.cpp: remove unused variables. + - src/unixhelper.cpp: code cleanup. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 82e4374..d6b4993 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -31,7 +31,6 @@ #include <vector> #include <cstdlib> #include <stdio.h> -#include <string.h> /* For documentation please see unixhelper.h. */ @@ -60,8 +59,8 @@ namespace unixhelper { } /* Error. */ else if (-1 == tmp_pid) { - perror ("WARNING: unable to fork off another process to kill original process group"); - std::cerr << "Proceeding with normal operation, but process might kill itself before tree vanishes." << std::endl; + std::perror ("WARNING: unable to fork off another process to kill original process group"); + std::cerr << "Proceeding with normal operation, but process might kill itself before tree vanishes." << std::endl; real_kill_pgroup (pgid_to_kill); } @@ -72,7 +71,7 @@ namespace unixhelper { * spawn a bunch of new processes due to subsequent calls * to kill_pgroup () from unix_cleanup (). */ - exit (EXIT_SUCCESS); + std::exit (EXIT_SUCCESS); } } } @@ -96,13 +95,10 @@ namespace unixhelper { * Let's handle errors and exit, if necessary. */ if (0 != kill_ret) { - char err_str[512] = { }; - snprintf (err_str, 512, "WARNING: failed to kill process group '%d'", pgid); - - perror (err_str); + std::cerr << "WARNING: failed to kill process group '" << pgid << "': " << std::strerror (err_str) << std::endl; } - exit (EXIT_SUCCESS); + std::exit (EXIT_SUCCESS); } int unix_cleanup (const pid_t parent) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0acbdcb6bc00c4c7197a7b1147539c7ce6123259 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Aug 13 23:42:53 2016 +0200 src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. --- debian/changelog | 1 + src/unixhelper.cpp | 18 ++++++++++++------ src/x2goclient.cpp | 9 ++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2908c2b..3b5a34b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -402,6 +402,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium process group are killed. - src/pulsemanager.cpp: remove unused variables. - src/unixhelper.cpp: code cleanup. + - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d6b4993..406cdda 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -79,7 +79,8 @@ namespace unixhelper { void real_kill_pgroup (const pid_t pgid) { /* Try to kill via SIGTERM first. */ if (0 != killpg (pgid, SIGTERM)) { - std::cerr << "WARNING: unable to send SIGTERM to process group '" << pgid << "': " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "WARNING: unable to send SIGTERM to process group '" << pgid << "': " << std::strerror (saved_errno) << std::endl; } /* Grant a grace period of (at least) 10 seconds. */ @@ -95,7 +96,8 @@ namespace unixhelper { * Let's handle errors and exit, if necessary. */ if (0 != kill_ret) { - std::cerr << "WARNING: failed to kill process group '" << pgid << "': " << std::strerror (err_str) << std::endl; + const int saved_errno = errno; + std::cerr << "WARNING: failed to kill process group '" << pgid << "': " << std::strerror (saved_errno) << std::endl; } std::exit (EXIT_SUCCESS); @@ -108,14 +110,16 @@ namespace unixhelper { */ sigset_t empty_set; if (0 != sigemptyset (&empty_set)) { - std::cerr << "Unable to fetch empty signal set: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to fetch empty signal set: " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ } if (0 != sigprocmask (SIG_SETMASK, &empty_set, NULL)) { - std::cerr << "Unable to set empty signal set: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to set empty signal set: " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ @@ -137,7 +141,8 @@ namespace unixhelper { /* Set up signal handler to ignore the current signal. */ if (0 != sigaction (*it, &sig_action, NULL)) { - std::cerr << "Unable to ignore signal " << strsignal (*it) << ": " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to ignore signal " << strsignal (*it) << ": " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ @@ -151,7 +156,8 @@ namespace unixhelper { sig_action.sa_flags = SA_RESTART; if (0 != sigaction (SIGHUP, &sig_action, NULL)) { - std::cerr << "Unable to set up signal handler for SIGHUP: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Unable to set up signal handler for SIGHUP: " << std::strerror (saved_errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index b201a4e..431a01e 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -58,13 +58,15 @@ int fork_helper (int argc, char **argv) { new_argv_c_str->push_back (0); if (0 != execv (new_argv_c_str->front (), &(new_argv_c_str->front ()))) { - std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (errno) << "\n" + const int saved_errno = errno; + std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (saved_errno) << "\n" << "Terminating and killing parent." << "\n" << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; pid_t parent_pid = getppid (); if (0 != kill (parent_pid, SIGTERM)) { - std::cerr << "Failed to kill parent process: " << std::strerror (errno) << std::endl; + const int saved_errno = errno; + std::cerr << "Failed to kill parent process: " << std::strerror (saved_errno) << std::endl; } std::exit (EXIT_FAILURE); @@ -75,7 +77,8 @@ int fork_helper (int argc, char **argv) { } /* Error. */ else if (-1 == tmp_pid) { - std::cerr << "Unable to create a new process for the UNIX cleanup watchdog: " << std::strerror (errno) << "\n"; + const int saved_errno = errno; + std::cerr << "Unable to create a new process for the UNIX cleanup watchdog: " << std::strerror (saved_errno) << "\n"; std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; std::exit (EXIT_FAILURE); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 376a01347d07e2f6973a27d18bd5dbea3a6092b6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 22 04:05:53 2016 +0200 src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3b5a34b..d7c8581 100644 --- a/debian/changelog +++ b/debian/changelog @@ -403,6 +403,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: remove unused variables. - src/unixhelper.cpp: code cleanup. - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. + - src/onmainwindow.cpp: document createRSAKey () because what it does is + completely non-obvious. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 9eb6986..59db174 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8112,6 +8112,33 @@ void ONMainWindow::exportDefaultDirs() QString ONMainWindow::createRSAKey() { + /* + * I spent multiple hours on trying to understand this function + * and directory exporting in general, so I'd better document + * this. + * + * This function first generates a new RSA private-public key + * pair as ~/.x2go/ssh/gen/key.XXXXX{,.pub}. + * + * Then, the SSH daemon's public host key is read and appended + * to the *private* SSH key file after a marker looking like + * this: "----BEGIN RSA IDENTITY----" + * + * Later on, this *private* SSH key file is transferred to the + * remote server, which parses it in the "x2gomountdirs" perl + * script and extracts the public key (used for logging in + * to the client machine) and the public *host* key, used to + * circumvent the "untrusted host" message by SSH by + * explicitly giving the aforementioned public *host* key as + * the only element in a fake "authorized_keys" file. Again, + * this is all happening server-side. + * + * The *public* key part generated here is then taken and + * later added to the "authorized_keys" file on the client + * side, to allow auto-logins via the generated and transferred + * private SSH key. + */ + QDir dr; QString keyPath=homeDir +"/.x2go/ssh/gen"; dr.mkpath ( keyPath ); @@ -8127,6 +8154,9 @@ QString ONMainWindow::createRSAKey() QStringList args; + /* + * Generating new key material here. + */ args<<"-t"<<"rsa"<<"-b"<<"1024"<<"-N"<<""<<"-f"<<keyName<<"-q"; x2goDebug<<"ssh-keygen " + args.join(" "); @@ -8139,6 +8169,9 @@ QString ONMainWindow::createRSAKey() x2goDebug<<"ssh-keygen succeeded."; + /* + * Now taking the *host* pub key here... + */ QFile rsa ( "/etc/ssh/ssh_host_rsa_key.pub" ); #ifdef Q_OS_WIN rsa.setFileName ( -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 33b91f3eddbcc63493f52863470cf910aeed11be Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 22 04:08:45 2016 +0200 src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). --- debian/changelog | 3 +++ src/onmainwindow.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index d7c8581..792a3fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -405,6 +405,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use. - src/onmainwindow.cpp: document createRSAKey () because what it does is completely non-obvious. + - src/onmainwindow.cpp: add support for explicitly setting the private key + bit size based on type and use values (currently) regarded as secure to + generateHostKey (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 59db174..fa1dc4f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10355,26 +10355,33 @@ void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; QString stringified_key_type = ""; + std::size_t key_bits = 0; switch (key_type) { case RSA_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "rsa"; + key_bits = 4096; break; case DSA_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "dsa"; + key_bits = 1024; break; case ECDSA_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "ecdsa"; + key_bits = 384; break; case ED25519_KEY_TYPE: sanitized_key_type = key_type; stringified_key_type = "ed25519"; + /* Fixed key length, flag will be unused. */ + key_bits = 0; break; default: sanitized_key_type = UNKNOWN_KEY_TYPE; stringified_key_type = "unknown"; + key_bits = 0; } if (sanitized_key_type == UNKNOWN_KEY_TYPE) { @@ -10401,6 +10408,8 @@ void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type) QStringList args; args << "-t" << stringified_key_type + << "-b" + << QString::number (key_bits) << "-N" << "" << "-C" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit a347d027f2811d09ceafa4746dc01e110da297c0 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 22 04:57:38 2016 +0200 src/onmainwindow.{cpp,h}: rename generateHostKey () to generateKey () and add a boolean parameter with a default of false to request a public key. Change old invocations of generateHostKey () accordingly. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 6 +++--- src/onmainwindow.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 792a3fd..6f2fb15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -408,6 +408,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey (). + - src/onmainwindow.{cpp,h}: rename generateHostKey () to generateKey () + and add a boolean parameter with a default of false to request a public + key. Change old invocations of generateHostKey () accordingly. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index fa1dc4f..c1fe992 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8207,7 +8207,7 @@ QString ONMainWindow::createRSAKey() if ( !rsa.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { #if defined (Q_OS_LINUX) || defined (Q_OS_DARWIN) - generateHostKey (RSA_KEY_TYPE); + generateKey (RSA_KEY_TYPE, true); generateEtcFiles (); if (!startSshd ()) { @@ -10172,7 +10172,7 @@ void ONMainWindow::startWinServers() { dr.mkpath ( etcDir ); - generateHostKey(RSA_KEY_TYPE); + generateKey(RSA_KEY_TYPE, true); generateEtcFiles(); sshStarter->start(); } @@ -10351,7 +10351,7 @@ void ONMainWindow::generateEtcFiles() x2goDebug<<etcDir +"/sshd_config created."; } -void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type) +void ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; QString stringified_key_type = ""; diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 1fb1e8e..38c22c3 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1206,7 +1206,7 @@ private: #endif void filterDesktops ( const QString& filter, bool strict=false ); - void generateHostKey(key_types key_type); + void generateKey(key_types key_type, bool host_key = false); void generateEtcFiles(); QString u3DataPath(); void cleanPortable(); -- 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 7ac26e82716fb26fd21d2a16e087712bdeb3d5a9 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 22 05:32:59 2016 +0200 src/onmainwindow.cpp: refactor generateKey () a little bit to compact it. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6f2fb15..c17a56a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -411,6 +411,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: rename generateHostKey () to generateKey () and add a boolean parameter with a default of false to request a public key. Change old invocations of generateHostKey () accordingly. + - src/onmainwindow.cpp: refactor generateKey () a little bit to compact + it. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index c1fe992..388be6f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10390,21 +10390,22 @@ void ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) close (); } - QString etcDir = homeDir + "/.x2go/etc/"; - QDir dr (homeDir); - dr.mkpath (etcDir); - QString private_key_file = etcDir + "/ssh_host_" + stringified_key_type + "_key"; + QString etc_dir = homeDir + "/.x2go/etc/"; + QDir dir (homeDir); + dir.mkpath (etc_dir); + QString private_key_file = ""; +#ifdef Q_OS_WIN + private_key_file = cygwinPath (wapiShortFileName (etc_dir)); +#else + private_key_file = etc_dir; +#endif + private_key_file += "/ssh_host_" + stringified_key_type + "_key"; QString public_key_file = private_key_file + ".pub"; if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) { x2goDebug << "Generating host key. Type: " << stringified_key_type; -#ifdef Q_OS_WIN - private_key_file = cygwinPath (wapiShortFileName (etcDir)) - + "/ssh_host_" + stringified_key_type + "_key"; -#endif - QStringList args; args << "-t" << stringified_key_type -- 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 fdbfe8a7e1fc5f7e4d0ab069c435521a50b17ced Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 02:49:03 2016 +0200 src/onmainwindow.{cpp,h}: rewrite generateKey () function to actually also generate user keys. Now returns the private key file path (public key file path is trivially determined by appending ".pub" to that return value.) Change all locations referencing generateKey () to use the return value (if necessary) and remove dead code that was used to generate a user key manually previously. --- debian/changelog | 6 +++ src/onmainwindow.cpp | 130 +++++++++++++++++++++++++++++++------------------- src/onmainwindow.h | 2 +- 3 files changed, 87 insertions(+), 51 deletions(-) diff --git a/debian/changelog b/debian/changelog index c17a56a..d02abed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -413,6 +413,12 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium key. Change old invocations of generateHostKey () accordingly. - src/onmainwindow.cpp: refactor generateKey () a little bit to compact it. + - src/onmainwindow.{cpp,h}: rewrite generateKey () function to actually + also generate user keys. Now returns the private key file path (public + key file path is trivially determined by appending ".pub" to that return + value.) Change all locations referencing generateKey () to use the + return value (if necessary) and remove dead code that was used to + generate a user key manually previously. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 388be6f..378a7f2 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8139,35 +8139,7 @@ QString ONMainWindow::createRSAKey() * private SSH key. */ - QDir dr; - QString keyPath=homeDir +"/.x2go/ssh/gen"; - dr.mkpath ( keyPath ); -#ifdef Q_OS_WIN - keyPath=wapiShortFileName ( keyPath ); -#endif - QTemporaryFile fl ( keyPath+"/key" ); - fl.open(); - QString keyName=fl.fileName(); - fl.setAutoRemove ( false ); - fl.close(); - fl.remove(); - - QStringList args; - - /* - * Generating new key material here. - */ - args<<"-t"<<"rsa"<<"-b"<<"1024"<<"-N"<<""<<"-f"<<keyName<<"-q"; - - x2goDebug<<"ssh-keygen " + args.join(" "); - - if ( QProcess::execute ( "ssh-keygen",args ) !=0 ) - { - x2goDebug<<"ssh-keygen failed." <<endl; - return QString::null; - } - x2goDebug<<"ssh-keygen succeeded."; - + QString user_key = generateKey (RSA_KEY_TYPE); /* * Now taking the *host* pub key here... @@ -8207,14 +8179,14 @@ QString ONMainWindow::createRSAKey() if ( !rsa.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { #if defined (Q_OS_LINUX) || defined (Q_OS_DARWIN) - generateKey (RSA_KEY_TYPE, true); + QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); generateEtcFiles (); if (!startSshd ()) { return (QString::null); } - rsa.setFileName ( homeDir+"/.x2go/etc/ssh_host_rsa_key.pub" ); + rsa.setFileName (tmp_file_name + ".pub"); rsa.open ( QIODevice::ReadOnly | QIODevice::Text ); #else printSshDError_noHostPubKey(); @@ -8232,18 +8204,18 @@ QString ONMainWindow::createRSAKey() return QString::null; } - QFile file ( keyName ); + QFile file ( user_key ); if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ) ) { - x2goErrorf(10)<<tr("Cannot open key: ")<<keyName; - return keyName; + x2goErrorf(10) << tr ("Cannot open key: ") << user_key; + return user_key; } QTextStream out ( &file ); out<<"----BEGIN RSA IDENTITY----"<<rsa_pub; file.close(); - return keyName; + return user_key; } void ONMainWindow::slotCopyKey ( bool result, QString output, int pid) @@ -10172,7 +10144,7 @@ void ONMainWindow::startWinServers() { dr.mkpath ( etcDir ); - generateKey(RSA_KEY_TYPE, true); + UNUSED (generateKey (RSA_KEY_TYPE, true)); generateEtcFiles(); sshStarter->start(); } @@ -10351,11 +10323,12 @@ void ONMainWindow::generateEtcFiles() x2goDebug<<etcDir +"/sshd_config created."; } -void ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) +QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; - QString stringified_key_type = ""; + QString stringified_key_type (""); std::size_t key_bits = 0; + QString ret (""); switch (key_type) { case RSA_KEY_TYPE: sanitized_key_type = key_type; @@ -10385,28 +10358,83 @@ void ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) } if (sanitized_key_type == UNKNOWN_KEY_TYPE) { - QMessageBox::critical (this, tr ("Host key type selection error"), - tr ("Unknown host key selected.\nTerminating application.")); + QMessageBox::critical (this, tr ("SSH key type selection error"), + tr ("Unknown SSH key selected.") + + "\n" + + tr ("Terminating application.")); close (); } - QString etc_dir = homeDir + "/.x2go/etc/"; - QDir dir (homeDir); - dir.mkpath (etc_dir); - QString private_key_file = ""; + QString base_dir (homeDir); + QString private_key_file (""); + + if (host_key) { + base_dir += "/.x2go/etc/"; + } + else { + base_dir += "/.x2go/ssh/gen/"; + } + + { + QDir dir (homeDir); + if (!(dir.mkpath (base_dir))) { + QMessageBox::critical (this, tr ("SSH key base directory creation error"), + tr ("Unable to create SSH key base directory '%1'.").arg (base_dir) + + "\n" + + tr ("Terminating application.")); + } + } + #ifdef Q_OS_WIN - private_key_file = cygwinPath (wapiShortFileName (etc_dir)); + private_key_file = cygwinPath (wapiShortFileName (base_dir)); #else - private_key_file = etc_dir; + private_key_file = base_dir; #endif - private_key_file += "/ssh_host_" + stringified_key_type + "_key"; - QString public_key_file = private_key_file + ".pub"; + ret = base_dir; + + { + QString tmp_to_add (""); + + if (host_key) { + QString tmp_to_add = "/ssh_host_" + stringified_key_type + "_key"; + } + else { + QTemporaryFile temp_file (base_dir + "/key"); + temp_file.open (); + + /* Extract base name. */ + QFileInfo tmp_file_info (temp_file.fileName ()); + tmp_to_add = tmp_file_info.fileName (); + + /* Clean up again. We don't need the temporary file anymore. */ + temp_file.setAutoRemove (false); + temp_file.close (); + temp_file.remove (); + } + + private_key_file += tmp_to_add; + ret += tmp_to_add; + } + + QString public_key_file (private_key_file + ".pub"); if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) { - x2goDebug << "Generating host key. Type: " << stringified_key_type; + x2goDebug << "Generating SSH key. Type: " << stringified_key_type; QStringList args; + + QString comment = "X2Go Client " + stringified_key_type + " "; + + if (host_key) { + comment += "host"; + } + else { + comment += "user"; + } + + comment += " key"; + args << "-t" << stringified_key_type << "-b" @@ -10414,11 +10442,13 @@ void ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) << "-N" << "" << "-C" - << QString ("X2Go Client " + stringified_key_type + "host key") + << comment << "-f" << private_key_file; QProcess::execute ("ssh-keygen", args); } + + return (ret); } bool ONMainWindow::startSshd() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 38c22c3..64624cc 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1206,7 +1206,7 @@ private: #endif void filterDesktops ( const QString& filter, bool strict=false ); - void generateKey(key_types key_type, bool host_key = false); + QString generateKey(key_types key_type, bool host_key = false); void generateEtcFiles(); QString u3DataPath(); void cleanPortable(); -- 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 0ada6b7a185fe6c331b426d286452bbdc7d035fe Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 03:12:43 2016 +0200 src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 30 +++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d02abed..1c16930 100644 --- a/debian/changelog +++ b/debian/changelog @@ -419,6 +419,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium value.) Change all locations referencing generateKey () to use the return value (if necessary) and remove dead code that was used to generate a user key manually previously. + - src/onmainwindow.cpp: add more error handling to generateKey () and fix + up a broken error-handling section. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 378a7f2..8c542b1 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10382,6 +10382,7 @@ QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_ke tr ("Unable to create SSH key base directory '%1'.").arg (base_dir) + "\n" + tr ("Terminating application.")); + close (); } } @@ -10445,7 +10446,34 @@ QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_ke << comment << "-f" << private_key_file; - QProcess::execute ("ssh-keygen", args); + + const int keygen_ret = QProcess::execute ("ssh-keygen", args); + + if (-2 == keygen_ret) { + QMessageBox::critical (this, tr ("ssh-keygen launching error"), + tr ("Unable to start the ssh-keygen binary.") + + "\n" + + tr ("Terminating application.")); + close (); + } + + if (-1 == keygen_ret) { + QMessageBox::critical (this, tr ("ssh-keygen crashed"), + tr ("The ssh-keygen binary crashed.") + + "\n" + + tr ("Terminating application.")); + close (); + } + + if (0 != keygen_ret) { + QMessageBox::critical (this, tr ("ssh-keygen program error"), + tr ("The ssh-keygen binary did not exit cleanly.") + + " " + + tr ("It was probably called with unknown arguments.") + + "\n" + + tr ("Terminating application.")); + close (); + } } return (ret); -- 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 202a6b72b23c25609d172b8bcee8accbfe759255 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 03:22:29 2016 +0200 src/onmainwindow.cpp: fix up a few debug strings. --- debian/changelog | 1 + src/onmainwindow.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1c16930..a1c64ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -421,6 +421,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium generate a user key manually previously. - src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section. + - src/onmainwindow.cpp: fix up a few debug strings. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 8c542b1..87bbb64 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8306,7 +8306,7 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, QMessageBox::NoButton ); } QFile file ( key+".pub" ); - x2goDebug<<"Deactivating public key from "<<key<<".pub again."<<endl; + x2goDebug << "Deactivating public key from " << QString (key + ".pub") << " again."; if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) { printSshDError_noExportPubKey(); @@ -9691,7 +9691,7 @@ void ONMainWindow::startX2goMount() out << line; authorized_keys_file.close (); - x2goDebug << "Temporarily activated public key from file " << fsExportKey << ".pub."; + x2goDebug << "Temporarily activated public key from file " << QString (fsExportKey + ".pub") << "."; QString passwd=getCurrentPass(); QString user=getCurrentUname(); -- 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 a2f3bfb8f6204f275cda920199a89d916bf78219 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 04:47:22 2016 +0200 src/{onmainwindow.{cpp,h},configdialog.cpp}: remove userSshd variable and code related to non-user-mode-sshd setups. Simplifies code a bit and we want to always start a user-mode OpenSSH server anyway. Also get rid of the clientport variable that is now unnecessary. --- debian/changelog | 4 + src/configdialog.cpp | 20 ----- src/onmainwindow.cpp | 234 ++++++++++---------------------------------------- src/onmainwindow.h | 1 - 4 files changed, 48 insertions(+), 211 deletions(-) diff --git a/debian/changelog b/debian/changelog index a1c64ed..c7ec333 100644 --- a/debian/changelog +++ b/debian/changelog @@ -422,6 +422,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: add more error handling to generateKey () and fix up a broken error-handling section. - src/onmainwindow.cpp: fix up a few debug strings. + - src/{onmainwindow.{cpp,h},configdialog.cpp}: remove userSshd variable + and code related to non-user-mode-sshd setups. Simplifies code a bit and + we want to always start a user-mode OpenSSH server anyway. Also get rid + of the clientport variable that is now unnecessary. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/configdialog.cpp b/src/configdialog.cpp index d1973d0..9e771d5 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -248,22 +248,6 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f ) #endif //Q_OS_DARWIN -#ifndef Q_OS_WIN - clientSshPort=new QSpinBox ( fr ); - clientSshPort->setMaximum ( 1000000 ); - clientSshPort->setValue ( st.setting()->value ( "clientport", - ( QVariant ) 22 ).toInt() ); - - QHBoxLayout* sshLay=new QHBoxLayout(); - sshLay->addWidget ( - new QLabel ( tr ( - "Clientside (local) SSH daemon port for file system export usage:" - ),fr ) ); - sshLay->addWidget ( clientSshPort ); - sshLay->addStretch(); - frLay->addLayout ( sshLay ); -#endif - if ( embedMode ) { cbStartEmbed=new QCheckBox ( @@ -411,10 +395,6 @@ void ConfigDialog::slot_accepted() st.setting()->setValue ( "xdarwin/directory", ( QVariant ) leXexec->text() ); #endif -#ifndef Q_OS_WIN - st.setting()->setValue ( "clientport", - ( QVariant ) clientSshPort->value() ); -#endif pwid->saveSettings(); if ( embedMode ) diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 87bbb64..eff2467 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -151,7 +151,6 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) X2goSettings st ( "settings" ); winSshdStarted=false; #else - userSshd=false; sshd=0l; #endif @@ -1516,7 +1515,7 @@ void ONMainWindow::closeClient() #endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ #ifndef Q_OS_WIN - if ( userSshd && sshd ) + if (sshd) { x2goDebug<<"Terminating the OpenSSH server ..."; sshd->terminate(); @@ -1645,11 +1644,6 @@ void ONMainWindow::loadSettings() ldapPort2=st1.setting()->value ( "LDAP/port2", ( QVariant ) 0 ).toInt(); } -#ifndef Q_OS_WIN - if ( !userSshd ) - clientSshPort=st1.setting()->value ( "clientport", - ( QVariant ) 22 ).toString(); -#endif showToolBar=st1.setting()->value ( "toolbar/show", ( QVariant ) true ).toBool(); @@ -8144,52 +8138,26 @@ QString ONMainWindow::createRSAKey() /* * Now taking the *host* pub key here... */ - QFile rsa ( "/etc/ssh/ssh_host_rsa_key.pub" ); + QFile rsa (homeDir + "/.x2go/etc/ssh_host_rsa_key.pub"); #ifdef Q_OS_WIN - rsa.setFileName ( - wapiShortFileName ( - homeDir+"\\.x2go\\etc\\ssh_host_rsa_key.pub" ) ); -#else - if ( userSshd ) - rsa.setFileName ( homeDir+"/.x2go/etc/ssh_host_dsa_key.pub" ); - + rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\ssh_host_rsa_key.pub")); #endif -#ifdef Q_OS_DARWIN - { - /* OS X 10.11+ changed the key location to /etc/ssh/. */ - QFileInfo rsa_host_key ("/etc/ssh/ssh_host_rsa_key.pub"); - - x2goDebug << "first try for RSA key " << rsa_host_key.absoluteFilePath () << ": " - << rsa_host_key.exists (); - if (!(rsa_host_key.exists ())) { - rsa_host_key = QFileInfo ("/etc/ssh_host_rsa_key.pub"); - - x2goDebug << "second try for RSA key " << rsa_host_key.absoluteFilePath () << ": " - << rsa_host_key.exists (); - if (!(rsa_host_key.exists ())) { - printSshDError_noHostPubKey (); - return QString::null; - } - } - - rsa.setFileName (rsa_host_key.absoluteFilePath ()); - } -#endif - if ( !rsa.open ( QIODevice::ReadOnly | QIODevice::Text ) ) - { -#if defined (Q_OS_LINUX) || defined (Q_OS_DARWIN) + if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { + x2goDebug << "Unable to open public host key file."; +#ifdef Q_OS_UNIX + x2goDebug << "Creating a new one."; QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); generateEtcFiles (); - if (!startSshd ()) { + if (!(startSshd ())) { return (QString::null); } rsa.setFileName (tmp_file_name + ".pub"); - rsa.open ( QIODevice::ReadOnly | QIODevice::Text ); + rsa.open (QIODevice::ReadOnly | QIODevice::Text); #else - printSshDError_noHostPubKey(); + printSshDError_noHostPubKey (); return QString::null; #endif } @@ -8319,21 +8287,8 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, file.close(); QDir authorized_keys_dir (homeDir); + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/.ssh/"); - /* - * Do the user SSHD/global SSHD dance here and either use the - * private .x2go/.ssh or the global .ssh dir. - * - * Note: Windows is implicitly always using an user-mode SSH server. - */ -#ifndef Q_OS_WIN - if (userSshd) -#endif /* !defined (Q_OS_WIN) */ - { - 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"); /* @@ -9602,30 +9557,12 @@ void ONMainWindow::startX2goMount() file.close(); QDir authorized_keys_dir (homeDir); + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/.ssh/"); - /* - * Do the user SSHD/global SSHD dance here and either use the - * private .x2go/.ssh or the global .ssh dir. - * - * Note: Windows is implicitly always using an user-mode SSH server. - */ -#ifndef Q_OS_WIN - if (userSshd) -#endif /* !defined (Q_OS_WIN) */ - { - 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"); -#ifndef Q_OS_WIN - if (userSshd) -#endif /* !defined (Q_OS_WIN) */ - { - x2goDebug << "Creating dir " << authorized_keys_dir.absolutePath (); - authorized_keys_dir.mkpath (authorized_keys_dir.absolutePath ()); - } + x2goDebug << "Potentially 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)) { @@ -9702,7 +9639,11 @@ void ONMainWindow::startX2goMount() QString cuser; -#ifndef Q_WS_HILDON +#ifdef Q_WS_HILDON + cuser="user"; +#elif defined (Q_OS_WIN) + cuser=wapiGetUserName(); +#else for ( int i=0; i<env.size(); ++i ) { QStringList ls=env[i].split ( "=" ); @@ -9713,11 +9654,6 @@ void ONMainWindow::startX2goMount() break; } } -#else - cuser="user"; -#endif -#ifdef Q_OS_WIN - cuser=wapiGetUserName(); #endif QString cmd; QString dirs=dir->dirList; @@ -10397,7 +10333,7 @@ QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_ke QString tmp_to_add (""); if (host_key) { - QString tmp_to_add = "/ssh_host_" + stringified_key_type + "_key"; + tmp_to_add = "/ssh_host_" + stringified_key_type + "_key"; } else { QTemporaryFile temp_file (base_dir + "/key"); @@ -10485,17 +10421,7 @@ bool ONMainWindow::startSshd() { return false; } -#ifdef Q_OS_LINUX clientSshPort = "7022"; -#else // defined (Q_OS_LINUX) -#ifdef Q_OS_DARWIN - // Should also automatically create keys if Remote Login is enabled - // under Sharing in System Preferences. - if (!isServerRunning (clientSshPort.toInt ())) { - clientSshPort = "7022"; - } -#endif // defined (Q_OS_DARWIN) -#endif // defined (Q_OS_LINUX) QString etcDir=homeDir+"/.x2go/etc"; int port=clientSshPort.toInt(); //clientSshPort have initvalue @@ -10506,6 +10432,7 @@ bool ONMainWindow::startSshd() std::string clientdir=wapiShortFileName ( appDir ).toStdString(); std::stringstream strm; std::string config="\""+cygwinPath(etcDir+"/sshd_config").toStdString()+"\""; + /* FIXME: make this generic! */ std::string key="\""+cygwinPath(etcDir+"/ssh_host_rsa_key").toStdString()+"\""; // generate a unique sshLog filepath, and create its directory @@ -10571,21 +10498,20 @@ bool ONMainWindow::startSshd() delete []desktop; winSshdStarted=true; #else // defined (Q_OS_WIN) - userSshd=true; - sshd=new QProcess ( this ); - QString binary = appDir + "/sshd"; -#ifdef Q_OS_DARWIN - binary = "/usr/sbin/sshd"; -#endif // defined (Q_OS_DARWIN) + QString binary ("/usr/sbin/sshd"); +#ifndef Q_OS_UNIX + binary = appDir + "/sshd"; +#endif /* !(defined (Q_OS_UNIX)) */ QStringList arguments; + /* FIXME: make key selection more generic! */ arguments<<"-f"<<etcDir +"/sshd_config"<< "-h" << - etcDir+"/ssh_host_dsa_key"<<"-D"<<"-p"<<clientSshPort; + etcDir+"/ssh_host_rsa_key"<<"-D"<<"-p"<<clientSshPort; sshd->start (binary, arguments); -#endif // defined (Q_OS_WIN) +#endif /* defined (Q_OS_WIN) */ // Allow sshd a grace time of 3 seconds to come up. QTime sleepTime = QTime::currentTime ().addSecs (3); @@ -12026,67 +11952,24 @@ void ONMainWindow::printSshDError_startupFailure() return; QString error_message; -#ifdef Q_OS_WIN error_message = tr ("SSH daemon could not be started.\n\n"); -#else // defined (Q_OS_WIN) - if (userSshd) { - error_message = tr ("SSH daemon could not be started.\n\n"); - } - else { - error_message = tr ("SSH daemon is not running.\n\n"); - } -#endif // defined (Q_OS_WIN) QString detailed_error_message = tr ("You have enabled Remote Printing or File Sharing.\n" "These features require a running and functioning SSH server on your computer.\n" - "<b>Printing and File Sharing will be disabled for this session.</b>\n\n" - - "Please also check the <b>Clientside SSH port</b> in the general settings.\n\n"); + "<b>Printing and File Sharing will be disabled for this session.</b>\n\n"); #ifdef Q_OS_WIN detailed_error_message += tr ("Normally, this should not happen as X2Go Client for Windows " "ships its own internal SSH server.\n\n" - "If you see this message, please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "If you see this message, please report a bug on:\n"); +#else /* defined (Q_OS_WIN) */ + detailed_error_message += tr ("The SSH server failed to start.\n\n" + + "Please report a bug on:\n"); +#endif /* defined (Q_OS_WIN) */ + detailed_error_message += tr ("<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" "https://wiki.x2go.org/doku.php/wiki:bugs" "</a></center>\n"); -#else // defined (Q_OS_WIN) - if (userSshd) { - detailed_error_message += tr ("The SSH server failed to start.\n\n"); - detailed_error_message += tr ("X2Go Client did not detect a globally running SSH server " - "on your machine and was unable to start its own.\n\n" - - "Please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" - "</a></center>\n"); - } - else { - detailed_error_message += tr ("The SSH server is currently not started.\n\n"); -#ifdef Q_OS_DARWIN - detailed_error_message += tr ("On OS X, please follow the following steps to enable " - "SSH service:" - "<ul>" - "<li>Open <b>System Preferences</b> (Applications -> System Preferences)</li>" - "<li>Go to <b>Sharing</b></li>" - "<li>Tick the checkbox besides <b>Remote Login</b></li>" - "<li>Check that <b>Allow access for:</b> is set to either:" - "<ul>" - "<li>All users: <b>no further steps necessary</b></li>" - "<li>Only these users <b>and your user name is included in the list</b></li>" - "</ul>" - "<li>Optionally, add your user name to the allowed list " - "via the <b>Plus Button</b></li>" - "</ul>" - "<b>Warning: enabling SSH access will allow any user on the network to connect " - "to your machine. It is your responsibility to set a strong password for every " - "user that is allowed to log in via SSH.</b>\n\n"); -#else // defined (Q_OS_DARWIN) - detailed_error_message += tr ("Please ask your system administrator to provide the SSH " - "service on your computer.\n\n"); -#endif // defined (Q_OS_DARWIN) - } -#endif // defined (Q_OS_WIN) detailed_error_message += tr ("Disabling Remote Printing or File Sharing support " "in the session settings will get rid of this message."); @@ -12104,50 +11987,21 @@ void ONMainWindow::printSshDError_noHostPubKey() QString detailed_error_message = tr ("You have enabled Remote Printing or File Sharing.\n" "These features require a running and functioning SSH server on your computer.\n" - "<b>Printing and File Sharing will be disabled for this session.</b>\n\n" - - "The SSH server is currently not configured correctly.\n\n" - - "Please ensure that the server's public key exists.\n\n"); + "<b>Printing and File Sharing will be disabled for this session.</b>\n\n"); #ifdef Q_OS_WIN detailed_error_message += tr ("Normally, this should not happen as X2Go Client for Windows " "ships its own internal SSH server and automatically " "generates the required keys.\n\n" - "If you see this message, please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "If you see this message, please report a bug on:\n"); +#else /* defined (Q_OS_WIN) */ + detailed_error_message += tr ("X2Go Client was unable to create SSH host keys.\n\n" + + "Please report a bug on:\n"); +#endif /* defined (Q_OS_WIN) */ + detailed_error_message += tr ("<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" "https://wiki.x2go.org/doku.php/wiki:bugs" "</a></center>\n"); -#else // defined (Q_OS_WIN) - if (userSshd) { - detailed_error_message += tr ("X2Go Client was unable to create SSH host keys.\n\n" - - "Please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" - "</a></center>\n"); - } - else { -#ifdef Q_OS_DARWIN - detailed_error_message += tr ("On OS X, please follow these steps to generate the " - "required keys:" - - "<ul>" - "<li>Open a <b>Terminal Window</b> (Applications -> Utilities -> Terminal)</li>" - "<li>Run this command: <b>ssh -p " + clientSshPort.toLatin1 () - + " localhost</b></li>" - "<li>You do not need to login. Just quit the Terminal application " - "via Cmd + Q</li>" - "</ul>"); -#else // defined (Q_OS_DARWIN) - detailed_error_message += tr ("Please ask your system administrator to generate the required host keys.\n\n" - - "If you are administrating this system yourself, please run:\n" - - "<center><b>sudo ssh-keygen -A</b></center>\n\n"); -#endif // defined (Q_OS_DARWIN) - } -#endif // defined (Q_OS_WIN) detailed_error_message += tr ("Disabling Remote Printing or File Sharing support " "in the session settings will get rid of this message."); diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 64624cc..4b4de51 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -838,7 +838,6 @@ private: QProcess *nxproxy; #ifndef Q_OS_WIN QProcess *sshd; - bool userSshd; #else QProcess *xorg; PROCESS_INFORMATION sshd; -- 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 cc19d5c45af8ec951747ebb6e2279282fe796da0 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 08:00:19 2016 +0200 src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise maximum startup time to 5 seconds and break out early, if the process went into running state earlier. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c7ec333..a9e0f8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -426,6 +426,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium and code related to non-user-mode-sshd setups. Simplifies code a bit and we want to always start a user-mode OpenSSH server anyway. Also get rid of the clientport variable that is now unnecessary. + - src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise + maximum startup time to 5 seconds and break out early, if the process + went into running state earlier. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index eff2467..fa67971 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10513,9 +10513,13 @@ bool ONMainWindow::startSshd() sshd->start (binary, arguments); #endif /* defined (Q_OS_WIN) */ - // Allow sshd a grace time of 3 seconds to come up. - QTime sleepTime = QTime::currentTime ().addSecs (3); + // Allow sshd a grace time of 5 seconds to come up. + QTime sleepTime = QTime::currentTime ().addSecs (5); while (QTime::currentTime () < sleepTime) { + if (QProcess::Running == sshd->state ()) { + break; + } + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); } -- 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 62058c2d2cb26c33d24d0f7ed555c2dc7a03c967 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 08:01:38 2016 +0200 src/onmainwindow.cpp: uppercase key type in debug output and comment string in generateKey (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a9e0f8a..7f6d73e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -429,6 +429,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise maximum startup time to 5 seconds and break out early, if the process went into running state earlier. + - src/onmainwindow.cpp: uppercase key type in debug output and comment + string in generateKey (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index fa67971..d865342 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10357,11 +10357,12 @@ QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_ke if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) { - x2goDebug << "Generating SSH key. Type: " << stringified_key_type; + x2goDebug << "Generating SSH key. Type: " << stringified_key_type.toUpper () + << "; Location: " << private_key_file; QStringList args; - QString comment = "X2Go Client " + stringified_key_type + " "; + QString comment = "X2Go Client " + stringified_key_type.toUpper () + " "; if (host_key) { comment += "host"; -- 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 d2fe563a58bfe51497a333ebd53b1a26ead5e028 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Sep 23 08:21:13 2016 +0200 src/onmainwindow.cpp: terminate sshd more correctly. First via terminate (), then wait up to 5 seconds, then via kill (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 32 +++++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7f6d73e..ea60df6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -431,6 +431,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium went into running state earlier. - src/onmainwindow.cpp: uppercase key type in debug output and comment string in generateKey (). + - src/onmainwindow.cpp: terminate sshd more correctly. First via terminate + (), then wait up to 5 seconds, then via kill (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index d865342..48b7cca 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -1515,11 +1515,33 @@ void ONMainWindow::closeClient() #endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ #ifndef Q_OS_WIN - if (sshd) - { - x2goDebug<<"Terminating the OpenSSH server ..."; - sshd->terminate(); - x2goDebug<<"Terminated the OpenSSH server."; + if (sshd) { + x2goDebug << "Terminating the OpenSSH server ..."; + sshd->terminate (); + + /* Allow sshd a grace time of 5 seconds to terminate. */ + QTime sleep_time = QTime::currentTime ().addSecs (5); + bool killed = false; + while (QTime::currentTime () < sleep_time) { + if (QProcess::NotRunning == sshd->state ()) { + killed = true; + break; + } + + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); + } + + if (!killed) { + /* Grace period over, force termination. */ + sshd->kill (); + + if (!(sshd->waitForFinished (500))) { + x2goWarningf (8) << "OpenSSH Server failed to terminate in time " + " and the kill command timed out."; + } + } + + x2goDebug << "Terminated the OpenSSH server."; delete sshd; } #endif /* !defined (Q_OS_WIN) */ -- 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 0d2493401bd03dea8c2ee977b6fc184524542c51 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:07:38 2016 +0200 src/onmainwindow.{cpp,h}: add new function check_key_type (). Takes a key type and checks for validity/if it's known. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 27 +++++++++++++++++++++++++++ src/onmainwindow.h | 2 ++ 3 files changed, 31 insertions(+) diff --git a/debian/changelog b/debian/changelog index ea60df6..711e16f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -433,6 +433,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium string in generateKey (). - src/onmainwindow.cpp: terminate sshd more correctly. First via terminate (), then wait up to 5 seconds, then via kill (). + - src/onmainwindow.{cpp,h}: add new function check_key_type (). Takes a + key type and checks for validity/if it's known. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 48b7cca..3dda051 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10281,6 +10281,33 @@ void ONMainWindow::generateEtcFiles() x2goDebug<<etcDir +"/sshd_config created."; } +ONMainWindow::key_types ONMainWindow::check_key_type (ONMainWindow::key_types key_type) { + ONMainWindow::key_types ret = key_type; + + switch (key_type) { + case RSA_KEY_TYPE: + break; + case DSA_KEY_TYPE: + break; + case ECDSA_KEY_TYPE: + break; + case ED25519_KEY_TYPE: + break; + default: + ret = UNKNOWN_KEY_TYPE; + } + + if (UNKNOWN_KEY_TYPE == ret) { + QMessageBox::critical (this, tr ("SSH key type selection error"), + tr ("Unknown SSH key selected.") + + "\n" + + tr ("Terminating application.")); + close (); + } + + return (ret); +} + QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 4b4de51..b21e417 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1218,6 +1218,8 @@ private: QString getXDisplay(); #endif + key_types check_key_type (key_types key_type); + ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN public slots: -- 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 25cf30c076023dd71e10f6048635932b6e19fbe1 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:13:08 2016 +0200 src/onmainwindow.{cpp,h}: add new function key_type_to_string (). Returns a stringified version of the selected key type, after checking for validity. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 24 ++++++++++++++++++++++++ src/onmainwindow.h | 1 + 3 files changed, 28 insertions(+) diff --git a/debian/changelog b/debian/changelog index 711e16f..352e184 100644 --- a/debian/changelog +++ b/debian/changelog @@ -435,6 +435,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium (), then wait up to 5 seconds, then via kill (). - src/onmainwindow.{cpp,h}: add new function check_key_type (). Takes a key type and checks for validity/if it's known. + - src/onmainwindow.{cpp,h}: add new function key_type_to_string (). + Returns a stringified version of the selected key type, after checking + for validity. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 3dda051..daff8fb 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10308,6 +10308,30 @@ ONMainWindow::key_types ONMainWindow::check_key_type (ONMainWindow::key_types ke return (ret); } +QString ONMainWindow::key_type_to_string (ONMainWindow::key_types key_type) { + ONMainWindow::key_types sanitized_key_type = check_key_type (key_type); + QString ret (""); + + switch (sanitized_key_type) { + case RSA_KEY_TYPE: + ret = "rsa"; + break; + case DSA_KEY_TYPE: + ret = "dsa"; + break; + case ECDSA_KEY_TYPE: + ret = "ecdsa"; + break; + case ED25519_KEY_TYPE: + ret = "ed25519"; + break; + default: + ret = "unknown"; + } + + return (ret); +} + QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; diff --git a/src/onmainwindow.h b/src/onmainwindow.h index b21e417..0d3fb49 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1219,6 +1219,7 @@ private: #endif key_types check_key_type (key_types key_type); + QString key_type_to_string (key_types key_type); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 4f26db0343a491d73fa689a1127802733d3ace58 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:17:05 2016 +0200 src/onmainwindow.{cpp,h}: add new function default_size_for_key_type (). Returns the default key size in bits for the selected key type, after checking for validity. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 25 +++++++++++++++++++++++++ src/onmainwindow.h | 1 + 3 files changed, 29 insertions(+) diff --git a/debian/changelog b/debian/changelog index 352e184..cd6e81a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -438,6 +438,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: add new function key_type_to_string (). Returns a stringified version of the selected key type, after checking for validity. + - src/onmainwindow.{cpp,h}: add new function default_size_for_key_type (). + Returns the default key size in bits for the selected key type, after + checking for validity. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index daff8fb..419de3f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10332,6 +10332,31 @@ QString ONMainWindow::key_type_to_string (ONMainWindow::key_types key_type) { return (ret); } +std::size_t ONMainWindow::default_size_for_key_type (ONMainWindow::key_types key_type) { + ONMainWindow::key_types sanitized_key_type = check_key_type (key_type); + std::size_t ret = 0; + + switch (sanitized_key_type) { + case RSA_KEY_TYPE: + ret = 4096; + break; + case DSA_KEY_TYPE: + ret = 1024; + break; + case ECDSA_KEY_TYPE: + ret = 384; + break; + case ED25519_KEY_TYPE: + /* Fixed key length, flag will be unused. */ + ret = 0; + break; + default: + ret = 0; + } + + return (ret); +} + QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) { ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 0d3fb49..bf4ed80 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1220,6 +1220,7 @@ private: key_types check_key_type (key_types key_type); QString key_type_to_string (key_types key_type); + std::size_t default_size_for_key_type (key_types key_type); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 86fee87a4fb433244e479177d47b3e76c48dd247 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:19:42 2016 +0200 src/onmainwindow.cpp: use the new functions in generateKey (). --- debian/changelog | 1 + src/onmainwindow.cpp | 41 +++-------------------------------------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/debian/changelog b/debian/changelog index cd6e81a..c28a8db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -441,6 +441,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: add new function default_size_for_key_type (). Returns the default key size in bits for the selected key type, after checking for validity. + - src/onmainwindow.cpp: use the new functions in generateKey (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 419de3f..0e9077b 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10359,45 +10359,10 @@ std::size_t ONMainWindow::default_size_for_key_type (ONMainWindow::key_types key QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) { - ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE; - QString stringified_key_type (""); - std::size_t key_bits = 0; + QString stringified_key_type (key_type_to_string (key_type)); + std::size_t key_bits = default_size_for_key_type (key_type); + QString ret (""); - switch (key_type) { - case RSA_KEY_TYPE: - sanitized_key_type = key_type; - stringified_key_type = "rsa"; - key_bits = 4096; - break; - case DSA_KEY_TYPE: - sanitized_key_type = key_type; - stringified_key_type = "dsa"; - key_bits = 1024; - break; - case ECDSA_KEY_TYPE: - sanitized_key_type = key_type; - stringified_key_type = "ecdsa"; - key_bits = 384; - break; - case ED25519_KEY_TYPE: - sanitized_key_type = key_type; - stringified_key_type = "ed25519"; - /* Fixed key length, flag will be unused. */ - key_bits = 0; - break; - default: - sanitized_key_type = UNKNOWN_KEY_TYPE; - stringified_key_type = "unknown"; - key_bits = 0; - } - - if (sanitized_key_type == UNKNOWN_KEY_TYPE) { - QMessageBox::critical (this, tr ("SSH key type selection error"), - tr ("Unknown SSH key selected.") - + "\n" - + tr ("Terminating application.")); - close (); - } QString base_dir (homeDir); QString private_key_file (""); -- 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 0dafa6df6c57ff364f8e5b8fc20566815fb2cc57 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:25:39 2016 +0200 src/onmainwindow.h: move generateKey () declaration around. --- debian/changelog | 1 + src/onmainwindow.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c28a8db..e8fd1de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -442,6 +442,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium Returns the default key size in bits for the selected key type, after checking for validity. - src/onmainwindow.cpp: use the new functions in generateKey (). + - src/onmainwindow.h: move generateKey () declaration around. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.h b/src/onmainwindow.h index bf4ed80..08c3833 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1205,7 +1205,6 @@ private: #endif void filterDesktops ( const QString& filter, bool strict=false ); - QString generateKey(key_types key_type, bool host_key = false); void generateEtcFiles(); QString u3DataPath(); void cleanPortable(); @@ -1221,6 +1220,7 @@ private: key_types check_key_type (key_types key_type); QString key_type_to_string (key_types key_type); std::size_t default_size_for_key_type (key_types key_type); + QString generateKey(key_types key_type, bool host_key = false); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 84a99581c45912f812ea5b5b1fe9d4d6c55eab2e Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:26:47 2016 +0200 src/onmainwindow.{cpp,h}: reformat generateKey () only. --- debian/changelog | 1 + src/onmainwindow.cpp | 184 +++++++++++++++++++++++++------------------------- src/onmainwindow.h | 2 +- 3 files changed, 93 insertions(+), 94 deletions(-) diff --git a/debian/changelog b/debian/changelog index e8fd1de..6b29016 100644 --- a/debian/changelog +++ b/debian/changelog @@ -443,6 +443,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium checking for validity. - src/onmainwindow.cpp: use the new functions in generateKey (). - src/onmainwindow.h: move generateKey () declaration around. + - src/onmainwindow.{cpp,h}: reformat generateKey () only. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 0e9077b..61f910c 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10357,126 +10357,124 @@ std::size_t ONMainWindow::default_size_for_key_type (ONMainWindow::key_types key return (ret); } -QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key) -{ - QString stringified_key_type (key_type_to_string (key_type)); - std::size_t key_bits = default_size_for_key_type (key_type); +QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_key) { + QString stringified_key_type (key_type_to_string (key_type)); + std::size_t key_bits = default_size_for_key_type (key_type); - QString ret (""); + QString ret (""); - QString base_dir (homeDir); - QString private_key_file (""); + QString base_dir (homeDir); + QString private_key_file (""); - if (host_key) { - base_dir += "/.x2go/etc/"; - } - else { - base_dir += "/.x2go/ssh/gen/"; - } + if (host_key) { + base_dir += "/.x2go/etc/"; + } + else { + base_dir += "/.x2go/ssh/gen/"; + } - { - QDir dir (homeDir); - if (!(dir.mkpath (base_dir))) { - QMessageBox::critical (this, tr ("SSH key base directory creation error"), - tr ("Unable to create SSH key base directory '%1'.").arg (base_dir) - + "\n" - + tr ("Terminating application.")); - close (); - } + { + QDir dir (homeDir); + if (!(dir.mkpath (base_dir))) { + QMessageBox::critical (this, tr ("SSH key base directory creation error"), + tr ("Unable to create SSH key base directory '%1'.").arg (base_dir) + + "\n" + + tr ("Terminating application.")); + close (); } + } #ifdef Q_OS_WIN - private_key_file = cygwinPath (wapiShortFileName (base_dir)); + private_key_file = cygwinPath (wapiShortFileName (base_dir)); #else - private_key_file = base_dir; + private_key_file = base_dir; #endif - ret = base_dir; + ret = base_dir; - { - QString tmp_to_add (""); + { + QString tmp_to_add (""); - if (host_key) { - tmp_to_add = "/ssh_host_" + stringified_key_type + "_key"; - } - else { - QTemporaryFile temp_file (base_dir + "/key"); - temp_file.open (); + if (host_key) { + tmp_to_add = "/ssh_host_" + stringified_key_type + "_key"; + } + else { + QTemporaryFile temp_file (base_dir + "/key"); + temp_file.open (); - /* Extract base name. */ - QFileInfo tmp_file_info (temp_file.fileName ()); - tmp_to_add = tmp_file_info.fileName (); + /* Extract base name. */ + QFileInfo tmp_file_info (temp_file.fileName ()); + tmp_to_add = tmp_file_info.fileName (); - /* Clean up again. We don't need the temporary file anymore. */ - temp_file.setAutoRemove (false); - temp_file.close (); - temp_file.remove (); - } - - private_key_file += tmp_to_add; - ret += tmp_to_add; + /* Clean up again. We don't need the temporary file anymore. */ + temp_file.setAutoRemove (false); + temp_file.close (); + temp_file.remove (); } - QString public_key_file (private_key_file + ".pub"); + private_key_file += tmp_to_add; + ret += tmp_to_add; + } - if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) - { - x2goDebug << "Generating SSH key. Type: " << stringified_key_type.toUpper () - << "; Location: " << private_key_file; + QString public_key_file (private_key_file + ".pub"); - QStringList args; + if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) { + x2goDebug << "Generating SSH key. Type: " << stringified_key_type.toUpper () + << "; Location: " << private_key_file; - QString comment = "X2Go Client " + stringified_key_type.toUpper () + " "; + QStringList args; - if (host_key) { - comment += "host"; - } - else { - comment += "user"; - } + QString comment = "X2Go Client " + stringified_key_type.toUpper () + " "; - comment += " key"; + if (host_key) { + comment += "host"; + } + else { + comment += "user"; + } - args << "-t" - << stringified_key_type - << "-b" - << QString::number (key_bits) - << "-N" - << "" - << "-C" - << comment - << "-f" - << private_key_file; + comment += " key"; - const int keygen_ret = QProcess::execute ("ssh-keygen", args); + args << "-t" + << stringified_key_type + << "-b" + << QString::number (key_bits) + << "-N" + << "" + << "-C" + << comment + << "-f" + << private_key_file; - if (-2 == keygen_ret) { - QMessageBox::critical (this, tr ("ssh-keygen launching error"), - tr ("Unable to start the ssh-keygen binary.") - + "\n" - + tr ("Terminating application.")); - close (); - } + const int keygen_ret = QProcess::execute ("ssh-keygen", args); - if (-1 == keygen_ret) { - QMessageBox::critical (this, tr ("ssh-keygen crashed"), - tr ("The ssh-keygen binary crashed.") - + "\n" - + tr ("Terminating application.")); - close (); - } + if (-2 == keygen_ret) { + QMessageBox::critical (this, tr ("ssh-keygen launching error"), + tr ("Unable to start the ssh-keygen binary.") + + "\n" + + tr ("Terminating application.")); + close (); + } - if (0 != keygen_ret) { - QMessageBox::critical (this, tr ("ssh-keygen program error"), - tr ("The ssh-keygen binary did not exit cleanly.") - + " " - + tr ("It was probably called with unknown arguments.") - + "\n" - + tr ("Terminating application.")); - close (); - } + if (-1 == keygen_ret) { + QMessageBox::critical (this, tr ("ssh-keygen crashed"), + tr ("The ssh-keygen binary crashed.") + + "\n" + + tr ("Terminating application.")); + close (); } - return (ret); + if (0 != keygen_ret) { + QMessageBox::critical (this, tr ("ssh-keygen program error"), + tr ("The ssh-keygen binary did not exit cleanly.") + + " " + + tr ("It was probably called with unknown arguments.") + + "\n" + + tr ("Terminating application.")); + close (); + } + } + + return (ret); } bool ONMainWindow::startSshd() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 08c3833..47ef1e7 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1220,7 +1220,7 @@ private: key_types check_key_type (key_types key_type); QString key_type_to_string (key_types key_type); std::size_t default_size_for_key_type (key_types key_type); - QString generateKey(key_types key_type, bool host_key = false); + QString generateKey (key_types key_type, bool host_key = false); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 5c2cd927a70d1b77fbd3c79bc5d46a44756fc89f Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:33:15 2016 +0200 src/onmainwindow.{cpp,h}: move createRSAKey () around. --- debian/changelog | 1 + src/onmainwindow.cpp | 164 +++++++++++++++++++++++++------------------------- src/onmainwindow.h | 2 +- 3 files changed, 84 insertions(+), 83 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6b29016..4a4af7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -444,6 +444,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: use the new functions in generateKey (). - src/onmainwindow.h: move generateKey () declaration around. - src/onmainwindow.{cpp,h}: reformat generateKey () only. + - src/onmainwindow.{cpp,h}: move createRSAKey () around. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 61f910c..59b1393 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8126,88 +8126,6 @@ void ONMainWindow::exportDefaultDirs() exportDirs ( dirs.join ( ":" ) ); } -QString ONMainWindow::createRSAKey() -{ - /* - * I spent multiple hours on trying to understand this function - * and directory exporting in general, so I'd better document - * this. - * - * This function first generates a new RSA private-public key - * pair as ~/.x2go/ssh/gen/key.XXXXX{,.pub}. - * - * Then, the SSH daemon's public host key is read and appended - * to the *private* SSH key file after a marker looking like - * this: "----BEGIN RSA IDENTITY----" - * - * Later on, this *private* SSH key file is transferred to the - * remote server, which parses it in the "x2gomountdirs" perl - * script and extracts the public key (used for logging in - * to the client machine) and the public *host* key, used to - * circumvent the "untrusted host" message by SSH by - * explicitly giving the aforementioned public *host* key as - * the only element in a fake "authorized_keys" file. Again, - * this is all happening server-side. - * - * The *public* key part generated here is then taken and - * later added to the "authorized_keys" file on the client - * side, to allow auto-logins via the generated and transferred - * private SSH key. - */ - - QString user_key = generateKey (RSA_KEY_TYPE); - - /* - * Now taking the *host* pub key here... - */ - QFile rsa (homeDir + "/.x2go/etc/ssh_host_rsa_key.pub"); -#ifdef Q_OS_WIN - rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\ssh_host_rsa_key.pub")); -#endif - - if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { - x2goDebug << "Unable to open public host key file."; -#ifdef Q_OS_UNIX - x2goDebug << "Creating a new one."; - QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); - generateEtcFiles (); - - if (!(startSshd ())) { - return (QString::null); - } - - rsa.setFileName (tmp_file_name + ".pub"); - rsa.open (QIODevice::ReadOnly | QIODevice::Text); -#else - printSshDError_noHostPubKey (); - return QString::null; -#endif - } - - QByteArray rsa_pub; - - if ( !rsa.atEnd() ) - rsa_pub = rsa.readLine(); - else - { - x2goErrorf(9)<<tr("RSA file empty."); - return QString::null; - } - - QFile file ( user_key ); - if ( !file.open ( - QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ) - ) - { - x2goErrorf(10) << tr ("Cannot open key: ") << user_key; - return user_key; - } - QTextStream out ( &file ); - out<<"----BEGIN RSA IDENTITY----"<<rsa_pub; - file.close(); - return user_key; -} - void ONMainWindow::slotCopyKey ( bool result, QString output, int pid) { fsExportKey=sshConnection->getSourceFile(pid); @@ -10477,6 +10395,88 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k return (ret); } +QString ONMainWindow::createRSAKey() +{ + /* + * I spent multiple hours on trying to understand this function + * and directory exporting in general, so I'd better document + * this. + * + * This function first generates a new RSA private-public key + * pair as ~/.x2go/ssh/gen/key.XXXXX{,.pub}. + * + * Then, the SSH daemon's public host key is read and appended + * to the *private* SSH key file after a marker looking like + * this: "----BEGIN RSA IDENTITY----" + * + * Later on, this *private* SSH key file is transferred to the + * remote server, which parses it in the "x2gomountdirs" perl + * script and extracts the public key (used for logging in + * to the client machine) and the public *host* key, used to + * circumvent the "untrusted host" message by SSH by + * explicitly giving the aforementioned public *host* key as + * the only element in a fake "authorized_keys" file. Again, + * this is all happening server-side. + * + * The *public* key part generated here is then taken and + * later added to the "authorized_keys" file on the client + * side, to allow auto-logins via the generated and transferred + * private SSH key. + */ + + QString user_key = generateKey (RSA_KEY_TYPE); + + /* + * Now taking the *host* pub key here... + */ + QFile rsa (homeDir + "/.x2go/etc/ssh_host_rsa_key.pub"); +#ifdef Q_OS_WIN + rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\ssh_host_rsa_key.pub")); +#endif + + if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { + x2goDebug << "Unable to open public host key file."; +#ifdef Q_OS_UNIX + x2goDebug << "Creating a new one."; + QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); + generateEtcFiles (); + + if (!(startSshd ())) { + return (QString::null); + } + + rsa.setFileName (tmp_file_name + ".pub"); + rsa.open (QIODevice::ReadOnly | QIODevice::Text); +#else + printSshDError_noHostPubKey (); + return QString::null; +#endif + } + + QByteArray rsa_pub; + + if ( !rsa.atEnd() ) + rsa_pub = rsa.readLine(); + else + { + x2goErrorf(9)<<tr("RSA file empty."); + return QString::null; + } + + QFile file ( user_key ); + if ( !file.open ( + QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ) + ) + { + x2goErrorf(10) << tr ("Cannot open key: ") << user_key; + return user_key; + } + QTextStream out ( &file ); + out<<"----BEGIN RSA IDENTITY----"<<rsa_pub; + file.close(); + return user_key; +} + bool ONMainWindow::startSshd() { if ( embedMode && config.confFS && !config.useFs ) diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 47ef1e7..2df3afa 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -956,7 +956,6 @@ private: bool soundParameter ( QString val ); void printError ( QString param ); void exportDefaultDirs(); - QString createRSAKey(); directory* getExpDir ( QString key ); bool findInList ( const QString& uid ); void setUsersEnabled ( bool enable ); @@ -1221,6 +1220,7 @@ private: QString key_type_to_string (key_types key_type); std::size_t default_size_for_key_type (key_types key_type); QString generateKey (key_types key_type, bool host_key = false); + QString createRSAKeyBundle(); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 77dff6c2e31109001acb1ecf7bc816373dcc61c6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 04:38:51 2016 +0200 src/onmainwindow.{cpp,h}: reformat createRSAKey () only. --- debian/changelog | 1 + src/onmainwindow.cpp | 129 ++++++++++++++++++++++++-------------------------- src/onmainwindow.h | 2 +- 3 files changed, 64 insertions(+), 68 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a4af7a..6f3701b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -445,6 +445,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.h: move generateKey () declaration around. - src/onmainwindow.{cpp,h}: reformat generateKey () only. - src/onmainwindow.{cpp,h}: move createRSAKey () around. + - src/onmainwindow.{cpp,h}: reformat createRSAKey () only. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 59b1393..2e39dc4 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10395,86 +10395,81 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k return (ret); } -QString ONMainWindow::createRSAKey() -{ - /* - * I spent multiple hours on trying to understand this function - * and directory exporting in general, so I'd better document - * this. - * - * This function first generates a new RSA private-public key - * pair as ~/.x2go/ssh/gen/key.XXXXX{,.pub}. - * - * Then, the SSH daemon's public host key is read and appended - * to the *private* SSH key file after a marker looking like - * this: "----BEGIN RSA IDENTITY----" - * - * Later on, this *private* SSH key file is transferred to the - * remote server, which parses it in the "x2gomountdirs" perl - * script and extracts the public key (used for logging in - * to the client machine) and the public *host* key, used to - * circumvent the "untrusted host" message by SSH by - * explicitly giving the aforementioned public *host* key as - * the only element in a fake "authorized_keys" file. Again, - * this is all happening server-side. - * - * The *public* key part generated here is then taken and - * later added to the "authorized_keys" file on the client - * side, to allow auto-logins via the generated and transferred - * private SSH key. - */ +QString ONMainWindow::createRSAKey () { + /* + * I spent multiple hours on trying to understand this function + * and directory exporting in general, so I'd better document + * this. + * + * This function first generates a new RSA private-public key + * pair as ~/.x2go/ssh/gen/key.XXXXX{,.pub}. + * + * Then, the SSH daemon's public host key is read and appended + * to the *private* SSH key file after a marker looking like + * this: "----BEGIN RSA IDENTITY----" + * + * Later on, this *private* SSH key file is transferred to the + * remote server, which parses it in the "x2gomountdirs" perl + * script and extracts the public key (used for logging in + * to the client machine) and the public *host* key, used to + * circumvent the "untrusted host" message by SSH by + * explicitly giving the aforementioned public *host* key as + * the only element in a fake "authorized_keys" file. Again, + * this is all happening server-side. + * + * The *public* key part generated here is then taken and + * later added to the "authorized_keys" file on the client + * side, to allow auto-logins via the generated and transferred + * private SSH key. + */ - QString user_key = generateKey (RSA_KEY_TYPE); + QString user_key = generateKey (RSA_KEY_TYPE); - /* - * Now taking the *host* pub key here... - */ - QFile rsa (homeDir + "/.x2go/etc/ssh_host_rsa_key.pub"); + /* + * Now taking the *host* pub key here... + */ + QFile rsa (homeDir + "/.x2go/etc/ssh_host_rsa_key.pub"); #ifdef Q_OS_WIN - rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\ssh_host_rsa_key.pub")); + rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\ssh_host_rsa_key.pub")); #endif - if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { - x2goDebug << "Unable to open public host key file."; + if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { + x2goDebug << "Unable to open public host key file."; #ifdef Q_OS_UNIX - x2goDebug << "Creating a new one."; - QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); - generateEtcFiles (); + x2goDebug << "Creating a new one."; + QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); + generateEtcFiles (); - if (!(startSshd ())) { - return (QString::null); - } + if (!(startSshd ())) { + return (QString::null); + } - rsa.setFileName (tmp_file_name + ".pub"); - rsa.open (QIODevice::ReadOnly | QIODevice::Text); + rsa.setFileName (tmp_file_name + ".pub"); + rsa.open (QIODevice::ReadOnly | QIODevice::Text); #else - printSshDError_noHostPubKey (); - return QString::null; + printSshDError_noHostPubKey (); + return (QString::null); #endif - } + } - QByteArray rsa_pub; + QByteArray rsa_pub; - if ( !rsa.atEnd() ) - rsa_pub = rsa.readLine(); - else - { - x2goErrorf(9)<<tr("RSA file empty."); - return QString::null; - } + if (!(rsa.atEnd ())) { + rsa_pub = rsa.readLine (); + else { + x2goErrorf (9) << tr ("RSA file empty."); + return (QString::null); + } - QFile file ( user_key ); - if ( !file.open ( - QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ) - ) - { - x2goErrorf(10) << tr ("Cannot open key: ") << user_key; - return user_key; - } - QTextStream out ( &file ); - out<<"----BEGIN RSA IDENTITY----"<<rsa_pub; - file.close(); - return user_key; + QFile file (user_key); + if (!(file.open (QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append))) { + x2goErrorf (10) << tr ("Cannot open key: ") << user_key; + return (user_key); + } + QTextStream out (&file); + out << "----BEGIN RSA IDENTITY----" << rsa_pub; + file.close (); + return (user_key); } bool ONMainWindow::startSshd() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 2df3afa..abfb019 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1220,7 +1220,7 @@ private: QString key_type_to_string (key_types key_type); std::size_t default_size_for_key_type (key_types key_type); QString generateKey (key_types key_type, bool host_key = false); - QString createRSAKeyBundle(); + QString createRSAKey (); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 6073c3cd53c3553f15ef1e481c96f3bf37ef771a Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 23:04:46 2016 +0200 src/onmainwindow.cpp: let startSshd () act as a wrapper and be called multiple times. Check if the OpenSSH Server is already running and return true, otherwise try to start it. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6f3701b..b5f3c2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -446,6 +446,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: reformat generateKey () only. - src/onmainwindow.{cpp,h}: move createRSAKey () around. - src/onmainwindow.{cpp,h}: reformat createRSAKey () only. + - src/onmainwindow.cpp: let startSshd () act as a wrapper and be called + multiple times. Check if the OpenSSH Server is already running and + return true, otherwise try to start it. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 2e39dc4..f8d97bc 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10478,6 +10478,19 @@ bool ONMainWindow::startSshd() { return false; } + + /* Don't start sshd, if it's already running. */ +#ifdef Q_OS_WIN + if (winSshdStarted) +#else /* defined (Q_OS_WIN) */ + if (sshd) +#endif /* defined (Q_OS_WIN) */ + { + if (isServerRunning (clientSshPort.toInt ())) { + return (true); + } + } + clientSshPort = "7022"; QString etcDir=homeDir+"/.x2go/etc"; int port=clientSshPort.toInt(); -- 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 23b9e77d0c5a3b984644a19ded46995b0a80fbc6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 23:09:18 2016 +0200 src/onmainwindow.cpp: add some comments only to createRSAKey (). --- debian/changelog | 1 + src/onmainwindow.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index b5f3c2b..f9cbf0d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -449,6 +449,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: let startSshd () act as a wrapper and be called multiple times. Check if the OpenSSH Server is already running and return true, otherwise try to start it. + - src/onmainwindow.cpp: add some comments only to createRSAKey (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index f8d97bc..cea1756 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10466,7 +10466,15 @@ QString ONMainWindow::createRSAKey () { x2goErrorf (10) << tr ("Cannot open key: ") << user_key; return (user_key); } + + /* Append public host key into private user key file. */ QTextStream out (&file); + + /* + * The string here should be changed, but this requires + * changes to X2Go Server as well. + * As such, I'll be not changing it here for now. + */ out << "----BEGIN RSA IDENTITY----" << rsa_pub; file.close (); return (user_key); -- 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 71efa332906864534bfce5cad5ee18674e898011 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 24 23:12:15 2016 +0200 src/onmainwindow.{cpp,h}: rename createRSAKey () to the more-appropriate name createKeyBundle (). Also add a key-type parameter and use it to select the required key type (and maybe generate it if necessary.) Also use the new functions to get a stringified version of the key type etc. --- debian/changelog | 4 ++++ src/onmainwindow.cpp | 30 +++++++++++++++++++----------- src/onmainwindow.h | 2 +- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index f9cbf0d..fc94571 100644 --- a/debian/changelog +++ b/debian/changelog @@ -450,6 +450,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium multiple times. Check if the OpenSSH Server is already running and return true, otherwise try to start it. - src/onmainwindow.cpp: add some comments only to createRSAKey (). + - src/onmainwindow.{cpp,h}: rename createRSAKey () to the more-appropriate + name createKeyBundle (). Also add a key-type parameter and use it to + select the required key type (and maybe generate it if necessary.) Also + use the new functions to get a stringified version of the key type etc. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index cea1756..4f7f173 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -7961,7 +7961,7 @@ void ONMainWindow::exportDirs ( QString exports,bool removable ) dr.dirList=exports; - dr.key=createRSAKey(); + dr.key=createKeyBundle(); // Key creation failure or the like. if (dr.key.isEmpty ()) { @@ -10395,7 +10395,7 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k return (ret); } -QString ONMainWindow::createRSAKey () { +QString ONMainWindow::createKeyBundle (key_types key_type) { /* * I spent multiple hours on trying to understand this function * and directory exporting in general, so I'd better document @@ -10423,41 +10423,49 @@ QString ONMainWindow::createRSAKey () { * private SSH key. */ - QString user_key = generateKey (RSA_KEY_TYPE); + QString stringified_key_type (key_type_to_string (key_type)); + + QString user_key = generateKey (key_type); /* * Now taking the *host* pub key here... */ - QFile rsa (homeDir + "/.x2go/etc/ssh_host_rsa_key.pub"); + const QString host_pub_key_file_name ("ssh_host_" + stringified_key_type + "_key.pub"); + QFile rsa (homeDir + "/.x2go/etc/" + host_pub_key_file_name); #ifdef Q_OS_WIN - rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\ssh_host_rsa_key.pub")); + rsa.setFileName (wapiShortFileName (homeDir + "\\.x2go\\etc\\" + host_pub_key_file_name)); #endif if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { x2goDebug << "Unable to open public host key file."; #ifdef Q_OS_UNIX x2goDebug << "Creating a new one."; - QString tmp_file_name (generateKey (RSA_KEY_TYPE, true)); + QString tmp_file_name (generateKey (key_type, true)); generateEtcFiles (); - if (!(startSshd ())) { + rsa.setFileName (tmp_file_name + ".pub"); + if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { + x2goErrorf (9) << tr ("Unable to open newly generated %1 public host key file.").arg (stringified_key_type.toUpper ()); return (QString::null); } - - rsa.setFileName (tmp_file_name + ".pub"); - rsa.open (QIODevice::ReadOnly | QIODevice::Text); #else printSshDError_noHostPubKey (); return (QString::null); #endif } + if (!(startSshd ())) { + x2goDebug << "Failed to start OpenSSH Server pro-actively."; + return (QString::null); + } + QByteArray rsa_pub; if (!(rsa.atEnd ())) { rsa_pub = rsa.readLine (); + } else { - x2goErrorf (9) << tr ("RSA file empty."); + x2goErrorf (9) << tr ("%1 public host key file empty.").arg (stringified_key_type.toUpper ()); return (QString::null); } diff --git a/src/onmainwindow.h b/src/onmainwindow.h index abfb019..f556f85 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1220,7 +1220,7 @@ private: QString key_type_to_string (key_types key_type); std::size_t default_size_for_key_type (key_types key_type); QString generateKey (key_types key_type, bool host_key = false); - QString createRSAKey (); + QString createKeyBundle (key_types key_type = RSA_KEY_TYPE); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 ebcb7e66c3cc78b23bc592566fb92046d76b0c03 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 17:51:18 2016 +0200 macbuild.sh: switch to bundling PA 9.0. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fc94571..c4ed053 100644 --- a/debian/changelog +++ b/debian/changelog @@ -454,6 +454,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium name createKeyBundle (). Also add a key-type parameter and use it to select the required key type (and maybe generate it if necessary.) Also use the new functions to get a stringified version of the key type etc. + - macbuild.sh: switch to bundling PA 9.0. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 5e7b336..90f8afb 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -178,7 +178,7 @@ NXPROXY="nxproxy" PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" "pamon" "paplay" "parec" "parecord" "pasuspender" ) PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" - "pulse-8.0" + "pulse-9.0" "pulseaudio" ) RESOURCE_FILES=( "audio/startup.wav" ) -- 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 076fe4a3d9b79b2f8df63b6dc56ebdde9fc63da5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 17:57:05 2016 +0200 src/onmainwindow.cpp: move QProcess startup check in startSshd () to non-Windows code section and add a listening socket check loop. Windows uses other means of starting the daemon. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 22 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index c4ed053..9e87aee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -455,6 +455,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium select the required key type (and maybe generate it if necessary.) Also use the new functions to get a stringified version of the key type etc. - macbuild.sh: switch to bundling PA 9.0. + - src/onmainwindow.cpp: move QProcess startup check in startSshd () to + non-Windows code section and add a listening socket check loop. Windows + uses other means of starting the daemon. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 4f7f173..70c9058 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10597,17 +10597,31 @@ bool ONMainWindow::startSshd() etcDir+"/ssh_host_rsa_key"<<"-D"<<"-p"<<clientSshPort; sshd->start (binary, arguments); -#endif /* defined (Q_OS_WIN) */ - // Allow sshd a grace time of 5 seconds to come up. - QTime sleepTime = QTime::currentTime ().addSecs (5); - while (QTime::currentTime () < sleepTime) { + /* Allow sshd a grace time of 5 seconds to come up. */ + QTime sleep_time = QTime::currentTime ().addSecs (5); + while (QTime::currentTime () < sleep_time) { if (QProcess::Running == sshd->state ()) { + /* + * Additionally, spin up to 3 seconds to give sshd + * the opportunity to launch its listening socket. + */ + QTime new_sleep_time = QTime::currentTime ().addSecs (3); + + while (QTime::currentTime () < new_sleep_time) { + if (isServerRunning (clientSshPort.toInt ())) { + break; + } + + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); + } + break; } QCoreApplication::processEvents (QEventLoop::AllEvents, 100); } +#endif /* defined (Q_OS_WIN) */ if (!isServerRunning (clientSshPort.toInt ())) { printSshDError_startupFailure (); -- 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 56abaee983807d8316ca2dc401220c387247d414 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 17:58:27 2016 +0200 src/onmainwindow.cpp: add comment to last all-in listening check in startSshd (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9e87aee..1884d1a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -458,6 +458,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: move QProcess startup check in startSshd () to non-Windows code section and add a listening socket check loop. Windows uses other means of starting the daemon. + - src/onmainwindow.cpp: add comment to last all-in listening check in + startSshd (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 70c9058..fa369e6 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10623,6 +10623,7 @@ bool ONMainWindow::startSshd() } #endif /* defined (Q_OS_WIN) */ + /* Check to see if connecting to the listening socket works. */ if (!isServerRunning (clientSshPort.toInt ())) { printSshDError_startupFailure (); x2goDebug << "Failed to start user mode OpenSSH server."; -- 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 d68e4edefbd6d96be637d45759da68aacf66a24a Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 18:01:52 2016 +0200 src/onmainwindow.cpp: add listening-check loop to the Windows-specific code of startSshd (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1884d1a..2690efb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -460,6 +460,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium uses other means of starting the daemon. - src/onmainwindow.cpp: add comment to last all-in listening check in startSshd (). + - src/onmainwindow.cpp: add listening-check loop to the Windows-specific + code of startSshd (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index fa369e6..1bd2797 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10569,20 +10569,37 @@ bool ONMainWindow::startSshd() ZeroMemory ( &sshd, sizeof ( sshd ) ); si.lpDesktop=desktop; si.cb = sizeof ( si ); - CreateProcessA ( NULL, // No module name (use command line) - ( LPSTR ) strm.str().c_str(), // Command line - NULL, // Process handle not inheritable - NULL, // Thread handle not inheritable - TRUE, // Set handle inheritance to FALSE - 0/*CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP*/, - //creation flags - NULL, // Use parent's environment block - clientdir.c_str(), // Starting directory - &si, // Pointer to STARTUPINFO structure - &sshd );// Pointer to PROCESS_INFORMATION structure - /* FIXME: test successful SSH daemon startup */ + const BOOL ret = CreateProcessA ( NULL, // No module name (use command line) + ( LPSTR ) strm.str().c_str(), // Command line + NULL, // Process handle not inheritable + NULL, // Thread handle not inheritable + TRUE, // Set handle inheritance to FALSE + 0/*CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP*/, + //creation flags + NULL, // Use parent's environment block + clientdir.c_str(), // Starting directory + &si, // Pointer to STARTUPINFO structure + &sshd );// Pointer to PROCESS_INFORMATION structure + + /* Test successful SSH daemon startup for at most 5 seconds. */ + if (ret) { + QTime sleep_time = QTime::currentTime ().addSecs (5); + + while (QTime::currentTime () < sleep_time) { + if (isServerRunning (clientSshPort.toInt ())) { + winSshdStarted = true; + + break; + } + + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); + } + } + else { + winSshdStarted = false; + } + delete []desktop; - winSshdStarted=true; #else // defined (Q_OS_WIN) sshd=new QProcess ( this ); -- 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 7afae87c959db737a30132eb4afebc095a3ce7a9 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 18:21:13 2016 +0200 src/onmainwindow.{cpp,h}: make startSshd () private. There's no need to keep it public, as only class-internal functions are using it. --- debian/changelog | 2 ++ src/onmainwindow.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2690efb..5c912e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -462,6 +462,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium startSshd (). - src/onmainwindow.cpp: add listening-check loop to the Windows-specific code of startSshd (). + - src/onmainwindow.{cpp,h}: make startSshd () private. There's no need to + keep it public, as only class-internal functions are using it. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.h b/src/onmainwindow.h index f556f85..9046349 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -584,7 +584,6 @@ public: QString internAppName ( const QString& transAppName, bool* found=0l ); void setEmbedSessionActionsEnabled ( bool enable ); - bool startSshd(); QSize getEmbedAreaSize(); #ifdef Q_OS_WIN static QString cygwinPath ( const QString& winPath ); @@ -1221,6 +1220,7 @@ private: std::size_t default_size_for_key_type (key_types key_type); QString generateKey (key_types key_type, bool host_key = false); QString createKeyBundle (key_types key_type = RSA_KEY_TYPE); + bool startSshd(); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 d8333062a972989dc4fcaa7bc466bb506cb1a13c Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 19:04:50 2016 +0200 src/onmainwindow.{cpp,h}: add ssh_key_type_ member variable and getter and setter to WinServerStarter class. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 7 +++++++ src/onmainwindow.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5c912e9..dd5690c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -464,6 +464,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium code of startSshd (). - src/onmainwindow.{cpp,h}: make startSshd () private. There's no need to keep it public, as only class-internal functions are using it. + - src/onmainwindow.{cpp,h}: add ssh_key_type_ member variable and getter + and setter to WinServerStarter class. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 1bd2797..38b258f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10001,6 +10001,13 @@ void WinServerStarter::run() } } +void WinServerStarter::set_ssh_key_type (ONMainWindow::key_types key_type) { + ssh_key_type_ = key_type; +} + +ONMainWindow::key_types WinServerStarter::get_ssh_key_type () { + return (ssh_key_type_); +} void ONMainWindow::startWinServers() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 9046349..2e2da7f 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -256,9 +256,12 @@ public: enum daemon {X,SSH}; WinServerStarter ( daemon server, ONMainWindow * par ); void run(); + void set_ssh_key_type (ONMainWindow::key_types key_type); + ONMainWindow::key_types get_ssh_key_type (); private: daemon mode; ONMainWindow* parent; + key_types ssh_key_type_ = RSA_KEY_TYPE; }; #endif -- 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 bfe09a285d4248b0d98a47f9739da857d34f3d9b Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 19:09:42 2016 +0200 src/onmainwindow.{cpp,h}: add SSH key type parameter to startSshd (). --- debian/changelog | 1 + src/onmainwindow.cpp | 2 +- src/onmainwindow.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index dd5690c..ad38be2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -466,6 +466,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium keep it public, as only class-internal functions are using it. - src/onmainwindow.{cpp,h}: add ssh_key_type_ member variable and getter and setter to WinServerStarter class. + - src/onmainwindow.{cpp,h}: add SSH key type parameter to startSshd (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 38b258f..afdaa67 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10495,7 +10495,7 @@ QString ONMainWindow::createKeyBundle (key_types key_type) { return (user_key); } -bool ONMainWindow::startSshd() +bool ONMainWindow::startSshd(ONMainWindow::key_types key_type) { if ( embedMode && config.confFS && !config.useFs ) { diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 2e2da7f..c6c785b 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1223,7 +1223,7 @@ private: std::size_t default_size_for_key_type (key_types key_type); QString generateKey (key_types key_type, bool host_key = false); QString createKeyBundle (key_types key_type = RSA_KEY_TYPE); - bool startSshd(); + bool startSshd (key_types key_type = RSA_KEY_TYPE); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 d79652c293b4922a2b53e430c9c2b74e773925bd Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 19:13:15 2016 +0200 src/onmainwindow.cpp: pass new ssh_key_type_ member to startSshd () call in WinServerStarter::run (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ad38be2..8f72355 100644 --- a/debian/changelog +++ b/debian/changelog @@ -467,6 +467,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: add ssh_key_type_ member variable and getter and setter to WinServerStarter class. - src/onmainwindow.{cpp,h}: add SSH key type parameter to startSshd (). + - src/onmainwindow.cpp: pass new ssh_key_type_ member to startSshd () call + in WinServerStarter::run (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index afdaa67..3c09ee4 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9993,7 +9993,7 @@ void WinServerStarter::run() switch ( mode ) { case SSH: - parent->startSshd(); + parent->startSshd(ssh_key_type_); break; case X: parent->startXOrg(); -- 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 45ce18987166235d0bbc1db4c86b743350c6b6f4 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 19:14:20 2016 +0200 src/onmainwindow.cpp: pass key_type parameter to startSshd () in createKeyBundle (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8f72355..9dd4ac9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -469,6 +469,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: add SSH key type parameter to startSshd (). - src/onmainwindow.cpp: pass new ssh_key_type_ member to startSshd () call in WinServerStarter::run (). + - src/onmainwindow.cpp: pass key_type parameter to startSshd () in + createKeyBundle (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 3c09ee4..c0c289f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10461,7 +10461,7 @@ QString ONMainWindow::createKeyBundle (key_types key_type) { #endif } - if (!(startSshd ())) { + if (!(startSshd (key_type))) { x2goDebug << "Failed to start OpenSSH Server pro-actively."; return (QString::null); } -- 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 543bfa7f873971298329238cc57d98489da846f6 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 19:18:07 2016 +0200 src/onmainwindow.cpp: add and use key_types parameter to startWinServers (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 6 ++++-- src/onmainwindow.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9dd4ac9..79ef160 100644 --- a/debian/changelog +++ b/debian/changelog @@ -471,6 +471,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium in WinServerStarter::run (). - src/onmainwindow.cpp: pass key_type parameter to startSshd () in createKeyBundle (). + - src/onmainwindow.cpp: add and use key_types parameter to + startWinServers (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index c0c289f..2d61342 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10010,8 +10010,9 @@ ONMainWindow::key_types WinServerStarter::get_ssh_key_type () { } -void ONMainWindow::startWinServers() +void ONMainWindow::startWinServers(ONMainWindow::key_types key_type) { + key_type = check_key_type (key_type); x2goDebug<<"Starting helper servers for Windows ..."; @@ -10027,7 +10028,8 @@ void ONMainWindow::startWinServers() { dr.mkpath ( etcDir ); - UNUSED (generateKey (RSA_KEY_TYPE, true)); + UNUSED (generateKey (key_type, true)); + sshStarter->set_ssh_key_type (key_type); generateEtcFiles(); sshStarter->start(); } diff --git a/src/onmainwindow.h b/src/onmainwindow.h index c6c785b..14240e5 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1012,7 +1012,7 @@ protected: #else private slots: void slotSetWinServersReady(); - void startWinServers(); + void startWinServers(key_types key_type = RSA_KEY_TYPE); void slotCheckXOrgLog(); void slotCheckXOrgConnection(); void slotStartParec (); -- 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 431a047c38037a94ba0e4881e93cde0cab80ff45 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 19:25:33 2016 +0200 src/onmainwindow.cpp: actually use key_type parameter in startSshd () and make selection more generic. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 79ef160..3ced34b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -473,6 +473,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium createKeyBundle (). - src/onmainwindow.cpp: add and use key_types parameter to startWinServers (). + - src/onmainwindow.cpp: actually use key_type parameter in startSshd () + and make selection more generic. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 2d61342..8f36f18 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10504,6 +10504,8 @@ bool ONMainWindow::startSshd(ONMainWindow::key_types key_type) return false; } + const QString stringified_key_type = key_type_to_string (key_type); + /* Don't start sshd, if it's already running. */ #ifdef Q_OS_WIN if (winSshdStarted) @@ -10527,8 +10529,7 @@ bool ONMainWindow::startSshd(ONMainWindow::key_types key_type) std::string clientdir=wapiShortFileName ( appDir ).toStdString(); std::stringstream strm; std::string config="\""+cygwinPath(etcDir+"/sshd_config").toStdString()+"\""; - /* FIXME: make this generic! */ - std::string key="\""+cygwinPath(etcDir+"/ssh_host_rsa_key").toStdString()+"\""; + std::string key="\""+cygwinPath(etcDir+"/ssh_host_" + stringified_key_type + "_key").toStdString()+"\""; // generate a unique sshLog filepath, and create its directory if (debugging) @@ -10618,9 +10619,8 @@ bool ONMainWindow::startSshd(ONMainWindow::key_types key_type) #endif /* !(defined (Q_OS_UNIX)) */ QStringList arguments; - /* FIXME: make key selection more generic! */ arguments<<"-f"<<etcDir +"/sshd_config"<< "-h" << - etcDir+"/ssh_host_rsa_key"<<"-D"<<"-p"<<clientSshPort; + etcDir+"/ssh_host_" + stringified_key_type + "_key"<<"-D"<<"-p"<<clientSshPort; sshd->start (binary, arguments); -- 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 55b0e0234b3bca802cded0a6cd66ea9fe48671dd Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 20:36:14 2016 +0200 src/onmainwindow.h: move WinServerStarter class definition around to hopefully get the definition of ONMainWindow::key_types. --- debian/changelog | 2 ++ src/onmainwindow.h | 35 +++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ced34b..0d240ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -475,6 +475,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium startWinServers (). - src/onmainwindow.cpp: actually use key_type parameter in startSshd () and make selection more generic. + - src/onmainwindow.h: move WinServerStarter class definition around to + hopefully get the definition of ONMainWindow::key_types. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 14240e5..bf721a6 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -247,22 +247,6 @@ class WWrapper : public QPushButton { friend class ONMainWindow; }; -#include <QThread> -#include <QMutex> -class ONMainWindow; -class WinServerStarter: public QThread -{ -public: - enum daemon {X,SSH}; - WinServerStarter ( daemon server, ONMainWindow * par ); - void run(); - void set_ssh_key_type (ONMainWindow::key_types key_type); - ONMainWindow::key_types get_ssh_key_type (); -private: - daemon mode; - ONMainWindow* parent; - key_types ssh_key_type_ = RSA_KEY_TYPE; -}; #endif @@ -1270,4 +1254,23 @@ private slots: ////////////////end of plugin stuff//////////////////// }; +#ifdef Q_OS_WIN +#include <QThread> +#include <QMutex> +class ONMainWindow; +class WinServerStarter: public QThread +{ +public: + enum daemon {X,SSH}; + WinServerStarter ( daemon server, ONMainWindow * par ); + void run(); + void set_ssh_key_type (ONMainWindow::key_types key_type); + ONMainWindow::key_types get_ssh_key_type (); +private: + daemon mode; + ONMainWindow* parent; + ONMainWindow::key_types ssh_key_type_ = RSA_KEY_TYPE; +}; +#endif + #endif -- 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 f72ddfa3ca75423572cbc3e1e931f063a69f20f8 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 20:37:29 2016 +0200 src/onmainwindow.h: remove WWrapper definition, seems to be unused. --- debian/changelog | 1 + src/onmainwindow.h | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0d240ee..29c7d9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -477,6 +477,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium and make selection more generic. - src/onmainwindow.h: move WinServerStarter class definition around to hopefully get the definition of ONMainWindow::key_types. + - src/onmainwindow.h: remove WWrapper definition, seems to be unused. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.h b/src/onmainwindow.h index bf721a6..cbf4118 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -241,15 +241,6 @@ struct sshKey }; -//wrapper to send mouse events under windows in embedded mode -#ifdef Q_OS_WIN -class WWrapper : public QPushButton -{ - friend class ONMainWindow; -}; -#endif - - class SessTreeView : public QTreeView { Q_OBJECT -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 827579d6d890b01377034530534c49d1cb71838d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 20:42:45 2016 +0200 src/onmainwindow.{cpp,h}: don't try to initialize non-static ssh_key_type_ member variable directly, but in the constructor. Also, use the initializer list to initialize the other member variables directly. --- debian/changelog | 4 ++++ src/onmainwindow.cpp | 4 +--- src/onmainwindow.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 29c7d9a..5990009 100644 --- a/debian/changelog +++ b/debian/changelog @@ -478,6 +478,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.h: move WinServerStarter class definition around to hopefully get the definition of ONMainWindow::key_types. - src/onmainwindow.h: remove WWrapper definition, seems to be unused. + - src/onmainwindow.{cpp,h}: don't try to initialize non-static + ssh_key_type_ member variable directly, but in the constructor. Also, + use the initializer list to initialize the other member variables + directly. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 8f36f18..ee42f94 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9982,10 +9982,8 @@ void ONMainWindow::slotCheckXOrgConnection() } WinServerStarter::WinServerStarter ( daemon server, ONMainWindow * par ) : - QThread ( 0 ) + QThread ( 0 ), ssh_key_type_ (ONMainWindow::RSA_KEY_TYPE), mode (server), parent (par) { - mode=server; - parent=par; } void WinServerStarter::run() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index cbf4118..61c66de 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1260,7 +1260,7 @@ public: private: daemon mode; ONMainWindow* parent; - ONMainWindow::key_types ssh_key_type_ = RSA_KEY_TYPE; + ONMainWindow::key_types ssh_key_type_; }; #endif -- 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 d13d2fdee896e8f614a5ee73885893f234338d9d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 20:46:08 2016 +0200 src/onmainwindow.cpp: re-order initializer list of WinServerStarter constructor. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5990009..788034d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -482,6 +482,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium ssh_key_type_ member variable directly, but in the constructor. Also, use the initializer list to initialize the other member variables directly. + - src/onmainwindow.cpp: re-order initializer list of WinServerStarter + constructor. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index ee42f94..e01dfb4 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -9982,7 +9982,7 @@ void ONMainWindow::slotCheckXOrgConnection() } WinServerStarter::WinServerStarter ( daemon server, ONMainWindow * par ) : - QThread ( 0 ), ssh_key_type_ (ONMainWindow::RSA_KEY_TYPE), mode (server), parent (par) + QThread ( 0 ), mode (server), parent (par), ssh_key_type_ (ONMainWindow::RSA_KEY_TYPE) { } -- 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 05dc4d0cd29d1b99f349b0e7d54ce3c48f8eef72 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 20:47:32 2016 +0200 src/onmainwindow.h: actually, we do need startSshd () to be public. Move it back. --- debian/changelog | 2 ++ src/onmainwindow.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 788034d..d64dde5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -484,6 +484,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium directly. - src/onmainwindow.cpp: re-order initializer list of WinServerStarter constructor. + - src/onmainwindow.h: actually, we do need startSshd () to be public. Move + it back. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 61c66de..e0f9d56 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -562,6 +562,7 @@ public: QString internAppName ( const QString& transAppName, bool* found=0l ); void setEmbedSessionActionsEnabled ( bool enable ); + bool startSshd (key_types key_type = RSA_KEY_TYPE); QSize getEmbedAreaSize(); #ifdef Q_OS_WIN static QString cygwinPath ( const QString& winPath ); @@ -1198,7 +1199,6 @@ private: std::size_t default_size_for_key_type (key_types key_type); QString generateKey (key_types key_type, bool host_key = false); QString createKeyBundle (key_types key_type = RSA_KEY_TYPE); - bool startSshd (key_types key_type = RSA_KEY_TYPE); ////////////////plugin stuff//////////////////// #ifdef CFGPLUGIN -- 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 6fe3aa311a2cf2411a446b4f117a5435572d4b97 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 21:27:37 2016 +0200 src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in generateKey (). Refactor a bit to drop the now-unnecessary ret variable. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index d64dde5..0ba751f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -486,6 +486,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium constructor. - src/onmainwindow.h: actually, we do need startSshd () to be public. Move it back. + - src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in + generateKey (). Refactor a bit to drop the now-unnecessary ret variable. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index e01dfb4..81dea8c 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10286,8 +10286,6 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k QString stringified_key_type (key_type_to_string (key_type)); std::size_t key_bits = default_size_for_key_type (key_type); - QString ret (""); - QString base_dir (homeDir); QString private_key_file (""); @@ -10309,12 +10307,10 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k } } -#ifdef Q_OS_WIN - private_key_file = cygwinPath (wapiShortFileName (base_dir)); -#else private_key_file = base_dir; +#ifdef Q_OS_WIN + QString private_key_file_cygwin = cygwinPath (wapiShortFileName (base_dir)); #endif - ret = base_dir; { QString tmp_to_add (""); @@ -10337,14 +10333,23 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k } private_key_file += tmp_to_add; - ret += tmp_to_add; +#ifdef Q_OS_WIN + private_key_file_cygwin += tmp_to_add; +#endif } QString public_key_file (private_key_file + ".pub"); if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) { x2goDebug << "Generating SSH key. Type: " << stringified_key_type.toUpper () - << "; Location: " << private_key_file; + << "; Location: " + << +#ifdef Q_OS_WIN + private_key_file_cygwin +#else + private_key_file +#endif + ; QStringList args; @@ -10399,7 +10404,7 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k } } - return (ret); + return (private_key_file); } QString ONMainWindow::createKeyBundle (key_types key_type) { -- 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 805b394e9d44b1670d19d3559983983f23cacabb Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Oct 26 22:05:10 2016 +0200 src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ba751f..692ea35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -488,6 +488,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium it back. - src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in generateKey (). Refactor a bit to drop the now-unnecessary ret variable. + - src/onmainwindow.cpp: use QFileInfo to get the key file's basename in + exportDirs () instead of the old, potentially faulty string replace + dance. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 81dea8c..4409527 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -7998,12 +7998,11 @@ void ONMainWindow::exportDirs ( QString exports,bool removable ) QString uname=getCurrentUname(); - QString dst=dr.key; - QString dhdir=homeDir+"/.x2go"; -#ifdef Q_OS_WIN - dhdir=wapiShortFileName ( dhdir ); -#endif - dst.replace ( dhdir +"/ssh/gen/","" ); + + /* For the destination, fetch the base name only. */ + QFileInfo tmp_file_info (dr.key); + QString dst = tmp_file_info.fileName (); + dst="~"+uname +"/.x2go/ssh/"+dst; dr.dstKey=dst; dr.isRemovable=removable; -- 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 c012d258d42351c8aac0a87449c6c82d6885c698 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 16:33:38 2016 +0100 src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. We will need it for sftp-server discovery. --- debian/changelog | 3 +++ src/x2goutils.cpp | 4 +++- src/x2goutils.h | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 692ea35..5fcddb5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -491,6 +491,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance. + - src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available + on all UNIX-based operating systems. We will need it for sftp-server + discovery. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index f218355..542ae7e 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -207,7 +207,9 @@ void show_XQuartz_generic_error (const QString &main_error, const QString &addit "or\n" "<center><b>/Applications/Utilities/XQuartz.app</b></center>")); } +#endif /* defined (Q_OS_DARWIN) */ +#ifdef Q_OS_UNIX QString add_to_path (const QString &orig_path, const QStringList &add, const bool back) { QString ret = orig_path; std::vector<bool> found; @@ -335,4 +337,4 @@ QString find_binary (const QString &path, const QString &binary_name) { return (ret); } -#endif /* defined (Q_OS_DARWIN) */ +#endif /* defined (Q_OS_UNIX) */ diff --git a/src/x2goutils.h b/src/x2goutils.h index dd7613c..f489439 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -45,7 +45,9 @@ bool font_is_monospaced (const QFont &font); void show_XQuartz_not_found_error (); void show_XQuartz_start_error (); void show_XQuartz_generic_error (const QString &main_error, const QString &additional_info); +#endif /* defined (Q_OS_DARWIN) */ +#ifdef Q_OS_UNIX /* * Add a list of strings to a PATH value. * @@ -65,6 +67,6 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo * Iff path is empty, (only) the current working dir is searched. */ QString find_binary (const QString &path, const QString &binary_name); -#endif /* defined (Q_OS_DARWIN) */ +#endif /* defined (Q_OS_UNIX) */ #endif /* !defined (X2GOUTILS_H) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 68930b521e85b1cbb985ca18fe43096bad5e6954 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 17:33:36 2016 +0100 src/pulsemanager.cpp: refactor PA binary searching code. Less duplication now. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 48 ++++++++++++++---------------------------------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5fcddb5..c825ff2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -494,6 +494,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/x2goutils.{cpp,h}: make find_binary () and add_to_path () available on all UNIX-based operating systems. We will need it for sftp-server discovery. + - src/pulsemanager.cpp: refactor PA binary searching code. Less + duplication now. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 93c83b3..d7b6d72 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -79,21 +79,6 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), if (server_binary_.isEmpty ()) { server_binary_ = find_binary (path_val, "pulseaudio"); - - if (server_binary_.isEmpty ()) { - x2goErrorf (29) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; - show_RichText_ErrorMsgBox (tr ("Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), - tr ("If you downloaded the bundled, pre-compiled version from the official home page, " - "please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" - "</a></center>\n"), - true); - abort (); - } - else { - system_pulse_ = true; - } } #else /* QT_VERSION < 0x050000 */ QStringList search_paths; @@ -117,30 +102,25 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), search_paths << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); - - if (server_binary_.isEmpty ()) { - x2goErrorf (28) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; - show_RichText_ErrorMsgBox (tr ("Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), - tr ("If you downloaded the bundled, pre-compiled version from the official home page, " - "please report a bug on:\n" - "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" - "</a></center>\n"), - true); - abort (); - } } } + } +#endif /* QT_VERSION < 0x050000 */ - /* - * The detection above either failed or succeeded. - * Failure means that the program already stopped, - * success means that all code reaches this point. - * Be careful when refactoring this code. - */ + if (server_binary_.isEmpty ()) { + x2goErrorf (29) << "Unable to find the PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."; + show_RichText_ErrorMsgBox (tr ("Unable to find the PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories."), + tr ("If you downloaded the bundled, pre-compiled version from the official home page, " + "please report a bug on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); + abort (); + } + else { system_pulse_ = true; } -#endif /* QT_VERSION < 0x050000 */ QFileInfo tmp_file_info = QFileInfo (server_binary_); server_working_dir_ = tmp_file_info.canonicalPath (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0b84096ed3c8e819ea4d2a57148a4df5c141ccf8 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 17:38:57 2016 +0100 src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 75 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index c825ff2..d1bad86 100644 --- a/debian/changelog +++ b/debian/changelog @@ -496,6 +496,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium discovery. - src/pulsemanager.cpp: refactor PA binary searching code. Less duplication now. + - src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching + for the real sftp-server binary path. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 4409527..aabb879 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10185,14 +10185,81 @@ void ONMainWindow::generateEtcFiles() out<<"StrictModes no\n"<< "UsePrivilegeSeparation no\n"<< "PidFile \"" + varDir + "/sshd.pid\"\n" << - "AuthorizedKeysFile \"" << authKeyPath << "\"\n" << + "AuthorizedKeysFile \"" << authKeyPath << "\"\n"; #ifdef Q_OS_WIN - "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< - "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"; + out << "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< + "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"; #else - "Subsystem sftp " - /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ - <<appDir<<"/sftp-server\n"; + /* + * We need to find the sftp-server binary. + * This turns out to be surprisingly difficult, because there is no standard place + * for this binary. Instead, every distribution installs it where they see fit. + * Needless to say, we're screwed... + */ + + QString sftp_binary; + +#if QT_VERSION < 0x050000 + QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); + QString path_val = tmp_env.value ("PATH"); + + QStringList to_back; + to_back << "/usr/lib/openssh" /* Debian and Ubuntu */ + << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ + << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ + << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ + << "/usr/lib/misc" /* Gentoo */ + << "/usr/libexec"; /* Slackware, OS X */ + + add_to_path (path_val, to_back); + + /* Just in case we bundle sftp-server ourselves. */ + sftp_binary = find_binary (appDir, "sftp-server"); + + if (sftp_binary.isEmpty ()) { + sftp_binary = find_binary (path_val, "sftp-server"); + } +#else /* QT_VERSION < 0x050000 */ + QStringList search_paths; + search_paths << appDir; + + sftp_binary = QStandardPaths::findExecutable ("sftp-binary", search_paths); + + if (sftp_binary.isEmpty ()) { + search_paths = QStringList (); + + sftp_binary = QStandardPaths::findExecutable ("sftp-binary", search_paths); + + if (sftp_binary.isEmpty ()) { + search_paths = QStringList (); + search_paths << "/usr/lib/openssh" /* Debian and Ubuntu */ + << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ + << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ + << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ + << "/usr/lib/misc" /* Gentoo */ + << "/usr/libexec"; /* Slackware, OS X */ + + sftp_binary = QStandardPaths::findExecutable ("sftp-server", search_paths); + } + } +#endif /* QT_VERSION < 0x050000 */ + + if (sftp_binary.isEmpty ()) { + x2goErrorf (31) << "Unable to find the sftp-server binary. Neither bundled, nor found in $PATH nor additional directories."; + show_RichText_ErrorMsgBox (tr ("Unable to find the sftp-server binary. Neither bundled, nor found in $PATH nor additional directories."), + tr ("If you are using a Linux-based operating system, please ask your system administrator " + "to install the package containing the sftp-server binary. Common names are <b>openssh</b>, " + "<b>openssh-server</b> or <b>openssh-sftp-server</b> depending upon distribution.\n\n" + "If the sftp-server binary is installed on your system, please report a bug " + "mentioning its path on:\n" + "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" + "https://wiki.x2go.org/doku.php/wiki:bugs" + "</a></center>\n"), + true); + abort (); + } + + out << "Subsystem sftp " << sftp_binary << "\n"; #endif /* The log file in startSshd() is specific to Windows. */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e5bac32a1d896ee59770accb3c1f7565b23c8bca Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 28 18:09:53 2016 +0100 src/pulsemanager.cpp: fix PA binary searching logic. We don't want to unconditionally set system_pulse_ to true if we found a binary... it might as well be the bundled one... --- debian/changelog | 3 +++ src/pulsemanager.cpp | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index d1bad86..92217b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -498,6 +498,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium duplication now. - src/onmainwindow.cpp: fix sshd_config generation on UNIX by searching for the real sftp-server binary path. + - src/pulsemanager.cpp: fix PA binary searching logic. We don't want to + unconditionally set system_pulse_ to true if we found a binary... it + might as well be the bundled one... [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d7b6d72..a956054 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -79,6 +79,10 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), if (server_binary_.isEmpty ()) { server_binary_ = find_binary (path_val, "pulseaudio"); + + if (!(server_binary_.isEmpty ())) { + system_pulse_ = true; + } } #else /* QT_VERSION < 0x050000 */ QStringList search_paths; @@ -102,8 +106,18 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), search_paths << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ server_binary_ = QStandardPaths::findExecutable ("pulseaudio", search_paths); + + if (!(server_binary_.isEmpty ())) { + system_pulse_ = true; + } + } + else { + system_pulse_ = true; } } + else { + system_pulse_ = true; + } } #endif /* QT_VERSION < 0x050000 */ @@ -118,9 +132,6 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), true); abort (); } - else { - system_pulse_ = true; - } QFileInfo tmp_file_info = QFileInfo (server_binary_); server_working_dir_ = tmp_file_info.canonicalPath (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b3f3e293620126910af5e8c225c4a257faae5b2b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 9 16:51:47 2016 +0100 src/onmainwindow.cpp: move generateEtcFiles () call to startSshd (). We must make sure that the sshd_config file exists and is up-to-date, so let's always do it right before starting the sshd binary. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 92217b7..066b093 100644 --- a/debian/changelog +++ b/debian/changelog @@ -501,6 +501,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: fix PA binary searching logic. We don't want to unconditionally set system_pulse_ to true if we found a binary... it might as well be the bundled one... + - src/onmainwindow.cpp: move generateEtcFiles () call to startSshd (). We + must make sure that the sshd_config file exists and is up-to-date, so + let's always do it right before starting the sshd binary. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index aabb879..0649586 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10027,7 +10027,6 @@ void ONMainWindow::startWinServers(ONMainWindow::key_types key_type) dr.mkpath ( etcDir ); UNUSED (generateKey (key_type, true)); sshStarter->set_ssh_key_type (key_type); - generateEtcFiles(); sshStarter->start(); } @@ -10519,7 +10518,6 @@ QString ONMainWindow::createKeyBundle (key_types key_type) { #ifdef Q_OS_UNIX x2goDebug << "Creating a new one."; QString tmp_file_name (generateKey (key_type, true)); - generateEtcFiles (); rsa.setFileName (tmp_file_name + ".pub"); if (!(rsa.open (QIODevice::ReadOnly | QIODevice::Text))) { @@ -10587,6 +10585,12 @@ bool ONMainWindow::startSshd(ONMainWindow::key_types key_type) } } + /* + * Pro-actively (re-)create sshd_config file, we'll need it for sshd + * and more importantly make sure that it's up-to-date. + */ + generateEtcFiles (); + clientSshPort = "7022"; QString etcDir=homeDir+"/.x2go/etc"; int port=clientSshPort.toInt(); -- 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 af07a40e68cdb4991e85d8a824d45e85f1f63bb4 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 9 16:52:51 2016 +0100 src/onmainwindow.cpp: stop duplicating the list of known sftp-server binary locations. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 25 +++++++++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 066b093..8ee9906 100644 --- a/debian/changelog +++ b/debian/changelog @@ -504,6 +504,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: move generateEtcFiles () call to startSshd (). We must make sure that the sshd_config file exists and is up-to-date, so let's always do it right before starting the sshd binary. + - src/onmainwindow.cpp: stop duplicating the list of known sftp-server + binary locations. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 0649586..95c0315 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10197,20 +10197,19 @@ void ONMainWindow::generateEtcFiles() */ QString sftp_binary; + QStringList common_sftp_dirs; + common_sftp_dirs << "/usr/lib/openssh" /* Debian and Ubuntu */ + << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ + << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ + << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ + << "/usr/lib/misc" /* Gentoo */ + << "/usr/libexec"; /* Slackware, OS X */ #if QT_VERSION < 0x050000 QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); QString path_val = tmp_env.value ("PATH"); - QStringList to_back; - to_back << "/usr/lib/openssh" /* Debian and Ubuntu */ - << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ - << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ - << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ - << "/usr/lib/misc" /* Gentoo */ - << "/usr/libexec"; /* Slackware, OS X */ - - add_to_path (path_val, to_back); + add_to_path (path_val, common_sftp_dirs); /* Just in case we bundle sftp-server ourselves. */ sftp_binary = find_binary (appDir, "sftp-server"); @@ -10230,13 +10229,7 @@ void ONMainWindow::generateEtcFiles() sftp_binary = QStandardPaths::findExecutable ("sftp-binary", search_paths); if (sftp_binary.isEmpty ()) { - search_paths = QStringList (); - search_paths << "/usr/lib/openssh" /* Debian and Ubuntu */ - << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ - << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ - << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ - << "/usr/lib/misc" /* Gentoo */ - << "/usr/libexec"; /* Slackware, OS X */ + search_paths = common_sftp_dirs; sftp_binary = QStandardPaths::findExecutable ("sftp-server", search_paths); } -- 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 47048cfcc4511290fde88582b0af56922e5c2b4c Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 9 16:54:33 2016 +0100 src/{onmainwindow,pulsemanager}.cpp: actually *use* what we got back from add_to_path ()... Fixes a few bugs here and there. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- src/pulsemanager.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8ee9906..aae7bf5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -506,6 +506,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium let's always do it right before starting the sshd binary. - src/onmainwindow.cpp: stop duplicating the list of known sftp-server binary locations. + - src/{onmainwindow,pulsemanager}.cpp: actually *use* what we got back + from add_to_path ()... Fixes a few bugs here and there. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 95c0315..aadf7b6 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10209,7 +10209,7 @@ void ONMainWindow::generateEtcFiles() QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); QString path_val = tmp_env.value ("PATH"); - add_to_path (path_val, common_sftp_dirs); + path_val = add_to_path (path_val, common_sftp_dirs); /* Just in case we bundle sftp-server ourselves. */ sftp_binary = find_binary (appDir, "sftp-server"); diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index a956054..8b2e736 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -72,8 +72,8 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), to_front << "/opt/local/bin"; /* MacPorts default prefix, FIXME: might need to make that configurable. */ to_back << "/usr/local/bin"; /* Homebrew or random stuff. Probably even both intermingled... */ - add_to_path (path_val, to_back); - add_to_path (path_val, to_front, false); + path_val = add_to_path (path_val, to_back); + path_val = add_to_path (path_val, to_front, false); server_binary_ = find_binary (server_working_dir_, "pulseaudio"); -- 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 d02a8366209aff79fc0256a566796bb32725d1f6 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 9 18:48:07 2016 +0100 src/onmainwindow.cpp: remove trailing slash from Mageia/SUSE/Arch sftp-server binary search path. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index aae7bf5..d58f0a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -508,6 +508,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium binary locations. - src/{onmainwindow,pulsemanager}.cpp: actually *use* what we got back from add_to_path ()... Fixes a few bugs here and there. + - src/onmainwindow.cpp: remove trailing slash from Mageia/SUSE/Arch + sftp-server binary search path. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index aadf7b6..13e7853 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10200,7 +10200,7 @@ void ONMainWindow::generateEtcFiles() QStringList common_sftp_dirs; common_sftp_dirs << "/usr/lib/openssh" /* Debian and Ubuntu */ << "/usr/libexec/openssh" /* Fedora, CentOS, hopefully also RHEL */ - << "/usr/lib/ssh/" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ + << "/usr/lib/ssh" /* Mageia, OpenSUSE, SLE{S,D} < 12 x86, SLE{S,D} 12, Arch */ << "/usr/lib64/ssh" /* SLE{S,D} < 12 x86_64 */ << "/usr/lib/misc" /* Gentoo */ << "/usr/libexec"; /* Slackware, OS X */ -- 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 7b36d12ca1820ec9be973ae0e47c7106636ada31 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 9 18:49:18 2016 +0100 src/x2goutils.cpp: add debugging output to add_to_path (). --- debian/changelog | 1 + src/x2goutils.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index d58f0a0..7e488ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -510,6 +510,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium from add_to_path ()... Fixes a few bugs here and there. - src/onmainwindow.cpp: remove trailing slash from Mageia/SUSE/Arch sftp-server binary search path. + - src/x2goutils.cpp: add debugging output to add_to_path (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 542ae7e..0a01b62 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -216,6 +216,8 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo QStringList orig_path_list = orig_path.split (":"); + x2goDebug << "path value at beginning: " << orig_path; + /* * Clean up add list. We want to make sure no entry ends in a slash * and skip empty entries. @@ -236,6 +238,8 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo } } + x2goDebug << "tmp_clean_add: " << tmp_clean_add; + /* Nothing to add, really... */ if (tmp_clean_add.isEmpty ()) { return (ret); @@ -262,6 +266,8 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo } } + x2goDebug << "clean_add: " << clean_add; + /* Nothing to add. */ if (clean_add.isEmpty ()) { return (ret); @@ -280,6 +286,10 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo } } + for (std::size_t i = 0; i < found.size (); ++i) { + x2goDebug << "found entry i (" << i << ") in orig_path_list (" << clean_add[i] << "): " << found[i]; + } + if (back) { for (int i = 0; i < clean_add.size (); ++i) { if (!found[i]) { @@ -295,6 +305,8 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo } } + x2goDebug << "return value at end: " << ret; + return (ret); } -- 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 1593e83e8cd817b2ba25e199f35a2d5f546f4442 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 9 18:51:15 2016 +0100 src/x2goutils.cpp: fix add_to_path (). We want to remove trailing slashes from elements-to-add, not just fetch a trailing slash if encountered. Also, better don't compare a value from the original path value to itself, but rather to the things we want to add in order to remove duplicates, not remove most of the list of elements to add... --- debian/changelog | 5 +++++ src/x2goutils.cpp | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7e488ed..546f11b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -511,6 +511,11 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: remove trailing slash from Mageia/SUSE/Arch sftp-server binary search path. - src/x2goutils.cpp: add debugging output to add_to_path (). + - src/x2goutils.cpp: fix add_to_path (). We want to remove trailing + slashes from elements-to-add, not just fetch a trailing slash if + encountered. Also, better don't compare a value from the original path + value to itself, but rather to the things we want to add in order to + remove duplicates, not remove most of the list of elements to add... [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 0a01b62..d076c74 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -226,7 +226,8 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo for (int i = 0; i < add.size (); ++i) { if (!(add[i].isEmpty ())) { if (add[i].right (1) == "/") { - QString tmp_elem = add[i].right (1); + QString tmp_elem = add[i]; + tmp_elem.chop (1); if (!(tmp_elem.isEmpty ())) { tmp_clean_add.append (tmp_elem); @@ -254,7 +255,7 @@ QString add_to_path (const QString &orig_path, const QStringList &add, const boo bool tmp_found = false; for (QStringList::const_iterator cit2 = cit + 1; cit2 != end; ++cit2) { - if (*cit == *cit) { + if (*cit == *cit2) { tmp_found = true; 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 f836bed6a351a875a7fbc13f30f0be449cbd9bae Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 14:36:07 2016 +0100 src/unixhelper.cpp: use cstdio instead of stdio.h. It's the C++ header and imports functions into the std namespace. --- debian/changelog | 2 ++ src/unixhelper.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 546f11b..f9b5c14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -516,6 +516,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium encountered. Also, better don't compare a value from the original path value to itself, but rather to the things we want to add in order to remove duplicates, not remove most of the list of elements to add... + - src/unixhelper.cpp: use cstdio instead of stdio.h. It's the C++ header + and imports functions into the std namespace. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 406cdda..98597c1 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,7 +30,7 @@ #include <cerrno> #include <vector> #include <cstdlib> -#include <stdio.h> +#include <cstdio> /* For documentation please see 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 4596fb81cbe51e52ed273f353ddd5a6aa36bd47e Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 14:38:02 2016 +0100 src/: create new file unix_stdint.h which imports the (u)int*_t types into the std namespace. --- debian/changelog | 2 ++ src/unix_stdint.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/debian/changelog b/debian/changelog index f9b5c14..ea22675 100644 --- a/debian/changelog +++ b/debian/changelog @@ -518,6 +518,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium remove duplicates, not remove most of the list of elements to add... - src/unixhelper.cpp: use cstdio instead of stdio.h. It's the C++ header and imports functions into the std namespace. + - src/: create new file unix_stdint.h which imports the (u)int*_t types + into the std namespace. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unix_stdint.h b/src/unix_stdint.h new file mode 100644 index 0000000..633ecec --- /dev/null +++ b/src/unix_stdint.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2016 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 UNIX_STDINT_H +#define UNIX_STDINT_H + +#ifdef Q_OS_UNIX + +#include <stdint.h> + +/* + * We need this ugly hack because the cstdint header is C++11-only + * (or available with extensions we can't portably use) + * and stdint.h won't put these types into the std namespace. + */ +namespace std { + using ::int8_t; + using ::int16_t; + using ::int32_t; + using ::int64_t; + using ::uint8_t; + using ::uint16_t; + using ::uint32_t; + using ::uint64_t; +} + +#endif /* defined (Q_OS_UNIX) */ + + +#endif /* !defined (UNIX_STDINT_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 2d9d3b2d60b3d235b560e21bc0e57b271f859a13 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 14:40:08 2016 +0100 src/pulsemanager.h: use unix_stdint.h on non-Windows-platforms to get std::(u)int*_t types without having to use C++11. --- debian/changelog | 2 ++ src/pulsemanager.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ea22675..d77df4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -520,6 +520,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium and imports functions into the std namespace. - src/: create new file unix_stdint.h which imports the (u)int*_t types into the std namespace. + - src/pulsemanager.h: use unix_stdint.h on non-Windows-platforms to get + std::(u)int*_t types without having to use C++11. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 0b1ae3c..0aa5c6a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -34,7 +34,7 @@ #ifdef Q_OS_WIN #include "windows_stdint.h" #else /* defined (Q_OS_WIN) */ -#include <cstdint> +#include "unix_stdint.h" #endif /* defined (Q_OS_WIN) */ #include "x2gosettings.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 6d0a4658c43700e72e3b75365cb52b33fd48e352 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 14:48:45 2016 +0100 src/pulsemanager.cpp: fix Linux-based code by fixing a really stupid typo ("erange" instead of "errno") and including the cerrno header. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d77df4c..319e67e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -522,6 +522,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium into the std namespace. - src/pulsemanager.h: use unix_stdint.h on non-Windows-platforms to get std::(u)int*_t types without having to use C++11. + - src/pulsemanager.cpp: fix Linux-based code by fixing a really stupid + typo ("erange" instead of "errno") and including the cerrno header. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 8b2e736..6e8df01 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -19,6 +19,7 @@ #include <unistd.h> #include <stdlib.h> +#include <cerrno> #include <QSysInfo> #if QT_VERSION >= 0x050000 @@ -163,7 +164,7 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), memset (buf, 0, path_len); ptr = getcwd (buf, path_len); - if ((NULL == ptr) && (ERANGE != erange)) { + if ((NULL == ptr) && (ERANGE != errno)) { int saved_errno = errno; x2goErrorf (17) << "getcwd() failed: " << QString (strerror (saved_errno)); show_RichText_ErrorMsgBox (tr ("getcwd() failed!"), -- 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 e891ec2fc3fd67707bcea468444b529cad38dac8 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 14:57:17 2016 +0100 src/pulsemanager.cpp: use std::ssize_t for the path length, because it could be -1 and std::size_t is not applicable. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 319e67e..3c79aca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -524,6 +524,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium std::(u)int*_t types without having to use C++11. - src/pulsemanager.cpp: fix Linux-based code by fixing a really stupid typo ("erange" instead of "errno") and including the cerrno header. + - src/pulsemanager.cpp: use std::ssize_t for the path length, because it + could be -1 and std::size_t is not applicable. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6e8df01..1878b60 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -144,7 +144,7 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), server_working_dir_ = QString (app_dir_ + "/pulse/"); server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); #elif defined (Q_OS_LINUX) - std::size_t path_len = pathconf (".", _PC_PATH_MAX); + std::ssize_t path_len = pathconf (".", _PC_PATH_MAX); if (-1 == path_len) { path_len = 1024; -- 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 b838252320bf17b9c20db5b71d0f8ed7e6c5640c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 14:59:09 2016 +0100 src/pulsemanager.cpp: cast the return value of realloc () to char*, as GCC doesn't seem to like reassigning the pointer otherwise. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3c79aca..e74d672 100644 --- a/debian/changelog +++ b/debian/changelog @@ -526,6 +526,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium typo ("erange" instead of "errno") and including the cerrno header. - src/pulsemanager.cpp: use std::ssize_t for the path length, because it could be -1 and std::size_t is not applicable. + - src/pulsemanager.cpp: cast the return value of realloc () to char*, as + GCC doesn't seem to like reassigning the pointer otherwise. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1878b60..203ab29 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -153,7 +153,7 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), char *buf, *ptr; for (buf = ptr = NULL; ptr == NULL; path_len += 20) { - if (NULL == (buf = realloc (buf, path_len))) { + if (NULL == (buf = static_cast<char *> (realloc (buf, path_len)))) { x2goErrorf (16) << "Could not allocate buffer for getting current working directory!"; show_RichText_ErrorMsgBox (tr ("Could not allocate buffer for getting current working directory!"), QString (), -- 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 92106d64265a8bec76a7690d88cd0c85a4113eca Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 10 15:11:36 2016 +0100 src/unix_stdint.h: use same hack to import ssize_t into std namespace. --- debian/changelog | 1 + src/unix_stdint.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index e74d672..3fc558c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -528,6 +528,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium could be -1 and std::size_t is not applicable. - src/pulsemanager.cpp: cast the return value of realloc () to char*, as GCC doesn't seem to like reassigning the pointer otherwise. + - src/unix_stdint.h: use same hack to import ssize_t into std namespace. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/unix_stdint.h b/src/unix_stdint.h index 633ecec..db59edf 100644 --- a/src/unix_stdint.h +++ b/src/unix_stdint.h @@ -40,6 +40,11 @@ namespace std { using ::uint64_t; } +/* Same issue with unistd's ssize_t type. */ +namespace std { + using ::ssize_t; +} + #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 09bdbd61d4188b9f7e30f339c169f327cf586776 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 15 09:29:40 2016 +0100 src/onmainwindow.{cpp,h}: remove left-over parec references and code. --- debian/changelog | 1 + src/onmainwindow.cpp | 41 +---------------------------------------- src/onmainwindow.h | 3 --- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3fc558c..b2c5cc6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -529,6 +529,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: cast the return value of realloc () to char*, as GCC doesn't seem to like reassigning the pointer otherwise. - src/unix_stdint.h: use same hack to import ssize_t into std namespace. + - src/onmainwindow.{cpp,h}: remove left-over parec references and code. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 13e7853..89b1b81 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -5368,7 +5368,6 @@ void ONMainWindow::slotRetResumeSess ( bool result, "/.pulse-cookie"; sshConnection->copyFile(cooFile, destFile, this, SLOT ( slotPCookieReady ( bool, QString,int ))); - parecTunnelOk=true; #endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ } } @@ -5404,18 +5403,10 @@ void ONMainWindow::slotRetResumeSess ( bool result, #endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ if ( sshSndTunnel ) { - const char* okSlot=0; -#ifdef Q_OS_WIN /* FIXME: Do we need explicit parec support in PulseManager? */ - if ( sndSystem==PULSE ) - { - parecTunnelOk=false; - okSlot=SLOT ( slotSndTunOk() ); - } -#endif sndTunnel=sshConnection->startTunnel ( "localhost", resumingSession.sndPort.toInt(),"127.0.0.1", - sndPort.toInt(),true,this,okSlot, SLOT ( + sndPort.toInt(),true,this,NULL, SLOT ( slotSndTunnelFailed ( bool, QString, int ) )); @@ -12230,43 +12221,13 @@ void ONMainWindow::printSshDError_noAuthorizedKeysFile() QMessageBox::Ok,QMessageBox::NoButton ); } -#ifdef Q_OS_WIN -void ONMainWindow::slotStartParec () -{ - - if ( !parecTunnelOk ) - { -// wait 1 sec and try again - QTimer::singleShot ( 1000, this, SLOT ( slotStartParec() ) ); - return; - } - QString passwd=getCurrentPass(); - QString user=getCurrentUname(); - QString host=resumingSession.server; - QString scmd="PULSE_CLIENTCONFIG=\"${HOME}/.x2go/C-"+ - resumingSession.sessionId+ - "/.pulse-client.conf\" "+ - "parec 1> /dev/null & sleep 1 && kill %1"; -} -#endif - -void ONMainWindow::slotSndTunOk() -{ - parecTunnelOk=true; -} - void ONMainWindow::slotPCookieReady ( bool result, QString , int ) { -#ifdef Q_OS_WIN - if ( result ) - slotStartParec(); -#else /* Silence warning. */ UNUSED (result); -#endif /* defined (Q_OS_WIN) */ } diff --git a/src/onmainwindow.h b/src/onmainwindow.h index e0f9d56..b23245c 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -777,7 +777,6 @@ private: bool runStartApp; bool ldapOnly; bool isScDaemonOk; - bool parecTunnelOk; #ifdef Q_OS_LINUX bool directRDP; #endif @@ -991,7 +990,6 @@ private slots: void startWinServers(key_types key_type = RSA_KEY_TYPE); void slotCheckXOrgLog(); void slotCheckXOrgConnection(); - void slotStartParec (); #endif #if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) @@ -1128,7 +1126,6 @@ private slots: void slotAttachProxyWindow(); void slotEmbedIntoParentWindow(); void slotEmbedWindow(); - void slotSndTunOk(); void slotPCookieReady ( bool result,QString output, int proc ); void slotEmbedToolBar(); -- 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 7442496ea7295e4d7f22682c8fd9e3d2c09df5ac Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 15 09:44:17 2016 +0100 src/onmainwindow.cpp: convert piece of code to non-Windows and non-Darwin, so that not only Linux but other operating systems are covered as well. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b2c5cc6..b8dc55c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -530,6 +530,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium GCC doesn't seem to like reassigning the pointer otherwise. - src/unix_stdint.h: use same hack to import ssize_t into std namespace. - src/onmainwindow.{cpp,h}: remove left-over parec references and code. + - src/onmainwindow.cpp: convert piece of code to non-Windows and + non-Darwin, so that not only Linux but other operating systems are + covered as well. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 89b1b81..4c5bfbe 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -5373,10 +5373,10 @@ void ONMainWindow::slotRetResumeSess ( bool result, } if ( sndSystem==ESD ) { -#ifdef Q_OS_LINUX +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) sshConnection->copyFile(homeDir+"/.esd_auth", "$HOME/.esd_auth" ); -#else /* defined (Q_OS_LINUX) */ +#else /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir ().absolutePath () + "/.esd_auth").absolutePath ()); QString destFile="$HOME/.esd_auth"; -- 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 ef62c5006787a4aed6bea2f3d3c15e3c83706ca5 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 31 01:38:10 2016 +0100 src/mediawidget.cpp: unify some redundant code. --- debian/changelog | 1 + src/mediawidget.cpp | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index b8dc55c..5621c1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -533,6 +533,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: convert piece of code to non-Windows and non-Darwin, so that not only Linux but other operating systems are covered as well. + - src/mediawidget.cpp: unify some redundant code. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/mediawidget.cpp b/src/mediawidget.cpp index c937ba4..16d837a 100644 --- a/src/mediawidget.cpp +++ b/src/mediawidget.cpp @@ -155,16 +155,13 @@ void MediaWidget::slot_sndSysSelected ( int system ) } case ESD: { + rbStartSnd->hide (); + rbNotStartSnd->hide (); + cbSndSshTun->show (); #ifdef Q_OS_WIN - rbStartSnd->hide(); - rbNotStartSnd->hide(); - cbSndSshTun->show(); cbSndSshTun->setEnabled ( false ); cbSndSshTun->setChecked ( true ); #elif defined (Q_OS_DARWIN) - rbStartSnd->hide (); - rbNotStartSnd->hide (); - cbSndSshTun->show (); cbSndSshTun->setEnabled (true); #endif /* defined (Q_OS_WIN) */ sbSndPort->setValue ( 16001 ); -- 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 0915f76cca1d89f8b852514b9b772b2fbc98c12d Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 31 01:41:02 2016 +0100 src/mediawidget.cpp: simplify expression. --- debian/changelog | 1 + src/mediawidget.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5621c1d..af6c534 100644 --- a/debian/changelog +++ b/debian/changelog @@ -534,6 +534,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium non-Darwin, so that not only Linux but other operating systems are covered as well. - src/mediawidget.cpp: unify some redundant code. + - src/mediawidget.cpp: simplify expression. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/mediawidget.cpp b/src/mediawidget.cpp index 16d837a..15971d6 100644 --- a/src/mediawidget.cpp +++ b/src/mediawidget.cpp @@ -210,7 +210,7 @@ void MediaWidget::slot_sndStartClicked() { lSndPort->setEnabled ( true ); sbSndPort->setEnabled ( true ); - cbDefSndPort->setEnabled ( true &&sound->isChecked()); + cbDefSndPort->setEnabled (sound->isChecked()); } 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 b8d193c5a2c2b3fc3a94fe39fd7a565372684455 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 31 01:41:54 2016 +0100 src/mediawidget.cpp: add deprecation warning for ARTS. --- debian/changelog | 1 + src/mediawidget.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index af6c534..1244fe3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -535,6 +535,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium covered as well. - src/mediawidget.cpp: unify some redundant code. - src/mediawidget.cpp: simplify expression. + - src/mediawidget.cpp: add deprecation warning for ARTS. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/mediawidget.cpp b/src/mediawidget.cpp index 15971d6..57f5b84 100644 --- a/src/mediawidget.cpp +++ b/src/mediawidget.cpp @@ -151,6 +151,11 @@ void MediaWidget::slot_sndSysSelected ( int system ) cbDefSndPort->setChecked ( false ); cbDefSndPort->setEnabled ( false ); sbSndPort->setValue ( 20221 ); + QMessageBox::warning (NULL, tr ("Deprecation Warning"), + tr ("ARTS support is scheduled to be removed soon.\n\n" + + "Please upgrade to PulseAudio."), + QMessageBox::Ok, QMessageBox::NoButton); break; } case ESD: -- 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 f8e9390ad9ed8d4f1042f5d82040483763431044 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Dec 31 01:43:45 2016 +0100 src/mediawidget.cpp: add deprecation warning for ESounD. --- debian/changelog | 1 + src/mediawidget.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1244fe3..58d7fbf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -536,6 +536,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/mediawidget.cpp: unify some redundant code. - src/mediawidget.cpp: simplify expression. - src/mediawidget.cpp: add deprecation warning for ARTS. + - src/mediawidget.cpp: add deprecation warning for ESounD. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/mediawidget.cpp b/src/mediawidget.cpp index 57f5b84..d5d1b37 100644 --- a/src/mediawidget.cpp +++ b/src/mediawidget.cpp @@ -169,6 +169,14 @@ void MediaWidget::slot_sndSysSelected ( int system ) #elif defined (Q_OS_DARWIN) cbSndSshTun->setEnabled (true); #endif /* defined (Q_OS_WIN) */ + +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) + QMessageBox::warning (NULL, tr ("Deprecation Warning"), + tr ("ESounD support is scheduled to be removed soon.\n\n" + + "Please upgrade to PulseAudio."), + QMessageBox::Ok, QMessageBox::NoButton); +#endif sbSndPort->setValue ( 16001 ); 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 e552d9ad865fb9cedd91b0dae531e443e19c0aee Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jan 19 10:56:31 2017 +0100 macbuild.sh: make compatible with new llvm-based otool binary, which now uses proper return values. Be backwards-compatible with otool-classic. --- debian/changelog | 2 ++ macbuild.sh | 79 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/debian/changelog b/debian/changelog index 58d7fbf..23917e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -537,6 +537,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/mediawidget.cpp: simplify expression. - src/mediawidget.cpp: add deprecation warning for ARTS. - src/mediawidget.cpp: add deprecation warning for ESounD. + - macbuild.sh: make compatible with new llvm-based otool binary, which now + uses proper return values. Be backwards-compatible with otool-classic. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 90f8afb..69e342d 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -514,48 +514,63 @@ if [ "${BUNDLE}" = "1" ]; then # Try to fixup files broken by duplicates removal. for all_entry in "${all_files[@]}"; do - typeset otool_out="$(otool -L "${all_entry}")" + typeset otool_out="" typeset -i tmp_ret="0" - # Don't merge the declaration and initialization with the real value assignment. - # We need the return value of parse_otool_output(), but running - # typeset foo="$(bar)" will give us the return value of typeset, not bar(). - typeset dependencies="" + # Newer otool versions terminate with a non-zero return code on errors, + # while the classic/legacy versions do not. We need to make sure our + # script doesn't terminate just because otool returns a non-zero exit + # status. set +e - dependencies="$(parse_otool_output "${otool_out}")" + otool_out="$(otool -L "${all_entry}")" tmp_ret="${?}" set -e + # If the return code was non-zero, skip this file. + # A return code of zero does not automatically mean that otool finished + # successfully, so in that case throw otool's stdout into parse_otool_output(). if [ "${tmp_ret}" -eq "0" ]; then - typeset line="" - while read -r line; do - #echo "dependency of ${all_entry}: ${line}" - - typeset duplicate_entry="" - typeset -i i="0" - for i in "${!duplicates[@]}"; do - typeset duplicate_entry="${duplicates[${i}]}" - #echo "checking for duplicate ${duplicate_entry}" - typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" - - if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then - if [ "${line}" = "${duplicate_format}" ]; then - install_name_tool -change "${line}" "${to_files[${i}]}" "${all_entry}" - fi - else - echo "ERROR: empty file name while replacing duplicate dependencies." >&2 - echo "ERROR: for file ${all_entry}" >&2 - echo "ERROR: at dependency ${line}" >&2 - echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 - echo "ERROR: dependency: \"${line}\"" >&2 - exit 1 - fi - done - done <<< "${dependencies}" - else + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + set +e + dependencies="$(parse_otool_output "${otool_out}")" + tmp_ret="${?}" + set -e + fi + + if [ "${tmp_ret}" -ne "0" ]; then echo "WARNING: otool returned error for file: ${all_entry}" >&2 echo "WARNING: skipping." >&2 + continue fi + + typeset line="" + while read -r line; do + #echo "dependency of ${all_entry}: ${line}" + + typeset duplicate_entry="" + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" + #echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" + + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then + install_name_tool -change "${line}" "${to_files[${i}]}" "${all_entry}" + fi + else + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" done phase "Bundling up using macdeployqt" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git