From 09d2732b4e299eaa06c64b7a683529e337691c59 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 14 Feb 2015 16:23:43 +0100 Subject: Patch system: Prepend a "0" to every patch file name in debian/patches/. Adapt only this changelog stanza to this modification. --- debian/changelog | 36 +- ...00_add-NX-redistribution-README.full+lite.patch | 48 + ...nxcompshad_build-against-nx-x11-only.full.patch | 39 + debian/patches/0003_nxcompshad_gcc43.full.patch | 33 + .../0004_nx-X11_fix-nxcompshad-build.full.patch | 18 + debian/patches/0005_nxcomp_gcc43.full+lite.patch | 77 + .../patches/0006_nxcomp_libpng15.full+lite.patch | 43 + .../0007_nxcompshad_clean-gch-files.full.patch | 17 + .../0008_nxcomp_sa-restorer.full+lite.patch | 46 + .../patches/0009_nxagent_add-man-page.full.patch | 43 + .../0009_nxproxy_add-man-page.full+lite.patch | 33 + ...00_add-NX-redistribution-README.full+lite.patch | 48 - ...0_nxauth_fix-binary-name-in-man-page.full.patch | 119 ++ ...omp_makefile-uninstall+autoconf.full+lite.patch | 74 + ...xcompext_makefile-uninstall+autoconf.full.patch | 66 + ...compshad_makefile-uninstall+autoconf.full.patch | 70 + ...0015_nxproxy_makefile-uninstall.full+lite.patch | 40 + .../0016_nx-X11_install-location.debian.patch | 17 + .../0016_nx-X11_install-location.full.patch | 154 ++ debian/patches/0024_fix-make-clean.full+lite.patch | 19 + debian/patches/0024_fix-make-clean.full.patch | 51 + ...nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch | 40 + .../0026_nxcomp_honour-optflags.full+lite.patch | 31 + .../0026_nxcompext_honour-optflags.full.patch | 17 + .../0026_nxcompshad_honour-optflags.full.patch | 17 + ...0027_nxcomp_abstract-X11-socket.full+lite.patch | 59 + .../0028_nx-X11_abstract-kernel-sockets.full.patch | 321 ++++ debian/patches/0029_nxcomp_ppc64.full+lite.patch | 17 + ...nxcompshad_build-against-nx-x11-only.full.patch | 39 - .../patches/0030_nx-X11_configure-args.full.patch | 51 + .../patches/0031_nx-X11_parallel-make.full.patch | 200 +++ debian/patches/003_nxcompshad_gcc43.full.patch | 33 - .../004_nx-X11_fix-nxcompshad-build.full.patch | 18 - .../0051_nxcomp_macos105-fdisset.full+lite.patch | 82 + ..._nxcomp_macos10-nxauth-location.full+lite.patch | 41 + ...0053_nx-X11_no-xcomp1-install-target.full.patch | 32 + debian/patches/0054_nx-X11_ppc64-ftbfs.full.patch | 14 + ..._nx-X11_imake-Werror-format-security.full.patch | 1090 ++++++++++++ .../0056_nx-X11_Werror-format-security.full.patch | 107 ++ .../0057_nx-X11_sanitize-eventmasks.full.patch | 70 + debian/patches/005_nxcomp_gcc43.full+lite.patch | 77 - debian/patches/006_nxcomp_libpng15.full+lite.patch | 43 - .../007_nxcompshad_clean-gch-files.full.patch | 17 - .../patches/008_nxcomp_sa-restorer.full+lite.patch | 46 - debian/patches/009_nxagent_add-man-page.full.patch | 43 - .../009_nxproxy_add-man-page.full+lite.patch | 33 - .../patches/0101_nxagent_set-rgb-path.full.patch | 19 + ...erver-xext_set-securitypolicy-path.debian.patch | 19 + ...xserver-xext_set-securitypolicy-path.full.patch | 19 + .../0103_nxagent_set-X0-config-path.full.patch | 40 + ...xagent_export-remote-keyboard-config.full.patch | 96 + .../0106_nxagent_utf8-copy-clipboard.full.patch | 52 + ...board-compound-text+small-bed-sheets.full.patch | 47 + .../0108_nxagent_wine-close-delay.full.patch | 60 + ...0_nxauth_fix-binary-name-in-man-page.full.patch | 119 -- ...10_nxagent_createpixmap-bounds-check.full.patch | 44 + ...omp_makefile-uninstall+autoconf.full+lite.patch | 74 - ...xcompext_makefile-uninstall+autoconf.full.patch | 66 - ...compshad_makefile-uninstall+autoconf.full.patch | 70 - .../015_nxproxy_makefile-uninstall.full+lite.patch | 40 - .../016_nx-X11_install-location.debian.patch | 17 - .../patches/016_nx-X11_install-location.full.patch | 154 -- ...00_nxagent_check-binary-x2go-flavour.full.patch | 64 + ...t_set-x2go-icon-if-x2goagent-flavour.full.patch | 219 +++ .../patches/0202_nx-X11_enable-xinerama.full.patch | 292 +++ .../0203_nxagent_disable-rootless-exit.full.patch | 63 + .../0204_nxagent_repaint-solidpict.full.patch | 53 + .../patches/0205_nxagent_refresh-adsl.full.patch | 14 + .../0206_nxagent_clipboard-as-nxoption.full.patch | 53 + .../0207_nxagent_fix-xfixes-selection.full.patch | 33 + .../patches/0209_x2goagent_add-man-page.full.patch | 41 + .../0210_nxagent_save_session_state.full.patch | 176 ++ .../0210_nxcomp_save_session_state.full+lite.patch | 15 + ...0211_nxcomp_set_default_options.full+lite.patch | 27 + .../0212_nxcomp_build-on-Android.full+lite.patch | 253 +++ ...0220_nxproxy_bind-loopback-only.full+lite.patch | 130 ++ debian/patches/024_fix-make-clean.full+lite.patch | 19 - debian/patches/024_fix-make-clean.full.patch | 51 - ...nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch | 40 - .../026_nxcomp_honour-optflags.full+lite.patch | 31 - .../026_nxcompext_honour-optflags.full.patch | 17 - .../026_nxcompshad_honour-optflags.full.patch | 17 - .../027_nxcomp_abstract-X11-socket.full+lite.patch | 59 - .../028_nx-X11_abstract-kernel-sockets.full.patch | 321 ---- debian/patches/029_nxcomp_ppc64.full+lite.patch | 17 - .../patches/0300_nxagent_set-wm-class.full.patch | 60 + .../patches/0301_nx-X11_use-shared-libs.full.patch | 106 ++ .../0302_nx-X11_xkbbasedir-detection.full.patch | 84 + .../patches/030_nx-X11_configure-args.full.patch | 51 - debian/patches/031_nx-X11_parallel-make.full.patch | 200 --- ...0320_nxagent_configurable-keystrokes.full.patch | 1031 +++++++++++ ...agent_x2go-specific-keystroke-config.full.patch | 25 + debian/patches/0400_nxcomp-version.full+lite.patch | 240 +++ ...sts-and-genericevent-extensions.full+lite.patch | 1870 ++++++++++++++++++++ .../051_nxcomp_macos105-fdisset.full+lite.patch | 82 - ..._nxcomp_macos10-nxauth-location.full+lite.patch | 41 - .../053_nx-X11_no-xcomp1-install-target.full.patch | 32 - debian/patches/054_nx-X11_ppc64-ftbfs.full.patch | 14 - ..._nx-X11_imake-Werror-format-security.full.patch | 1090 ------------ .../056_nx-X11_Werror-format-security.full.patch | 107 -- .../057_nx-X11_sanitize-eventmasks.full.patch | 70 - ...nxcompext+nxcompshad_unique-libnames.full.patch | 1183 +++++++++++++ ...changes-to-not-use-bundled-libraries.full.patch | 99 ++ debian/patches/0602_nx-X11_initgroups.full.patch | 67 + .../0603_nx-X11_compilation_warnings.full.patch | 38 + ...ont-use-STL-internals-on-libc++.full+lite.patch | 52 + .../0606_nx-X11_build-on-aarch64.full.patch | 77 + ...osx-X11-launcher-in-private-tmp.full+lite.patch | 14 + .../0990_fix-DEBUG-and-TEST-builds.full.patch | 69 + debian/patches/0991_fix-hr-typos.full+lite.patch | 97 + debian/patches/0991_fix-hr-typos.full.patch | 36 + ...gent_unbrand-nxagent-brand-x2goagent.full.patch | 367 ++++ debian/patches/101_nxagent_set-rgb-path.full.patch | 19 - ...erver-xext_set-securitypolicy-path.debian.patch | 19 - ...xserver-xext_set-securitypolicy-path.full.patch | 19 - .../103_nxagent_set-X0-config-path.full.patch | 40 - ...xagent_export-remote-keyboard-config.full.patch | 96 - .../106_nxagent_utf8-copy-clipboard.full.patch | 52 - ...board-compound-text+small-bed-sheets.full.patch | 47 - .../108_nxagent_wine-close-delay.full.patch | 60 - ...10_nxagent_createpixmap-bounds-check.full.patch | 44 - ...00_nxagent_check-binary-x2go-flavour.full.patch | 64 - ...t_set-x2go-icon-if-x2goagent-flavour.full.patch | 219 --- .../patches/202_nx-X11_enable-xinerama.full.patch | 292 --- .../203_nxagent_disable-rootless-exit.full.patch | 63 - .../204_nxagent_repaint-solidpict.full.patch | 53 - debian/patches/205_nxagent_refresh-adsl.full.patch | 14 - .../206_nxagent_clipboard-as-nxoption.full.patch | 53 - .../207_nxagent_fix-xfixes-selection.full.patch | 33 - .../patches/209_x2goagent_add-man-page.full.patch | 41 - .../210_nxagent_save_session_state.full.patch | 176 -- .../210_nxcomp_save_session_state.full+lite.patch | 15 - .../211_nxcomp_set_default_options.full+lite.patch | 27 - .../212_nxcomp_build-on-Android.full+lite.patch | 253 --- .../220_nxproxy_bind-loopback-only.full+lite.patch | 130 -- debian/patches/300_nxagent_set-wm-class.full.patch | 60 - .../patches/301_nx-X11_use-shared-libs.full.patch | 106 -- .../302_nx-X11_xkbbasedir-detection.full.patch | 84 - .../320_nxagent_configurable-keystrokes.full.patch | 1031 ----------- ...agent_x2go-specific-keystroke-config.full.patch | 25 - debian/patches/400_nxcomp-version.full+lite.patch | 240 --- ...sts-and-genericevent-extensions.full+lite.patch | 1870 -------------------- ...nxcompext+nxcompshad_unique-libnames.full.patch | 1183 ------------- ...changes-to-not-use-bundled-libraries.full.patch | 99 -- debian/patches/602_nx-X11_initgroups.full.patch | 67 - .../603_nx-X11_compilation_warnings.full.patch | 38 - ...ont-use-STL-internals-on-libc++.full+lite.patch | 52 - .../patches/606_nx-X11_build-on-aarch64.full.patch | 77 - ...osx-X11-launcher-in-private-tmp.full+lite.patch | 14 - .../990_fix-DEBUG-and-TEST-builds.full.patch | 69 - debian/patches/991_fix-hr-typos.full+lite.patch | 97 - debian/patches/991_fix-hr-typos.full.patch | 36 - ...gent_unbrand-nxagent-brand-x2goagent.full.patch | 367 ---- debian/patches/series | 152 +- 154 files changed, 10636 insertions(+), 10632 deletions(-) create mode 100644 debian/patches/0000_add-NX-redistribution-README.full+lite.patch create mode 100644 debian/patches/0002_nxcompshad_build-against-nx-x11-only.full.patch create mode 100644 debian/patches/0003_nxcompshad_gcc43.full.patch create mode 100644 debian/patches/0004_nx-X11_fix-nxcompshad-build.full.patch create mode 100644 debian/patches/0005_nxcomp_gcc43.full+lite.patch create mode 100644 debian/patches/0006_nxcomp_libpng15.full+lite.patch create mode 100644 debian/patches/0007_nxcompshad_clean-gch-files.full.patch create mode 100644 debian/patches/0008_nxcomp_sa-restorer.full+lite.patch create mode 100644 debian/patches/0009_nxagent_add-man-page.full.patch create mode 100644 debian/patches/0009_nxproxy_add-man-page.full+lite.patch delete mode 100644 debian/patches/000_add-NX-redistribution-README.full+lite.patch create mode 100644 debian/patches/0010_nxauth_fix-binary-name-in-man-page.full.patch create mode 100644 debian/patches/0012_nxcomp_makefile-uninstall+autoconf.full+lite.patch create mode 100644 debian/patches/0013_nxcompext_makefile-uninstall+autoconf.full.patch create mode 100644 debian/patches/0014_nxcompshad_makefile-uninstall+autoconf.full.patch create mode 100644 debian/patches/0015_nxproxy_makefile-uninstall.full+lite.patch create mode 100644 debian/patches/0016_nx-X11_install-location.debian.patch create mode 100644 debian/patches/0016_nx-X11_install-location.full.patch create mode 100644 debian/patches/0024_fix-make-clean.full+lite.patch create mode 100644 debian/patches/0024_fix-make-clean.full.patch create mode 100644 debian/patches/0025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch create mode 100644 debian/patches/0026_nxcomp_honour-optflags.full+lite.patch create mode 100644 debian/patches/0026_nxcompext_honour-optflags.full.patch create mode 100644 debian/patches/0026_nxcompshad_honour-optflags.full.patch create mode 100644 debian/patches/0027_nxcomp_abstract-X11-socket.full+lite.patch create mode 100644 debian/patches/0028_nx-X11_abstract-kernel-sockets.full.patch create mode 100644 debian/patches/0029_nxcomp_ppc64.full+lite.patch delete mode 100644 debian/patches/002_nxcompshad_build-against-nx-x11-only.full.patch create mode 100644 debian/patches/0030_nx-X11_configure-args.full.patch create mode 100644 debian/patches/0031_nx-X11_parallel-make.full.patch delete mode 100644 debian/patches/003_nxcompshad_gcc43.full.patch delete mode 100644 debian/patches/004_nx-X11_fix-nxcompshad-build.full.patch create mode 100644 debian/patches/0051_nxcomp_macos105-fdisset.full+lite.patch create mode 100644 debian/patches/0052_nxcomp_macos10-nxauth-location.full+lite.patch create mode 100644 debian/patches/0053_nx-X11_no-xcomp1-install-target.full.patch create mode 100644 debian/patches/0054_nx-X11_ppc64-ftbfs.full.patch create mode 100644 debian/patches/0055_nx-X11_imake-Werror-format-security.full.patch create mode 100644 debian/patches/0056_nx-X11_Werror-format-security.full.patch create mode 100644 debian/patches/0057_nx-X11_sanitize-eventmasks.full.patch delete mode 100644 debian/patches/005_nxcomp_gcc43.full+lite.patch delete mode 100644 debian/patches/006_nxcomp_libpng15.full+lite.patch delete mode 100644 debian/patches/007_nxcompshad_clean-gch-files.full.patch delete mode 100644 debian/patches/008_nxcomp_sa-restorer.full+lite.patch delete mode 100644 debian/patches/009_nxagent_add-man-page.full.patch delete mode 100644 debian/patches/009_nxproxy_add-man-page.full+lite.patch create mode 100644 debian/patches/0101_nxagent_set-rgb-path.full.patch create mode 100644 debian/patches/0102_xserver-xext_set-securitypolicy-path.debian.patch create mode 100644 debian/patches/0102_xserver-xext_set-securitypolicy-path.full.patch create mode 100644 debian/patches/0103_nxagent_set-X0-config-path.full.patch create mode 100644 debian/patches/0105_nxagent_export-remote-keyboard-config.full.patch create mode 100644 debian/patches/0106_nxagent_utf8-copy-clipboard.full.patch create mode 100644 debian/patches/0107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch create mode 100644 debian/patches/0108_nxagent_wine-close-delay.full.patch delete mode 100644 debian/patches/010_nxauth_fix-binary-name-in-man-page.full.patch create mode 100644 debian/patches/0110_nxagent_createpixmap-bounds-check.full.patch delete mode 100644 debian/patches/012_nxcomp_makefile-uninstall+autoconf.full+lite.patch delete mode 100644 debian/patches/013_nxcompext_makefile-uninstall+autoconf.full.patch delete mode 100644 debian/patches/014_nxcompshad_makefile-uninstall+autoconf.full.patch delete mode 100644 debian/patches/015_nxproxy_makefile-uninstall.full+lite.patch delete mode 100644 debian/patches/016_nx-X11_install-location.debian.patch delete mode 100644 debian/patches/016_nx-X11_install-location.full.patch create mode 100644 debian/patches/0200_nxagent_check-binary-x2go-flavour.full.patch create mode 100644 debian/patches/0201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch create mode 100644 debian/patches/0202_nx-X11_enable-xinerama.full.patch create mode 100644 debian/patches/0203_nxagent_disable-rootless-exit.full.patch create mode 100644 debian/patches/0204_nxagent_repaint-solidpict.full.patch create mode 100644 debian/patches/0205_nxagent_refresh-adsl.full.patch create mode 100644 debian/patches/0206_nxagent_clipboard-as-nxoption.full.patch create mode 100644 debian/patches/0207_nxagent_fix-xfixes-selection.full.patch create mode 100644 debian/patches/0209_x2goagent_add-man-page.full.patch create mode 100644 debian/patches/0210_nxagent_save_session_state.full.patch create mode 100644 debian/patches/0210_nxcomp_save_session_state.full+lite.patch create mode 100644 debian/patches/0211_nxcomp_set_default_options.full+lite.patch create mode 100644 debian/patches/0212_nxcomp_build-on-Android.full+lite.patch create mode 100644 debian/patches/0220_nxproxy_bind-loopback-only.full+lite.patch delete mode 100644 debian/patches/024_fix-make-clean.full+lite.patch delete mode 100644 debian/patches/024_fix-make-clean.full.patch delete mode 100644 debian/patches/025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch delete mode 100644 debian/patches/026_nxcomp_honour-optflags.full+lite.patch delete mode 100644 debian/patches/026_nxcompext_honour-optflags.full.patch delete mode 100644 debian/patches/026_nxcompshad_honour-optflags.full.patch delete mode 100644 debian/patches/027_nxcomp_abstract-X11-socket.full+lite.patch delete mode 100644 debian/patches/028_nx-X11_abstract-kernel-sockets.full.patch delete mode 100644 debian/patches/029_nxcomp_ppc64.full+lite.patch create mode 100644 debian/patches/0300_nxagent_set-wm-class.full.patch create mode 100644 debian/patches/0301_nx-X11_use-shared-libs.full.patch create mode 100644 debian/patches/0302_nx-X11_xkbbasedir-detection.full.patch delete mode 100644 debian/patches/030_nx-X11_configure-args.full.patch delete mode 100644 debian/patches/031_nx-X11_parallel-make.full.patch create mode 100644 debian/patches/0320_nxagent_configurable-keystrokes.full.patch create mode 100644 debian/patches/0321_nxagent_x2go-specific-keystroke-config.full.patch create mode 100644 debian/patches/0400_nxcomp-version.full+lite.patch create mode 100644 debian/patches/0401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch delete mode 100644 debian/patches/051_nxcomp_macos105-fdisset.full+lite.patch delete mode 100644 debian/patches/052_nxcomp_macos10-nxauth-location.full+lite.patch delete mode 100644 debian/patches/053_nx-X11_no-xcomp1-install-target.full.patch delete mode 100644 debian/patches/054_nx-X11_ppc64-ftbfs.full.patch delete mode 100644 debian/patches/055_nx-X11_imake-Werror-format-security.full.patch delete mode 100644 debian/patches/056_nx-X11_Werror-format-security.full.patch delete mode 100644 debian/patches/057_nx-X11_sanitize-eventmasks.full.patch create mode 100644 debian/patches/0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch create mode 100644 debian/patches/0601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch create mode 100644 debian/patches/0602_nx-X11_initgroups.full.patch create mode 100644 debian/patches/0603_nx-X11_compilation_warnings.full.patch create mode 100644 debian/patches/0605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch create mode 100644 debian/patches/0606_nx-X11_build-on-aarch64.full.patch create mode 100644 debian/patches/0607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch create mode 100644 debian/patches/0990_fix-DEBUG-and-TEST-builds.full.patch create mode 100644 debian/patches/0991_fix-hr-typos.full+lite.patch create mode 100644 debian/patches/0991_fix-hr-typos.full.patch create mode 100644 debian/patches/0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch delete mode 100644 debian/patches/101_nxagent_set-rgb-path.full.patch delete mode 100644 debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch delete mode 100644 debian/patches/102_xserver-xext_set-securitypolicy-path.full.patch delete mode 100644 debian/patches/103_nxagent_set-X0-config-path.full.patch delete mode 100644 debian/patches/105_nxagent_export-remote-keyboard-config.full.patch delete mode 100644 debian/patches/106_nxagent_utf8-copy-clipboard.full.patch delete mode 100644 debian/patches/107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch delete mode 100644 debian/patches/108_nxagent_wine-close-delay.full.patch delete mode 100644 debian/patches/110_nxagent_createpixmap-bounds-check.full.patch delete mode 100644 debian/patches/200_nxagent_check-binary-x2go-flavour.full.patch delete mode 100644 debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch delete mode 100644 debian/patches/202_nx-X11_enable-xinerama.full.patch delete mode 100644 debian/patches/203_nxagent_disable-rootless-exit.full.patch delete mode 100644 debian/patches/204_nxagent_repaint-solidpict.full.patch delete mode 100644 debian/patches/205_nxagent_refresh-adsl.full.patch delete mode 100644 debian/patches/206_nxagent_clipboard-as-nxoption.full.patch delete mode 100644 debian/patches/207_nxagent_fix-xfixes-selection.full.patch delete mode 100644 debian/patches/209_x2goagent_add-man-page.full.patch delete mode 100644 debian/patches/210_nxagent_save_session_state.full.patch delete mode 100644 debian/patches/210_nxcomp_save_session_state.full+lite.patch delete mode 100644 debian/patches/211_nxcomp_set_default_options.full+lite.patch delete mode 100644 debian/patches/212_nxcomp_build-on-Android.full+lite.patch delete mode 100644 debian/patches/220_nxproxy_bind-loopback-only.full+lite.patch delete mode 100644 debian/patches/300_nxagent_set-wm-class.full.patch delete mode 100644 debian/patches/301_nx-X11_use-shared-libs.full.patch delete mode 100644 debian/patches/302_nx-X11_xkbbasedir-detection.full.patch delete mode 100644 debian/patches/320_nxagent_configurable-keystrokes.full.patch delete mode 100644 debian/patches/321_nxagent_x2go-specific-keystroke-config.full.patch delete mode 100644 debian/patches/400_nxcomp-version.full+lite.patch delete mode 100644 debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch delete mode 100644 debian/patches/600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch delete mode 100644 debian/patches/601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch delete mode 100644 debian/patches/602_nx-X11_initgroups.full.patch delete mode 100644 debian/patches/603_nx-X11_compilation_warnings.full.patch delete mode 100644 debian/patches/605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch delete mode 100644 debian/patches/606_nx-X11_build-on-aarch64.full.patch delete mode 100644 debian/patches/607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch delete mode 100644 debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch delete mode 100644 debian/patches/991_fix-hr-typos.full+lite.patch delete mode 100644 debian/patches/991_fix-hr-typos.full.patch delete mode 100644 debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch diff --git a/debian/changelog b/debian/changelog index 6ce69dbc5..e88feca54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,26 +1,26 @@ nx-libs (2:3.5.0.29-0x2go2) UNRELEASED; urgency=medium [ Paul Szabo ] - * DISABLED:401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch. + * DISABLED:0401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch. Enable support for the X11 big requests extension and the generic events extension. [ Mike Gabriel ] - * Update 320_nxagent_configurable-keystrokes.full.patch. Fix patch header + * Update 0320_nxagent_configurable-keystrokes.full.patch. Fix patch header referring to keystrokes.cfg (plural), not keystroke.cfg. * Allow sysadmins to manipulate nxagent's / x2goagent's rgb file by placing it into /etc/nxagent or /etc/x2go. * Provide support for separate .keyboard files for nxagent/x2goagent. - * Modify 101_nxagent_set-rgb-path.full.patch. Allow configurable rgb files. - * Extend 999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch. Let rgb + * Modify 0101_nxagent_set-rgb-path.full.patch. Allow configurable rgb files. + * Extend 0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch. Let rgb file shipped with x2goagent supersede rgb file shipped with nxagent. FIXME: a better approach would be to decide at runtime if to use /etc/x2go/rgb or /etc/nxagent/rgb. - * Extend 999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch. Allow + * Extend 0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch. Allow separate .keyboard files for x2goagent and nxagent. - * Update 600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch. Don't + * Update 0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch. Don't patch files that get removed during code reduction. - * Add 991_fix-hr-typos.full+lite.patch and 991_fix-hr-typos.full.patch. + * Add 0991_fix-hr-typos.full+lite.patch and 991_fix-hr-typos.full.patch. Fix several typos in upstream code detected by lintian. * Makefile.nx-libs: Don't allow symlinks to point into buildroot. * Makefile.nx-libs: Install man pages via main Makefile. @@ -43,19 +43,23 @@ nx-libs (2:3.5.0.29-0x2go2) UNRELEASED; urgency=medium - Makefile.nx-libs: Don't install Mesa header files into DESTDIR anymore. - Unify source tree reduction (debian/rules vs. roll-tarball.sh) via file/ folder lists in text files named debian/CODE-REDUCTION_*. - - Update 991_fix-hr-typos.full.patch. Don't patch files that get removed by + - Update 0991_fix-hr-typos.full.patch. Don't patch files that get removed by the NX code reduction effort. - - Drop 604_nx-X11_recent-freetype-API.full.patch. Not used in current build + - Drop 0604_nx-X11_recent-freetype-API.full.patch. Not used in current build process. - - Update 600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch. Don't + - Update 0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch. Don't patch files matter to the NX code reduction efforts. - - Update 031_nx-X11_parallel-make.full.patch. Don't patch .original files in + - Update 0031_nx-X11_parallel-make.full.patch. Don't patch .original files in NX code tree. - - Drop patches: 017_nx-X11_update-autotools-helper-files.full.patch, - 018_nx-X11_update-libtool-ltmain-script.full.patch, - 019_nx-X11_expat-build-against-system-libxmltok.full.patch. They patch files + - Drop patches: 0017_nx-X11_update-autotools-helper-files.full.patch, + 0018_nx-X11_update-libtool-ltmain-script.full.patch, + 0019_nx-X11_expat-build-against-system-libxmltok.full.patch. They patch files that are not used at build time. + * Patch system: + - Prepend a "0" to every patch file name in debian/patches/. Adapt only this + changelog stanza to this modification. + * Debian/Ubuntu packaging: + Fully rework the way nx-libs gets packaged for Debian/Ubuntu. + Split up libnx-x11 into individual packages. @@ -110,10 +114,10 @@ nx-libs (2:3.5.0.29-0x2go2) UNRELEASED; urgency=medium x2goagent.keyboard). [ Horst Schirmeier ] - * Update 320_nxagent_configurable-keystrokes.full.patch. Fix a typo that + * Update 0320_nxagent_configurable-keystrokes.full.patch. Fix a typo that prevented the /etc/nxagent/keystrokes.cfg file from being parsed. (Fixes: #741). - * Add 321_nxagent_x2go-specific-keystroke-config.full.patch. If nxagent is + * Add 0321_nxagent_x2go-specific-keystroke-config.full.patch. If nxagent is launched as x2goagent, use X2Go-specific paths for the keystrokes.cfg file. (Fixes: #744). diff --git a/debian/patches/0000_add-NX-redistribution-README.full+lite.patch b/debian/patches/0000_add-NX-redistribution-README.full+lite.patch new file mode 100644 index 000000000..3e1f2e878 --- /dev/null +++ b/debian/patches/0000_add-NX-redistribution-README.full+lite.patch @@ -0,0 +1,48 @@ +Description: Add README.NX-redistributed +Author: Mike Gabriel + +--- /dev/null ++++ b/README.NX-redistributed +@@ -0,0 +1,42 @@ ++NX redistribution by X2Go ++------------------------- ++This source tree is a re-distribution of those NX packages needed to ++setup FreeNX and/or X2Go on a Linux server. ++ ++The NX re-distribution currently is maintained by the X2Go Project: ++http://wiki.x2go.org ++ ++Our goal is: ++ - provide _one_ tarball that builds NX projects via a common Makefile ++ - provide _one_ tarball for distribution packagers ++ ++This re-distribution contains the following tarballs derived from ++NoMachine (http://www.nomachine.com/sources.php): ++ ++ nxcomp ++ nxcompext ++ nxcompshad ++ nxproxy ++ nx-X11 ++ nxagent ++ nxauth ++ ++The patches we apply are shipped with this tarball, for further introspection ++please refer to this folder: ++ ++ doc/applied-patches ++ ++This source tree is maintained on the X2Go Git server: ++Browsing... http://code.x2go.org/gitweb?p=nx-libs.git;a=summary ++Git-Cloning... git clone git://code.x2go.org/nx-libs.git ++ ++If you have any questions about this NX redistribution or want to file ++a bug, then please contact the X2Go developers on ++ ++ x2go-dev@lists.berlios.de ++ ++The X2Go-Dev mailing list requires subscription before you can post to it: ++http://lists.berlios.de/mailman/listinfo/x2go-dev ++ ++thanks+light+love ++Mike Gabriel diff --git a/debian/patches/0002_nxcompshad_build-against-nx-x11-only.full.patch b/debian/patches/0002_nxcompshad_build-against-nx-x11-only.full.patch new file mode 100644 index 000000000..4e92c3b04 --- /dev/null +++ b/debian/patches/0002_nxcompshad_build-against-nx-x11-only.full.patch @@ -0,0 +1,39 @@ +Description: Build nxcompshad against nx-X11. + Make sure nxcompshad get built against nx-X11. + . + Furthermore /usr/X11R6/lib is an outdated path on + current Debian systems. +Forwarded: pending... +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nxcompshad/Makefile.in ++++ b/nxcompshad/Makefile.in +@@ -48,7 +48,7 @@ + CCDEFINES = + + LDFLAGS = @LDFLAGS@ +-LIBS = @LIBS@ -L/usr/X11R6/lib -lX11 ++LIBS = @LIBS@ -lX11 + + # + # Only if THREADS is defined. +@@ -162,7 +162,7 @@ + -Wl,--enable-auto-import \ + -Wl,--whole-archive ${LIBARCHIVE} \ + -Wl,--no-whole-archive \ +- ${LIBS} -L/usr/X11R6/lib ++ ${LIBS} + + $(PROGRAM): $(MOBJ) $(COBJ) $(CXXOBJ) $(LIBDLL) + # $(CC) $(CCFLAGS) -o $@ $(MOBJ) $(MLIBS) +--- a/nxcompshad/configure.in ++++ b/nxcompshad/configure.in +@@ -19,7 +19,7 @@ + + if test -d "../nx-X11/exports/include" ; then + CXXFLAGS="$CXXFLAGS -I../nx-X11/exports/include" +- LIBS="$LIBS -L../nx-X11/exports/lib" ++ LIBS="-L../nx-X11/exports/lib" + fi + + dnl Check whether --with-ipaq was given. diff --git a/debian/patches/0003_nxcompshad_gcc43.full.patch b/debian/patches/0003_nxcompshad_gcc43.full.patch new file mode 100644 index 000000000..165c30035 --- /dev/null +++ b/debian/patches/0003_nxcompshad_gcc43.full.patch @@ -0,0 +1,33 @@ +Description: gcc43 fix + Use builtin includes to build with gcc43. + . + Originally contributed by Marcelo Boveto Shima . +Forwarded: pending... +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nxcompshad/Logger.h ++++ b/nxcompshad/Logger.h +@@ -18,8 +18,8 @@ + #ifndef Logger_H + #define Logger_H + +-#include +-#include ++#include ++#include + + // + // Error handling macros. +--- a/nxcompshad/Misc.h ++++ b/nxcompshad/Misc.h +@@ -20,8 +20,8 @@ + + #include + +-#include +-#include ++#include ++#include + + using namespace std; + diff --git a/debian/patches/0004_nx-X11_fix-nxcompshad-build.full.patch b/debian/patches/0004_nx-X11_fix-nxcompshad-build.full.patch new file mode 100644 index 000000000..f65fb7877 --- /dev/null +++ b/debian/patches/0004_nx-X11_fix-nxcompshad-build.full.patch @@ -0,0 +1,18 @@ +Description: Fix build on Debian + By an unknown reason this patch currently is needed to + build nx-X11, nxcomp, nxcompshad and nxcompext with + dpkg-buildpackage and debuild. +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -1047,7 +1047,7 @@ + #else + $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) + cd $(NX_XSHADOWLIBDIR) && \ +- make ++ rm -f *.o && make + #endif + + ServerTarget(nxagent,$(NX_XSHADOWLIBTARGET) $(NXAGENTDIRS),$(NXAGENTOBJS), \ diff --git a/debian/patches/0005_nxcomp_gcc43.full+lite.patch b/debian/patches/0005_nxcomp_gcc43.full+lite.patch new file mode 100644 index 000000000..bb758c2bd --- /dev/null +++ b/debian/patches/0005_nxcomp_gcc43.full+lite.patch @@ -0,0 +1,77 @@ +Description: gcc43 fix + Use builtin includes to build with gcc43. + . + Originally contributed by Marcelo Boveto Shima . +Forwarded: not-yet +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nxcomp/Message.cpp 2012-03-01 03:46:39.220943822 +0100 ++++ b/nxcomp/Message.cpp 2012-03-01 03:47:27.605712530 +0100 +@@ -15,9 +15,9 @@ + /* */ + /**************************************************************************/ + +-#include ++#include + #include +-#include ++#include + + #include + +--- a/nxcomp/Misc.cpp 2012-03-01 03:46:39.220943822 +0100 ++++ b/nxcomp/Misc.cpp 2012-03-01 03:47:27.605712530 +0100 +@@ -15,11 +15,11 @@ + /* */ + /**************************************************************************/ + +-#include +-#include +-#include ++#include ++#include ++#include + #include +-#include ++#include + + #include + #include +--- a/nxcomp/Misc.h 2012-03-01 03:46:39.220943822 +0100 ++++ b/nxcomp/Misc.h 2012-03-01 03:47:27.605712530 +0100 +@@ -21,8 +21,8 @@ + #include + #include + +-#include +-#include ++#include ++#include + + #ifdef __sun + +--- a/nxcomp/Proxy.cpp 2012-03-01 03:46:39.224943897 +0100 ++++ b/nxcomp/Proxy.cpp 2012-03-01 03:47:27.605712530 +0100 +@@ -15,9 +15,9 @@ + /* */ + /**************************************************************************/ + +-#include ++#include + #include +-#include ++#include + #include + #include + +--- a/nxcomp/Split.cpp 2012-03-01 03:46:39.224943897 +0100 ++++ b/nxcomp/Split.cpp 2012-03-01 03:47:27.605712530 +0100 +@@ -16,7 +16,7 @@ + /**************************************************************************/ + + #include +-#include ++#include + #include + #include + #include diff --git a/debian/patches/0006_nxcomp_libpng15.full+lite.patch b/debian/patches/0006_nxcomp_libpng15.full+lite.patch new file mode 100644 index 000000000..a75c59bac --- /dev/null +++ b/debian/patches/0006_nxcomp_libpng15.full+lite.patch @@ -0,0 +1,43 @@ +Description: Fix building against libpng 1.5. + From the libpng homepage... + + The libpng 1.5.x series continues the evolution of the libpng API, + finally hiding the contents of the venerable and hoary png_struct and + png_info data structures inside private (i.e., non-installed) header + files. Instead of direct struct-access, applications should be using + the various png_get_xxx() and png_set_xxx() accessor functions, which + have existed for almost as long as libpng itself. (Apps that compiled + against libpng 1.4 without warnings about deprecated features should + happily compile against 1.5, too. +Forwarded: pending... +Author: Fedora packagers of NX +Last-Update: 2012-02-06 +--- a/nxcomp/Pgn.cpp 2010-03-01 19:18:59.000000000 +0200 ++++ b/nxcomp/Pgn.cpp 2011-09-13 16:35:12.000000000 +0300 +@@ -414,7 +414,7 @@ + + png_read_info(pngPtr, infoPtr); + +- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) ++ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) + { + png_set_expand(pngPtr); + } +@@ -565,7 +565,7 @@ + + png_read_info( pngPtr, infoPtr ) ; + +- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) ++ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) + { + png_set_expand(pngPtr); + } +@@ -709,7 +709,7 @@ + png_read_info(pngPtr, infoPtr) ; + + +- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) ++ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) + { + png_set_expand(pngPtr); + } diff --git a/debian/patches/0007_nxcompshad_clean-gch-files.full.patch b/debian/patches/0007_nxcompshad_clean-gch-files.full.patch new file mode 100644 index 000000000..897e27890 --- /dev/null +++ b/debian/patches/0007_nxcompshad_clean-gch-files.full.patch @@ -0,0 +1,17 @@ +Description: Remove .gch files during cleanup. + When building nxcompshad .gch files get created. On + cleanup these should be removed. +Forwarded: pending... +Author: Mike Gabriel +Last-Update: 2012-12-31 +--- a/nxcompshad/Makefile.in ++++ b/nxcompshad/Makefile.in +@@ -185,7 +185,7 @@ + install.man: + + clean: +- -rm -f *~ *.o *.bak st?????? core core.* *.out.* *.exe.stackdump \ ++ -rm -f *~ *.o *.gch *.bak st?????? core core.* *.out.* *.exe.stackdump \ + $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe + + distclean: clean diff --git a/debian/patches/0008_nxcomp_sa-restorer.full+lite.patch b/debian/patches/0008_nxcomp_sa-restorer.full+lite.patch new file mode 100644 index 000000000..f1447ccb0 --- /dev/null +++ b/debian/patches/0008_nxcomp_sa-restorer.full+lite.patch @@ -0,0 +1,46 @@ +Description: sa_restorer vs. memset + Use memset instead of setting sa_restorer to NULL. +Forwarded: pending +Author: Alexander Morozov +Last-Update: 2012-02-07 +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -5884,20 +5884,9 @@ + + struct sigaction newAction; + +- newAction.sa_handler = HandleSignal; +- +- // +- // This field doesn't exist on most OSes except +- // Linux. We keep setting the field to NULL to +- // avoid side-effects in the case the field is +- // a value return. +- // ++ memset(&newAction, 0, sizeof(newAction)); + +- #if defined(__linux__) +- +- newAction.sa_restorer = NULL; +- +- #endif ++ newAction.sa_handler = HandleSignal; + + sigemptyset(&(newAction.sa_mask)); + +@@ -6509,13 +6498,9 @@ + + struct sigaction action; + +- action.sa_handler = HandleTimer; +- +- #if defined(__linux__) ++ memset(&action, 0, sizeof(action)); + +- action.sa_restorer = NULL; +- +- #endif ++ action.sa_handler = HandleTimer; + + sigemptyset(&action.sa_mask); + diff --git a/debian/patches/0009_nxagent_add-man-page.full.patch b/debian/patches/0009_nxagent_add-man-page.full.patch new file mode 100644 index 000000000..cec8c7527 --- /dev/null +++ b/debian/patches/0009_nxagent_add-man-page.full.patch @@ -0,0 +1,43 @@ +Description: man page for nxagent +Author: Mike Gabriel + +--- /dev/null ++++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +@@ -0,0 +1,37 @@ ++.TH NXAGENT 1 ++.SH NAME ++nxagent \- NoMachine's NX Agent. ++.SH SYNOPSIS ++.B nxagent ++.I "[options]" ++ ++.SH DESCRIPTION ++\fBnxagent\fR is an Xnest-like X server for remote application/desktop access. ++.PP ++\fBnxagent\fR implements a very efficient compression of the X11 protocol. ++.PP ++This increases performance when using X applications over high latency and ++low bandwidth networks, while providing a local (LAN-like) usage experience ++even if connecting from off-site locations (via cable modem or GSM). ++.PP ++\fBnxagent\fR is not designed to be used as a standalone application. ++It has to be launched on the server side by remote desktop frameworks like FreeNX. ++.PP ++Available clients are ++NoMachine's \fBnxclient\fR or the community projects \fBqtnx\fR and \fBremmina\fR ++(with NX plugin). ++ ++.SH OPTIONS ++.TP ++.B \--help ++Lists all others options that are not listed here. ++ ++.SH FURTHER READINGS ++Information on NX: http://www.nomachine.com ++.PP ++Information on FreeNX: http://freenx.berlios.de ++ ++.SH AUTHOR ++This manual page was written by Per Hansen , ++and modified by Marcelo Boveto Shima and ++Mike Gabriel . diff --git a/debian/patches/0009_nxproxy_add-man-page.full+lite.patch b/debian/patches/0009_nxproxy_add-man-page.full+lite.patch new file mode 100644 index 000000000..b60e218ee --- /dev/null +++ b/debian/patches/0009_nxproxy_add-man-page.full+lite.patch @@ -0,0 +1,33 @@ +Description: man page for nxproxy +Author: Mike Gabriel + +--- /dev/null ++++ b/nxproxy/man/nxproxy.1 +@@ -0,0 +1,27 @@ ++'\" -*- coding: utf-8 -*- ++.if \n(.g .ds T< \\FC ++.if \n(.g .ds T> \\F[\n[.fam]] ++.de URL ++\\$2 \(la\\$1\(ra\\$3 ++.. ++.if \n(.g .mso www.tmac ++.TH nxproxy 1 "Nov 2011" "Version 3.5.0" "NX Proxy" ++.SH NAME ++nxproxy \- NX Proxy Tool ++.SH SYNOPSIS ++'nh ++.fi ++.ad l ++\fBnxproxy\fR ++ ++.SH DESCRIPTION ++\fBnxproxy\fR is a tool that allows one to tunnel X sessions through ++the NX compression libraries. \fBnxproxy\fR is a backend application ++utilized by the X2GoClient GUI and some other NX/X2Go clients. ++.PP ++.SH OPTIONS ++For an insight in \fBnxproxy\fR options use \fBnxproxy \-\-help\fR on the command line. ++.PP ++.SH AUTHOR ++This manual has been written by Mike Gabriel for the X2Go project ++(http://www.x2go.org). diff --git a/debian/patches/000_add-NX-redistribution-README.full+lite.patch b/debian/patches/000_add-NX-redistribution-README.full+lite.patch deleted file mode 100644 index 3e1f2e878..000000000 --- a/debian/patches/000_add-NX-redistribution-README.full+lite.patch +++ /dev/null @@ -1,48 +0,0 @@ -Description: Add README.NX-redistributed -Author: Mike Gabriel - ---- /dev/null -+++ b/README.NX-redistributed -@@ -0,0 +1,42 @@ -+NX redistribution by X2Go -+------------------------- -+This source tree is a re-distribution of those NX packages needed to -+setup FreeNX and/or X2Go on a Linux server. -+ -+The NX re-distribution currently is maintained by the X2Go Project: -+http://wiki.x2go.org -+ -+Our goal is: -+ - provide _one_ tarball that builds NX projects via a common Makefile -+ - provide _one_ tarball for distribution packagers -+ -+This re-distribution contains the following tarballs derived from -+NoMachine (http://www.nomachine.com/sources.php): -+ -+ nxcomp -+ nxcompext -+ nxcompshad -+ nxproxy -+ nx-X11 -+ nxagent -+ nxauth -+ -+The patches we apply are shipped with this tarball, for further introspection -+please refer to this folder: -+ -+ doc/applied-patches -+ -+This source tree is maintained on the X2Go Git server: -+Browsing... http://code.x2go.org/gitweb?p=nx-libs.git;a=summary -+Git-Cloning... git clone git://code.x2go.org/nx-libs.git -+ -+If you have any questions about this NX redistribution or want to file -+a bug, then please contact the X2Go developers on -+ -+ x2go-dev@lists.berlios.de -+ -+The X2Go-Dev mailing list requires subscription before you can post to it: -+http://lists.berlios.de/mailman/listinfo/x2go-dev -+ -+thanks+light+love -+Mike Gabriel diff --git a/debian/patches/0010_nxauth_fix-binary-name-in-man-page.full.patch b/debian/patches/0010_nxauth_fix-binary-name-in-man-page.full.patch new file mode 100644 index 000000000..c8f76b51a --- /dev/null +++ b/debian/patches/0010_nxauth_fix-binary-name-in-man-page.full.patch @@ -0,0 +1,119 @@ +Description: Fix binary name in man page for nxauth. + The NX auth man page in upstream still uses xauth as + binary name. +Author: Mike Gabriel +Last-Update: 2012-12-31 +--- a/nx-X11/programs/nxauth/nxauth.man ++++ b/nx-X11/programs/nxauth/nxauth.man +@@ -27,51 +27,51 @@ + .\" + .TH XAUTH 1 __xorgversion__ + .SH NAME +-xauth \- X authority file utility ++nxauth \- NoMachine X authority file utility + .SH SYNOPSIS +-.B xauth ++.B nxauth + [ \fB\-f\fP \fIauthfile\fP ] [ \fB\-vqib\fP ] [ \fIcommand arg ...\fP ] + .SH DESCRIPTION + .PP +-The \fIxauth\fP program is used to edit and display the authorization ++The \fInxauth\fP program is used to edit and display the authorization + information used in connecting to the X server. This program is usually + used to extract authorization records from one machine and merge them in on + another (as is the case when using remote logins or granting access to + other users). Commands (described below) may be entered interactively, +-on the \fIxauth\fP command line, or in scripts. Note that this program ++on the \fInxauth\fP command line, or in scripts. Note that this program + does \fBnot\fP contact the X server except when the generate command is used. +-Normally \fIxauth\fP is not used to create the authority file entry in ++Normally \fInxauth\fP is not used to create the authority file entry in + the first place; \fIxdm\fP does that. + .SH OPTIONS +-The following options may be used with \fIxauth\fP. They may be given ++The following options may be used with \fInxauth\fP. They may be given + individually (e.g., \fI\-q \-i\|\fP) or may combined (e.g., \fI\-qi\|\fP). + .TP 8 + .B "\-f \fIauthfile\fP" + This option specifies the name of the authority file to use. By default, +-\fIxauth\fP will use the file specified by the XAUTHORITY environment variable ++\fInxauth\fP will use the file specified by the nxauthORITY environment variable + or \fI\.Xauthority\fP in the user's home directory. + .TP 8 + .B \-q +-This option indicates that \fIxauth\fP should operate quietly and not print +-unsolicited status messages. This is the default if an \fIxauth\fP command is ++This option indicates that \fInxauth\fP should operate quietly and not print ++unsolicited status messages. This is the default if an \fInxauth\fP command is + is given on the command line or if the standard output is not directed to a + terminal. + .TP 8 + .B \-v +-This option indicates that \fIxauth\fP should operate verbosely and print ++This option indicates that \fInxauth\fP should operate verbosely and print + status messages indicating the results of various operations (e.g., how many +-records have been read in or written out). This is the default if \fIxauth\fP ++records have been read in or written out). This is the default if \fInxauth\fP + is reading commands from its standard input and its standard output is + directed to a terminal. + .TP 8 + .B \-i +-This option indicates that \fIxauth\fP should ignore any authority file +-locks. Normally, \fIxauth\fP will refuse to read or edit any authority files ++This option indicates that \fInxauth\fP should ignore any authority file ++locks. Normally, \fInxauth\fP will refuse to read or edit any authority files + that have been locked by other programs (usually \fIxdm\fP or another +-\fIxauth\fP). ++\fInxauth\fP). + .TP 8 + .B \-b +-This option indicates that \fIxauth\fP should attempt to break any authority ++This option indicates that \fInxauth\fP should attempt to break any authority + file locks before proceeding. Use this option only to clean up stale locks. + .SH COMMANDS + The following commands may be used to manipulate authority files: +@@ -157,14 +157,14 @@ + authority file. + .TP 8 + .B "source \fIfilename" +-The specified file is treated as a script containing \fIxauth\fP commands ++The specified file is treated as a script containing \fInxauth\fP commands + to execute. Blank lines and lines beginning with a sharp sign (#) are + ignored. A single dash may be used to indicate the standard input, if it + hasn't already been read. + .TP 8 + .B "info" + Information describing the authorization file, whether or not any changes +-have been made, and from where \fIxauth\fP commands are being read ++have been made, and from where \fInxauth\fP commands are being read + is printed on the standard output. + .TP 8 + .B "exit" +@@ -194,12 +194,12 @@ + local entries for different machines may be stored in one authority file. + .SH EXAMPLE + .PP +-The most common use for \fIxauth\fP is to extract the entry for the ++The most common use for \fInxauth\fP is to extract the entry for the + current display, copy it to another machine, and merge it into the + user's authority file on the remote machine: + .sp + .nf +- % xauth extract \- $DISPLAY | rsh otherhost xauth merge \- ++ % nxauth extract \- $DISPLAY | rsh otherhost nxauth merge \- + .fi + .PP + .sp +@@ -207,10 +207,10 @@ + authorization using the MIT-MAGIC-COOKIE-1 protocol. Clients that + connect with this authorization will be untrusted. + .nf +- % xauth generate :0 . ++ % nxauth generate :0 . + .fi + .SH ENVIRONMENT +-This \fIxauth\fP program uses the following environment variables: ++This \fInxauth\fP program uses the following environment variables: + .TP 8 + .B XAUTHORITY + to get the name of the authority file to use if the \fI\-f\fP option isn't diff --git a/debian/patches/0012_nxcomp_makefile-uninstall+autoconf.full+lite.patch b/debian/patches/0012_nxcomp_makefile-uninstall+autoconf.full+lite.patch new file mode 100644 index 000000000..af778fefc --- /dev/null +++ b/debian/patches/0012_nxcomp_makefile-uninstall+autoconf.full+lite.patch @@ -0,0 +1,74 @@ +Description: Add install and uninstall stanzas to nxcomp/Makefile, honor ac dirs + Provide install and uninstall functionality in nxcomp/Makefile. + . + Honor autoconf's libdir (and includedir, while at it). This is a + must-have for multiarch platforms like x86_64 et al where multiple + forms of libraries can be installed at the same time. +Forwarded: pending... +Author: Mike Gabriel +Author: Jan Engelhardt +Last-Update: 2012-02-14 +--- a/nxcomp/Makefile.in ++++ b/nxcomp/Makefile.in +@@ -64,10 +64,15 @@ + bindir = @bindir@ + man1dir = @mandir@/man1 + VPATH = @srcdir@ ++libdir = @libdir@ ++includedir = @includedir@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ ++INSTALL_LINK = cp -av ++DESTDIR = ++RM_FILE = rm -f + + # + # This should be autodetected. +@@ -264,12 +269,44 @@ + fi + touch depend.status + +-install: install.bin install.man ++install: install.bin install.lib install.man + + install.bin: + ++install.lib: all ++ ./mkinstalldirs $(DESTDIR)${libdir} ++ ./mkinstalldirs $(DESTDIR)${includedir}/nx ++ $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} ++ $(INSTALL_LINK) libXcomp.so.3 $(DESTDIR)${libdir} ++ $(INSTALL_LINK) libXcomp.so $(DESTDIR)${libdir} ++ $(INSTALL_DATA) libXcomp.a $(DESTDIR)${libdir} ++ $(INSTALL_DATA) NX*.h $(DESTDIR)${includedir}/nx ++ $(INSTALL_DATA) MD5.h $(DESTDIR)${includedir}/nx ++ echo "Running ldconfig tool, this may take a while..." && ldconfig || true ++ + install.man: + ++uninstall: uninstall.bin uninstall.lib uninstall.man ++ ++uninstall.bin: ++ ++uninstall.lib: ++ $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcomp.so.3 ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcomp.so ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcomp.a ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXalert.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NX.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXmitshm.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXpack.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXproto.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXrender.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXvars.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/MD5.h ++ echo "Running ldconfig tool, this may take a while..." && ldconfig || true ++ ++uninstall.man: ++ + clean: + -rm -f *~ *.o *.bak *.orig *.rej st?????? core core.* *.out.* \ + @ALL@ diff --git a/debian/patches/0013_nxcompext_makefile-uninstall+autoconf.full.patch b/debian/patches/0013_nxcompext_makefile-uninstall+autoconf.full.patch new file mode 100644 index 000000000..300c0a39e --- /dev/null +++ b/debian/patches/0013_nxcompext_makefile-uninstall+autoconf.full.patch @@ -0,0 +1,66 @@ +Description: Add install and uninstall stanzas to nxcompext/Makefile, honor autoconf dirs. + Provide install and uninstall functionality in nxcompext/Makefile. + . + Honor autoconf's libdir (and includedir, while at it). This is a + must-have for multiarch platforms like x86_64 et al where multiple + forms of libraries can be installed at the same time. +Forwarded: pending... +Author: Mike Gabriel +Author: Jan Engelhardt +Last-Update: 2012-02-14 +--- a/nxcompext/Makefile.in ++++ b/nxcompext/Makefile.in +@@ -56,11 +56,15 @@ + bindir = @bindir@ + man1dir = @mandir@/man1 + VPATH = @srcdir@ ++libdir = @libdir@ ++includedir = @includedir@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ +- ++INSTALL_LINK = cp -av ++DESTDIR = ++RM_FILE = rm -f + # + # This should be autodetected. + # +@@ -147,12 +151,35 @@ + fi + touch depend.status + +-install: install.bin install.man ++install: install.bin install.lib install.man + + install.bin: + ++install.lib: all ++ ./mkinstalldirs $(DESTDIR)${libdir} ++ ./mkinstalldirs $(DESTDIR)${includedir}/nx ++ $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} ++ $(INSTALL_LINK) libXcompext.so.3 $(DESTDIR)${libdir} ++ $(INSTALL_LINK) libXcompext.so $(DESTDIR)${libdir} ++ $(INSTALL_DATA) NX*.h $(DESTDIR)${includedir}/nx ++ echo "Running ldconfig tool, this may take a while..." && ldconfig || true ++ + install.man: + ++uninstall: uninstall.bin uninstall.lib uninstall.man ++ ++uninstall.bin: ++ ++uninstall.lib: ++ $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcompext.so.3 ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcompext.so ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXlib.h ++ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXlibint.h ++ echo "Running ldconfig tool, this may take a while..." && ldconfig || true ++ ++uninstall.man: ++ + clean: + -rm -f *~ *.o *.bak *.orig *.rej st?????? core core.* *.out.* \ + @ALL@ diff --git a/debian/patches/0014_nxcompshad_makefile-uninstall+autoconf.full.patch b/debian/patches/0014_nxcompshad_makefile-uninstall+autoconf.full.patch new file mode 100644 index 000000000..921eccc4f --- /dev/null +++ b/debian/patches/0014_nxcompshad_makefile-uninstall+autoconf.full.patch @@ -0,0 +1,70 @@ +Description: Add install and uninstall stanzas to nxcompshad/Makefile, honor autoconf dirs + Provide install and uninstall functionality in nxcompshad/Makefile. + . + Honor autoconf's libdir (and includedir, while at it). This is a + must-have for multiarch platforms like x86_64 et al where multiple + forms of libraries can be installed at the same time. +Forwarded: pending... +Author: Mike Gabriel +Author: Jan Engelhardt +Last-Update: 2012-02-14 +--- a/nxcompshad/Makefile.in ++++ b/nxcompshad/Makefile.in +@@ -74,10 +74,17 @@ + bindir = @bindir@ + man1dir = @mandir@/man1 + VPATH = @srcdir@ ++libdir = @libdir@ ++includedir = @includedir@ + + INSTALL = @INSTALL@ ++INSTALL_DIR = $(INSTALL) -d -o root -g root -m 0755 + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ ++INSTALL_LINK = cp -av ++DESTDIR = ++RM_FILE = rm -f ++RM_DIR = rmdir -p --ignore-fail-on-non-empty + + # + # This should be autodetected. +@@ -178,12 +185,38 @@ + fi + touch depend.status + +-install: install.bin install.man ++install: install.bin install.lib install.man + + install.bin: + ++install.lib: all ++ $(INSTALL_DIR) $(DESTDIR)${libdir} ++ $(INSTALL_DIR) $(DESTDIR)${includedir}/nx ++ $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} ++ $(INSTALL_LINK) libXcompshad.so.3 $(DESTDIR)${libdir} ++ $(INSTALL_LINK) libXcompshad.so $(DESTDIR)${libdir} ++ $(INSTALL_DATA) *.a $(DESTDIR)${libdir} ++ $(INSTALL_DATA) *.h $(DESTDIR)${includedir}/nx ++ echo "Running ldconfig tool, this may take a while..." && ldconfig || true ++ + install.man: + ++uninstall: uninstall.bin uninstall.lib uninstall.man ++ ++uninstall.bin: ++ ++uninstall.lib: ++ $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.so.3 ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.so ++ $(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.a ++ for header in *.h; do $(RM_FILE) $(DESTDIR)${includedir}/nx/$$header; done ++ $(RM_DIR) $(DESTDIR)${libdir}/nx/ ++ $(RM_DIR) $(DESTDIR)${includedir}/nx/ ++ echo "Running ldconfig tool, this may take a while..." && ldconfig || true ++ ++uninstall.man: ++ + clean: + -rm -f *~ *.o *.gch *.bak st?????? core core.* *.out.* *.exe.stackdump \ + $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe diff --git a/debian/patches/0015_nxproxy_makefile-uninstall.full+lite.patch b/debian/patches/0015_nxproxy_makefile-uninstall.full+lite.patch new file mode 100644 index 000000000..554c86aa4 --- /dev/null +++ b/debian/patches/0015_nxproxy_makefile-uninstall.full+lite.patch @@ -0,0 +1,40 @@ +Description: Add install and uninstall stanzas to nxcomp/Makefile + Provide install and uninstall functionality in nxcomp/Makefile. +Forwarded: pending... +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nxproxy/Makefile.in ++++ b/nxproxy/Makefile.in +@@ -41,6 +41,8 @@ + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ ++DESTDIR = ++RM_FILE = rm -f + + # + # This should be autodetected. +@@ -87,11 +89,20 @@ + install: install.bin install.man + + install.bin: $(PROGRAM) +- $(srcdir)/mkinstalldirs $(bindir) +- $(INSTALL) $(PROGRAM) $(bindir)/$(PROGRAM) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) ++ $(INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) + + install.man: +- $(srcdir)/mkinstalldirs $(man1dir) ++ $(srcdir)/mkinstalldirs $(DESTDIR)$(man1dir) ++ $(INSTALL_DATA) man/$(PROGRAM).1 $(DESTDIR)$(man1dir)/$(PROGRAM).1 ++ ++uninstall: uninstall.bin uninstall.man ++ ++uninstall.bin: ++ $(RM_FILE) $(DESTDIR)$(bindir)/$(PROGRAM) ++ ++uninstall.man: ++ $(RM_FILE) $(DESTDIR)$(man1dir)/nxproxy.1 + + clean: + -rm -f *~ *.o *.bak st?????? core core.* *.out.* \ diff --git a/debian/patches/0016_nx-X11_install-location.debian.patch b/debian/patches/0016_nx-X11_install-location.debian.patch new file mode 100644 index 000000000..94e2cb075 --- /dev/null +++ b/debian/patches/0016_nx-X11_install-location.debian.patch @@ -0,0 +1,17 @@ +Description: FHS adaptation for Debian packaging + On Debian, NX libraries and binaries are installed to + /usr/lib/nx. +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2012-12-31 +--- a/nx-X11/config/cf/Imake.tmpl ++++ b/nx-X11/config/cf/Imake.tmpl +@@ -829,7 +829,7 @@ + #define AlternateUsrLibDir YES + #endif + #else +-#define UsrLibDir Concat4(/usr/local,/,LibDirName,/nx) ++#define UsrLibDir Concat4(/usr,/,LibDirName,/nx) + #ifndef AlternateUsrLibDir + #define AlternateUsrLibDir NO + #endif diff --git a/debian/patches/0016_nx-X11_install-location.full.patch b/debian/patches/0016_nx-X11_install-location.full.patch new file mode 100644 index 000000000..6571aea9e --- /dev/null +++ b/debian/patches/0016_nx-X11_install-location.full.patch @@ -0,0 +1,154 @@ +Description: FHS adaptation for Debian packaging + From tarball, NX libraries and binaries are installed to + /usr/local/lib/nx. +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2012-12-31 +--- a/nx-X11/config/cf/Imake.tmpl ++++ b/nx-X11/config/cf/Imake.tmpl +@@ -820,12 +820,12 @@ + + #ifndef UsrLibDir + #ifdef ProjectRoot +-#define UsrLibDir Concat3(ProjectRoot,/,LibDirName) ++#define UsrLibDir Concat4(ProjectRoot,/,LibDirName,/nx) + #ifndef AlternateUsrLibDir + #define AlternateUsrLibDir YES + #endif + #else +-#define UsrLibDir Concat3(/usr,/,LibDirName) ++#define UsrLibDir Concat4(/usr/local,/,LibDirName,/nx) + #ifndef AlternateUsrLibDir + #define AlternateUsrLibDir NO + #endif +@@ -863,7 +863,7 @@ + #endif + #ifndef IncRoot + #ifdef ProjectRoot +-#define IncRoot Concat(ProjectRoot,/include) ++#define IncRoot Concat(ProjectRoot,/include/nx) + #ifndef AlternateIncRoot + #define AlternateIncRoot YES + #endif +--- a/nx-X11/config/cf/X11.rules ++++ b/nx-X11/config/cf/X11.rules +@@ -36,17 +36,17 @@ + #endif + + #if defined(X11ProjectRoot) +-# define XBinDir $(XPROJECTROOT)/bin ++# define XBinDir $(XPROJECTROOT)/lib/nx/bin + #elif defined(ProjectRoot) +-# define XBinDir $(PROJECTROOT)/bin ++# define XBinDir $(PROJECTROOT)/lib/nx/bin + #else + # define XBinDir $(BINDIR) + #endif + + #ifdef X11ProjectRoot +-# define XUsrLibDirPath $(USRLIBDIR):$(XPROJECTROOT)/lib ++# define XUsrLibDirPath $(USRLIBDIR)/nx:$(XPROJECTROOT) + #else +-# define XUsrLibDirPath $(USRLIBDIR) ++# define XUsrLibDirPath $(USRLIBDIR)/nx + #endif + #ifdef UsrLibDirPath + # undef UsrLibDirPath +@@ -60,7 +60,7 @@ + #if ImportX11 + # define XLdPreLibs -L$(LIBSRC) + #elif defined(UseInstalledX11) && defined(X11ProjectRoot) +-# define XLdPreLibs -L$(XPROJECTROOT)/lib ++# define XLdPreLibs -L$(XPROJECTROOT) + #else + # define XLdPreLibs /**/ + #endif +@@ -70,7 +70,7 @@ + #define LdPreLibs LdPreLib XLdPreLibs + + #ifdef X11ProjectRoot +-# define XLdPostLibs -L$(XPROJECTROOT)/lib ++# define XLdPostLibs -L$(XPROJECTROOT) + #else + # define XLdPostLibs /**/ + #endif +@@ -86,7 +86,7 @@ + # define TopXInclude -I$(TOP)/exports/include + #else + # ifdef X11ProjectRoot +-# define TopXInclude -I$(XPROJECTROOT)/include ++# define TopXInclude -I$(XPROJECTROOT)/../../include/nx + # else + # define TopXInclude /**/ + # endif +@@ -98,7 +98,7 @@ + #define TopIncludes TopInclude $(TOP_X_INCLUDES) + + #if UseInstalledX11 && defined(X11ProjectRoot) +-# define X11BuildLibPath $(XPROJECTROOT)/lib ++# define X11BuildLibPath $(XPROJECTROOT) + #elif UseInstalledX11 + # define X11BuildLibPath $(USRLIBDIR) + #elif ImportX11 +--- a/nx-X11/config/cf/X11.tmpl ++++ b/nx-X11/config/cf/X11.tmpl +@@ -1401,7 +1401,7 @@ + + #ifndef BinDir + #ifdef ProjectRoot +-#define BinDir Concat(ProjectRoot,/bin) ++#define BinDir Concat(ProjectRoot,/lib/nx/bin) + #else + #define BinDir /usr/bin/X11 + #endif +@@ -1461,7 +1461,7 @@ + #endif + #ifndef LibDir + # ifdef ProjectRoot +-# define LibDir Concat(ProjectRoot,/lib/X11) ++# define LibDir Concat(ProjectRoot,/lib/nx/X11) + # else + # define LibDir /usr/lib/X11 + # endif +--- a/nx-X11/config/cf/linux.cf ++++ b/nx-X11/config/cf/linux.cf +@@ -1054,7 +1054,7 @@ + + #if HaveLib64 + # ifndef LibDirName +-# define LibDirName lib64 ++# define LibDirName lib + # endif + # ifndef SystemUsrLibDir + # define SystemUsrLibDir /usr/lib64 +--- a/nx-X11/config/cf/site.def ++++ b/nx-X11/config/cf/site.def +@@ -72,7 +72,7 @@ + #ifdef AfterVendorCF + + #ifndef ProjectRoot +-#define ProjectRoot /usr/local/lib/nx ++#define ProjectRoot /usr/local + #endif + + /* +@@ -87,7 +87,7 @@ + * ProjectRoot rather than in /etc/X11. See also HasVarDirectory, + * UseEtcX11 and UseSeparateConfDir. + * +-#define EtcX11Directory ProjectRoot/etc ++#define EtcX11Directory /etc/nx + */ + + +--- a/nxproxy/Makefile.in ++++ b/nxproxy/Makefile.in +@@ -33,7 +33,7 @@ + + srcdir = @srcdir@ + prefix = @prefix@ +-exec_prefix = @exec_prefix@ ++exec_prefix = @exec_prefix@/lib/nx + bindir = @bindir@ + man1dir = @mandir@/man1 + VPATH = @srcdir@ diff --git a/debian/patches/0024_fix-make-clean.full+lite.patch b/debian/patches/0024_fix-make-clean.full+lite.patch new file mode 100644 index 000000000..7f0b327cf --- /dev/null +++ b/debian/patches/0024_fix-make-clean.full+lite.patch @@ -0,0 +1,19 @@ +Description: fix clean rule in nxcomp's Makefile.in +Author: Mike Gabriel + +--- a/nxcomp/Makefile.in ++++ b/nxcomp/Makefile.in +@@ -313,4 +313,4 @@ + + distclean: clean + -rm -rf autom4te.cache config.status config.log \ +- config.cache depend.status Makefile tags ++ config.cache depend.status Makefile tags configure +--- a/nxproxy/Makefile.in ++++ b/nxproxy/Makefile.in +@@ -109,4 +109,4 @@ + $(PROGRAM) $(PROGRAM).exe $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) + + distclean: clean +- -rm -f config.status config.log config.cache depend.status Makefile tags ++ -rm -rf autom4te.cache config.status config.log config.cache depend.status Makefile tags configure diff --git a/debian/patches/0024_fix-make-clean.full.patch b/debian/patches/0024_fix-make-clean.full.patch new file mode 100644 index 000000000..356ce47d8 --- /dev/null +++ b/debian/patches/0024_fix-make-clean.full.patch @@ -0,0 +1,51 @@ +Description: Provide main Makefile for whole source tree + By design this patch is not needed to be sent upstream. +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2012-10-19 +--- a/nx-X11/Makefile ++++ b/nx-X11/Makefile +@@ -138,6 +138,7 @@ + + xmakefile: Imakefile + $(RM) xmakefile ++ @rm -f $(IRULESRC)/date.def; echo "" > $(IRULESRC)/date.def; + $(IMAKE_CMD) -s xmakefile -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) + + World.Win32: +@@ -197,11 +198,16 @@ + # a copy of every rule that might be invoked at top level + + clean: +- $(MAKE_CMD) $@ ++ -$(MAKE_CMD) $@ ++ find config -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done ++ find lib -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done ++ find programs -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done ++ find include -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done ++ rm -f config/cf/{version.def,date.def} + dangerous_strip_clean: + $(MAKE_CMD) $@ + distclean: +- $(MAKE_CMD) $@ ++ -$(MAKE_CMD) $@ + $(RM) xmakefile $(IRULESRC)/version.def $(IRULESRC)/date.def + depend: + $(MAKE_CMD) $@ +--- a/nxcompext/Makefile.in ++++ b/nxcompext/Makefile.in +@@ -185,5 +185,5 @@ + @ALL@ + + distclean: clean +- -rm -rf autom4te.cache config.status config.log \ ++ -rm -rf autom4te.cache config.status config.log configure \ + config.cache depend.status Makefile tags +--- a/nxcompshad/Makefile.in ++++ b/nxcompshad/Makefile.in +@@ -222,4 +222,4 @@ + $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe + + distclean: clean +- -rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache ++ -rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache configure diff --git a/debian/patches/0025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch b/debian/patches/0025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch new file mode 100644 index 000000000..66ca8c33e --- /dev/null +++ b/debian/patches/0025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch @@ -0,0 +1,40 @@ +Description: Fix FTBFS when built against libjpeg9a +Author: Gabriel Marcano +--- a/nxcomp/Jpeg.cpp 2014-08-19 22:23:36.139072400 -0400 ++++ b/nxcomp/Jpeg.cpp 2014-08-19 22:25:24.323182800 -0400 +@@ -440,7 +440,7 @@ + + JpegSetSrcManager(&cinfo, compressedData, compressedLen); + +- jpeg_read_header(&cinfo, 1); ++ jpeg_read_header(&cinfo, TRUE); + + if (jpegError) goto AbortDecompressJpeg16; + +@@ -581,7 +581,7 @@ + + JpegSetSrcManager(&cinfo, compressedData, compressedLen); + +- jpeg_read_header(&cinfo, 1); ++ jpeg_read_header(&cinfo, TRUE); + + if (jpegError) goto AbortDecompressJpeg24; + +@@ -718,7 +718,7 @@ + + JpegSetSrcManager(&cinfo, compressedData, compressedLen); + +- jpeg_read_header(&cinfo, 1); ++ jpeg_read_header(&cinfo, TRUE); + + if (jpegError) goto AbortDecompressJpeg32; + +@@ -833,7 +833,7 @@ + jpegSrcManager.bytes_in_buffer = jpegBufferLen; + jpegSrcManager.next_input_byte = (JOCTET *)jpegBufferPtr; + +- return 1; ++ return TRUE; + } + + static void JpegSkipInputData(j_decompress_ptr cinfo, long num_bytes) diff --git a/debian/patches/0026_nxcomp_honour-optflags.full+lite.patch b/debian/patches/0026_nxcomp_honour-optflags.full+lite.patch new file mode 100644 index 000000000..a2713a1bc --- /dev/null +++ b/debian/patches/0026_nxcomp_honour-optflags.full+lite.patch @@ -0,0 +1,31 @@ +Description: Honour compiler/linker option flags +Forwarded: pending +Author: Orion Poplawski +diff -up a/nxcomp/configure.in b/nxcomp/configure.in +--- a/nxcomp/configure.in 2012-11-10 06:40:55.000000000 -0700 ++++ b/nxcomp/configure.in 2012-12-11 13:13:19.390229196 -0700 +@@ -7,8 +7,8 @@ AC_PREREQ(2.13) + + dnl Set our default compilation flags. + +-CXXFLAGS="-O3 -fno-rtti -fno-exceptions" +-CFLAGS="-O3" ++CXXFLAGS="$CXXFLAGS -O3 -fno-rtti -fno-exceptions" ++CFLAGS="$CFLAGS -O3" + + dnl Reset default linking directives. + +diff -up a/nxproxy/configure.in b/nxproxy/configure.in +--- a/nxproxy/configure.in 2012-11-10 06:40:55.000000000 -0700 ++++ b/nxproxy/configure.in 2012-12-11 13:16:19.955301045 -0700 +@@ -7,8 +7,8 @@ AC_PREREQ(2.13) + + dnl Reset default compilation flags. + +-CXXFLAGS="-O3" +-CPPFLAGS="-O3" ++CXXFLAGS="$CXXFLAGS -O3" ++CPPFLAGS="$CPPFLAGS -O3" + + dnl Prefer headers and libraries from nx-X11 if present. + diff --git a/debian/patches/0026_nxcompext_honour-optflags.full.patch b/debian/patches/0026_nxcompext_honour-optflags.full.patch new file mode 100644 index 000000000..4d5df3e6b --- /dev/null +++ b/debian/patches/0026_nxcompext_honour-optflags.full.patch @@ -0,0 +1,17 @@ +Description: Honour compiler/linker option flags +Forwarded: pending +Author: Orion Poplawski +diff -up a/nxcompext/configure.in b/nxcompext/configure.in +--- a/nxcompext/configure.in 2012-11-10 06:40:55.000000000 -0700 ++++ b/nxcompext/configure.in 2012-12-11 13:15:26.712576302 -0700 +@@ -7,8 +7,8 @@ AC_PREREQ(2.13) + + dnl Reset default compilation flags. + +-CXXFLAGS="-O3" +-CFLAGS="-O3" ++CXXFLAGS="$CXXFLAGS -O3" ++CFLAGS="$CFLAGS -O3" + + dnl Reset default linking directives. + diff --git a/debian/patches/0026_nxcompshad_honour-optflags.full.patch b/debian/patches/0026_nxcompshad_honour-optflags.full.patch new file mode 100644 index 000000000..ea1d2ad80 --- /dev/null +++ b/debian/patches/0026_nxcompshad_honour-optflags.full.patch @@ -0,0 +1,17 @@ +Description: Honour compiler/linker option flags +Forwarded: pending +Author: Orion Poplawski +diff -up a/nxcompshad/configure.in b/nxcompshad/configure.in +--- a/nxcompshad/configure.in 2012-11-10 06:40:56.000000000 -0700 ++++ b/nxcompshad/configure.in 2012-12-11 13:13:25.915196300 -0700 +@@ -7,8 +7,8 @@ AC_PREREQ(2.13) + + dnl Reset default compilation flags. + +-CXXFLAGS="-O3" +-CPPFLAGS="-O3" ++CXXFLAGS="$CXXFLAGS -O3" ++CPPFLAGS="$CPPFLAGS -O3" + + dnl Reset default linking directives. + diff --git a/debian/patches/0027_nxcomp_abstract-X11-socket.full+lite.patch b/debian/patches/0027_nxcomp_abstract-X11-socket.full+lite.patch new file mode 100644 index 000000000..4c457c5d5 --- /dev/null +++ b/debian/patches/0027_nxcomp_abstract-X11-socket.full+lite.patch @@ -0,0 +1,59 @@ +Description: Add X11 abstract socket support to nxcomp/nxproxy +Author: Mike Gabriel + +diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp +index 92b6fc2..d86809d 100644 +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -4250,6 +4250,39 @@ int SetupDisplaySocket(int &xServerAddrFamily, sockaddr *&xServerAddr, + // where the socket will be created. + // + ++ // Try abstract X11 socket first (via a test connect), if that fails ++ // fall back to Unix domain socket file. ++ ++ #ifdef __linux__ ++ int testSocketFD; ++ testSocketFD = socket(xServerAddrFamily, SOCK_STREAM, PF_UNSPEC); ++ ++ int len = sprintf(unixSocketName + 1, "/tmp/.X11-unix/X%d", xPort); ++ unixSocketName[0] = '\0'; ++ ++ sockaddr_un *xServerAddrABSTRACT = new sockaddr_un; ++ memset(xServerAddrABSTRACT, 0, xServerAddrLength); ++ xServerAddrABSTRACT -> sun_family = AF_UNIX; ++ memcpy(xServerAddrABSTRACT -> sun_path, unixSocketName, len+1); ++ xServerAddrLength = len +3; ++ ++ int ret = connect(testSocketFD, (struct sockaddr *) xServerAddrABSTRACT, xServerAddrLength); ++ if (ret == 0) { ++ ++ cerr << "Info" << ": Using abstract X11 socket in kernel namespace " ++ << "for accessing DISPLAY=:" << xPort << ".\n"; ++ ++ close(testSocketFD); ++ xServerAddr = (sockaddr *) xServerAddrABSTRACT; ++ return 1; ++ ++ } else { ++ ++ cerr << "Info" << ": Falling back to file system X11 socket " ++ << "for accessing DISPLAY=:" << xPort << ".\n"; ++ ++ #endif ++ + struct stat statInfo; + + char unixSocketDir[DEFAULT_STRING_LENGTH]; +@@ -4322,6 +4355,11 @@ int SetupDisplaySocket(int &xServerAddrFamily, sockaddr *&xServerAddr, + + xServerAddr = (sockaddr *) xServerAddrUNIX; + xServerAddrLength = sizeof(sockaddr_un); ++ ++ #ifdef __linux__ ++ ++ } ++ #endif + } + else + { diff --git a/debian/patches/0028_nx-X11_abstract-kernel-sockets.full.patch b/debian/patches/0028_nx-X11_abstract-kernel-sockets.full.patch new file mode 100644 index 000000000..279f9a9af --- /dev/null +++ b/debian/patches/0028_nx-X11_abstract-kernel-sockets.full.patch @@ -0,0 +1,321 @@ +Author: Mike Gabriel +Description: Support abstract local sockets for Linux systems +Abstract: + Relevant code taken from xtrans 1.2.7 on 2014-06-11. + +--- a/nx-X11/lib/xtrans/Xtranssock.c ++++ b/nx-X11/lib/xtrans/Xtranssock.c +@@ -172,6 +172,8 @@ + sock_init();\ + IBMsockInit = 1;\ + } ++ ++ + #undef EINTR + #define EINTR SOCEINTR + #undef EINVAL +@@ -192,6 +194,10 @@ + #define SocketInitOnce() /**/ + #endif + ++#if defined(linux) ++#define HAVE_ABSTRACT_SOCKETS ++#endif ++ + #define MIN_BACKLOG 128 + #ifdef SOMAXCONN + #if SOMAXCONN > MIN_BACKLOG +@@ -532,7 +538,7 @@ + + void TRANS(SocketRejectConnection) (XtransConnInfo ciptr) + { +- size_t sa_l = sizeof(struct sockaddr); ++ socklen_t sa_l = sizeof(struct sockaddr); + struct sockaddr sa; + fd_set fs; + struct timeval t; +@@ -914,9 +920,11 @@ + struct sockaddr_in socknamev4; + void *socknamePtr; + #if defined(SVR4) || defined(__SCO__) ++# define SOCKLEN_T_PTR void* + size_t namelen; + #else +- int namelen; ++# define SOCKLEN_T_PTR socklen_t* ++ socklen_t namelen; + #endif + + PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0); +@@ -935,7 +943,7 @@ + } + + if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr, +- (void *)&namelen) < 0) ++ (SOCKLEN_T_PTR)&namelen) < 0) + { + #ifdef WIN32 + errno = WSAGetLastError(); +@@ -1477,23 +1485,28 @@ + + #ifdef UNIXCONN + static int +-set_sun_path(const char *port, const char *upath, char *path) ++set_sun_path(const char *port, const char *upath, char *path, int abstract) + { + struct sockaddr_un s; + int maxlen = sizeof(s.sun_path) - 1; ++ const char *at = ""; + + if (!port || !*port || !path) + return -1; + +- if (*port == '/') { /* a full pathname */ +- if (strlen(port) > maxlen) +- return -1; +- sprintf(path, "%s", port); +- } else { +- if (strlen(port) + strlen(upath) > maxlen) +- return -1; +- sprintf(path, "%s%s", upath, port); +- } ++#ifdef HAVE_ABSTRACT_SOCKETS ++ if (port[0] == '@') ++ upath = ""; ++ else if (abstract) ++ at = "@"; ++#endif ++ ++ if (*port == '/') /* a full pathname */ ++ upath = ""; ++ ++ if (strlen(port) + strlen(upath) > maxlen) ++ return -1; ++ snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port); + return 0; + } + #endif +@@ -1726,6 +1739,12 @@ + int oldUmask; + int status; + unsigned int mode; ++ char tmpport[108]; ++ ++ int abstract = 0; ++#ifdef HAVE_ABSTRACT_SOCKETS ++ abstract = ciptr->transptr->flags & TRANS_ABSTRACT; ++#endif + + PRMSG (2, "SocketUNIXCreateListener(%s)\n", + port ? port : "NULL", 0, 0); +@@ -1741,11 +1760,11 @@ + mode = 0777; + #endif + #ifdef NX_TRANS_SOCKET +- if (trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) { ++ if (!abstract && trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) { + PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", + _NXGetUnixDir(UNIX_DIR), errno, 0); + #else +- if (trans_mkdir(UNIX_DIR, mode) == -1) { ++ if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) { + PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", + UNIX_DIR, errno, 0); + #endif +@@ -1754,13 +1773,18 @@ + } + #endif + ++ memset(&sockname, 0, sizeof(sockname)); + sockname.sun_family = AF_UNIX; + ++ if (!(port && *port)) { ++ snprintf (tmpport, sizeof(tmpport), "%s%ld", UNIX_PATH, (long)getpid()); ++ port = tmpport; ++ } + if (port && *port) { + #ifdef NX_TRANS_SOCKET +- if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path) != 0) { ++ if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path, abstract) != 0) { + #else +- if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { ++ if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) { + #endif + PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0); + return TRANS_CREATE_LISTENER_FAILED; +@@ -1784,7 +1808,12 @@ + fprintf(stderr, "SocketUNIXCreateListener: Unlinking path [%s] for ciptr at [%p].\n", + sockname.sun_path, (void *) ciptr); + #endif +- unlink (sockname.sun_path); ++ if (abstract) { ++ sockname.sun_path[0] = '\0'; ++ namelen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&sockname.sun_path[1]); ++ } ++ else ++ unlink (sockname.sun_path); + + if ((status = TRANS(SocketCreateListener) (ciptr, + (struct sockaddr *) &sockname, namelen, flags)) < 0) +@@ -1814,6 +1843,9 @@ + return TRANS_CREATE_LISTENER_FAILED; + } + ++ if (abstract) ++ sockname.sun_path[0] = '@'; ++ + ciptr->family = sockname.sun_family; + ciptr->addrlen = namelen; + memcpy (ciptr->addr, &sockname, ciptr->addrlen); +@@ -1823,7 +1855,6 @@ + return 0; + } + +- + static int + TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr) + +@@ -1836,15 +1867,20 @@ + struct stat statb; + int status = TRANS_RESET_NOOP; + unsigned int mode; ++ int abstract = 0; ++#ifdef HAVE_ABSTRACT_SOCKETS ++ abstract = ciptr->transptr->flags & TRANS_ABSTRACT; ++#endif + + PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0); + +- if (stat (unsock->sun_path, &statb) == -1 || ++ if (!abstract && ( ++ stat (unsock->sun_path, &statb) == -1 || + ((statb.st_mode & S_IFMT) != + #if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK) + S_IFIFO)) + #else +- S_IFSOCK)) ++ S_IFSOCK))) + #endif + { + int oldUmask = umask (0); +@@ -2034,6 +2070,11 @@ + } + + ++ /* ++ * if the socket is abstract, we already modified the address to have a ++ * @ instead of the initial NUL, so no need to do that again here. ++ */ ++ + newciptr->addrlen = ciptr->addrlen; + memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); + +@@ -2626,6 +2667,12 @@ + struct sockaddr_un sockname; + int namelen; + ++ ++ int abstract = 0; ++#ifdef HAVE_ABSTRACT_SOCKETS ++ abstract = ciptr->transptr->flags & TRANS_ABSTRACT; ++#endif ++ + #if defined(hpux) && defined(X11_t) + struct sockaddr_un old_sockname; + int old_namelen; +@@ -2674,9 +2721,9 @@ + sockname.sun_family = AF_UNIX; + + #ifdef NX_TRANS_SOCKET +- if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path) != 0) { ++ if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path, abstract) != 0) { + #else +- if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { ++ if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) { + #endif + PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); + return TRANS_CONNECT_FAILED; +@@ -2722,6 +2769,14 @@ + #endif + + /* ++ * Adjust the socket path if using abstract sockets. ++ * Done here because otherwise all the strlen() calls above would fail. ++ */ ++ ++ if (abstract) ++ sockname.sun_path[0] = '\0'; ++ ++ /* + * Do the connect() + */ + +@@ -2757,12 +2812,18 @@ + * should try again. + */ + +- if (olderrno == ENOENT || olderrno == EINTR) +- return TRANS_TRY_CONNECT_AGAIN; +- else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) ++ if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) + return TRANS_IN_PROGRESS; +- else +- { ++ else if (olderrno == EINTR) ++ return TRANS_TRY_CONNECT_AGAIN; ++ else if (olderrno == ENOENT || olderrno == ECONNREFUSED) ++ /* If opening as abstract failed, try again normally */ ++ if (abstract) { ++ ciptr->transptr->flags &= ~(TRANS_ABSTRACT); ++ return TRANS_TRY_CONNECT_AGAIN; ++ } else { ++ return TRANS_CONNECT_FAILED; ++ } else { + PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n", + EGET(),0, 0); + +@@ -2791,6 +2852,9 @@ + return TRANS_CONNECT_FAILED; + } + ++ if (abstract) ++ sockname.sun_path[0] = '@'; ++ + ciptr->family = AF_UNIX; + ciptr->addrlen = namelen; + ciptr->peeraddrlen = namelen; +@@ -3323,7 +3387,11 @@ + Xtransport TRANS(SocketLocalFuncs) = { + /* Socket Interface */ + "local", ++#ifdef HAVE_ABSTRACT_SOCKETS ++ TRANS_ABSTRACT, ++#else + 0, ++#endif + #ifdef TRANS_CLIENT + TRANS(SocketOpenCOTSClient), + #endif /* TRANS_CLIENT */ +@@ -3369,7 +3437,7 @@ + Xtransport TRANS(SocketUNIXFuncs) = { + /* Socket Interface */ + "unix", +-#if !defined(LOCALCONN) ++#if !defined(LOCALCONN) && !defined(HAVE_ABSTRACT_SOCKETS) + TRANS_ALIAS, + #else + 0, +--- a/nx-X11/lib/xtrans/Xtransint.h ++++ b/nx-X11/lib/xtrans/Xtransint.h +@@ -374,9 +374,10 @@ + #define TRANS_DISABLED (1<<2) /* Don't open this one */ + #define TRANS_NOLISTEN (1<<3) /* Don't listen on this one */ + #define TRANS_NOUNLINK (1<<4) /* Dont unlink transport endpoints */ ++#define TRANS_ABSTRACT (1<<5) /* Use abstract sockets if available */ + + /* Flags to preserve when setting others */ +-#define TRANS_KEEPFLAGS (TRANS_NOUNLINK) ++#define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT) + + /* + * readv() and writev() don't exist or don't work correctly on some diff --git a/debian/patches/0029_nxcomp_ppc64.full+lite.patch b/debian/patches/0029_nxcomp_ppc64.full+lite.patch new file mode 100644 index 000000000..9d454d5db --- /dev/null +++ b/debian/patches/0029_nxcomp_ppc64.full+lite.patch @@ -0,0 +1,17 @@ +Description: Fix BIGENDIAN issue in nxcomp (relevant on PPC64 arch) +Author: Mihai Moldovan + +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -6832,9 +6832,9 @@ + { + sockaddr_in newAddr; + +- size_t addrLen = sizeof(sockaddr_in); ++ socklen_t addrLen = sizeof(sockaddr_in); + +- newFD = accept(proxyFD, (sockaddr *) &newAddr, (socklen_t *) &addrLen); ++ newFD = accept(proxyFD, (sockaddr *) &newAddr, &addrLen); + + if (newFD == -1) + { diff --git a/debian/patches/002_nxcompshad_build-against-nx-x11-only.full.patch b/debian/patches/002_nxcompshad_build-against-nx-x11-only.full.patch deleted file mode 100644 index 4e92c3b04..000000000 --- a/debian/patches/002_nxcompshad_build-against-nx-x11-only.full.patch +++ /dev/null @@ -1,39 +0,0 @@ -Description: Build nxcompshad against nx-X11. - Make sure nxcompshad get built against nx-X11. - . - Furthermore /usr/X11R6/lib is an outdated path on - current Debian systems. -Forwarded: pending... -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nxcompshad/Makefile.in -+++ b/nxcompshad/Makefile.in -@@ -48,7 +48,7 @@ - CCDEFINES = - - LDFLAGS = @LDFLAGS@ --LIBS = @LIBS@ -L/usr/X11R6/lib -lX11 -+LIBS = @LIBS@ -lX11 - - # - # Only if THREADS is defined. -@@ -162,7 +162,7 @@ - -Wl,--enable-auto-import \ - -Wl,--whole-archive ${LIBARCHIVE} \ - -Wl,--no-whole-archive \ -- ${LIBS} -L/usr/X11R6/lib -+ ${LIBS} - - $(PROGRAM): $(MOBJ) $(COBJ) $(CXXOBJ) $(LIBDLL) - # $(CC) $(CCFLAGS) -o $@ $(MOBJ) $(MLIBS) ---- a/nxcompshad/configure.in -+++ b/nxcompshad/configure.in -@@ -19,7 +19,7 @@ - - if test -d "../nx-X11/exports/include" ; then - CXXFLAGS="$CXXFLAGS -I../nx-X11/exports/include" -- LIBS="$LIBS -L../nx-X11/exports/lib" -+ LIBS="-L../nx-X11/exports/lib" - fi - - dnl Check whether --with-ipaq was given. diff --git a/debian/patches/0030_nx-X11_configure-args.full.patch b/debian/patches/0030_nx-X11_configure-args.full.patch new file mode 100644 index 000000000..67184d330 --- /dev/null +++ b/debian/patches/0030_nx-X11_configure-args.full.patch @@ -0,0 +1,51 @@ +Description: Allow to pass in configure args. + Allow to pass in configure args. +Forward: pending +Author: Jan Engelhardt +Last-Update: 2012-02-14 +--- + nx-X11/lib/X11/Imakefile | 6 ++++-- + nx-X11/programs/Xserver/Imakefile | 4 +++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +Index: nx-X11/lib/X11/Imakefile +=================================================================== +--- a/nx-X11/lib/X11/Imakefile ++++ b/nx-X11/lib/X11/Imakefile +@@ -1147,15 +1147,17 @@ ks_tables.h: $(XINCLUDESRC)/keysymdef.h + + includes:: ks_tables.h + ++CONFIGURE ?= ./configure ++ + #if NXLibraries + + $(NX_XCOMPCONFIGTARGET): + cd ../../../nxcomp && \ +- ./configure ++ ${CONFIGURE} + + $(NX_XCOMPEXTCONFIGTARGET): + cd ../../../nxcompext && \ +- ./configure ++ ${CONFIGURE} + + #ifdef SunArchitecture + $(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) +Index: nx-X11/programs/Xserver/Imakefile +=================================================================== +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -1036,9 +1036,11 @@ NX_XSHADOWLIBDIR = $(XTOP)/../nxcomps + NX_XSHADOWLIBTARGET = $(NX_XSHADOWLIBDIR)/$(NX_XSHADOWLIBNAME) + NX_XSHADOWCONFIGTARGET = $(NX_XSHADOWLIBDIR)/config.status + ++CONFIGURE ?= ./configure ++ + $(NX_XSHADOWCONFIGTARGET): + cd $(NX_XSHADOWLIBDIR) && \ +- ./configure ++ ${CONFIGURE} + + #ifdef SunArchitecture + $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) diff --git a/debian/patches/0031_nx-X11_parallel-make.full.patch b/debian/patches/0031_nx-X11_parallel-make.full.patch new file mode 100644 index 000000000..496020545 --- /dev/null +++ b/debian/patches/0031_nx-X11_parallel-make.full.patch @@ -0,0 +1,200 @@ +Description: Enable parallel make + Restore ability to build things in parallel. + (${MAKE} must always appear in the rule directly, and not be + hidden through expansions of other variables to get this to work.) +Forward: pending +Author: Jan Engelhardt +Last-Update: 2012-01-26 22:29:13.993994227 +0100 + +--- + nx-X11/Makefile | 64 +++++++++++++++++----------------- + nx-X11/config/imake/Makefile.ini | 1 + nx-X11/lib/X11/Imakefile | 12 ++---- + nx-X11/programs/Xserver/Imakefile | 4 +- + 10 files changed, 60 insertions(+), 69 deletions(-) + +--- a/nx-X11/Makefile ++++ b/nx-X11/Makefile +@@ -32,8 +32,8 @@ + VERSPROG = $(CONFIGSRC)/util/printver.exe + + all: +- @$(MAKE_CMD) xmakefile-exists || $(MAKE) all-initial +- @$(MAKE_CMD) $@ ++ @${MAKE} ${MAKE_OPTS} xmakefile-exists || $(MAKE) all-initial ++ @${MAKE} ${MAKE_OPTS} $@ + + all-initial: + @echo Please use make World, or on NT use nmake World.Win32. +@@ -57,8 +57,8 @@ + @date + @echo "" + @if [ -f xmakefile ]; then \ +- $(MAKE_CMD) -k distclean || \ +- $(MAKE_CMD) -k clean || \ ++ ${MAKE} ${MAKE_OPTS} -k distclean || \ ++ ${MAKE} ${MAKE_OPTS} -k clean || \ + $(RM) xmakefile; \ + fi + @if [ ! -f $(IRULESRC)/host.def ]; then \ +@@ -84,14 +84,14 @@ + # fi + cd $(IMAKESRC) && $(MAKE) $(FLAGS) clean + $(MAKE) $(MFLAGS) Makefile.boot +- $(MAKE_CMD) $(MFLAGS) version.def ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) version.def + $(MAKE) $(MFLAGS) Makefile.boot +- $(MAKE_CMD) $(MFLAGS) VerifyOS +- $(MAKE_CMD) $(MFLAGS) Makefiles +- $(MAKE_CMD) $(MFLAGS) BOOTSTRAPSUBDIRS= clean +- $(MAKE_CMD) $(MFLAGS) includes +- $(MAKE_CMD) $(MFLAGS) depend +- $(MAKE_CMD) $(MFLAGS) $(WORLDOPTS) World ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) VerifyOS ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) Makefiles ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) BOOTSTRAPSUBDIRS= clean ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) includes ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) depend ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) $(WORLDOPTS) World + @echo "" + @date + @echo "" +@@ -154,15 +154,15 @@ + -if exist xmakefile.bak del xmakefile.bak + -if exist xmakefile ren xmakefile xmakefile.bak + $(IMAKE:/=\) -s xmakefile -I$(IRULESRC) $(IMAKE_DEFINES) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) +- $(MAKE_CMD) $(MFLAGS) VerifyOS +- $(MAKE_CMD) $(MFLAGS) Makefiles +- $(MAKE_CMD) $(MFLAGS) clean ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) VerifyOS ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) Makefiles ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) clean + cd $(CONFIGSRC)\util + $(MAKE) mkdirhier.exe + cd ..\.. +- $(MAKE_CMD) $(MFLAGS) includes +- $(MAKE_CMD) $(MFLAGS) depend +- $(MAKE_CMD) $(MFLAGS) $(WIN32WORLDOPTS) ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) includes ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) depend ++ ${MAKE} ${MAKE_OPTS} $(MFLAGS) $(WIN32WORLDOPTS) + @echo : + @echo : + @echo Full build of $(RELEASE) complete. +@@ -198,38 +198,38 @@ + # a copy of every rule that might be invoked at top level + + clean: +- -$(MAKE_CMD) $@ ++ -${MAKE_CMD} ${MAKE_OPTS} $@ + find config -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done + find lib -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done + find programs -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done + find include -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done + rm -f config/cf/{version.def,date.def} + dangerous_strip_clean: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + distclean: +- -$(MAKE_CMD) $@ ++ -${MAKE} ${MAKE_OPTS} $@ + $(RM) xmakefile $(IRULESRC)/version.def $(IRULESRC)/date.def + depend: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + Everything: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + external.ln: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + includes: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + install.sdk: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + install.ln: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + install.man: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + install: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + Makefiles: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + man_keywords: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + tags: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ + VerifyOS: +- $(MAKE_CMD) $@ ++ ${MAKE} ${MAKE_OPTS} $@ +--- a/nx-X11/config/imake/Makefile.ini ++++ b/nx-X11/config/imake/Makefile.ini +@@ -21,7 +21,6 @@ + SHELL = /bin/sh + RM = rm -f + MV = mv +-MAKE = make + RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \ + tags TAGS make.log + NPROC = 1 +--- a/nx-X11/lib/X11/Imakefile ++++ b/nx-X11/lib/X11/Imakefile +@@ -1161,25 +1161,23 @@ + + #ifdef SunArchitecture + $(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) +- cd $(NX_XCOMPLIBDIR) && \ +- gmake ++ ${MAKE} -C $(NX_XCOMPLIBDIR) + + $(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) +- cd ../../../nxcompext && \ +- gmake ++ ${MAKE} -C ../../../nxcompext + + #else + $(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) +- cd $(NX_XCOMPLIBDIR) && \ +- make ++ ${MAKE} -C $(NX_XCOMPLIBDIR) + +-$(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) +- cd ../../../nxcompext && \ +- make ++$(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) $(NX_XCOMPLIBTARGET) lib$(LIBNAME).so.$(SOXLIBREV) ++ ${MAKE} -C ../../../nxcompext + + #endif + +-depend:: $(NX_XCOMPLIBTARGET) ++depend:: ++ ++lib$(LIBNAME).so.$(SOXLIBREV): $(NX_XCOMPLIBTARGET) + + all:: $(NX_XCOMPLIBTARGET) + +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -1045,11 +1045,11 @@ + #ifdef SunArchitecture + $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) + cd $(NX_XSHADOWLIBDIR) && \ +- gmake ++ ${MAKE} + #else + $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) + cd $(NX_XSHADOWLIBDIR) && \ +- rm -f *.o && make ++ rm -f *.o && ${MAKE} + #endif + + ServerTarget(nxagent,$(NX_XSHADOWLIBTARGET) $(NXAGENTDIRS),$(NXAGENTOBJS), \ + diff --git a/debian/patches/003_nxcompshad_gcc43.full.patch b/debian/patches/003_nxcompshad_gcc43.full.patch deleted file mode 100644 index 165c30035..000000000 --- a/debian/patches/003_nxcompshad_gcc43.full.patch +++ /dev/null @@ -1,33 +0,0 @@ -Description: gcc43 fix - Use builtin includes to build with gcc43. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: pending... -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nxcompshad/Logger.h -+++ b/nxcompshad/Logger.h -@@ -18,8 +18,8 @@ - #ifndef Logger_H - #define Logger_H - --#include --#include -+#include -+#include - - // - // Error handling macros. ---- a/nxcompshad/Misc.h -+++ b/nxcompshad/Misc.h -@@ -20,8 +20,8 @@ - - #include - --#include --#include -+#include -+#include - - using namespace std; - diff --git a/debian/patches/004_nx-X11_fix-nxcompshad-build.full.patch b/debian/patches/004_nx-X11_fix-nxcompshad-build.full.patch deleted file mode 100644 index f65fb7877..000000000 --- a/debian/patches/004_nx-X11_fix-nxcompshad-build.full.patch +++ /dev/null @@ -1,18 +0,0 @@ -Description: Fix build on Debian - By an unknown reason this patch currently is needed to - build nx-X11, nxcomp, nxcompshad and nxcompext with - dpkg-buildpackage and debuild. -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -1047,7 +1047,7 @@ - #else - $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) - cd $(NX_XSHADOWLIBDIR) && \ -- make -+ rm -f *.o && make - #endif - - ServerTarget(nxagent,$(NX_XSHADOWLIBTARGET) $(NXAGENTDIRS),$(NXAGENTOBJS), \ diff --git a/debian/patches/0051_nxcomp_macos105-fdisset.full+lite.patch b/debian/patches/0051_nxcomp_macos105-fdisset.full+lite.patch new file mode 100644 index 000000000..6b78a6bc2 --- /dev/null +++ b/debian/patches/0051_nxcomp_macos105-fdisset.full+lite.patch @@ -0,0 +1,82 @@ +Description: workaround for Mac OS X 10.5 + The Mac OS X 10.5 SDK requires the second argument of FD_ISSET to be + writeable, although it does only access the data. Given that we have a + const pointer for a const struct, copy and pass that. + . + Note that this is merely a workaround for OS X 10.5, as 10.6 and later + define the second argument of FD_ISSET as const struct const *foo, too. + . + It is safe, as data is accessed read-only by FD_ISSET, even on 10.5. +Forward: pending +Author: Mihai Moldovan +--- + nxcomp/Agent.h | 28 ++++++++++++++++++++-------- + 1 files changed, 20 insertions(+), 8 deletions(-) + +--- a/nxcomp/Agent.h ++++ b/nxcomp/Agent.h +@@ -149,30 +149,38 @@ + + int remoteCanRead(const fd_set * const readSet) + { ++ // OS X 10.5 requires the second argument to be non-const, so copy readSet. ++ // It's safe though, as FD_ISSET does not operate on it. ++ fd_set readWorkSet = *readSet; ++ + #if defined(TEST) || defined(INFO) + *logofs << "Agent: remoteCanRead() is " << +- (FD_ISSET(remoteFd_, readSet) && transport_ -> dequeuable() != 0) +- << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, readSet) ++ (FD_ISSET(remoteFd_, &readWorkSet) && transport_ -> dequeuable() != 0) ++ << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, &readWorkSet) + << " and dequeuable " << transport_ -> dequeuable() + << ".\n" << logofs_flush; + #endif + +- return (FD_ISSET(remoteFd_, readSet) && ++ return (FD_ISSET(remoteFd_, &readWorkSet) && + transport_ -> dequeuable() != 0); + } + + int remoteCanWrite(const fd_set * const writeSet) + { ++ // OS X 10.5 requires the second argument to be non-const, so copy writeSet. ++ // It's safe though, as FD_ISSET does not operate on it. ++ fd_set writeWorkSet = *writeSet; ++ + #if defined(TEST) || defined(INFO) + *logofs << "Agent: remoteCanWrite() is " << +- (FD_ISSET(remoteFd_, writeSet) && transport_ -> ++ (FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> + queuable() != 0 && canRead_ == 1) << " with FD_ISSET() " +- << (int) FD_ISSET(remoteFd_, writeSet) << " queueable " ++ << (int) FD_ISSET(remoteFd_, &writeWorkSet) << " queueable " + << transport_ -> queuable() << " channel can read " + << canRead_ << ".\n" << logofs_flush; + #endif + +- return (FD_ISSET(remoteFd_, writeSet) && ++ return (FD_ISSET(remoteFd_, &writeWorkSet) && + transport_ -> queuable() != 0 && + canRead_ == 1); + } +@@ -203,13 +211,17 @@ + + int proxyCanRead(const fd_set * const readSet) + { ++ // OS X 10.5 requires the second argument to be non-const, so copy readSet. ++ // It's safe though, as FD_ISSET does not operate on it. ++ fd_set readWorkSet = *readSet; ++ + #if defined(TEST) || defined(INFO) + *logofs << "Agent: proxyCanRead() is " +- << ((int) FD_ISSET(proxy -> getFd(), readSet) ++ << ((int) FD_ISSET(proxy -> getFd(), &readWorkSet) + << ".\n" << logofs_flush; + #endif + +- return (FD_ISSET(proxy -> getFd(), readSet)); ++ return (FD_ISSET(proxy -> getFd(), &readWorkSet)); + } + + int enqueueData(const char *data, const int size) const diff --git a/debian/patches/0052_nxcomp_macos10-nxauth-location.full+lite.patch b/debian/patches/0052_nxcomp_macos10-nxauth-location.full+lite.patch new file mode 100644 index 000000000..813363e69 --- /dev/null +++ b/debian/patches/0052_nxcomp_macos10-nxauth-location.full+lite.patch @@ -0,0 +1,41 @@ +Description: Fix nxauth location on Mac OS X 10 +Author: Mihai Moldovan + +--- a/nxcomp/Auth.cpp ++++ b/nxcomp/Auth.cpp +@@ -217,22 +217,31 @@ + + // + // Use the nxauth command on Windows and the Mac, xauth +- // on all the other platforms. On Windows and on the Mac +- // we assume that the nxauth command is located under +- // bin in the client installation directory. On all the ++ // on all the other platforms. On Windows we assume that ++ // the nxauth command is located under bin in the client ++ // installation directory. On Mac OS X we assume that the ++ // command is located directly in the client installation ++ // directory, to make bundle shipping easier. On all the + // other platforms we use the default xauth command that + // is in our path. + // + + char command[DEFAULT_STRING_LIMIT]; + +- #if defined(__CYGWIN32__) || defined(__APPLE__) ++ #if defined(__CYGWIN32__) + + snprintf(command, DEFAULT_STRING_LIMIT - 1, + "%s/bin/nxauth", control -> SystemPath); + + *(command + DEFAULT_STRING_LIMIT - 1) = '\0'; + ++ #elif defined(__APPLE__) ++ ++ snprintf(command, DEFAULT_STRING_LIMIT - 1, ++ "%s/nxauth", control -> SystemPath); ++ ++ *(command + DEFAULT_STRING_LIMIT - 1) = '\0'; ++ + #else + + strcpy(command, "xauth"); diff --git a/debian/patches/0053_nx-X11_no-xcomp1-install-target.full.patch b/debian/patches/0053_nx-X11_no-xcomp1-install-target.full.patch new file mode 100644 index 000000000..acf9374e5 --- /dev/null +++ b/debian/patches/0053_nx-X11_no-xcomp1-install-target.full.patch @@ -0,0 +1,32 @@ +Description: Avoid building libXcomp.so.1 (which is identical to libXcomp.so.3) +Author: Orion Poplawski + +--- a/nx-X11/lib/X11/Imakefile 2013-01-04 05:25:49.000000000 -0700 ++++ b/nx-X11/lib/X11/Imakefile 2013-01-15 15:26:07.969167259 -0700 +@@ -63,7 +63,6 @@ NX_XCOMPLIBDIR = $(XTOP)/../nxcomp + NX_XCOMPLIBLINK = Xcomp + NX_XCOMPLIBTARGET = $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) + NX_REQUIREDLIBS = -L$(NX_XCOMPLIBDIR) -l$(NX_XCOMPLIBLINK) +-NX_XCOMPDEPTARGET = $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) + NX_XCOMPCONFIGTARGET = $(NX_XCOMPLIBDIR)/config.status + + NX_XCOMPEXTLIBDIR = $(XTOP)/../nxcompext +@@ -1181,17 +1180,9 @@ lib$(LIBNAME).so.$(SOXLIBREV): $(NX_XCOM + + all:: $(NX_XCOMPLIBTARGET) + +-$(NX_XCOMPDEPTARGET): +- ln -s $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) +- ln -s $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME).1 $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME).1 +- + depend:: $(NX_XCOMPLIBTARGET) + +-all:: $(NX_XCOMPDEPTARGET) $(NX_XCOMPEXTLIBTARGET) +- +-clean:: +- rm -f $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) +- rm -f $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME).1 ++all:: $(NX_XCOMPEXTLIBTARGET) + + #endif + diff --git a/debian/patches/0054_nx-X11_ppc64-ftbfs.full.patch b/debian/patches/0054_nx-X11_ppc64-ftbfs.full.patch new file mode 100644 index 000000000..d60426e91 --- /dev/null +++ b/debian/patches/0054_nx-X11_ppc64-ftbfs.full.patch @@ -0,0 +1,14 @@ +Description: Fix FTBFS on ppc64 architecture +Author: Orion Poplawski +diff -up a/nx-X11/lib/GL/mesa/main/Imakefile.inc b/nx-X11/lib/GL/mesa/main/Imakefile.inc +--- a/nx-X11/lib/GL/mesa/main/Imakefile.inc 2014-01-04 13:39:35.000000000 -0700 ++++ b/nx-X11/lib/GL/mesa/main/Imakefile.inc 2014-01-24 12:04:00.085272615 -0700 +@@ -1,5 +1,8 @@ + XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ + ++/* gcc on ppc64 defines this, causes macro recursion with pixel below */ ++#undef pixel ++ + #ifndef MesaBuildDir + #define MesaBuildDir $(GLXLIBSRC)/mesa/main/ + #endif diff --git a/debian/patches/0055_nx-X11_imake-Werror-format-security.full.patch b/debian/patches/0055_nx-X11_imake-Werror-format-security.full.patch new file mode 100644 index 000000000..6e5b4c80e --- /dev/null +++ b/debian/patches/0055_nx-X11_imake-Werror-format-security.full.patch @@ -0,0 +1,1090 @@ +Description: Fix FTBFS when compiled with -Werror=format-security +Author: Orion Poplawski +diff -up a/nx-X11/config/imake/imake.c b/nx-X11/config/imake/imake.c +--- a/nx-X11/config/imake/imake.c 2014-01-04 13:39:35.000000000 -0700 ++++ b/nx-X11/config/imake/imake.c 2014-01-24 13:55:53.940697330 -0700 +@@ -7,8 +7,6 @@ + * be passed to the template file. * + * * + ***************************************************************************/ +-/* $XFree86: xc/config/imake/imake.c,v 3.63tsi Exp $ */ +- + /* + * + Copyright (c) 1985, 1986, 1987, 1998 The Open Group +@@ -153,23 +151,14 @@ in this Software without prior written a + #endif + #include + #include +-#ifdef MONOLITH +-# include "Xosdefs.h" +-#else +-# include +-#endif ++#include ++#include ++#include + #include + #include + #ifdef WIN32 + # include "Xw32defs.h" + #endif +-#if 0 +-#ifndef X_NOT_POSIX +-# ifndef _POSIX_SOURCE +-# define _POSIX_SOURCE +-# endif +-#endif +-#endif + #include + #include + #ifdef X_NOT_POSIX +@@ -231,22 +220,16 @@ typedef union wait waitType; + # define WIFEXITED(w) waitCode(w) + # endif + #endif /* X_NOT_POSIX */ +-# include +-#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ +-char *malloc(), *realloc(); +-#endif /* macII */ ++#include + #include + #ifdef __minix_vmd +-#define USE_FREOPEN 1 ++# define USE_FREOPEN 1 + #endif + +-#if !((defined(sun) && !defined(SVR4)) || defined(macII)) +-#define USE_STRERROR 1 +-#endif + #ifndef WIN32 +-#include ++# include + #else +-#include ++# include + #endif + #ifndef SYS_NMLN + # ifdef _SYS_NMLN +@@ -256,39 +239,22 @@ char *malloc(), *realloc(); + # endif + #endif + #if defined(linux) || defined(__GNU__) || defined(__GLIBC__) +-#include +-#include ++# include ++# include + #endif + #ifdef __QNX__ +-#include +-#endif +- +-/* +- * This define of strerror is copied from (and should be identical to) +- * Xos.h, which we don't want to include here for bootstrapping reasons. +- */ +-#ifndef USE_STRERROR +-# ifndef strerror +-extern char *sys_errlist[]; +-extern int sys_nerr; +-# define strerror(n) \ +- (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error") +-# endif ++# include + #endif + + #if defined(__NetBSD__) /* see code clock in init() below */ +-#include +-#endif +- +-#if !(defined(Lynx) || defined(__Lynx__) || (defined(SVR4) && !defined(sun))) && !defined (__CYGWIN__) +-#define HAS_MKSTEMP ++# include + #endif + + typedef unsigned char boolean; + #define TRUE 1 + #define FALSE 0 + +-# include "imakemdep.h" ++#include "imakemdep.h" + #ifdef CROSSCOMPILE + # include "imakemdep_cpp.h" + #endif +@@ -305,7 +271,7 @@ int xvariables[10]; + #endif + + #ifndef PATH_MAX +-#define PATH_MAX 1024 ++# define PATH_MAX 1024 + #endif + + /* +@@ -331,11 +297,13 @@ void KludgeOutputLine(char **), KludgeRe + # endif + #endif + +-char *cpp = NULL; ++const char *cpp = NULL; + +-char *tmpMakefile = "/tmp/Imf.XXXXXX"; +-char *tmpImakefile = "/tmp/IIf.XXXXXX"; +-char *make_argv[ ARGUMENTS ] = { ++const char *tmpMakefile; ++const char *tmpMakefileTemplate = "/tmp/Imf.XXXXXX"; ++const char *tmpImakefile; ++const char *tmpImakefileTemplate = "/tmp/IIf.XXXXXX"; ++const char *make_argv[ ARGUMENTS ] = { + #ifdef WIN32 + "nmake" + #else +@@ -345,53 +313,53 @@ char *make_argv[ ARGUMENTS ] = { + + int make_argindex; + int cpp_argindex; +-char *Imakefile = NULL; +-char *Makefile = "Makefile"; +-char *Template = "Imake.tmpl"; +-char *ImakefileC = "Imakefile.c"; ++const char *Imakefile = NULL; ++const char *Makefile = "Makefile"; ++const char *Template = "Imake.tmpl"; ++const char *ImakefileC = "Imakefile.c"; + boolean haveImakefileC = FALSE; +-char *cleanedImakefile = NULL; +-char *program; +-char *FindImakefile(char *Imakefile); +-char *ReadLine(FILE *tmpfd, char *tmpfname); +-char *CleanCppInput(char *imakefile); +-char *Strdup(char *cp); ++const char *cleanedImakefile = NULL; ++const char *program; ++const char *FindImakefile(const char *Imakefile); ++char *ReadLine(FILE *tmpfd, const char *tmpfname); ++const char *CleanCppInput(const char *imakefile); ++char *Strdup(const char *cp); + char *Emalloc(int size); +-void LogFatalI(char *s, int i), LogFatal(char *x0, char *x1), +- LogMsg(char *x0, char *x1); ++void LogFatal(const char *x0, ...) _X_ATTRIBUTE_PRINTF(1, 2); ++void LogMsg(const char *x0, ...) _X_ATTRIBUTE_PRINTF(1, 2); + + void showit(FILE *fd); + void wrapup(void); + void init(void); +-void AddMakeArg(char *arg); +-void AddCppArg(char *arg); ++void AddMakeArg(const char *arg); ++void AddCppArg(const char *arg); + #ifdef CROSSCOMPILE + char *CrossCompileCPP(void); + #endif + void SetOpts(int argc, char **argv); +-void CheckImakefileC(char *masterc); +-void cppit(char *imakefile, char *template, char *masterc, +- FILE *outfd, char *outfname); ++void CheckImakefileC(const char *masterc); ++void cppit(const char *imakefile, const char *template, const char *masterc, ++ FILE *outfd, const char *outfname); + void makeit(void); +-void CleanCppOutput(FILE *tmpfd, char *tmpfname); ++void CleanCppOutput(FILE *tmpfd, const char *tmpfname); + boolean isempty(char *line); +-void writetmpfile(FILE *fd, char *buf, int cnt, char *fname); ++void writetmpfile(FILE *fd, const char *buf, int cnt, const char *fname); + #ifdef SIGNALRETURNSINT + int catch(int sig); + #else + void catch(int sig); + #endif +-void showargs(char **argv); +-boolean optional_include(FILE *inFile, char *defsym, char *fname); +-void doit(FILE *outfd, char *cmd, char **argv); ++void showargs(const char **argv); ++boolean optional_include(FILE *inFile, const char *defsym, const char *fname); ++void doit(FILE *outfd, const char *cmd, const char **argv); + boolean define_os_defaults(FILE *inFile); + #ifdef CROSSCOMPILE + static void get_cross_compile_dir(FILE *inFile); + #endif + #ifdef CROSSCOMPILEDIR +-char *CrossCompileDir = CROSSCOMPILEDIR; ++const char *CrossCompileDir = CROSSCOMPILEDIR; + #else +-char *CrossCompileDir = ""; ++const char *CrossCompileDir = ""; + #endif + boolean CrossCompiling = FALSE; + +@@ -428,24 +396,25 @@ main(int argc, char *argv[]) + if ((tmpfd = fopen(tmpMakefile, "w+")) == NULL) + LogFatal("Cannot create temporary file %s.", tmpMakefile); + } else { +-#ifdef HAS_MKSTEMP ++#ifdef HAVE_MKSTEMP + int fd; + #endif +- tmpMakefile = Strdup(tmpMakefile); +-#ifndef HAS_MKSTEMP +- if (mktemp(tmpMakefile) == NULL || +- (tmpfd = fopen(tmpMakefile, "w+")) == NULL) { +- LogFatal("Cannot create temporary file %s.", tmpMakefile); ++ char *tmpMakefileName = Strdup(tmpMakefileTemplate); ++#ifndef HAVE_MKSTEMP ++ if (mktemp(tmpMakefileName) == NULL || ++ (tmpfd = fopen(tmpMakefileName, "w+")) == NULL) { ++ LogFatal("Cannot create temporary file %s.", tmpMakefileName); + } + #else +- fd = mkstemp(tmpMakefile); ++ fd = mkstemp(tmpMakefileName); + if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) { + if (fd != -1) { +- unlink(tmpMakefile); close(fd); ++ unlink(tmpMakefileName); close(fd); + } +- LogFatal("Cannot create temporary file %s.", tmpMakefile); ++ LogFatal("Cannot create temporary file %s.", tmpMakefileName); + } + #endif ++ tmpMakefile = tmpMakefileName; + } + AddMakeArg("-f"); + AddMakeArg( tmpMakefile ); +@@ -498,7 +467,7 @@ void + catch(int sig) + { + errno = 0; +- LogFatalI("Signal %d.", sig); ++ LogFatal("Signal %d.", sig); + } + + /* +@@ -572,21 +541,21 @@ init(void) + } + + void +-AddMakeArg(char *arg) ++AddMakeArg(const char *arg) + { + errno = 0; + if (make_argindex >= ARGUMENTS-1) +- LogFatal("Out of internal storage.", ""); ++ LogFatal("Out of internal storage."); + make_argv[ make_argindex++ ] = arg; + make_argv[ make_argindex ] = NULL; + } + + void +-AddCppArg(char *arg) ++AddCppArg(const char *arg) + { + errno = 0; + if (cpp_argindex >= ARGUMENTS-1) +- LogFatal("Out of internal storage.", ""); ++ LogFatal("Out of internal storage."); + cpp_argv[ cpp_argindex++ ] = arg; + cpp_argv[ cpp_argindex ] = NULL; + } +@@ -618,7 +587,7 @@ SetOpts(int argc, char **argv) + else { + argc--, argv++; + if (! argc) +- LogFatal("No description arg after -f flag", ""); ++ LogFatal("No description arg after -f flag"); + Imakefile = argv[0]; + } + } else if (argv[0][1] == 's') { +@@ -628,7 +597,7 @@ SetOpts(int argc, char **argv) + else { + argc--, argv++; + if (!argc) +- LogFatal("No description arg after -s flag", ""); ++ LogFatal("No description arg after -s flag"); + Makefile = ((argv[0][0] == '-') && !argv[0][1]) ? + NULL : argv[0]; + } +@@ -642,7 +611,7 @@ SetOpts(int argc, char **argv) + else { + argc--, argv++; + if (! argc) +- LogFatal("No description arg after -T flag", ""); ++ LogFatal("No description arg after -T flag"); + Template = argv[0]; + } + } else if (argv[0][1] == 'C') { +@@ -651,7 +620,7 @@ SetOpts(int argc, char **argv) + else { + argc--, argv++; + if (! argc) +- LogFatal("No imakeCfile arg after -C flag", ""); ++ LogFatal("No imakeCfile arg after -C flag"); + ImakefileC = argv[0]; + } + } else if (argv[0][1] == 'v') { +@@ -667,10 +636,10 @@ SetOpts(int argc, char **argv) + if (!cpp) + { + AddCppArg("-E"); +-#ifdef __GNUC__ ++# ifdef __GNUC__ + if (verbose) + AddCppArg("-v"); +-#endif ++# endif + cpp = DEFAULT_CC; + } + # else +@@ -686,8 +655,8 @@ SetOpts(int argc, char **argv) + AddCppArg(ImakefileC); + } + +-char * +-FindImakefile(char *Imakefile) ++const char * ++FindImakefile(const char *Imakefile) + { + if (Imakefile) { + if (access(Imakefile, R_OK) < 0) +@@ -695,7 +664,7 @@ FindImakefile(char *Imakefile) + } else { + if (access("Imakefile", R_OK) < 0) { + if (access("imakefile", R_OK) < 0) +- LogFatal("No description file.", ""); ++ LogFatal("No description file."); + else + Imakefile = "imakefile"; + } else +@@ -704,44 +673,50 @@ FindImakefile(char *Imakefile) + return(Imakefile); + } + +-void +-LogFatalI(char *s, int i) ++static void _X_ATTRIBUTE_PRINTF(1, 0) ++vLogMsg(const char *fmt, va_list args) + { +- /*NOSTRICT*/ +- LogFatal(s, (char *)(long)i); ++ int error_number = errno; ++ ++ if (error_number) { ++ fprintf(stderr, "%s: ", program); ++ fprintf(stderr, "%s\n", strerror(error_number)); ++ } ++ fprintf(stderr, "%s: ", program); ++ vfprintf(stderr, fmt, args); ++ fprintf(stderr, "\n"); + } + + void +-LogFatal(char *x0, char *x1) ++LogFatal(const char *fmt, ...) + { + static boolean entered = FALSE; ++ va_list args; + + if (entered) + return; + entered = TRUE; + +- LogMsg(x0, x1); ++ va_start(args, fmt); ++ vLogMsg(fmt, args); ++ va_end(args); + fprintf(stderr, " Stop.\n"); + wrapup(); + exit(1); + } + + void +-LogMsg(char *x0, char *x1) ++LogMsg(const char *fmt, ...) + { +- int error_number = errno; ++ va_list args; + +- if (error_number) { +- fprintf(stderr, "%s: ", program); +- fprintf(stderr, "%s\n", strerror(error_number)); +- } +- fprintf(stderr, "%s: ", program); +- fprintf(stderr, x0, x1); +- fprintf(stderr, "\n"); ++ va_start(args, fmt); ++ vLogMsg(fmt, args); ++ va_end(args); + } + + void +-showargs(char **argv) ++showargs(const char **argv) + { + for (; *argv; argv++) + fprintf(stderr, "%s ", *argv); +@@ -751,7 +726,7 @@ showargs(char **argv) + #define ImakefileCHeader "/* imake - temporary file */" + + void +-CheckImakefileC(char *masterc) ++CheckImakefileC(const char *masterc) + { + char mkcbuf[1024]; + FILE *inFile; +@@ -767,7 +742,8 @@ CheckImakefileC(char *masterc) + fclose(inFile); + LogFatal("Refuse to overwrite: %s", masterc); + } +- fclose(inFile); ++ else ++ fclose(inFile); + } + } + +@@ -778,7 +754,7 @@ CheckImakefileC(char *masterc) + #define OverrideWarning "Warning: local file \"%s\" overrides global macros." + + boolean +-optional_include(FILE *inFile, char *defsym, char *fname) ++optional_include(FILE *inFile, const char *defsym, const char *fname) + { + errno = 0; + if (access(fname, R_OK) == 0) { +@@ -790,7 +766,7 @@ optional_include(FILE *inFile, char *def + } + + void +-doit(FILE *outfd, char *cmd, char **argv) ++doit(FILE *outfd, const char *cmd, const char **argv) + { + int pid; + waitType status; +@@ -805,18 +781,18 @@ doit(FILE *outfd, char *cmd, char **argv + if (status < 0) + LogFatal("Cannot spawn %s.", cmd); + if (status > 0) +- LogFatalI("Exit code %d.", status); ++ LogFatal("Exit code %d.", status); + #else + pid = fork(); + if (pid < 0) +- LogFatal("Cannot fork.", ""); ++ LogFatal("Cannot fork."); + if (pid) { /* parent... simply wait */ + while (wait(&status) > 0) { + errno = 0; + if (WIFSIGNALED(status)) +- LogFatalI("Signal %d.", waitSig(status)); ++ LogFatal("Signal %d.", waitSig(status)); + if (WIFEXITED(status) && waitCode(status)) +- LogFatalI("Exit code %d.", waitCode(status)); ++ LogFatal("Exit code %d.", waitCode(status)); + } + } + else { /* child... dup and exec cmd */ +@@ -832,7 +808,7 @@ doit(FILE *outfd, char *cmd, char **argv + + #if !defined WIN32 + static void +-parse_utsname(struct utsname *name, char *fmt, char *result, char *msg) ++parse_utsname(struct utsname *name, const char *fmt, char *result, const char *msg) + { + char buf[SYS_NMLN * 5 + 1]; + char *ptr = buf; +@@ -892,7 +868,7 @@ parse_utsname(struct utsname *name, char + + /* Just in case... */ + if (strlen(buf) >= sizeof(buf)) +- LogFatal("Buffer overflow parsing uname.", ""); ++ LogFatal("Buffer overflow parsing uname."); + + /* Parse the buffer. The sscanf() return value is rarely correct. */ + *result = '\0'; +@@ -978,13 +954,23 @@ const char *libc_c= + static void + get_libc_version(FILE *inFile) + { +- char aout[] = "/tmp/imakeXXXXXX"; ++ char aout[4096], *tmpdir; + FILE *fp; + const char *format = "%s -o %s -x c -"; + char *cc; + int len; + char *command; + ++ /* If $TMPDIR is defined and has an acceptable length, ++ * use that as tmp dir, else use /tmp. That fixes ++ * problems with /tmp mounted "noexec". ++ */ ++ if((tmpdir = getenv("TMPDIR")) != NULL && strlen(tmpdir) < (4096-13)) ++ strcpy(aout, tmpdir); ++ else ++ strcpy(aout, "/tmp"); ++ strcat(aout, "/imakeXXXXXX"); ++ + /* Pre-create temp file safely */ + { + /* Linux + ELF has mkstemp() */ +@@ -1000,7 +986,8 @@ get_libc_version(FILE *inFile) + cc = "gcc"; + len = strlen (aout) + strlen (format) + strlen (cc); + if (len < 128) len = 128; +- command = alloca (len); ++ if((command = alloca (len)) == NULL) ++ abort(); + + if (snprintf (command , len, format, cc, aout) == len) + abort (); +@@ -1015,12 +1002,16 @@ get_libc_version(FILE *inFile) + abort (); + + while (fgets (command, len, fp)) +- fprintf (inFile, command); ++ fputs (command, inFile); + + len = pclose (fp); + remove (aout); +- if (len) +- abort (); ++ if (len) { ++ /* handwave furiously */ ++ printf("#define DefaultLinuxCLibMajorVersion 6\n"); ++ printf("#define DefaultLinuxCLibMinorVersion 12\n"); ++ printf("#define DefaultLinuxCLibTeenyVersion 0\n"); ++ } + } + #endif + +@@ -1031,14 +1022,14 @@ get_stackprotector(FILE *inFile) + FILE *fp; + char *cc; + char command[1024], buf[1024]; +- ++ + cc = getenv("CC"); + if (cc == NULL) { + cc = "cc"; + } + snprintf(command, sizeof(command), "%s -v 2>&1", cc); + fp = popen(command, "r"); +- if (fp == NULL) ++ if (fp == NULL) + abort(); + while (fgets(buf, sizeof(buf), fp)) { + if (strstr(buf, "propolice") != NULL) { +@@ -1046,11 +1037,10 @@ get_stackprotector(FILE *inFile) + break; + } + } +- if (pclose(fp)) +- abort(); ++ pclose(fp); + } + #endif +- ++ + + #if defined CROSSCOMPILE || defined linux || defined(__GLIBC__) + static void +@@ -1058,9 +1048,9 @@ get_distrib(FILE *inFile) + { + struct stat sb; + +- static char* suse = "/etc/SuSE-release"; +- static char* redhat = "/etc/redhat-release"; +- static char* debian = "/etc/debian_version"; ++ static const char* suse = "/etc/SuSE-release"; ++ static const char* redhat = "/etc/redhat-release"; ++ static const char* debian = "/etc/debian_version"; + + fprintf (inFile, "%s\n", "#define LinuxUnknown 0"); + fprintf (inFile, "%s\n", "#define LinuxSuSE 1"); +@@ -1076,14 +1066,14 @@ get_distrib(FILE *inFile) + fprintf (inFile, "%s\n", "#define LinuxWare 11"); + fprintf (inFile, "%s\n", "#define LinuxYggdrasil 12"); + +-#ifdef CROSSCOMPILE ++# ifdef CROSSCOMPILE + if (CrossCompiling) { + fprintf (inFile, "%s\n", + "#define DefaultLinuxDistribution LinuxUnknown"); + fprintf (inFile, "%s\n", "#define DefaultLinuxDistName Unknown"); + return; + } +-#endif ++# endif + if (lstat (suse, &sb) == 0) { + fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxSuSE"); + fprintf (inFile, "%s\n", "#define DefaultLinuxDistName SuSE"); +@@ -1116,7 +1106,7 @@ get_ld_version(FILE *inFile) + int ldmajor, ldminor; + const char *ld = "ld -v"; + +-#ifdef CROSSCOMPILE ++# ifdef CROSSCOMPILE + if (CrossCompiling) { + char cmd[PATH_MAX]; + strcpy (cmd, CrossCompileDir); +@@ -1124,7 +1114,7 @@ get_ld_version(FILE *inFile) + strcat (cmd,ld); + ldprog = popen (cmd, "r"); + } else +-#endif ++# endif + ldprog = popen (ld, "r"); + + if (ldprog) { +@@ -1192,7 +1182,7 @@ get_binary_format(FILE *inFile) + * Returns: 0 if successful, -1 if not. + */ + static int +-ask_sun_compiler_for_versions(const char *cmd, const char *path, ++ask_sun_compiler_for_versions(const char *cmd, const char *path, + int *cmajor, int *cminor) + { + char buf[BUFSIZ]; +@@ -1201,7 +1191,7 @@ ask_sun_compiler_for_versions(const char + FILE* ccproc; + const char vflag[] = " -V 2>&1"; + int retval = -1; +- ++ + int len = strlen(cmd) + sizeof(vflag); + + if (path != NULL) { +@@ -1229,7 +1219,7 @@ ask_sun_compiler_for_versions(const char + } + } + if (retval != 0) { +- fprintf(stderr, ++ fprintf(stderr, + "warning: could not parse version number in output of:\n" + " %s\n", cmdtorun); + } +@@ -1247,23 +1237,22 @@ get_sun_compiler_versions (FILE *inFile) + { + const char* sunpro_path = "/opt/SUNWspro/bin"; + int cmajor, cminor, found = 0; +- struct stat sb; + + /* If cross-compiling, only check CrossCompilerDir for compilers. +- * If not cross-compiling, first check cc in users $PATH, ++ * If not cross-compiling, first check cc in users $PATH, + * then try /opt/SUNWspro if not found in the users $PATH + */ + +-#if defined CROSSCOMPILE ++# if defined CROSSCOMPILE + if (CrossCompiling) { + if (ask_sun_compiler_for_versions("cc", CrossCompileDir, + &cmajor, &cminor) == 0) { + found = 1; + } +- } ++ } + else +-#endif +- { ++# endif ++ { + if (ask_sun_compiler_for_versions("cc", NULL, &cmajor, &cminor) == 0) { + found = 1; + } else if (ask_sun_compiler_for_versions("cc", sunpro_path, +@@ -1282,22 +1271,22 @@ get_sun_compiler_versions (FILE *inFile) + + /* Now do it again for C++ compiler (CC) */ + found = 0; +-#if defined CROSSCOMPILE ++# if defined CROSSCOMPILE + if (CrossCompiling) { + if (ask_sun_compiler_for_versions("CC", CrossCompileDir, + &cmajor, &cminor) == 0) { + found = 1; + } +- } ++ } + else +-#endif +- { ++# endif ++ { + if (ask_sun_compiler_for_versions("CC", NULL, &cmajor, &cminor) == 0) { + found = 1; + } else if (ask_sun_compiler_for_versions("CC", sunpro_path, + &cmajor, &cminor) == 0) { + found = 1; +- fprintf(inFile, ++ fprintf(inFile, + "#define DefaultSunProCplusplusCompilerDir %s", sunpro_path); + } + } +@@ -1318,7 +1307,7 @@ static void + get_gcc_version(FILE *inFile, char *name) + { + fprintf (inFile, "#define HasGcc 1\n"); +-#ifdef CROSSCOMPILE ++# ifdef CROSSCOMPILE + if (CrossCompiling) + { + if (gnu_c > 1) { +@@ -1329,20 +1318,20 @@ get_gcc_version(FILE *inFile, char *name + fprintf (inFile, "#define GccMajorVersion %d\n", gnu_c); + fprintf (inFile, "#define GccMinorVersion %d\n", gnu_c_minor); + } else +-#endif ++# endif + { +-#if __GNUC__ > 1 ++# if __GNUC__ > 1 + fprintf (inFile, "#define HasGcc2 1\n"); +-# if __GNUC__ > 2 ++# if __GNUC__ > 2 + fprintf (inFile, "#define HasGcc3 1\n"); ++# endif + # endif +-#endif + fprintf (inFile, "#define GccMajorVersion %d\n", __GNUC__); + fprintf (inFile, "#define GccMinorVersion %d\n", __GNUC_MINOR__); + } +-#if defined(HAS_MERGE_CONSTANTS) ++# if defined(HAS_MERGE_CONSTANTS) + fprintf (inFile, "#define HasGccMergeConstants %d\n", HAS_MERGE_CONSTANTS); +-#endif ++# endif + } + #endif + +@@ -1350,8 +1339,8 @@ static boolean + get_gcc(char *cmd) + { + struct stat sb; +- static char* gcc_path[] = { +-# if defined(linux) || \ ++ static const char* gcc_path[] = { ++#if defined(linux) || \ + defined(__NetBSD__) || \ + defined(__OpenBSD__) || \ + defined(__FreeBSD__) || \ +@@ -1362,14 +1351,14 @@ get_gcc(char *cmd) + defined(__GNU__) || \ + defined(__GLIBC__) + "/usr/bin/cc", /* for Linux PostIncDir */ +-# endif ++#endif + "/usr/local/bin/gcc", + "/opt/gnu/bin/gcc", + "/usr/pkg/bin/gcc" + }; + + #ifdef CROSSCOMPILE +- static char* cross_cc_name[] = { ++ static const char* cross_cc_name[] = { + "cc", + "gcc" + }; +@@ -1399,7 +1388,7 @@ get_gcc(char *cmd) + return FALSE; + } + +-#if defined CROSSCOMPILE || !defined __UNIXOS2__ ++#ifdef CROSSCOMPILE + static void + get_gcc_incdir(FILE *inFile, char* name) + { +@@ -1428,14 +1417,14 @@ get_gcc_incdir(FILE *inFile, char* name) + boolean + define_os_defaults(FILE *inFile) + { +-#if defined CROSSCOMPILE || ( !defined(WIN32) && !defined(__UNIXOS2__) ) +-#ifdef CROSSCOMPILE +-#ifdef __GNUC__ ++#if defined CROSSCOMPILE || !defined(WIN32) ++# ifdef CROSSCOMPILE ++# ifdef __GNUC__ + if (1) +-#else ++# else + if ((sys != win32) && (sys != emx)) +-#endif +-#endif ++# endif ++# endif + { + # if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \ + defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV)) +@@ -1444,16 +1433,16 @@ define_os_defaults(FILE *inFile) + char buf[SYS_NMLN * 5 + 1]; + + /* Obtain the system information. */ +-#ifdef CROSSCOMPILE ++# ifdef CROSSCOMPILE + if (!CrossCompiling) +-#endif ++# endif + { + if (uname(&uts_name) < 0) +- LogFatal("Cannot invoke uname", ""); ++ LogFatal("Cannot invoke uname"); + else + name = &uts_name; + } +-#if defined CROSSCOMPILE && (defined linux || defined(__GLIBC__)) ++# if defined CROSSCOMPILE && (defined linux || defined(__GLIBC__)) + else { + strncpy(uts_name.sysname,cross_uts_sysname,SYS_NMLN); + strncpy(uts_name.release,cross_uts_release,SYS_NMLN); +@@ -1461,14 +1450,14 @@ define_os_defaults(FILE *inFile) + strncpy(uts_name.machine,cross_uts_machine,SYS_NMLN); + name = &uts_name; + } +-#endif +-# ifdef __FreeBSD__ ++# endif ++# ifdef __FreeBSD__ + /* Override for compiling in chroot of other OS version, such as + * in the bento build cluster. + */ + { + char *e; +- if ((e = getenv("OSREL")) != NULL && ++ if ((e = getenv("OSREL")) != NULL && + strlen(name->sysname) + strlen(e) + 1 < SYS_NMLN) { + strcpy(name->release, e); + strcpy(name->version, name->sysname); +@@ -1476,7 +1465,7 @@ define_os_defaults(FILE *inFile) + strcat(name->version, e); + } + } +-# endif ++# endif + + # if defined DEFAULT_OS_NAME + # if defined CROSSCOMPILE +@@ -1648,10 +1637,8 @@ define_os_defaults(FILE *inFile) + char name[PATH_MAX]; + if (get_gcc(name)) { + get_gcc_version (inFile,name); +-# if defined CROSSCOMPILE || !defined __UNIXOS2__ +-# if defined CROSSCOMPILE ++# if defined CROSSCOMPILE + if (sys != emx) +-# endif + get_gcc_incdir(inFile,name); + # endif + } +@@ -1664,7 +1651,7 @@ define_os_defaults(FILE *inFile) + get_binary_format(inFile); + # endif + } +-#endif /* !WIN32 && !__UNIXOS2__*/ ++#endif /* !WIN32 */ + #if defined WIN32 + # ifdef CROSSCOMPILE + else if (sys == win32 && !CrossCompiling) +@@ -1688,8 +1675,6 @@ define_os_defaults(FILE *inFile) + #endif /* WIN32 */ + #ifdef CROSSCOMPILE + else if (sys == emx) +-#endif +-#if defined CROSSCOMPILE || defined __UNIXOS2__ + { + fprintf(inFile, "#define DefaultOSMajorVersion 4\n"); + fprintf(inFile, "#define DefaultOSMinorVersion 0\n"); +@@ -1703,8 +1688,8 @@ define_os_defaults(FILE *inFile) + } + + void +-cppit(char *imakefile, char *template, char *masterc, +- FILE *outfd, char *outfname) ++cppit(const char *imakefile, const char *template, const char *masterc, ++ FILE *outfd, const char *outfname) + { + FILE *inFile; + +@@ -1721,8 +1706,11 @@ cppit(char *imakefile, char *template, c + fprintf(inFile, IncludeFmt, ImakeTmplSym) < 0 || + optional_include(inFile, "IMAKE_ADMIN_MACROS", "adminmacros") || + optional_include(inFile, "IMAKE_LOCAL_MACROS", "localmacros") || +- fflush(inFile) || +- fclose(inFile)) ++ fflush(inFile)) { ++ fclose(inFile); ++ LogFatal("Cannot write to %s.", masterc); ++ } ++ else if (fclose(inFile)) + LogFatal("Cannot write to %s.", masterc); + /* + * Fork and exec cpp +@@ -1737,8 +1725,8 @@ makeit(void) + doit(NULL, make_argv[0], make_argv); + } + +-char * +-CleanCppInput(char *imakefile) ++const char * ++CleanCppInput(const char *imakefile) + { + FILE *outFile = NULL; + FILE *inFile; +@@ -1792,28 +1780,29 @@ CleanCppInput(char *imakefile) + strcmp(ptoken, "pragma") && + strcmp(ptoken, "undef")) { + if (outFile == NULL) { +-#ifdef HAS_MKSTEMP ++#ifdef HAVE_MKSTEMP + int fd; + #endif +- tmpImakefile = Strdup(tmpImakefile); +-#ifndef HAS_MKSTEMP +- if (mktemp(tmpImakefile) == NULL || +- (outFile = fopen(tmpImakefile, "w+")) == NULL) { ++ char *tmpImakefileName = Strdup(tmpImakefileTemplate); ++#ifndef HAVE_MKSTEMP ++ if (mktemp(tmpImakefileName) == NULL || ++ (outFile = fopen(tmpImakefileName, "w+")) == NULL) { + LogFatal("Cannot open %s for write.", +- tmpImakefile); ++ tmpImakefileName); + } + #else +- fd=mkstemp(tmpImakefile); ++ fd=mkstemp(tmpImakefileName); + if (fd != -1) + outFile = fdopen(fd, "w"); + if (outFile == NULL) { + if (fd != -1) { +- unlink(tmpImakefile); close(fd); ++ unlink(tmpImakefileName); close(fd); + } + LogFatal("Cannot open %s for write.", +- tmpImakefile); ++ tmpImakefileName); + } + #endif ++ tmpImakefile = tmpImakefileName; + } + writetmpfile(outFile, punwritten, pbuf-punwritten, + tmpImakefile); +@@ -1838,7 +1827,7 @@ CleanCppInput(char *imakefile) + } + + void +-CleanCppOutput(FILE *tmpfd, char *tmpfname) ++CleanCppOutput(FILE *tmpfd, const char *tmpfname) + { + char *input; + int blankline = 0; +@@ -1960,7 +1949,7 @@ isempty(char *line) + + /*ARGSUSED*/ + char * +-ReadLine(FILE *tmpfd, char *tmpfname) ++ReadLine(FILE *tmpfd, const char *tmpfname) + { + static boolean initialized = FALSE; + static char *buf, *pline, *end; +@@ -1988,10 +1977,10 @@ ReadLine(FILE *tmpfd, char *tmpfname) + fseek(tmpfd, 0, 0); + #if defined(SYSV) || defined(WIN32) || defined(USE_FREOPEN) + tmpfd = freopen(tmpfname, "w+", tmpfd); +-#ifdef WIN32 ++# ifdef WIN32 + if (! tmpfd) /* if failed try again */ + tmpfd = freopen(tmpfname, "w+", fp); +-#endif ++# endif + if (! tmpfd) + LogFatal("cannot reopen %s\n", tmpfname); + #else /* !SYSV */ +@@ -1999,8 +1988,6 @@ ReadLine(FILE *tmpfd, char *tmpfname) + #endif /* !SYSV */ + initialized = TRUE; + fprintf (tmpfd, "# Makefile generated by imake - do not edit!\n"); +- fprintf (tmpfd, "# %s\n", +- "$Xorg: imake.c,v 1.6 2001/02/09 02:03:15 xorgcvs Exp $"); + } + + for (p1 = pline; p1 < end; p1++) { +@@ -2036,7 +2023,7 @@ ReadLine(FILE *tmpfd, char *tmpfname) + } + + void +-writetmpfile(FILE *fd, char *buf, int cnt, char *fname) ++writetmpfile(FILE *fd, const char *buf, int cnt, const char *fname) + { + if (fwrite(buf, sizeof(char), cnt, fd) == -1) + LogFatal("Cannot write to %s.", fname); +@@ -2048,7 +2035,7 @@ Emalloc(int size) + char *p; + + if ((p = malloc(size)) == NULL) +- LogFatalI("Cannot allocate %d bytes", size); ++ LogFatal("Cannot allocate %d bytes", size); + return(p); + } + +@@ -2066,10 +2053,10 @@ KludgeOutputLine(char **pline) + break; + case ' ': /*May need a tab*/ + default: +-#ifdef CROSSCOMPILE ++# ifdef CROSSCOMPILE + if (inline_syntax) +-#endif +-#if defined CROSSCOMPILE || defined INLINE_SYNTAX ++# endif ++# if defined CROSSCOMPILE || defined INLINE_SYNTAX + { + if (*p == '<' && p[1] == '<') { /* inline file close */ + InInline--; +@@ -2077,7 +2064,7 @@ KludgeOutputLine(char **pline) + break; + } + } +-#endif ++# endif + /* + * The following cases should not be treated as beginning of + * rules: +@@ -2116,26 +2103,26 @@ KludgeOutputLine(char **pline) + quotechar = ']'; + break; + case '=': +-#ifdef CROSSCOMPILE ++# ifdef CROSSCOMPILE + if (remove_cpp_leadspace) +-#endif +-#if defined CROSSCOMPILE || defined REMOVE_CPP_LEADSPACE ++# endif ++# if defined CROSSCOMPILE || defined REMOVE_CPP_LEADSPACE + { + if (!InRule && **pline == ' ') { + while (**pline == ' ') + (*pline)++; + } + } +-#endif ++# endif + goto breakfor; +-#if defined CROSSCOMPILE || defined INLINE_SYNTAX ++# if defined CROSSCOMPILE || defined INLINE_SYNTAX + case '<': + if (inline_syntax) { + if (p[1] == '<') /* inline file start */ + InInline++; + } + break; +-#endif ++# endif + case ':': + if (p[1] == '=') + goto breakfor; +@@ -2159,7 +2146,7 @@ KludgeResetRule(void) + } + #endif + char * +-Strdup(char *cp) ++Strdup(const char *cp) + { + char *new = Emalloc(strlen(cp) + 1); + diff --git a/debian/patches/0056_nx-X11_Werror-format-security.full.patch b/debian/patches/0056_nx-X11_Werror-format-security.full.patch new file mode 100644 index 000000000..a047de774 --- /dev/null +++ b/debian/patches/0056_nx-X11_Werror-format-security.full.patch @@ -0,0 +1,107 @@ +Description: Fix -Werror=format-security errors +Author: Orion Poplawski +Abstract: + The below patch fixes more -Werror=format-security errors. + Interestingly, most of the errors only showed up on our arm builds. No + idea why. +--- a/nx-X11/lib/xtrans/Xtransint.h ++++ b/nx-X11/lib/xtrans/Xtransint.h +@@ -444,7 +444,7 @@ + int hack= 0, saveerrno=errno; \ + struct timeval tp;\ + gettimeofday(&tp,0); \ +- ErrorF(__xtransname); \ ++ ErrorF("%s",__xtransname); \ + ErrorF(x+hack,a,b,c); \ + ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ + errno=saveerrno; \ +@@ -454,7 +454,7 @@ + int hack= 0, saveerrno=errno; \ + struct timeval tp;\ + gettimeofday(&tp,0); \ +- fprintf(stderr, __xtransname); fflush(stderr); \ ++ fprintf(stderr, "%s",__xtransname); fflush(stderr); \ + fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ + fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ + fflush(stderr); \ +@@ -466,14 +466,14 @@ + /* Use ErrorF() for the X server */ + #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ + int hack= 0, saveerrno=errno; \ +- ErrorF(__xtransname); \ ++ ErrorF("%s",__xtransname); \ + ErrorF(x+hack,a,b,c); \ + errno=saveerrno; \ + } else ((void)0) + #else + #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ + int hack= 0, saveerrno=errno; \ +- fprintf(stderr, __xtransname); fflush(stderr); \ ++ fprintf(stderr, "%s",__xtransname); fflush(stderr); \ + fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ + errno=saveerrno; \ + } else ((void)0) +--- a/nx-X11/programs/nxauth/process.c ++++ b/nx-X11/programs/nxauth/process.c +@@ -974,7 +974,7 @@ + char *hex; + + hex = bintohex(len, cp); +- fprintf(fp, hex); ++ fprintf(fp, "%s", hex); + free(hex); + } + +--- a/nx-X11/programs/Xserver/GL/glx/glximports.c ++++ b/nx-X11/programs/Xserver/GL/glx/glximports.c +@@ -110,12 +110,12 @@ + + void __glXImpWarning(__GLcontext *gc, char *msg) + { +- ErrorF((char *)msg); ++ ErrorF("%s",(char *)msg); + } + + void __glXImpFatal(__GLcontext *gc, char *msg) + { +- ErrorF((char *)msg); ++ ErrorF("%s",(char *)msg); + __glXAbort(); + } + +--- a/nx-X11/programs/Xserver/hw/nxagent/Error.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c +@@ -232,7 +232,7 @@ + + int nxagentExitHandler(const char *message) + { +- FatalError(message); ++ FatalError("%s", message); + + return 0; + } +--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c +@@ -481,7 +481,7 @@ + + nxagentStartRedirectToClientsLog(); + +- fprintf(stderr, buffer); ++ fprintf(stderr, "%s", buffer); + + nxagentEndRedirectToClientsLog(); + } +--- a/nx-X11/programs/Xserver/os/log.c ++++ b/nx-X11/programs/Xserver/os/log.c +@@ -692,9 +692,9 @@ + return; + sprintf(err, "%s: ", str); + strcat(err, strerror(saveErrno)); +- LogWrite(-1, err); ++ LogWrite(-1, "%s", err); + } else +- LogWrite(-1, strerror(saveErrno)); ++ LogWrite(-1, "%s", strerror(saveErrno)); + } + + void diff --git a/debian/patches/0057_nx-X11_sanitize-eventmasks.full.patch b/debian/patches/0057_nx-X11_sanitize-eventmasks.full.patch new file mode 100644 index 000000000..9c1171712 --- /dev/null +++ b/debian/patches/0057_nx-X11_sanitize-eventmasks.full.patch @@ -0,0 +1,70 @@ +Description: Create Windows and fix drawing issues on Big Endian 64bit systems +Author: Mihai Moldovan +Abstract: + Multiple endiannes issues were setting incorrect event masks when creating and + drawing X11 windows. + . + This time, a smaller integer has been casted to a bigger one and passed to some + function actually setting its value. + . + This meant, that garbage from stack was attached to the smaller integer value, + putting unknown memory into the lower bytes of the bigger integer. + . + Fix this by creating a big, initialized temporary variable, let the function do + its magic on that one and pass the value back to the smaller variable--and + cross your fingers the smaller variable can hold it without overrunning. (The + last bit is a design issue we can't really fix and has been around even before + this patch.) + +--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c +@@ -327,7 +327,10 @@ + + if (mask & CWEventMask) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + } + #ifdef WARNING + else +@@ -2891,7 +2894,10 @@ + + if (mask & CWEventMask) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + } + #ifdef WARNING + else +@@ -3352,7 +3358,10 @@ + + if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + + XChangeWindowAttributes(nxagentDisplay, nxagentWindow(pWin), mask, &attributes); + } +--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c +@@ -1665,7 +1665,10 @@ + + attributes.background_pixel = nxagentBlackPixel; + +- nxagentGetDefaultEventMask((Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetDefaultEventMask(&tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + + attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); + diff --git a/debian/patches/005_nxcomp_gcc43.full+lite.patch b/debian/patches/005_nxcomp_gcc43.full+lite.patch deleted file mode 100644 index bb758c2bd..000000000 --- a/debian/patches/005_nxcomp_gcc43.full+lite.patch +++ /dev/null @@ -1,77 +0,0 @@ -Description: gcc43 fix - Use builtin includes to build with gcc43. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: not-yet -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nxcomp/Message.cpp 2012-03-01 03:46:39.220943822 +0100 -+++ b/nxcomp/Message.cpp 2012-03-01 03:47:27.605712530 +0100 -@@ -15,9 +15,9 @@ - /* */ - /**************************************************************************/ - --#include -+#include - #include --#include -+#include - - #include - ---- a/nxcomp/Misc.cpp 2012-03-01 03:46:39.220943822 +0100 -+++ b/nxcomp/Misc.cpp 2012-03-01 03:47:27.605712530 +0100 -@@ -15,11 +15,11 @@ - /* */ - /**************************************************************************/ - --#include --#include --#include -+#include -+#include -+#include - #include --#include -+#include - - #include - #include ---- a/nxcomp/Misc.h 2012-03-01 03:46:39.220943822 +0100 -+++ b/nxcomp/Misc.h 2012-03-01 03:47:27.605712530 +0100 -@@ -21,8 +21,8 @@ - #include - #include - --#include --#include -+#include -+#include - - #ifdef __sun - ---- a/nxcomp/Proxy.cpp 2012-03-01 03:46:39.224943897 +0100 -+++ b/nxcomp/Proxy.cpp 2012-03-01 03:47:27.605712530 +0100 -@@ -15,9 +15,9 @@ - /* */ - /**************************************************************************/ - --#include -+#include - #include --#include -+#include - #include - #include - ---- a/nxcomp/Split.cpp 2012-03-01 03:46:39.224943897 +0100 -+++ b/nxcomp/Split.cpp 2012-03-01 03:47:27.605712530 +0100 -@@ -16,7 +16,7 @@ - /**************************************************************************/ - - #include --#include -+#include - #include - #include - #include diff --git a/debian/patches/006_nxcomp_libpng15.full+lite.patch b/debian/patches/006_nxcomp_libpng15.full+lite.patch deleted file mode 100644 index a75c59bac..000000000 --- a/debian/patches/006_nxcomp_libpng15.full+lite.patch +++ /dev/null @@ -1,43 +0,0 @@ -Description: Fix building against libpng 1.5. - From the libpng homepage... - - The libpng 1.5.x series continues the evolution of the libpng API, - finally hiding the contents of the venerable and hoary png_struct and - png_info data structures inside private (i.e., non-installed) header - files. Instead of direct struct-access, applications should be using - the various png_get_xxx() and png_set_xxx() accessor functions, which - have existed for almost as long as libpng itself. (Apps that compiled - against libpng 1.4 without warnings about deprecated features should - happily compile against 1.5, too. -Forwarded: pending... -Author: Fedora packagers of NX -Last-Update: 2012-02-06 ---- a/nxcomp/Pgn.cpp 2010-03-01 19:18:59.000000000 +0200 -+++ b/nxcomp/Pgn.cpp 2011-09-13 16:35:12.000000000 +0300 -@@ -414,7 +414,7 @@ - - png_read_info(pngPtr, infoPtr); - -- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) -+ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) - { - png_set_expand(pngPtr); - } -@@ -565,7 +565,7 @@ - - png_read_info( pngPtr, infoPtr ) ; - -- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) -+ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) - { - png_set_expand(pngPtr); - } -@@ -709,7 +709,7 @@ - png_read_info(pngPtr, infoPtr) ; - - -- if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) -+ if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) - { - png_set_expand(pngPtr); - } diff --git a/debian/patches/007_nxcompshad_clean-gch-files.full.patch b/debian/patches/007_nxcompshad_clean-gch-files.full.patch deleted file mode 100644 index 897e27890..000000000 --- a/debian/patches/007_nxcompshad_clean-gch-files.full.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: Remove .gch files during cleanup. - When building nxcompshad .gch files get created. On - cleanup these should be removed. -Forwarded: pending... -Author: Mike Gabriel -Last-Update: 2012-12-31 ---- a/nxcompshad/Makefile.in -+++ b/nxcompshad/Makefile.in -@@ -185,7 +185,7 @@ - install.man: - - clean: -- -rm -f *~ *.o *.bak st?????? core core.* *.out.* *.exe.stackdump \ -+ -rm -f *~ *.o *.gch *.bak st?????? core core.* *.out.* *.exe.stackdump \ - $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe - - distclean: clean diff --git a/debian/patches/008_nxcomp_sa-restorer.full+lite.patch b/debian/patches/008_nxcomp_sa-restorer.full+lite.patch deleted file mode 100644 index f1447ccb0..000000000 --- a/debian/patches/008_nxcomp_sa-restorer.full+lite.patch +++ /dev/null @@ -1,46 +0,0 @@ -Description: sa_restorer vs. memset - Use memset instead of setting sa_restorer to NULL. -Forwarded: pending -Author: Alexander Morozov -Last-Update: 2012-02-07 ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -5884,20 +5884,9 @@ - - struct sigaction newAction; - -- newAction.sa_handler = HandleSignal; -- -- // -- // This field doesn't exist on most OSes except -- // Linux. We keep setting the field to NULL to -- // avoid side-effects in the case the field is -- // a value return. -- // -+ memset(&newAction, 0, sizeof(newAction)); - -- #if defined(__linux__) -- -- newAction.sa_restorer = NULL; -- -- #endif -+ newAction.sa_handler = HandleSignal; - - sigemptyset(&(newAction.sa_mask)); - -@@ -6509,13 +6498,9 @@ - - struct sigaction action; - -- action.sa_handler = HandleTimer; -- -- #if defined(__linux__) -+ memset(&action, 0, sizeof(action)); - -- action.sa_restorer = NULL; -- -- #endif -+ action.sa_handler = HandleTimer; - - sigemptyset(&action.sa_mask); - diff --git a/debian/patches/009_nxagent_add-man-page.full.patch b/debian/patches/009_nxagent_add-man-page.full.patch deleted file mode 100644 index cec8c7527..000000000 --- a/debian/patches/009_nxagent_add-man-page.full.patch +++ /dev/null @@ -1,43 +0,0 @@ -Description: man page for nxagent -Author: Mike Gabriel - ---- /dev/null -+++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 -@@ -0,0 +1,37 @@ -+.TH NXAGENT 1 -+.SH NAME -+nxagent \- NoMachine's NX Agent. -+.SH SYNOPSIS -+.B nxagent -+.I "[options]" -+ -+.SH DESCRIPTION -+\fBnxagent\fR is an Xnest-like X server for remote application/desktop access. -+.PP -+\fBnxagent\fR implements a very efficient compression of the X11 protocol. -+.PP -+This increases performance when using X applications over high latency and -+low bandwidth networks, while providing a local (LAN-like) usage experience -+even if connecting from off-site locations (via cable modem or GSM). -+.PP -+\fBnxagent\fR is not designed to be used as a standalone application. -+It has to be launched on the server side by remote desktop frameworks like FreeNX. -+.PP -+Available clients are -+NoMachine's \fBnxclient\fR or the community projects \fBqtnx\fR and \fBremmina\fR -+(with NX plugin). -+ -+.SH OPTIONS -+.TP -+.B \--help -+Lists all others options that are not listed here. -+ -+.SH FURTHER READINGS -+Information on NX: http://www.nomachine.com -+.PP -+Information on FreeNX: http://freenx.berlios.de -+ -+.SH AUTHOR -+This manual page was written by Per Hansen , -+and modified by Marcelo Boveto Shima and -+Mike Gabriel . diff --git a/debian/patches/009_nxproxy_add-man-page.full+lite.patch b/debian/patches/009_nxproxy_add-man-page.full+lite.patch deleted file mode 100644 index b60e218ee..000000000 --- a/debian/patches/009_nxproxy_add-man-page.full+lite.patch +++ /dev/null @@ -1,33 +0,0 @@ -Description: man page for nxproxy -Author: Mike Gabriel - ---- /dev/null -+++ b/nxproxy/man/nxproxy.1 -@@ -0,0 +1,27 @@ -+'\" -*- coding: utf-8 -*- -+.if \n(.g .ds T< \\FC -+.if \n(.g .ds T> \\F[\n[.fam]] -+.de URL -+\\$2 \(la\\$1\(ra\\$3 -+.. -+.if \n(.g .mso www.tmac -+.TH nxproxy 1 "Nov 2011" "Version 3.5.0" "NX Proxy" -+.SH NAME -+nxproxy \- NX Proxy Tool -+.SH SYNOPSIS -+'nh -+.fi -+.ad l -+\fBnxproxy\fR -+ -+.SH DESCRIPTION -+\fBnxproxy\fR is a tool that allows one to tunnel X sessions through -+the NX compression libraries. \fBnxproxy\fR is a backend application -+utilized by the X2GoClient GUI and some other NX/X2Go clients. -+.PP -+.SH OPTIONS -+For an insight in \fBnxproxy\fR options use \fBnxproxy \-\-help\fR on the command line. -+.PP -+.SH AUTHOR -+This manual has been written by Mike Gabriel for the X2Go project -+(http://www.x2go.org). diff --git a/debian/patches/0101_nxagent_set-rgb-path.full.patch b/debian/patches/0101_nxagent_set-rgb-path.full.patch new file mode 100644 index 000000000..9d20bee24 --- /dev/null +++ b/debian/patches/0101_nxagent_set-rgb-path.full.patch @@ -0,0 +1,19 @@ +Description: FHS path fix for rgb file + This patch is needed on Debian only, not reporting this path + addition to upstream. + . + Originally contributed by Marcelo Boveto Shima . +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2012-01-12 +--- a/nx-X11/programs/Xserver/os/oscolor.c ++++ b/nx-X11/programs/Xserver/os/oscolor.c +@@ -53,7 +53,7 @@ + #include + #include + +-static char* nxAltRgbPaths[] = {"/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; ++static char* nxAltRgbPaths[] = {"/etc/nxagent/rgb", "/usr/share/nx/rgb", "/usr/local/share/nx/rgb", "/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; + static char _NXRgbPath[1024]; + + #endif diff --git a/debian/patches/0102_xserver-xext_set-securitypolicy-path.debian.patch b/debian/patches/0102_xserver-xext_set-securitypolicy-path.debian.patch new file mode 100644 index 000000000..0d11f2f0a --- /dev/null +++ b/debian/patches/0102_xserver-xext_set-securitypolicy-path.debian.patch @@ -0,0 +1,19 @@ +Description: FHS path fix for SecurityPolicy file + This patch is needed on Debian only, not reporting this path + change to upstream. + . + Originally contributed by Marcelo Boveto Shima . +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2012-01-12 +--- a/nx-X11/programs/Xserver/Xext/security.c ++++ b/nx-X11/programs/Xserver/Xext/security.c +@@ -86,7 +86,7 @@ + + #ifdef NXAGENT_SERVER + +-#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" ++#define NX_ALTERNATIVEPOLICYFILE "/usr/share/nx/SecurityPolicy" + + #endif + diff --git a/debian/patches/0102_xserver-xext_set-securitypolicy-path.full.patch b/debian/patches/0102_xserver-xext_set-securitypolicy-path.full.patch new file mode 100644 index 000000000..9d27a372f --- /dev/null +++ b/debian/patches/0102_xserver-xext_set-securitypolicy-path.full.patch @@ -0,0 +1,19 @@ +Description: FHS path fix for SecurityPolicy file + This patch is needed for Tarball installation mode of NX (redistributed) + only, not reporting this path change to upstream. + . + Originally contributed by Marcelo Boveto Shima . +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2012-01-12 +--- a/nx-X11/programs/Xserver/Xext/security.c ++++ b/nx-X11/programs/Xserver/Xext/security.c +@@ -86,7 +86,7 @@ + + #ifdef NXAGENT_SERVER + +-#define NX_ALTERNATIVEPOLICYFILE "/usr/lib/xserver/SecurityPolicy" ++#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" + + #endif + diff --git a/debian/patches/0103_nxagent_set-X0-config-path.full.patch b/debian/patches/0103_nxagent_set-X0-config-path.full.patch new file mode 100644 index 000000000..eb705ca81 --- /dev/null +++ b/debian/patches/0103_nxagent_set-X0-config-path.full.patch @@ -0,0 +1,40 @@ +Description: FHS path fix for keyboard config file + This patch is needed for Tarball installation and on Distros like + Debian, not reporting this path addition to upstream. + . + Originally contributed by FreeNX Team. +Forwarded: not-needed +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +@@ -136,7 +136,7 @@ + #define XKB_ALTERNATE_BASE_DIRECTORY "/usr/X11R6/lib/X11/xkb" + #endif + #ifndef XKB_CONFIG_FILE +-#define XKB_CONFIG_FILE "X0-config.keyboard" ++#define XKB_CONFIG_FILE "/etc/nxagent/nxagent.keyboard" + #endif + #ifndef XKB_DFLT_RULES_FILE + #define XKB_DFLT_RULES_FILE "xfree86" +@@ -985,8 +985,7 @@ + + XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); + +- nxagentXkbConfigFilePathSize = strlen(XkbBaseDirectory) + +- strlen(XKB_CONFIG_FILE) + 1; ++ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE); + + nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char)); + +@@ -995,9 +994,7 @@ + FatalError("nxagentKeyboardProc: malloc failed."); + } + +- strcpy(nxagentXkbConfigFilePath, XkbBaseDirectory); +- strcat(nxagentXkbConfigFilePath, "/"); +- strcat(nxagentXkbConfigFilePath, XKB_CONFIG_FILE); ++ strcpy(nxagentXkbConfigFilePath, XKB_CONFIG_FILE); + + #ifdef TEST + fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n", diff --git a/debian/patches/0105_nxagent_export-remote-keyboard-config.full.patch b/debian/patches/0105_nxagent_export-remote-keyboard-config.full.patch new file mode 100644 index 000000000..389feaf92 --- /dev/null +++ b/debian/patches/0105_nxagent_export-remote-keyboard-config.full.patch @@ -0,0 +1,96 @@ +Description: Export remote keyboard configuration to session directory + Let nxagent write the keyboard configuration to /keyboard + and make it available within the NX session. + . + Originally contributed by Marcelo Boveto Shima . +Forwarded: pending... +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/hw/nxagent/Error.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c +@@ -497,7 +497,7 @@ + return rootPath; + } + +-char *nxagentGetSessionPath() ++char *nxagentGetSessionPath(void) + { + + char *rootPath; +--- a/nx-X11/programs/Xserver/hw/nxagent/Error.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h +@@ -34,4 +34,6 @@ + + void nxagentEndRedirectToClientsLog(void); + ++char *nxagentGetSessionPath(void); ++ + #endif /* __Error_H__ */ +--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +@@ -52,6 +52,7 @@ + #include "Keyboard.h" + #include "Events.h" + #include "Options.h" ++#include "Error.h" + + #include "NXlib.h" + +@@ -72,6 +73,8 @@ + + #include "Xatom.h" + ++#include ++ + static int nxagentXkbGetNames(char **rules, char **model, char **layout, + char **variant, char **options); + +@@ -1790,6 +1793,48 @@ + } + #endif + ++ if (drulesLen != 0) ++ { ++ char *sessionpath = nxagentGetSessionPath(); ++ if (sessionpath != NULL){ ++ int keyboard_file_path_size = strlen(sessionpath) + strlen("/keyboard"); ++ char *keyboard_file_path = malloc((keyboard_file_path_size + 1) * sizeof(char)); ++ FILE *keyboard_file; ++ if ( keyboard_file_path == NULL) ++ { ++ FatalError("nxagentKeyboardProc: malloc failed."); ++ } ++ strcpy(keyboard_file_path, sessionpath); ++ strcat(keyboard_file_path, "/keyboard"); ++ if ((keyboard_file = fopen(keyboard_file_path, "w")) != NULL) { ++ if ( drules != NULL ) ++ fprintf(keyboard_file, "rules=%s\n", drules); ++ if ( dmodel != NULL ) ++ fprintf(keyboard_file, "model=%s\n", dmodel); ++ if ( dlayout != NULL ) ++ fprintf(keyboard_file, "layout=%s\n", dlayout); ++ if ( dvariant != NULL ) ++ fprintf(keyboard_file, "variant=%s\n", dvariant); ++ if ( doptions != NULL ) ++ fprintf(keyboard_file, "options=%s\n", doptions); ++ fclose(keyboard_file); ++ fprintf(stderr, "keyboard file created\n"); ++ } ++ else { ++ int save_err = errno; ++ fprintf(stderr, "keyboard file not created: %s\n", strerror(save_err)); ++ } ++ free(keyboard_file_path); ++ } ++ else { ++ fprintf(stderr, "SessionPath not defined\n"); ++ } ++ } ++ else ++ { ++ fprintf(stderr, "Failed to create the keyboard file\n"); ++ } ++ + if (nxagentOption(ClientOs) == ClientOsLinux && + drules != NULL && dmodel != NULL && + (strcmp(drules, "evdev") == 0 || diff --git a/debian/patches/0106_nxagent_utf8-copy-clipboard.full.patch b/debian/patches/0106_nxagent_utf8-copy-clipboard.full.patch new file mode 100644 index 000000000..9c0a047d6 --- /dev/null +++ b/debian/patches/0106_nxagent_utf8-copy-clipboard.full.patch @@ -0,0 +1,52 @@ +Description: UTF-8 Clipboard copying + Enable UTF-8 clipboard copies. + . + Originally contributed by FreeNX Team (dimbor). +Forwarded: not-yet +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +@@ -166,7 +166,9 @@ + + if (target == XA_STRING) return True; + if (target == serverTEXT) return True; +- ++ /* by dimbor */ ++ if (target == serverUTF8_STRING) return True; ++ + return False; + } + +@@ -402,7 +404,12 @@ + lastServerProperty = X->xselectionrequest.property; + lastServerRequestor = X->xselectionrequest.requestor; + lastServerTarget = X->xselectionrequest.target; +- lastServerTime = X->xselectionrequest.time; ++ ++ /* by dimbor */ ++ if (lastServerTarget != XA_STRING) ++ lastServerTarget = serverUTF8_STRING; ++ ++ lastServerTime = X->xselectionrequest.time; + + x.u.u.type = SelectionRequest; + x.u.selectionRequest.time = GetTimeInMillis(); +@@ -424,11 +431,12 @@ + + x.u.selectionRequest.selection = CurrentSelections[i].selection; + +- /* +- * x.u.selectionRequest.target = X->xselectionrequest.target; +- */ +- +- x.u.selectionRequest.target = XA_STRING; ++ /* by dimbor (idea from zahvatov) */ ++ if (X->xselectionrequest.target != XA_STRING) ++ x.u.selectionRequest.target = clientUTF8_STRING; ++ else ++ x.u.selectionRequest.target = XA_STRING; ++ + x.u.selectionRequest.property = clientCutProperty; + + (void) TryClientEvents(lastSelectionOwner[i].client, &x, 1, diff --git a/debian/patches/0107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch b/debian/patches/0107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch new file mode 100644 index 000000000..129cb707e --- /dev/null +++ b/debian/patches/0107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch @@ -0,0 +1,47 @@ +Description: Prevent sending COMPOUND_TEXT + Do not send COMPOUND_TEXT to client. + . + Originally contributed by FreeNX Team (dimbor). +Forwarded: not-yet +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +@@ -1226,10 +1226,11 @@ + Atom xa_STRING[4]; + xEvent x; + ++ /* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */ + xa_STRING[0] = XA_STRING; +- xa_STRING[1] = clientTEXT; +- xa_STRING[2] = clientCOMPOUND_TEXT; +- xa_STRING[3] = clientUTF8_STRING; ++ xa_STRING[1] = clientUTF8_STRING; ++ xa_STRING[2] = clientTEXT; ++ xa_STRING[3] = clientCOMPOUND_TEXT; + + ChangeWindowProperty(pWin, + property, +--- a/nx-X11/programs/Xserver/hw/nxagent/Image.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c +@@ -644,6 +644,10 @@ + pDrawable -> depth != 1 && + nxagentOption(DeferLevel) >= 1) + { ++ /* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/ ++ if (dstHeight > 16) ++ { ++ /* -------------------------------------------------------------------------------- */ + #ifdef TEST + fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] " + "for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1, +@@ -654,6 +658,9 @@ + nxagentMarkCorruptedRegion(pDrawable, pRegion); + + goto nxagentPutImageEnd; ++ /* --- changed by dimbor ---*/ ++ } ++ /* ------------------------- */ + } + + if (pDrawable -> type == DRAWABLE_WINDOW && diff --git a/debian/patches/0108_nxagent_wine-close-delay.full.patch b/debian/patches/0108_nxagent_wine-close-delay.full.patch new file mode 100644 index 000000000..7a9c18cf2 --- /dev/null +++ b/debian/patches/0108_nxagent_wine-close-delay.full.patch @@ -0,0 +1,60 @@ +Description: Wine Close Delay + Wine close delay. + . + Originally contributed by FreeNX Team (dimbor). +Forwarded: not-yet +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c +@@ -176,6 +176,14 @@ + + static int nxagentForceExposure(WindowPtr pWin, pointer ptr); + ++/* by dimbor */ ++typedef struct ++{ ++ CARD32 state; ++ Window icon; ++} ++nxagentWMStateRec; ++ + /* + * This is currently unused. + */ +@@ -1861,6 +1869,17 @@ + nxagentAddConfiguredWindow(pWin, CWStackingOrder); + nxagentAddConfiguredWindow(pWin, CW_Shape); + ++ /* add by dimbor */ ++ if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) ++ { ++ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True); ++ nxagentWMStateRec wmState; ++ wmState.state = 1; /* NormalState */ ++ wmState.icon = None; ++ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success) ++ fprintf(stderr, "nxagentRealizeWindow: Additing WM_STATE fail.\n"); ++ } ++ + #ifdef SHAPE + + /* +@@ -1907,6 +1926,17 @@ + return True; + } + ++ /* add by dimbor */ ++ if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) ++ { ++ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True); ++ nxagentWMStateRec wmState; ++ wmState.state = 3; /* WithdrawnState */ ++ wmState.icon = None; ++ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success) ++ fprintf(stderr, "nxagentUnRealizeWindow: Changing WM_STATE failed.\n"); ++ } ++ + XUnmapWindow(nxagentDisplay, nxagentWindow(pWin)); + + return True; diff --git a/debian/patches/010_nxauth_fix-binary-name-in-man-page.full.patch b/debian/patches/010_nxauth_fix-binary-name-in-man-page.full.patch deleted file mode 100644 index c8f76b51a..000000000 --- a/debian/patches/010_nxauth_fix-binary-name-in-man-page.full.patch +++ /dev/null @@ -1,119 +0,0 @@ -Description: Fix binary name in man page for nxauth. - The NX auth man page in upstream still uses xauth as - binary name. -Author: Mike Gabriel -Last-Update: 2012-12-31 ---- a/nx-X11/programs/nxauth/nxauth.man -+++ b/nx-X11/programs/nxauth/nxauth.man -@@ -27,51 +27,51 @@ - .\" - .TH XAUTH 1 __xorgversion__ - .SH NAME --xauth \- X authority file utility -+nxauth \- NoMachine X authority file utility - .SH SYNOPSIS --.B xauth -+.B nxauth - [ \fB\-f\fP \fIauthfile\fP ] [ \fB\-vqib\fP ] [ \fIcommand arg ...\fP ] - .SH DESCRIPTION - .PP --The \fIxauth\fP program is used to edit and display the authorization -+The \fInxauth\fP program is used to edit and display the authorization - information used in connecting to the X server. This program is usually - used to extract authorization records from one machine and merge them in on - another (as is the case when using remote logins or granting access to - other users). Commands (described below) may be entered interactively, --on the \fIxauth\fP command line, or in scripts. Note that this program -+on the \fInxauth\fP command line, or in scripts. Note that this program - does \fBnot\fP contact the X server except when the generate command is used. --Normally \fIxauth\fP is not used to create the authority file entry in -+Normally \fInxauth\fP is not used to create the authority file entry in - the first place; \fIxdm\fP does that. - .SH OPTIONS --The following options may be used with \fIxauth\fP. They may be given -+The following options may be used with \fInxauth\fP. They may be given - individually (e.g., \fI\-q \-i\|\fP) or may combined (e.g., \fI\-qi\|\fP). - .TP 8 - .B "\-f \fIauthfile\fP" - This option specifies the name of the authority file to use. By default, --\fIxauth\fP will use the file specified by the XAUTHORITY environment variable -+\fInxauth\fP will use the file specified by the nxauthORITY environment variable - or \fI\.Xauthority\fP in the user's home directory. - .TP 8 - .B \-q --This option indicates that \fIxauth\fP should operate quietly and not print --unsolicited status messages. This is the default if an \fIxauth\fP command is -+This option indicates that \fInxauth\fP should operate quietly and not print -+unsolicited status messages. This is the default if an \fInxauth\fP command is - is given on the command line or if the standard output is not directed to a - terminal. - .TP 8 - .B \-v --This option indicates that \fIxauth\fP should operate verbosely and print -+This option indicates that \fInxauth\fP should operate verbosely and print - status messages indicating the results of various operations (e.g., how many --records have been read in or written out). This is the default if \fIxauth\fP -+records have been read in or written out). This is the default if \fInxauth\fP - is reading commands from its standard input and its standard output is - directed to a terminal. - .TP 8 - .B \-i --This option indicates that \fIxauth\fP should ignore any authority file --locks. Normally, \fIxauth\fP will refuse to read or edit any authority files -+This option indicates that \fInxauth\fP should ignore any authority file -+locks. Normally, \fInxauth\fP will refuse to read or edit any authority files - that have been locked by other programs (usually \fIxdm\fP or another --\fIxauth\fP). -+\fInxauth\fP). - .TP 8 - .B \-b --This option indicates that \fIxauth\fP should attempt to break any authority -+This option indicates that \fInxauth\fP should attempt to break any authority - file locks before proceeding. Use this option only to clean up stale locks. - .SH COMMANDS - The following commands may be used to manipulate authority files: -@@ -157,14 +157,14 @@ - authority file. - .TP 8 - .B "source \fIfilename" --The specified file is treated as a script containing \fIxauth\fP commands -+The specified file is treated as a script containing \fInxauth\fP commands - to execute. Blank lines and lines beginning with a sharp sign (#) are - ignored. A single dash may be used to indicate the standard input, if it - hasn't already been read. - .TP 8 - .B "info" - Information describing the authorization file, whether or not any changes --have been made, and from where \fIxauth\fP commands are being read -+have been made, and from where \fInxauth\fP commands are being read - is printed on the standard output. - .TP 8 - .B "exit" -@@ -194,12 +194,12 @@ - local entries for different machines may be stored in one authority file. - .SH EXAMPLE - .PP --The most common use for \fIxauth\fP is to extract the entry for the -+The most common use for \fInxauth\fP is to extract the entry for the - current display, copy it to another machine, and merge it into the - user's authority file on the remote machine: - .sp - .nf -- % xauth extract \- $DISPLAY | rsh otherhost xauth merge \- -+ % nxauth extract \- $DISPLAY | rsh otherhost nxauth merge \- - .fi - .PP - .sp -@@ -207,10 +207,10 @@ - authorization using the MIT-MAGIC-COOKIE-1 protocol. Clients that - connect with this authorization will be untrusted. - .nf -- % xauth generate :0 . -+ % nxauth generate :0 . - .fi - .SH ENVIRONMENT --This \fIxauth\fP program uses the following environment variables: -+This \fInxauth\fP program uses the following environment variables: - .TP 8 - .B XAUTHORITY - to get the name of the authority file to use if the \fI\-f\fP option isn't diff --git a/debian/patches/0110_nxagent_createpixmap-bounds-check.full.patch b/debian/patches/0110_nxagent_createpixmap-bounds-check.full.patch new file mode 100644 index 000000000..d65862bdc --- /dev/null +++ b/debian/patches/0110_nxagent_createpixmap-bounds-check.full.patch @@ -0,0 +1,44 @@ +Description: Avoid large pixmaps + It is allowed to try and allocate a pixmap which is larger than + 32767 in either dimension. However, all of the framebuffer code + is buggy and does not reliably draw to such big pixmaps, basically + because the Region data structure operates with signed shorts + for the rectangles in it. + . + Furthermore, several places in the X server computes the + size in bytes of the pixmap and tries to store it in an + integer. This integer can overflow and cause the allocated size + to be much smaller. + . + So, such big pixmaps are rejected here with a BadAlloc + . + Originally contributed by FreeNX Team +Forwarded: pending... +Author: Mike Gabriel +Last-Update: 2011-12-31 +--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +@@ -1973,6 +1973,23 @@ + client->errorValue = 0; + return BadValue; + } ++ if (stuff->width > 32767 || stuff->height > 32767) ++ { ++ /* It is allowed to try and allocate a pixmap which is larger than ++ * 32767 in either dimension. However, all of the framebuffer code ++ * is buggy and does not reliably draw to such big pixmaps, basically ++ * because the Region data structure operates with signed shorts ++ * for the rectangles in it. ++ * ++ * Furthermore, several places in the X server computes the ++ * size in bytes of the pixmap and tries to store it in an ++ * integer. This integer can overflow and cause the allocated size ++ * to be much smaller. ++ * ++ * So, such big pixmaps are rejected here with a BadAlloc ++ */ ++ return BadAlloc; ++ } + if (stuff->depth != 1) + { + pDepth = pDraw->pScreen->allowedDepths; diff --git a/debian/patches/012_nxcomp_makefile-uninstall+autoconf.full+lite.patch b/debian/patches/012_nxcomp_makefile-uninstall+autoconf.full+lite.patch deleted file mode 100644 index af778fefc..000000000 --- a/debian/patches/012_nxcomp_makefile-uninstall+autoconf.full+lite.patch +++ /dev/null @@ -1,74 +0,0 @@ -Description: Add install and uninstall stanzas to nxcomp/Makefile, honor ac dirs - Provide install and uninstall functionality in nxcomp/Makefile. - . - Honor autoconf's libdir (and includedir, while at it). This is a - must-have for multiarch platforms like x86_64 et al where multiple - forms of libraries can be installed at the same time. -Forwarded: pending... -Author: Mike Gabriel -Author: Jan Engelhardt -Last-Update: 2012-02-14 ---- a/nxcomp/Makefile.in -+++ b/nxcomp/Makefile.in -@@ -64,10 +64,15 @@ - bindir = @bindir@ - man1dir = @mandir@/man1 - VPATH = @srcdir@ -+libdir = @libdir@ -+includedir = @includedir@ - - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ - INSTALL_DATA = @INSTALL_DATA@ -+INSTALL_LINK = cp -av -+DESTDIR = -+RM_FILE = rm -f - - # - # This should be autodetected. -@@ -264,12 +269,44 @@ - fi - touch depend.status - --install: install.bin install.man -+install: install.bin install.lib install.man - - install.bin: - -+install.lib: all -+ ./mkinstalldirs $(DESTDIR)${libdir} -+ ./mkinstalldirs $(DESTDIR)${includedir}/nx -+ $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} -+ $(INSTALL_LINK) libXcomp.so.3 $(DESTDIR)${libdir} -+ $(INSTALL_LINK) libXcomp.so $(DESTDIR)${libdir} -+ $(INSTALL_DATA) libXcomp.a $(DESTDIR)${libdir} -+ $(INSTALL_DATA) NX*.h $(DESTDIR)${includedir}/nx -+ $(INSTALL_DATA) MD5.h $(DESTDIR)${includedir}/nx -+ echo "Running ldconfig tool, this may take a while..." && ldconfig || true -+ - install.man: - -+uninstall: uninstall.bin uninstall.lib uninstall.man -+ -+uninstall.bin: -+ -+uninstall.lib: -+ $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcomp.so.3 -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcomp.so -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcomp.a -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXalert.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NX.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXmitshm.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXpack.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXproto.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXrender.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXvars.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/MD5.h -+ echo "Running ldconfig tool, this may take a while..." && ldconfig || true -+ -+uninstall.man: -+ - clean: - -rm -f *~ *.o *.bak *.orig *.rej st?????? core core.* *.out.* \ - @ALL@ diff --git a/debian/patches/013_nxcompext_makefile-uninstall+autoconf.full.patch b/debian/patches/013_nxcompext_makefile-uninstall+autoconf.full.patch deleted file mode 100644 index 300c0a39e..000000000 --- a/debian/patches/013_nxcompext_makefile-uninstall+autoconf.full.patch +++ /dev/null @@ -1,66 +0,0 @@ -Description: Add install and uninstall stanzas to nxcompext/Makefile, honor autoconf dirs. - Provide install and uninstall functionality in nxcompext/Makefile. - . - Honor autoconf's libdir (and includedir, while at it). This is a - must-have for multiarch platforms like x86_64 et al where multiple - forms of libraries can be installed at the same time. -Forwarded: pending... -Author: Mike Gabriel -Author: Jan Engelhardt -Last-Update: 2012-02-14 ---- a/nxcompext/Makefile.in -+++ b/nxcompext/Makefile.in -@@ -56,11 +56,15 @@ - bindir = @bindir@ - man1dir = @mandir@/man1 - VPATH = @srcdir@ -+libdir = @libdir@ -+includedir = @includedir@ - - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ - INSTALL_DATA = @INSTALL_DATA@ -- -+INSTALL_LINK = cp -av -+DESTDIR = -+RM_FILE = rm -f - # - # This should be autodetected. - # -@@ -147,12 +151,35 @@ - fi - touch depend.status - --install: install.bin install.man -+install: install.bin install.lib install.man - - install.bin: - -+install.lib: all -+ ./mkinstalldirs $(DESTDIR)${libdir} -+ ./mkinstalldirs $(DESTDIR)${includedir}/nx -+ $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} -+ $(INSTALL_LINK) libXcompext.so.3 $(DESTDIR)${libdir} -+ $(INSTALL_LINK) libXcompext.so $(DESTDIR)${libdir} -+ $(INSTALL_DATA) NX*.h $(DESTDIR)${includedir}/nx -+ echo "Running ldconfig tool, this may take a while..." && ldconfig || true -+ - install.man: - -+uninstall: uninstall.bin uninstall.lib uninstall.man -+ -+uninstall.bin: -+ -+uninstall.lib: -+ $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcompext.so.3 -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcompext.so -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXlib.h -+ $(RM_FILE) $(DESTDIR)${includedir}/nx/NXlibint.h -+ echo "Running ldconfig tool, this may take a while..." && ldconfig || true -+ -+uninstall.man: -+ - clean: - -rm -f *~ *.o *.bak *.orig *.rej st?????? core core.* *.out.* \ - @ALL@ diff --git a/debian/patches/014_nxcompshad_makefile-uninstall+autoconf.full.patch b/debian/patches/014_nxcompshad_makefile-uninstall+autoconf.full.patch deleted file mode 100644 index 921eccc4f..000000000 --- a/debian/patches/014_nxcompshad_makefile-uninstall+autoconf.full.patch +++ /dev/null @@ -1,70 +0,0 @@ -Description: Add install and uninstall stanzas to nxcompshad/Makefile, honor autoconf dirs - Provide install and uninstall functionality in nxcompshad/Makefile. - . - Honor autoconf's libdir (and includedir, while at it). This is a - must-have for multiarch platforms like x86_64 et al where multiple - forms of libraries can be installed at the same time. -Forwarded: pending... -Author: Mike Gabriel -Author: Jan Engelhardt -Last-Update: 2012-02-14 ---- a/nxcompshad/Makefile.in -+++ b/nxcompshad/Makefile.in -@@ -74,10 +74,17 @@ - bindir = @bindir@ - man1dir = @mandir@/man1 - VPATH = @srcdir@ -+libdir = @libdir@ -+includedir = @includedir@ - - INSTALL = @INSTALL@ -+INSTALL_DIR = $(INSTALL) -d -o root -g root -m 0755 - INSTALL_PROGRAM = @INSTALL_PROGRAM@ - INSTALL_DATA = @INSTALL_DATA@ -+INSTALL_LINK = cp -av -+DESTDIR = -+RM_FILE = rm -f -+RM_DIR = rmdir -p --ignore-fail-on-non-empty - - # - # This should be autodetected. -@@ -178,12 +185,38 @@ - fi - touch depend.status - --install: install.bin install.man -+install: install.bin install.lib install.man - - install.bin: - -+install.lib: all -+ $(INSTALL_DIR) $(DESTDIR)${libdir} -+ $(INSTALL_DIR) $(DESTDIR)${includedir}/nx -+ $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} -+ $(INSTALL_LINK) libXcompshad.so.3 $(DESTDIR)${libdir} -+ $(INSTALL_LINK) libXcompshad.so $(DESTDIR)${libdir} -+ $(INSTALL_DATA) *.a $(DESTDIR)${libdir} -+ $(INSTALL_DATA) *.h $(DESTDIR)${includedir}/nx -+ echo "Running ldconfig tool, this may take a while..." && ldconfig || true -+ - install.man: - -+uninstall: uninstall.bin uninstall.lib uninstall.man -+ -+uninstall.bin: -+ -+uninstall.lib: -+ $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.so.3 -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.so -+ $(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.a -+ for header in *.h; do $(RM_FILE) $(DESTDIR)${includedir}/nx/$$header; done -+ $(RM_DIR) $(DESTDIR)${libdir}/nx/ -+ $(RM_DIR) $(DESTDIR)${includedir}/nx/ -+ echo "Running ldconfig tool, this may take a while..." && ldconfig || true -+ -+uninstall.man: -+ - clean: - -rm -f *~ *.o *.gch *.bak st?????? core core.* *.out.* *.exe.stackdump \ - $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe diff --git a/debian/patches/015_nxproxy_makefile-uninstall.full+lite.patch b/debian/patches/015_nxproxy_makefile-uninstall.full+lite.patch deleted file mode 100644 index 554c86aa4..000000000 --- a/debian/patches/015_nxproxy_makefile-uninstall.full+lite.patch +++ /dev/null @@ -1,40 +0,0 @@ -Description: Add install and uninstall stanzas to nxcomp/Makefile - Provide install and uninstall functionality in nxcomp/Makefile. -Forwarded: pending... -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nxproxy/Makefile.in -+++ b/nxproxy/Makefile.in -@@ -41,6 +41,8 @@ - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ - INSTALL_DATA = @INSTALL_DATA@ -+DESTDIR = -+RM_FILE = rm -f - - # - # This should be autodetected. -@@ -87,11 +89,20 @@ - install: install.bin install.man - - install.bin: $(PROGRAM) -- $(srcdir)/mkinstalldirs $(bindir) -- $(INSTALL) $(PROGRAM) $(bindir)/$(PROGRAM) -+ $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) -+ $(INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) - - install.man: -- $(srcdir)/mkinstalldirs $(man1dir) -+ $(srcdir)/mkinstalldirs $(DESTDIR)$(man1dir) -+ $(INSTALL_DATA) man/$(PROGRAM).1 $(DESTDIR)$(man1dir)/$(PROGRAM).1 -+ -+uninstall: uninstall.bin uninstall.man -+ -+uninstall.bin: -+ $(RM_FILE) $(DESTDIR)$(bindir)/$(PROGRAM) -+ -+uninstall.man: -+ $(RM_FILE) $(DESTDIR)$(man1dir)/nxproxy.1 - - clean: - -rm -f *~ *.o *.bak st?????? core core.* *.out.* \ diff --git a/debian/patches/016_nx-X11_install-location.debian.patch b/debian/patches/016_nx-X11_install-location.debian.patch deleted file mode 100644 index 94e2cb075..000000000 --- a/debian/patches/016_nx-X11_install-location.debian.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: FHS adaptation for Debian packaging - On Debian, NX libraries and binaries are installed to - /usr/lib/nx. -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-12-31 ---- a/nx-X11/config/cf/Imake.tmpl -+++ b/nx-X11/config/cf/Imake.tmpl -@@ -829,7 +829,7 @@ - #define AlternateUsrLibDir YES - #endif - #else --#define UsrLibDir Concat4(/usr/local,/,LibDirName,/nx) -+#define UsrLibDir Concat4(/usr,/,LibDirName,/nx) - #ifndef AlternateUsrLibDir - #define AlternateUsrLibDir NO - #endif diff --git a/debian/patches/016_nx-X11_install-location.full.patch b/debian/patches/016_nx-X11_install-location.full.patch deleted file mode 100644 index 6571aea9e..000000000 --- a/debian/patches/016_nx-X11_install-location.full.patch +++ /dev/null @@ -1,154 +0,0 @@ -Description: FHS adaptation for Debian packaging - From tarball, NX libraries and binaries are installed to - /usr/local/lib/nx. -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-12-31 ---- a/nx-X11/config/cf/Imake.tmpl -+++ b/nx-X11/config/cf/Imake.tmpl -@@ -820,12 +820,12 @@ - - #ifndef UsrLibDir - #ifdef ProjectRoot --#define UsrLibDir Concat3(ProjectRoot,/,LibDirName) -+#define UsrLibDir Concat4(ProjectRoot,/,LibDirName,/nx) - #ifndef AlternateUsrLibDir - #define AlternateUsrLibDir YES - #endif - #else --#define UsrLibDir Concat3(/usr,/,LibDirName) -+#define UsrLibDir Concat4(/usr/local,/,LibDirName,/nx) - #ifndef AlternateUsrLibDir - #define AlternateUsrLibDir NO - #endif -@@ -863,7 +863,7 @@ - #endif - #ifndef IncRoot - #ifdef ProjectRoot --#define IncRoot Concat(ProjectRoot,/include) -+#define IncRoot Concat(ProjectRoot,/include/nx) - #ifndef AlternateIncRoot - #define AlternateIncRoot YES - #endif ---- a/nx-X11/config/cf/X11.rules -+++ b/nx-X11/config/cf/X11.rules -@@ -36,17 +36,17 @@ - #endif - - #if defined(X11ProjectRoot) --# define XBinDir $(XPROJECTROOT)/bin -+# define XBinDir $(XPROJECTROOT)/lib/nx/bin - #elif defined(ProjectRoot) --# define XBinDir $(PROJECTROOT)/bin -+# define XBinDir $(PROJECTROOT)/lib/nx/bin - #else - # define XBinDir $(BINDIR) - #endif - - #ifdef X11ProjectRoot --# define XUsrLibDirPath $(USRLIBDIR):$(XPROJECTROOT)/lib -+# define XUsrLibDirPath $(USRLIBDIR)/nx:$(XPROJECTROOT) - #else --# define XUsrLibDirPath $(USRLIBDIR) -+# define XUsrLibDirPath $(USRLIBDIR)/nx - #endif - #ifdef UsrLibDirPath - # undef UsrLibDirPath -@@ -60,7 +60,7 @@ - #if ImportX11 - # define XLdPreLibs -L$(LIBSRC) - #elif defined(UseInstalledX11) && defined(X11ProjectRoot) --# define XLdPreLibs -L$(XPROJECTROOT)/lib -+# define XLdPreLibs -L$(XPROJECTROOT) - #else - # define XLdPreLibs /**/ - #endif -@@ -70,7 +70,7 @@ - #define LdPreLibs LdPreLib XLdPreLibs - - #ifdef X11ProjectRoot --# define XLdPostLibs -L$(XPROJECTROOT)/lib -+# define XLdPostLibs -L$(XPROJECTROOT) - #else - # define XLdPostLibs /**/ - #endif -@@ -86,7 +86,7 @@ - # define TopXInclude -I$(TOP)/exports/include - #else - # ifdef X11ProjectRoot --# define TopXInclude -I$(XPROJECTROOT)/include -+# define TopXInclude -I$(XPROJECTROOT)/../../include/nx - # else - # define TopXInclude /**/ - # endif -@@ -98,7 +98,7 @@ - #define TopIncludes TopInclude $(TOP_X_INCLUDES) - - #if UseInstalledX11 && defined(X11ProjectRoot) --# define X11BuildLibPath $(XPROJECTROOT)/lib -+# define X11BuildLibPath $(XPROJECTROOT) - #elif UseInstalledX11 - # define X11BuildLibPath $(USRLIBDIR) - #elif ImportX11 ---- a/nx-X11/config/cf/X11.tmpl -+++ b/nx-X11/config/cf/X11.tmpl -@@ -1401,7 +1401,7 @@ - - #ifndef BinDir - #ifdef ProjectRoot --#define BinDir Concat(ProjectRoot,/bin) -+#define BinDir Concat(ProjectRoot,/lib/nx/bin) - #else - #define BinDir /usr/bin/X11 - #endif -@@ -1461,7 +1461,7 @@ - #endif - #ifndef LibDir - # ifdef ProjectRoot --# define LibDir Concat(ProjectRoot,/lib/X11) -+# define LibDir Concat(ProjectRoot,/lib/nx/X11) - # else - # define LibDir /usr/lib/X11 - # endif ---- a/nx-X11/config/cf/linux.cf -+++ b/nx-X11/config/cf/linux.cf -@@ -1054,7 +1054,7 @@ - - #if HaveLib64 - # ifndef LibDirName --# define LibDirName lib64 -+# define LibDirName lib - # endif - # ifndef SystemUsrLibDir - # define SystemUsrLibDir /usr/lib64 ---- a/nx-X11/config/cf/site.def -+++ b/nx-X11/config/cf/site.def -@@ -72,7 +72,7 @@ - #ifdef AfterVendorCF - - #ifndef ProjectRoot --#define ProjectRoot /usr/local/lib/nx -+#define ProjectRoot /usr/local - #endif - - /* -@@ -87,7 +87,7 @@ - * ProjectRoot rather than in /etc/X11. See also HasVarDirectory, - * UseEtcX11 and UseSeparateConfDir. - * --#define EtcX11Directory ProjectRoot/etc -+#define EtcX11Directory /etc/nx - */ - - ---- a/nxproxy/Makefile.in -+++ b/nxproxy/Makefile.in -@@ -33,7 +33,7 @@ - - srcdir = @srcdir@ - prefix = @prefix@ --exec_prefix = @exec_prefix@ -+exec_prefix = @exec_prefix@/lib/nx - bindir = @bindir@ - man1dir = @mandir@/man1 - VPATH = @srcdir@ diff --git a/debian/patches/0200_nxagent_check-binary-x2go-flavour.full.patch b/debian/patches/0200_nxagent_check-binary-x2go-flavour.full.patch new file mode 100644 index 000000000..c69202088 --- /dev/null +++ b/debian/patches/0200_nxagent_check-binary-x2go-flavour.full.patch @@ -0,0 +1,64 @@ +Description: Detect nxagent/x2goagent flavour + Whether the agent runs in X2Go or NX mode is decide by the + name of the binary that executes the code. + . + Binary name equal to nxagent -> (Free)NX flavour + Binary name equal to x2goagent -> X2Go flavour +Forwarded: not-needed +Author: Oleksandr Shneyder +Last-Update: 2012-01-11 +--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c +@@ -177,6 +177,29 @@ + + int nxagentDoFullGeneration = 1; + ++ /* ++ * 1 if agent running as X2goAgent ++ * 0 if NX Agent ++ */ ++int nxagentX2go; ++ ++/* ++ * Checking if agent is x2go agent ++ */ ++ ++void checkX2goAgent() ++{ ++ extern const char *__progname; ++ if( strcasecmp(__progname,"x2goagent") == 0) ++ { ++ fprintf(stderr, "\nrunning as X2Go Agent\n"); ++ nxagentX2go=1; ++ } ++ else ++ nxagentX2go=0; ++} ++ ++ + /* + * Called at X server's initialization. + */ +@@ -193,6 +216,11 @@ + #endif + + /* ++ * Check if we running as X2Go Agent ++ */ ++ checkX2goAgent(); ++ ++ /* + * Print our pid and version information. + */ + +--- a/nx-X11/programs/Xserver/hw/nxagent/Init.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h +@@ -37,6 +37,8 @@ + extern int nxagentBackingStore; + extern int nxagentSaveUnder; + ++extern int nxagentX2go; ++ + extern ServerGrabInfoRec nxagentGrabServerInfo; + + #endif /* __Init_H__ */ diff --git a/debian/patches/0201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch b/debian/patches/0201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch new file mode 100644 index 000000000..48e4c4a4b --- /dev/null +++ b/debian/patches/0201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch @@ -0,0 +1,219 @@ +Description: X2Go icon when run with x2goagent flavour + Depending on the binary name of the agent either nxagent.xpm + or x2go.xpm is used as window icon. +Forwarded: not-needed +Author: Oleksandr Shneyder +Last-Update: 2012-01-11 +--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c +@@ -77,6 +77,7 @@ + #include "NXlib.h" + + #include NXAGENT_ICON_NAME ++#include X2GOAGENT_ICON_NAME + + /* + * Set here the required log level. +@@ -1941,12 +1942,29 @@ + Bool success = False; + XlibPixmap IconPixmap; + XlibPixmap IconShape; ++ char* agent_icon_name; ++ char* agentIconData; + +- snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", NXAGENT_ICON_NAME); ++ /* ++ * selecting x2go icon when running as X2Go agent ++ */ ++ if(nxagentX2go) ++ { ++ agent_icon_name=X2GOAGENT_ICON_NAME; ++ agentIconData=x2goagentIconData; ++ } ++ else ++ { ++ agent_icon_name=NXAGENT_ICON_NAME; ++ agentIconData=nxagentIconData; ++ } ++ ++ ++ snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", agent_icon_name); + + if ((icon_fp = fopen(default_path, "r")) == NULL) + { +- icon_fp = nxagentLookForIconFile(NXAGENT_ICON_NAME, "r", icon_path); ++ icon_fp = nxagentLookForIconFile(agent_icon_name, "r", icon_path); + + if (icon_fp != NULL) + { +@@ -1985,7 +2003,7 @@ + { + status = XpmCreatePixmapFromData(display, + DefaultRootWindow(display), +- nxagentIconData, ++ agentIconData, + &IconPixmap, + &IconShape, + NULL); +--- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h +@@ -24,6 +24,8 @@ + + #define NXAGENT_ICON_NAME "nxagent.xpm" + ++#define X2GOAGENT_ICON_NAME "x2go.xpm" ++ + #define NXAGENT_PLACEHOLDER_NAME "nxmissing.xpm" + + #endif /* __Icons_H__ */ +--- /dev/null ++++ b/nx-X11/programs/Xserver/hw/nxagent/x2go.xpm +@@ -0,0 +1,148 @@ ++/* XPM */ ++static char *x2goagentIconData[]={ ++"128 128 17 1", ++". c None", ++"m c #323232", ++"l c #323232", ++"f c #323232", ++"e c #323232", ++"o c #323232", ++"# c #323232", ++"h c #323232", ++"i c #323232", ++"n c #323232", ++"d c #323232", ++"a c #323232", ++"g c #323232", ++"j c #323232", ++"b c #323232", ++"k c #323232", ++"c c #323232", ++".....#abccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbde.....", ++"...fbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccgf...", ++"..#ccccaheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeijccckf..", ++".ecccgl..................................................................................................................ejcckf.", ++".bccd.....................................................................................................................mdccg.", ++"#cca.......................................................................................................................mjcce", ++"gckm........................................................................................................................eccd", ++"ccn..........................................................................................................................jcb", ++"cce..........................................................................................................................icc", ++"ccm..........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc............................................meeee..........................................................................ecc", ++"cc.........eeeeeeeeoiiiiiiiinggggggggjccccccccccccc....#ggggggggggggggggggggggggggggf.............ggggggggggggggggggggggf....ecc", ++"cc....meeeeoiiiiiiiinggggggggjccccccccccccccccccccc....icccccccccccccccccccccccccccce.............cccccccccccccccccccccce....ecc", ++"cc....................................meeeeeeeeoiii....icccccccccccccccccccccccccccce.............cccccccccccccccccccccce....ecc", ++"cc.......................................................menbccccccccccccccccccbhe..................logccccccccccccghe.......ecc", ++"cc...........................................................iccccccccccccccccdm.......................#cccccccccke..........ecc", ++"cc..............................................lee...........#cccccccccccccckm.........................jccccccckm...........ecc", ++"cc........feeeeeeeeoiiiiiiiiiaggggggggjcccccccccccc............icccccccccccccd..........................icccccccf............ecc", ++"cc....meeeeeoiiiiiiiinggggggggjcccccccccccccccccccciiiiii#m.....jcccccccccccci..........................icccccci.............ecc", ++"cc......................................eeeeeeeeeiiiiiiiiigl....eccccccccccccd..........................dcccccj..............ecc", ++"cc...............................................................dcccccccccccj..........................bccccce..............ecc", ++"cc...............................................................lccccccccccccl........................lccccca...............ecc", ++"cc.............................................meeeeeeee#iiiie....dccccccccccch........................icccccl...............ecc", ++"cc.........meeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccb....ecccccccccccb........................bccccn................ecc", ++"cc....meeeeiiiiiiiiiaggggggggbcccccccccccccccccccccccccccccccc#....gccccccccccco......................#cccckm................ecc", ++"cc....................................meeeeeeeeeiiiiiiiiiaggggd....#cccccccccccg......................bcccci.................ecc", ++"cc..................................................................bcccccccccccf....................#cccckm.................ecc", ++"cc..................................................................hcccccccccccd...................mkcccci..................ecc", ++"cc............................................meeeeeeeeoiiiiiiiil...mkcccccccccccl..................icccckm..................ecc", ++"cc.........eeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccccccn....dccccccccccci.................mkcccci...................ecc", ++"cc....meeeeeiiiiiiiiiaggggggggbccccccccccccccccccccccccccccccccckm...lccccccccccck.................icccckm...................ecc", ++"cc.....................................leeeeeeeeoiiiiiiiiigggggggo....accccccccccc#...............mkcccch....................ecc", ++"cc....................................................................ecccccccccccb...............iccccb.....................ecc", ++"cc.....................................................................jccccccccccce.............mkcccc#.....................ecc", ++"cc.............................................meeeeeeeeehiiiiiiii#....#ccccccccccca.............nccccb......................ecc", ++"cc........feeeeeeee#iiiiiiiiigggggggggkccccccccccccccccccccccccccccl....kcccccccccccl...........lccccc#......................ecc", ++"cc....meeeeeoiiiiiiiiigggggggggkcccccccccccccccccccccccccccccccccccd....icccccccccccd...........dccccb.......................ecc", ++"cc......................................leeeeeeeeoiiiiiiiingggggggga....mccccccccccckm.........lccccc#.......................ecc", ++"cc.......................................................................dccccccccccch.........dccccb........................ecc", ++"cc.......................................................................lcccccccccccb........lccccc#........................ecc", ++"cc.............................................meeeeeeeeoiiiiiiiingggo....gccccccccccc#.......dccccg.........................ecc", ++"cc.........meeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccccccccccg....occcccccccccg......lccccce.........................ecc", ++"cc....meeeeiiiiiiiiiaggggggggbcccccccccccccccccccccccccccccccccccccccce....bccccccccccce.....gccccg..........................ecc", ++"cc....................................meeeeeeeeeiiiiiiiiigggggggggkcccd....#cccccccccccd....eccccce..........................ecc", ++"cc.........................................................................mkcccccccccccl...gccccg...........................ecc", ++"cc..........................................................................nccccccccccci..eccccce...........................ecc", ++"cc............................................meeeeeeeeoiiiiiiiingggggggm...lccccccccccckm.gccccg............................ecc", ++"cc.........eeeeeeeeoiiiiiiiinggggggggjcccccccccccccccccccccccccccccccccc#....dccccccccccc#eccccce............................ecc", ++"cc....meeeeeiiiiiiiiiaggggggggkcccccccccccccccccccccccccccccccccccccccccb....ecccccccccccbgccccg.............................ecc", ++"cc.....................................leeeeeeeeoiiiiiiiiigggggggggkccccco....gccccccccccccccccl.............................ecc", ++"cc............................................................................#cccccccccccccccd..............................ecc", ++"cc.............................................................................bccccccccccccccl..............................ecc", ++"cc.............................................leeeeeeeeeiiiiiiiiiagggggggi....icccccccccccccd...............................ecc", ++"cc........feeeeeeee#iiiiiiiingggggggggkccccccccccccccccccccccccccccccccccckm...mkccccccccccccl...............................ecc", ++"cc....meeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccccccccccci....dccccccccccca................................ecc", ++"cc......................................leeeeeeeeoiiiiiiiiigggggggggccccccck....lccccccccccckm...............................ecc", ++"cc...............................................................................accccccccccc#...............................ecc", ++"cc...............................................................................ecccccccccccb...............................ecc", ++"cc............................................leeeeeeeeeiiiiiiiiiaggggggggbcce....bccccccccccce..............................ecc", ++"cc.......feeeeeeee#iiiiiiiiigggggggggkcccccccccccccccccccccccccccccccccccccccd....#cccccccccccg..............................ecc", ++"cc....meeeeeeoiiiiiiiingggggggggccccccccccccccccccccccccccccccccccccccccccccccl....kcccccccccccl.............................ecc", ++"cc.......................................feeeeeeeehiiiiiiiidggggggggbccccccccci....ncccccccccccd.............................ecc", ++"cc...........................................................................mm....bccccccccccccm............................ecc", ++"cc................................................................................#ccccccccccccci............................ecc", ++"cc..........................................leeeeeeee#iiiiiiiidggggggggbcccccl....bccccccccccccck............................ecc", ++"cc......feeeeeeeehiiiiiiiiaggggggggkccccccccccccccccccccccccccccccccccccccccd....#ccccccccccccccc#...........................ecc", ++"cc....meeeeeee#iiiiiiiidggggggggjcccccccccccccccccccccccccccccccccccccccccccl....bcccccccccccccccb...........................ecc", ++"cc.......................................meeeeeeeeeiiiiiiiiigggggggggkcccccd....#cccccbccccccccccce..........................ecc", ++"cc..............................................................................bccccdhcccccccccccg..........................ecc", ++"cc.............................................................................#ccccclmkcccccccccccl.........................ecc", ++"cc..........................................meeeeeeeeeiiiiiiiiiaggggggggbkm....bccccd..ncccccccccccd.........................ecc", ++"cc.....leeeeeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccccci....hcccckl..lccccccccccccm........................ecc", ++"cc....meeeeeeeehiiiiiiiidggggggggbcccccccccccccccccccccccccccccccccccccckm...mkcccci....dccccccccccci........................ecc", ++"cc........................................leeeeeeee#iiiiiiiinggggggggjcci....icccckm....eccccccccccck........................ecc", ++"cc..........................................................................mkcccci......gccccccccccc#.......................ecc", ++"cc..........................................................................icccckm......#cccccccccccb.......................ecc", ++"cc.........................................leeeeeeeeoiiiiiiiiigggggggga....mkcccci........bccccccccccce......................ecc", ++"cc....meeeeeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccci....icccckm........hcccccccccccg......................ecc", ++"cc.....feeeeeeeehiiiiiiiiaggggggggkcccccccccccccccccccccccccccccccccckm...mkcccci.........mkcccccccccccl.....................ecc", ++"cc.........................................feeeeeeeehiiiiiiiiagggggggh....icccckm..........icccccccccccd.....................ecc", ++"cc.......................................................................mkcccci...........lccccccccccccm....................ecc", ++"cc.......................................................................icccckm............dccccccccccci....................ecc", ++"cc...........................................eeeeeeeeehiiiiiiiidggga....mkcccci.............fccccccccccck....................ecc", ++"cc......feeeeeeee#iiiiiiiingggggggggccccccccccccccccccccccccccccccci....iccccb...............gccccccccccc#...................ecc", ++"cc....meeeeeeeoiiiiiiiiigggggggggbcccccccccccccccccccccccccccccccckm...mkcccc#...............occcccccccccb...................ecc", ++"cc........................................meeeeeeeeeiiiiiiiiidgggg#....iccccb.................bccccccccccce..................ecc", ++"cc....................................................................mkcccc#.................#cccccccccccg..................ecc", ++"cc....................................................................iccccb..................mkcccccccccccl.................ecc", ++"cc..........................................eeeeeeeeeiiiiiiiiiaga....mkcccc#...................icccccccccccd.................ecc", ++"cc.....leeeeeeee#iiiiiiiinggggggggjccccccccccccccccccccccccccccci....iccccb....................lccccccccccccm................ecc", ++"cc....meeeeeeee#iiiiiiiiigggggggggkcccccccccccccccccccccccccccckm...mkcccc#.....................dccccccccccci................ecc", ++"cc.........................................leeeeeeeeoiiiiiiiiiah....iccccb......................lccccccccccck................ecc", ++"cc.................................................................mkcccc#.......................gccccccccccc#...............ecc", ++"cc.................................................................dccccj........................ecccccccccccj...............ecc", ++"cc..........................................leeeeeeeeeiiiiiiih....lccccce.........................bccccccccccce..............ecc", ++"cc....meeeeeeeeeiiiiiiiiidgggggggggcccccccccccccccccccccccccci....dccccg..........................#ccccccccccca..............ecc", ++"cc.....feeeeeeeeiiiiiiiinggggggggbcccccccccccccccccccccccccckm...lccccce...........................kcccccccccccl.............ecc", ++"cc........................................leeeeeeeehiiiiiiiih....dccccg............................ncccccccccccd.............ecc", ++"cc..............................................................lccccce............................fccccccccccccf............ecc", ++"cc..............................................................dccccb..............................jcccccccccccg............ecc", ++"cc.........................................meeeeeeeeoiiiiil....lcccccn..............................icccccccccccce...........ecc", ++"cc......feeeeeeeehiiiiiiiigggggggggccccccccccccccccjgggggo.....gccccc#..............................eccccccccccccbm..........ecc", ++"cc....meeeeeeeoiiiiiiiiidgggggggggccccccccccccccccc...........hcccccco...............................cccccccccccccn..........ecc", ++"cc.........................................leeeeeee..........ecccccccn..............................lcccccccccccccc#.........ecc", ++"cc..........................................................#kccccccckf.............................nccccccccccccccc#........ecc", ++"cc........................................................ldcccccccccck#m.........................lncccccccccccccccccdl......ecc", ++"cc.........................................feeeeeee....ogjcccccccccccccccggi..................oggbcccccccccccccccccccccja....ecc", ++"cc.....leeeeeeee#iiiiiiiidggggggggbcccccccccccccccc....icccccccccccccccccccg..................icccccccccccccccccccccccccc....ecc", ++"cc....meeeeeeeehiiiiiiiiaggggggggkccccccccccccccccc....icccccccccccccccccccg..................icccccccccccccccccccccccccc....ecc", ++"cc........................................feeeeeeee..........................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cc...........................................................................................................................ecc", ++"cce..........................................................................................................................hcc", ++"ccn..........................................................................................................................acb", ++"jcb.........................................................................................................................lcca", ++"hcci........................................................................................................................acc#", ++"mkcc#......................................................................................................................dccb.", ++".occci...................................................................................................................macccf.", ++"..#cccbne.............................................................................................................menkccc#..", ++"...okccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbe...", ++"....mhjccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccg#....."}; diff --git a/debian/patches/0202_nx-X11_enable-xinerama.full.patch b/debian/patches/0202_nx-X11_enable-xinerama.full.patch new file mode 100644 index 000000000..6845ec51e --- /dev/null +++ b/debian/patches/0202_nx-X11_enable-xinerama.full.patch @@ -0,0 +1,292 @@ +Description: Enable Xinerama support for NX + This patch adds Xinerama awareness to NX agent windows. + . + The advantage of Xinerama awareness is that an NX session window + will only maximize to the dimensions of the active physical + display. +Forwarded: pending +Author: Oleksandr Shneyder +Last-Update: 2012-01-13 +--- a/nx-X11/config/cf/host.def ++++ b/nx-X11/config/cf/host.def +@@ -686,7 +686,7 @@ + * + #define BuildXinerama NO + */ +-#define BuildXinerama NO ++#define BuildXinerama YES + + /* + * If you don't want to build support for the GLX extension, uncomment this. +--- a/nx-X11/config/cf/X11.tmpl ++++ b/nx-X11/config/cf/X11.tmpl +@@ -456,7 +456,7 @@ + #define BuildXinerama NO + #endif + #ifndef BuildXineramaLibrary +-#define BuildXineramaLibrary (BuildXinerama && !BuildServersOnly) ++#define BuildXineramaLibrary (BuildXinerama) + #endif + #ifndef BuildDmxDevelTools + #define BuildDmxDevelTools NO +--- a/nx-X11/lib/Xinerama/Xinerama.c ++++ b/nx-X11/lib/Xinerama/Xinerama.c +@@ -34,7 +34,7 @@ + #include + #include + #include +- ++#include + + static XExtensionInfo _panoramiX_ext_info_data; + static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data; +@@ -249,6 +249,16 @@ + xXineramaIsActiveReq *req; + XExtDisplayInfo *info = find_display (dpy); + ++ ++ FILE* fptr; ++ if((fptr=fopen(getenv("NX_XINERAMA_CONF"),"r"))!=NULL) { ++ fclose (fptr); ++ return True; ++ } ++ else { ++ return False; ++ } ++ + if(!XextHasExtension(info)) + return False; /* server doesn't even have the extension */ + +@@ -266,7 +276,6 @@ + return rep.state; + } + +-#include + + XineramaScreenInfo * + XineramaQueryScreens( +@@ -279,39 +288,72 @@ + xXineramaQueryScreensReq *req; + XineramaScreenInfo *scrnInfo = NULL; + +- PanoramiXCheckExtension (dpy, info, 0); ++ int i; ++ int x,y,w,h; ++ FILE* fptr; ++ if((fptr=fopen(getenv("NX_XINERAMA_CONF"),"r"))==NULL) { ++ PanoramiXCheckExtension (dpy, info, 0); ++ LockDisplay (dpy); ++ GetReq (XineramaQueryScreens, req); ++ req->reqType = info->codes->major_opcode; ++ req->panoramiXReqType = X_XineramaQueryScreens; ++ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { ++ UnlockDisplay (dpy); ++ SyncHandle (); ++ return NULL; ++ } ++ if(rep.number) { ++ if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number))) { ++ xXineramaScreenInfo scratch; ++ int i; ++ ++ for(i = 0; i < rep.number; i++) { ++ _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo); ++ scrnInfo[i].screen_number = i; ++ scrnInfo[i].x_org = scratch.x_org; ++ scrnInfo[i].y_org = scratch.y_org; ++ scrnInfo[i].width = scratch.width; ++ scrnInfo[i].height = scratch.height; ++ } ++ ++ *number = rep.number; ++ } else { ++ _XEatData(dpy, rep.length << 2); ++ } ++ } + +- LockDisplay (dpy); +- GetReq (XineramaQueryScreens, req); +- req->reqType = info->codes->major_opcode; +- req->panoramiXReqType = X_XineramaQueryScreens; +- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { + UnlockDisplay (dpy); + SyncHandle (); +- return NULL; +- } + +- if(rep.number) { +- if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number))) { +- xXineramaScreenInfo scratch; +- int i; +- +- for(i = 0; i < rep.number; i++) { +- _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo); +- scrnInfo[i].screen_number = i; +- scrnInfo[i].x_org = scratch.x_org; +- scrnInfo[i].y_org = scratch.y_org; +- scrnInfo[i].width = scratch.width; +- scrnInfo[i].height = scratch.height; +- } ++ } else { + +- *number = rep.number; +- } else +- _XEatData(dpy, rep.length << 2); ++ i=0; ++ while(!feof(fptr)) { ++ w=h=0; ++ fscanf(fptr,"%d %d %d %d",&x,&y,&w,&h); ++ if(w&&h) ++ i++; ++ } ++ rewind(fptr); ++ *number=i; ++ if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * i))) { ++ i=0; ++ while(!feof(fptr)){ ++ w=h=0; ++ fscanf(fptr,"%d %d %d %d",&x,&y,&w,&h); ++ if(w&&h){ ++ scrnInfo[i].screen_number=i; ++ scrnInfo[i].x_org=x; ++ scrnInfo[i].y_org=y; ++ scrnInfo[i].width=w; ++ scrnInfo[i].height=h; ++ i++; ++ } ++ } ++ } ++ fclose(fptr); + } + +- UnlockDisplay (dpy); +- SyncHandle (); + return scrnInfo; + } + +--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile ++++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile +@@ -206,7 +206,7 @@ + -UNX_DEBUG_INPUT \ + -DRANDR_10_INTERFACE \ + -DRANDR_12_INTERFACE \ +- -UPANORAMIX \ ++ -DPANORAMIX \ + -UDEBUG_TREE + + all:: $(OBJS) +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c +@@ -275,17 +275,19 @@ + case xv_PutVideo: + #ifdef PANORAMIX + if(!noPanoramiXExtension) +- result = (XineramaXvPutVideo(client)); break; ++ result = (XineramaXvPutVideo(client)); + else + #endif +- result = (ProcXvPutVideo(client)); break; ++ result = (ProcXvPutVideo(client)); ++ break; + case xv_PutStill: + #ifdef PANORAMIX + if(!noPanoramiXExtension) +- result = (XineramaXvPutStill(client)); break ++ result = (XineramaXvPutStill(client)); + else + #endif +- result = (ProcXvPutStill(client)); break; ++ result = (ProcXvPutStill(client)); ++ break; + case xv_GetVideo: result = (ProcXvGetVideo(client)); break; + case xv_GetStill: result = (ProcXvGetStill(client)); break; + case xv_GrabPort: result = (ProcXvGrabPort(client)); break; +@@ -295,35 +297,39 @@ + case xv_StopVideo: + #ifdef PANORAMIX + if(!noPanoramiXExtension) +- result = (XineramaXvStopVideo(client)); break; ++ result = (XineramaXvStopVideo(client)); + else + #endif +- result = (ProcXvStopVideo(client)); break; ++ result = (ProcXvStopVideo(client)); ++ break; + case xv_SetPortAttribute: + #ifdef PANORAMIX + if(!noPanoramiXExtension) +- result = (XineramaXvSetPortAttribute(client)); break; ++ result = (XineramaXvSetPortAttribute(client)); + else + #endif +- result = (ProcXvSetPortAttribute(client)); break; ++ result = (ProcXvSetPortAttribute(client)); ++ break; + case xv_GetPortAttribute: result = (ProcXvGetPortAttribute(client)); break; + case xv_QueryBestSize: result = (ProcXvQueryBestSize(client)); break; + case xv_QueryPortAttributes: result = (ProcXvQueryPortAttributes(client)); break; + case xv_PutImage: + #ifdef PANORAMIX + if(!noPanoramiXExtension) +- result = (XineramaXvPutImage(client)); break; ++ result = (XineramaXvPutImage(client)); + else + #endif +- result = (ProcXvPutImage(client)); break; ++ result = (ProcXvPutImage(client)); ++ break; + #ifdef MITSHM + case xv_ShmPutImage: + #ifdef PANORAMIX + if(!noPanoramiXExtension) +- result = (XineramaXvShmPutImage(client)); break; ++ result = (XineramaXvShmPutImage(client)); + else + #endif +- result = (ProcXvShmPutImage(client)); break; ++ result = (ProcXvShmPutImage(client)); ++ break; + #endif + case xv_QueryImageAttributes: result = (ProcXvQueryImageAttributes(client)); break; + case xv_ListImageFormats: result = (ProcXvListImageFormats(client)); break; +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -1021,7 +1021,7 @@ + #else + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ + -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite ++ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama + #endif + + #endif +--- a/nx-X11/programs/Xserver/Xext/panoramiX.c ++++ b/nx-X11/programs/Xserver/Xext/panoramiX.c +@@ -1045,16 +1045,7 @@ + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; +-#if 1 +- { +- /* The following hack fools clients into thinking that Xinerama +- * is disabled even though it is not. */ +- extern Bool PanoramiXExtensionDisabledHack; +- rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack; +- } +-#else + rep.state = !noPanoramiXExtension; +-#endif + if (client->swapped) { + register int n; + swaps (&rep.sequenceNumber, n); +--- a/nx-X11/programs/Xserver/Xext/panoramiX.h ++++ b/nx-X11/programs/Xserver/Xext/panoramiX.h +@@ -44,7 +44,7 @@ + #define _PANORAMIX_H_ + + #include +-#include "gcstruct.h" ++/*#include "gcstruct.h"*/ + + + typedef struct _PanoramiXData { diff --git a/debian/patches/0203_nxagent_disable-rootless-exit.full.patch b/debian/patches/0203_nxagent_disable-rootless-exit.full.patch new file mode 100644 index 000000000..74579f4d8 --- /dev/null +++ b/debian/patches/0203_nxagent_disable-rootless-exit.full.patch @@ -0,0 +1,63 @@ +Description: Add -norootlessexit cmdline option to nxagent +Author: Oleksandr Shneyder + +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c +@@ -672,6 +672,12 @@ + return 1; + } + ++ if (!strcmp(argv[i], "-norootlessexit")) { ++ nxagentChangeOption(NoRootlessExit, True); ++ return 1; ++ } ++ ++ + if (!strcmp(argv[i], "-noonce")) + { + nxagentOnce = False; +@@ -1855,6 +1861,7 @@ + ErrorF("The NX system adds the following arguments:\n"); + ErrorF("-forcenx force use of NX protocol messages assuming communication through nxproxy\n"); + ErrorF("-timeout int auto-disconnect timeout in seconds (minimum allowed: 60)\n"); ++ ErrorF("-norootlessexit don't exit if there are no clients in rootless mode\n"); + #ifdef RENDER + ErrorF("-norender disable the use of the render extension\n"); + ErrorF("-nocomposite disable the use of the composite extension\n"); +--- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +@@ -219,7 +219,7 @@ + + if (nxagentOption(Rootless) && + nxagentLastWindowDestroyed && nxagentRootlessDialogPid == 0 && +- now > nxagentLastWindowDestroyedTime + 30 * 1000) ++ now > nxagentLastWindowDestroyedTime + 30 * 1000 && !nxagentOption(NoRootlessExit)) + { + #ifdef WARNING + fprintf(stderr, "nxagentBlockHandler: No application running. Closing the session.\n"); +--- a/nx-X11/programs/Xserver/hw/nxagent/Options.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c +@@ -56,6 +56,7 @@ + nxagentOptions.Persistent = 1; + nxagentOptions.Rootless = UNDEFINED; + nxagentOptions.Fullscreen = UNDEFINED; ++ nxagentOptions.NoRootlessExit = False; + + nxagentOptions.X = 0; + nxagentOptions.Y = 0; +--- a/nx-X11/programs/Xserver/hw/nxagent/Options.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h +@@ -381,6 +381,13 @@ + + int ImageRateLimit; + ++ /* ++ * True if agent should not exit if there are no ++ * clients in rootless mode ++ */ ++ ++ int NoRootlessExit; ++ + } AgentOptionsRec; + + typedef AgentOptionsRec *AgentOptionsPtr; diff --git a/debian/patches/0204_nxagent_repaint-solidpict.full.patch b/debian/patches/0204_nxagent_repaint-solidpict.full.patch new file mode 100644 index 000000000..139a46ad3 --- /dev/null +++ b/debian/patches/0204_nxagent_repaint-solidpict.full.patch @@ -0,0 +1,53 @@ +Description: Fix repainting of SolidFill pictures with libcairo > 1.12.x +Author: Oleksandr Shneyder +diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c +--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c 2012-05-16 18:05:07.000000000 +0200 ++++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c 2012-09-20 20:53:37.893459269 +0200 +@@ -2689,11 +2689,17 @@ void nxagentReconnectPicture(pointer p0, + #endif + } + +- if (!pForm) ++ if (!pForm && pPicture->pSourcePict) + { +- *pBool = False; +- +- return; ++ /*possible we need to add support for other picture types, for example gradients...*/ ++ switch(pPicture->pSourcePict->type) ++ { ++ case SourcePictTypeSolidFill: ++ nxagentPicturePriv(pPicture) -> picture = XRenderCreateSolidFill(nxagentDisplay, ++ (const XRenderColor*) &pPicture->pSourcePict->solidFill.fullColor); ++ break; ++ } ++ return; + } + + #ifdef TEST +diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c 2010-11-11 21:18:00.000000000 +0100 ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c 2012-09-20 20:54:50.209817849 +0200 +@@ -1137,6 +1137,10 @@ CreateSolidPicture (Picture pid, xRender + } + pPicture->pSourcePict->type = SourcePictTypeSolidFill; + pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); ++ pPicture->pSourcePict->solidFill.fullColor.alpha=color->alpha; ++ pPicture->pSourcePict->solidFill.fullColor.red=color->red; ++ pPicture->pSourcePict->solidFill.fullColor.green=color->green; ++ pPicture->pSourcePict->solidFill.fullColor.blue=color->blue; + return pPicture; + } + +diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h 2010-10-22 16:04:24.000000000 +0200 ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h 2012-09-20 20:55:31.106020653 +0200 +@@ -95,6 +95,7 @@ typedef struct _PictTransform { + typedef struct _PictSolidFill { + unsigned int type; + CARD32 color; ++ xRenderColor fullColor; + } PictSolidFill, *PictSolidFillPtr; + + typedef struct _PictGradientStop { + diff --git a/debian/patches/0205_nxagent_refresh-adsl.full.patch b/debian/patches/0205_nxagent_refresh-adsl.full.patch new file mode 100644 index 000000000..4840ea7ce --- /dev/null +++ b/debian/patches/0205_nxagent_refresh-adsl.full.patch @@ -0,0 +1,14 @@ +Description: Fix refresh errors on Win2012 RDP connections with speed=ADSL +Author: Oleksandr Shneyder +diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +--- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c 2014-05-06 12:52:35.082288455 +0200 ++++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c 2014-05-06 12:54:00.258710819 +0200 +@@ -339,7 +339,7 @@ FIXME: The popup could be synchronized w + */ + + if ((pDstDrawable -> type == DRAWABLE_PIXMAP && +- nxagentOption(DeferLevel) > 0) || nxagentOption(DeferLevel) >= 2) ++ nxagentOption(DeferLevel) > 0) || nxagentOption(DeferLevel) >= 3) + { + pClipRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, + width, height); diff --git a/debian/patches/0206_nxagent_clipboard-as-nxoption.full.patch b/debian/patches/0206_nxagent_clipboard-as-nxoption.full.patch new file mode 100644 index 000000000..12b51dc0e --- /dev/null +++ b/debian/patches/0206_nxagent_clipboard-as-nxoption.full.patch @@ -0,0 +1,53 @@ +Descripion: Add -clipboard cmdline option to nxagent +Author: Mike Gabriel + +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c +@@ -984,7 +984,7 @@ + + if (!strcmp(argv[i], "-clipboard")) + { +- if (!strcmp(argv[i+1], "both")) ++ if ((!strcmp(argv[i+1], "both")) || (!strcmp(argv[i+1], "1"))) + { + nxagentChangeOption(Clipboard, ClipboardBoth); + } +@@ -996,7 +996,7 @@ + { + nxagentChangeOption(Clipboard, ClipboardServer); + } +- else if (!strcmp(argv[i+1], "none")) ++ else if ((!strcmp(argv[i+1], "none")) || (!strcmp(argv[i+1], "1"))) + { + nxagentChangeOption(Clipboard, ClipboardNone); + } +@@ -1255,6 +1255,29 @@ + + return; + } ++ else if (strcmp(name, "clipboard") == 0) ++ { ++ if ((strcmp(value, "both") == 0) || (strcmp(value, "1") == 0)) ++ { ++ nxagentChangeOption(Clipboard, ClipboardBoth); ++ } ++ else if (strcmp(value, "client") == 0) ++ { ++ nxagentChangeOption(Clipboard, ClipboardClient); ++ } ++ else if (strcmp(value, "server") == 0) ++ { ++ nxagentChangeOption(Clipboard, ClipboardServer); ++ } ++ else if ((strcmp(value, "none") == 0) || (strcmp(value, "0") == 0)) ++ { ++ nxagentChangeOption(Clipboard, ClipboardNone); ++ } ++ else ++ { ++ nxagentChangeOption(Clipboard, ClipboardBoth); ++ } ++ } + else + { + #ifdef DEBUG diff --git a/debian/patches/0207_nxagent_fix-xfixes-selection.full.patch b/debian/patches/0207_nxagent_fix-xfixes-selection.full.patch new file mode 100644 index 000000000..712b36914 --- /dev/null +++ b/debian/patches/0207_nxagent_fix-xfixes-selection.full.patch @@ -0,0 +1,33 @@ +Description: Fix XFIXES selection handling (copy and paste via middle mouse button). +Abstract: + When nxagent has the XFIXES extension enabled copy and + paste from outside applications to applications within the session + that rely on XFixesSelectSelectionInput (e.g. qt applications like + konsole) did never receive any notifications because the nxagent did + not register itself at the real X server to receive them. Fixes Bug + #585. +Author: Ulrich Sibiller + +Index: nx-libs/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +=================================================================== +--- nx-libs.orig/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c 2014-11-04 22:42:50.893569624 +0100 ++++ nx-libs/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c 2014-11-04 22:42:50.893569624 +0100 +@@ -1556,10 +1556,14 @@ + fprintf(stderr, "nxagentInitClipboard: Registering for XFixesSelectionNotify events.\n"); + #endif + +- XFixesSelectSelectionInput(nxagentDisplay, iWindow, nxagentClipboardAtom, +- XFixesSetSelectionOwnerNotifyMask | +- XFixesSelectionWindowDestroyNotifyMask | +- XFixesSelectionClientCloseNotifyMask); ++ for (i = 0; i < nxagentMaxSelections; i++) ++ { ++ XFixesSelectSelectionInput(nxagentDisplay, iWindow, ++ lastSelectionOwner[i].selection, ++ XFixesSetSelectionOwnerNotifyMask | ++ XFixesSelectionWindowDestroyNotifyMask | ++ XFixesSelectionClientCloseNotifyMask); ++ } + + nxagentXFixesInfo.Initialized = 1; + } diff --git a/debian/patches/0209_x2goagent_add-man-page.full.patch b/debian/patches/0209_x2goagent_add-man-page.full.patch new file mode 100644 index 000000000..310fa87d6 --- /dev/null +++ b/debian/patches/0209_x2goagent_add-man-page.full.patch @@ -0,0 +1,41 @@ +Description: Add x2goagent man page +Author: Mike Gabriel + +--- /dev/null ++++ b/nx-X11/programs/Xserver/hw/nxagent/man/x2goagent.1 +@@ -0,0 +1,35 @@ ++.TH x2goagent 1 ++.SH NAME ++x2goagent \- X2Go Agent. ++.SH SYNOPSIS ++.B x2goagent ++.I "[options]" ++ ++.SH DESCRIPTION ++\fBx2goagent\fR is an Xnest-like X server for remote application/desktop access. ++.PP ++\fBx2goagent\fR implements a very efficient compression of the X11 protocol. ++.PP ++This increases performance when using X applications over high latency and ++low bandwidth networks, while providing a local (LAN-like) usage experience ++even if connecting from off-site locations (via cable modem or GSM). ++.PP ++\fBx2goagent\fR is not designed to be used as a standalone application. ++It has to be launched on the server side by the X2Go server software. ++.PP ++Available clients are ++\fBx2goclient\fR, \fBpyhoca-gui\fR and \fBpyhoca-gui\fR (using the ++Python X2Go API). ++ ++.SH OPTIONS ++.TP ++.B \--help ++Lists all others options that are not listed here. ++ ++.SH FURTHER READINGS ++Information on X2Go: http://wiki.x2go.org ++.PP ++Information on NX: http://www.nomachine.com ++ ++.SH AUTHOR ++This manual page was written by Mike Gabriel . diff --git a/debian/patches/0210_nxagent_save_session_state.full.patch b/debian/patches/0210_nxagent_save_session_state.full.patch new file mode 100644 index 000000000..223d0bc7a --- /dev/null +++ b/debian/patches/0210_nxagent_save_session_state.full.patch @@ -0,0 +1,176 @@ +Description: Save session state in file +Author: Oleksandr Shneyder + +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c +@@ -60,6 +60,7 @@ + #endif + #include "Handlers.h" + #include "Error.h" ++#include "Reconnect.h" + + /* + * NX includes and definitions. +@@ -1090,6 +1091,11 @@ + + return; + } ++ else if (!strcmp(name, "state")) ++ { ++ setStatePath(value); ++ return; ++ } + else if (!strcmp(name, "fullscreen")) + { + if (nxagentReconnectTrap == True) +@@ -1369,6 +1375,11 @@ + validateString(nxagentOptionFile)); + #endif + ++ /* ++ * Init statePath ++ */ ++ setStatePath(""); ++ + if (nxagentOptionFile == NULL) + { + return; +--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c +@@ -63,7 +63,7 @@ + + #include "NX.h" + #include "NXlib.h" +- ++#include "Reconnect.h" + /* + * Set here the required log level. + */ +@@ -233,6 +233,7 @@ + fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid()); + + fprintf(stderr, "Session: Starting session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("STARTING"); + } + + /* +--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +@@ -118,6 +118,33 @@ + + static enum RECONNECTION_STEP failedStep; + ++#include ++ ++/* ++ * Path of state File ++ */ ++char stateFile[PATH_MAX]; ++ ++ ++void setStatePath(char* path) ++{ ++ strncpy(stateFile, path, PATH_MAX-1); ++} ++ ++void saveAgentState(char* state) ++{ ++ FILE* fptr; ++ if(strlen(stateFile)) ++ { ++ fptr=fopen(stateFile, "w"); ++ if(!fptr) ++ return; ++ fprintf(fptr,"%s", state); ++ fclose(fptr); ++ } ++} ++ ++ + int nxagentHandleConnectionStates(void) + { + #ifdef TEST +@@ -211,6 +238,7 @@ + fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); + + fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("SUSPENDING"); + } + + nxagentDisconnectSession(); +@@ -265,6 +293,7 @@ + fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString()); + #endif + } ++ saveAgentState("SUSPENDED"); + + nxagentResetDisplayHandlers(); + +@@ -622,6 +651,7 @@ + #else + fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString()); + #endif ++ saveAgentState("RUNNING"); + + nxagentRemoveSplashWindow(NULL); + +@@ -785,12 +815,14 @@ + if (nxagentSessionState == SESSION_GOING_DOWN) + { + fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("SUSPENDING"); + + nxagentDisconnectSession(); + } + else if (nxagentSessionState == SESSION_GOING_UP) + { + fprintf(stderr, "Session: Resuming session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("RESUMING"); + + if (nxagentReconnectSession()) + { +@@ -803,6 +835,7 @@ + fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); + + fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("SUSPENDING"); + + nxagentDisconnectSession(); + } +--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h +@@ -34,6 +34,8 @@ + Bool nxagentReconnectSession(void); + int nxagentHandleConnectionStates(void); + void nxagentHandleConnectionChanges(void); ++void setStatePath(char*); ++void saveAgentState(char*); + + enum SESSION_STATE + { +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c +@@ -609,6 +609,7 @@ + #endif + + nxagentSessionState = SESSION_UP; ++ saveAgentState("RUNNING"); + } + + #ifdef BLOCKS +@@ -823,6 +824,7 @@ + */ + + fprintf(stderr, "Session: Terminating session at '%s'.\n", GetTimeAsString()); ++ saveAgentState("TERMINATING"); + + nxagentWaitDisplay(); + +@@ -833,6 +835,7 @@ + { + NXShadowDestroy(); + } ++ saveAgentState("TERMINATED"); + + KillAllClients(); + DEALLOCATE_LOCAL(clientReady); diff --git a/debian/patches/0210_nxcomp_save_session_state.full+lite.patch b/debian/patches/0210_nxcomp_save_session_state.full+lite.patch new file mode 100644 index 000000000..1ef4440d8 --- /dev/null +++ b/debian/patches/0210_nxcomp_save_session_state.full+lite.patch @@ -0,0 +1,15 @@ +Description: Ignore state= option in nxproxy/nxcomp +Author: Oleksandr Shneyder + +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -8872,7 +8872,8 @@ + } + else if (strcasecmp(name, "defer") == 0 || + strcasecmp(name, "tile") == 0 || +- strcasecmp(name, "menu") == 0) ++ strcasecmp(name, "menu") == 0 || ++ strcasecmp(name, "state") == 0 ) + { + #ifdef DEBUG + *logofs << "Loop: Ignoring agent option '" << name diff --git a/debian/patches/0211_nxcomp_set_default_options.full+lite.patch b/debian/patches/0211_nxcomp_set_default_options.full+lite.patch new file mode 100644 index 000000000..7bd8a781d --- /dev/null +++ b/debian/patches/0211_nxcomp_set_default_options.full+lite.patch @@ -0,0 +1,27 @@ +Description: Set default pack and link options to avoid damage of session. +Author: Oleksandr Shneyder + +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -8328,8 +8328,8 @@ + + cerr << "Error" << ": Can't identify 'link' option in string '" + << value << "'.\n"; +- +- return -1; ++ if (ParseLinkOption("adsl") < 0) ++ return -1; + } + } + else if (strcasecmp(name, "limit") == 0) +@@ -8783,8 +8783,8 @@ + + cerr << "Error" << ": Can't identify pack method for string '" + << value << "'.\n"; +- +- return -1; ++ if (ParsePackOption("nopack")<0) ++ return -1; + } + } + else if (strcasecmp(name, "core") == 0) diff --git a/debian/patches/0212_nxcomp_build-on-Android.full+lite.patch b/debian/patches/0212_nxcomp_build-on-Android.full+lite.patch new file mode 100644 index 000000000..528d33b74 --- /dev/null +++ b/debian/patches/0212_nxcomp_build-on-Android.full+lite.patch @@ -0,0 +1,253 @@ +Author: Nito Martinez +Description: Fix FTBFS of nxproxy/nxcomp on Android + +--- a/nxcomp/Jpeg.cpp ++++ b/nxcomp/Jpeg.cpp +@@ -17,6 +17,9 @@ + + #include + ++#ifdef ANDROID ++#include ++#endif + #include + #include + #include +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -4187,7 +4187,7 @@ + + #endif + +- char *separator = rindex(display, ':'); ++ char *separator = strrchr(display, ':'); + + if ((separator == NULL) || !isdigit(*(separator + 1))) + { +@@ -8240,7 +8240,7 @@ + char *name; + char *value; + +- value = rindex(nextOpts, ':'); ++ value = strrchr(nextOpts, ':'); + + if (value != NULL) + { +@@ -11010,7 +11010,7 @@ + packMethod == PACK_LOSSLESS || + packMethod == PACK_ADAPTIVE) + { +- const char *dash = rindex(opt, '-'); ++ const char *dash = strrchr(opt, '-'); + + if (dash != NULL && strlen(dash) == 2 && + *(dash + 1) >= '0' && *(dash + 1) <= '9') +@@ -12275,6 +12275,10 @@ + control -> ShmemServer = 0; + } + ++ // For android, no shared memory available ++ control -> ShmemServer = 0; ++ control -> ShmemClientSize = 0; ++ + return 1; + } + +@@ -13525,7 +13529,7 @@ + + int newPort = port; + +- const char *separator = rindex(opt, ':'); ++ const char *separator = strrchr(opt, ':'); + + if (separator != NULL) + { +--- a/nxcomp/Pgn.cpp ++++ b/nxcomp/Pgn.cpp +@@ -23,6 +23,9 @@ + + #include + ++#ifdef ANDROID ++#include ++#endif + #include + #include + #include +--- a/nxcomp/Proxy.cpp ++++ b/nxcomp/Proxy.cpp +@@ -20,6 +20,11 @@ + #include + #include + #include ++#ifdef ANDROID ++#include ++#include ++#include ++#endif + + #include "Misc.h" + +@@ -31,9 +36,11 @@ + #include + #endif + ++#ifndef ANDROID + #include + #include + #include ++#endif + + #if defined(__EMX__ ) || defined(__CYGWIN32__) + +--- a/nxcomp/ServerChannel.cpp ++++ b/nxcomp/ServerChannel.cpp +@@ -18,7 +18,9 @@ + #include + #include + #include ++#ifndef ANDROID + #include ++#endif + + #include + #include +@@ -1079,7 +1081,6 @@ + + priority_++; + } +- + // + // Account this data to the original opcode. + // +@@ -1500,7 +1501,6 @@ + continue; + } + } +- + // + // Check if user pressed the CTRL+ALT+SHIFT+ESC key + // sequence because was unable to kill the session +@@ -5475,7 +5475,7 @@ + *logofs << "handleColormap: Dumping colormap entries:\n" + << logofs_flush; + +- const unsigned char *p = unpackState_[resource] -> colormap -> data; ++ const unsigned char *p = (const unsigned char *) unpackState_[resource] -> colormap -> data; + + for (unsigned int i = 0; i < unpackState_[resource] -> + colormap -> entries; i++) +@@ -7100,7 +7100,12 @@ + { + encodeBuffer.encodeValue(stage, 2); + ++#ifndef ANDROID + shmemState_ -> present = *(buffer + 8); ++#else ++ shmemState_ -> present = 0; ++ cerr << "Info: handleShmemReply: In android no shared memory. Setting present to 0 hardcoded\n"; ++#endif + shmemState_ -> opcode = *(buffer + 9); + shmemState_ -> event = *(buffer + 10); + shmemState_ -> error = *(buffer + 11); +@@ -7128,7 +7133,12 @@ + cerr << "Info" << ": Using shared memory parameters 1/" + << (shmemState_ -> size / 1024) << "K.\n"; + ++#ifndef ANDROID + shmemState_ -> enabled = 1; ++#else ++ cerr << "Info: handleShmemReply: In android no shared memory. Setting enabled to -1. This should not be displayed\n"; ++ shmemState_ -> enabled = -1; ++#endif + + encodeBuffer.encodeBoolValue(1); + } +@@ -7241,7 +7251,7 @@ + // memory support is disabled by the + // user. + // +- ++#ifndef ANDROID + if (control -> ShmemServer == 1 && + control -> ShmemServerSize > 0 && + enableServer == 1) +@@ -7252,8 +7262,12 @@ + { + memcpy(buffer + 8, "NO-MIT-", 7); + } ++#else ++ cerr << "Info: handleShmemRequest: In android no shared memory. Returning NO-MIT- answer\n"; + +- sequenceQueue_.push(clientSequence_, opcode, ++ memcpy(buffer + 8, "NO-MIT-", 7); ++#endif ++ sequenceQueue_.push(clientSequence_, opcode, + opcodeStore_ -> getShmemParameters, stage); + + // +@@ -7289,9 +7303,13 @@ + + shmemState_ -> size = control -> ShmemServerSize; + ++#ifndef ANDROID + shmemState_ -> id = shmget(IPC_PRIVATE, shmemState_ -> size, + IPC_CREAT | permissions); +- ++#else ++ cerr << "Info: handleShmemReqyest: In android no shared memory (shmget). This message should not be displayed present should never be 1 in android\n"; ++ shmemState_ -> id = -1; ++#endif + if (shmemState_ -> id >= 0) + { + #if defined(TEST) || defined(INFO) +@@ -7302,8 +7320,12 @@ + #endif + + ++#ifndef ANDROID + shmemState_ -> address = shmat(shmemState_ -> id, 0, 0); +- ++#else ++ cerr << "Info: handleShmemReqyest: In android no shared memory (shmat). This message should not be displayed. present should never be 1 in android\n"; ++ shmemState_ -> address = NULL; ++#endif + if (shmemState_ -> address != NULL) + { + #ifdef TEST +@@ -7437,6 +7459,10 @@ + + return 0; + } ++#ifdef ANDROID ++ cerr << "Info: handleShmem: In android no shared memory. enabled should never be 1. This should not be displayed\n"; ++ return 0; ++#endif + + // + // Ignore null requests and requests that will not result +@@ -8054,14 +8080,22 @@ + { + if (shmemState_ != NULL) + { +- if (shmemState_ -> address != NULL) ++ if (shmemState_ -> address != NULL) + { +- shmdt((char *) shmemState_ -> address); ++#ifndef ANDROID ++ shmdt((char *) shmemState_ -> address); ++#else ++ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. address should always be NULL\n"; ++#endif + } + + if (shmemState_ -> id > 0) + { ++#ifndef ANDROID + shmctl(shmemState_ -> id, IPC_RMID, 0); ++#else ++ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. id should always be 0\n"; ++#endif + } + + delete shmemState_; diff --git a/debian/patches/0220_nxproxy_bind-loopback-only.full+lite.patch b/debian/patches/0220_nxproxy_bind-loopback-only.full+lite.patch new file mode 100644 index 000000000..c65b85501 --- /dev/null +++ b/debian/patches/0220_nxproxy_bind-loopback-only.full+lite.patch @@ -0,0 +1,130 @@ +Description: Force NX proxy to bind to loopback devices only (loopback option) +Author: Mike Gabriel +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -952,6 +952,7 @@ + static char displayHost[DEFAULT_STRING_LENGTH] = { 0 }; + static char authCookie[DEFAULT_STRING_LENGTH] = { 0 }; + ++static int loopbackBind = DEFAULT_LOOPBACK_BIND; + static int proxyPort = DEFAULT_NX_PROXY_PORT; + static int xPort = DEFAULT_NX_X_PORT; + +@@ -3959,7 +3960,14 @@ + + tcpAddr.sin_family = AF_INET; + tcpAddr.sin_port = htons(proxyPortTCP); +- tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ if ( loopbackBind ) ++ { ++ tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); ++ } ++ else ++ { ++ tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ } + + if (bind(tcpFD, (sockaddr *) &tcpAddr, sizeof(tcpAddr)) == -1) + { +@@ -4550,7 +4558,14 @@ + + tcpAddr.sin_family = AF_INET; + tcpAddr.sin_port = htons(portTCP); +- tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ if ( loopbackBind ) ++ { ++ tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); ++ } ++ else ++ { ++ tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ } + + if (bind(newFD, (sockaddr *) &tcpAddr, sizeof(tcpAddr)) == -1) + { +@@ -6718,7 +6733,14 @@ + + #ifdef __APPLE__ + +- tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ if ( loopbackBind ) ++ { ++ tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); ++ } ++ else ++ { ++ tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ } + + #else + +@@ -8397,6 +8419,10 @@ + + listenPort = ValidateArg("local", name, value); + } ++ else if (strcasecmp(name, "loopback") == 0) ++ { ++ loopbackBind = ValidateArg("local", name, value); ++ } + else if (strcasecmp(name, "accept") == 0) + { + if (*connectHost != '\0') +@@ -13778,7 +13804,14 @@ + } + else + { +- address = htonl(INADDR_ANY); ++ if ( loopbackBind ) ++ { ++ address = htonl(INADDR_LOOPBACK); ++ } ++ else ++ { ++ address = htonl(INADDR_ANY); ++ } + } + } + else +--- a/nxcomp/Misc.cpp ++++ b/nxcomp/Misc.cpp +@@ -42,6 +42,14 @@ + #undef DEBUG + + // ++// By default nxproxy binds to all network interfaces, setting ++// DEFAULT_LOOPBACK_BIND to 1 enables binding to the loopback ++// device only. ++// ++ ++const int DEFAULT_LOOPBACK_BIND = 0; ++ ++// + // TCP port offset applied to any NX port specification. + // + +@@ -137,6 +145,8 @@ + \n\ + listen=n Local port used for accepting the proxy connection.\n\ + \n\ ++ loopback=b Bind to the loopback device only.\n\ ++\n\ + accept=s Name or IP of host that can connect to the proxy.\n\ + \n\ + connect=s Name or IP of host that the proxy will connect to.\n\ +--- a/nxcomp/Misc.h ++++ b/nxcomp/Misc.h +@@ -90,6 +90,14 @@ + extern const int DEFAULT_NX_SLAVE_PORT_SERVER_OFFSET; + + // ++// NX proxy binds to all network interfaces by default ++// With the -loopback parameter, you can switch ++// over to binding to the loopback device only. ++// ++ ++extern const int DEFAULT_LOOPBACK_BIND; ++ ++// + // Return strings containing various info. + // + diff --git a/debian/patches/024_fix-make-clean.full+lite.patch b/debian/patches/024_fix-make-clean.full+lite.patch deleted file mode 100644 index 7f0b327cf..000000000 --- a/debian/patches/024_fix-make-clean.full+lite.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: fix clean rule in nxcomp's Makefile.in -Author: Mike Gabriel - ---- a/nxcomp/Makefile.in -+++ b/nxcomp/Makefile.in -@@ -313,4 +313,4 @@ - - distclean: clean - -rm -rf autom4te.cache config.status config.log \ -- config.cache depend.status Makefile tags -+ config.cache depend.status Makefile tags configure ---- a/nxproxy/Makefile.in -+++ b/nxproxy/Makefile.in -@@ -109,4 +109,4 @@ - $(PROGRAM) $(PROGRAM).exe $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) - - distclean: clean -- -rm -f config.status config.log config.cache depend.status Makefile tags -+ -rm -rf autom4te.cache config.status config.log config.cache depend.status Makefile tags configure diff --git a/debian/patches/024_fix-make-clean.full.patch b/debian/patches/024_fix-make-clean.full.patch deleted file mode 100644 index 356ce47d8..000000000 --- a/debian/patches/024_fix-make-clean.full.patch +++ /dev/null @@ -1,51 +0,0 @@ -Description: Provide main Makefile for whole source tree - By design this patch is not needed to be sent upstream. -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-10-19 ---- a/nx-X11/Makefile -+++ b/nx-X11/Makefile -@@ -138,6 +138,7 @@ - - xmakefile: Imakefile - $(RM) xmakefile -+ @rm -f $(IRULESRC)/date.def; echo "" > $(IRULESRC)/date.def; - $(IMAKE_CMD) -s xmakefile -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) - - World.Win32: -@@ -197,11 +198,16 @@ - # a copy of every rule that might be invoked at top level - - clean: -- $(MAKE_CMD) $@ -+ -$(MAKE_CMD) $@ -+ find config -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done -+ find lib -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done -+ find programs -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done -+ find include -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done -+ rm -f config/cf/{version.def,date.def} - dangerous_strip_clean: - $(MAKE_CMD) $@ - distclean: -- $(MAKE_CMD) $@ -+ -$(MAKE_CMD) $@ - $(RM) xmakefile $(IRULESRC)/version.def $(IRULESRC)/date.def - depend: - $(MAKE_CMD) $@ ---- a/nxcompext/Makefile.in -+++ b/nxcompext/Makefile.in -@@ -185,5 +185,5 @@ - @ALL@ - - distclean: clean -- -rm -rf autom4te.cache config.status config.log \ -+ -rm -rf autom4te.cache config.status config.log configure \ - config.cache depend.status Makefile tags ---- a/nxcompshad/Makefile.in -+++ b/nxcompshad/Makefile.in -@@ -222,4 +222,4 @@ - $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe - - distclean: clean -- -rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache -+ -rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache configure diff --git a/debian/patches/025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch b/debian/patches/025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch deleted file mode 100644 index 66ca8c33e..000000000 --- a/debian/patches/025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch +++ /dev/null @@ -1,40 +0,0 @@ -Description: Fix FTBFS when built against libjpeg9a -Author: Gabriel Marcano ---- a/nxcomp/Jpeg.cpp 2014-08-19 22:23:36.139072400 -0400 -+++ b/nxcomp/Jpeg.cpp 2014-08-19 22:25:24.323182800 -0400 -@@ -440,7 +440,7 @@ - - JpegSetSrcManager(&cinfo, compressedData, compressedLen); - -- jpeg_read_header(&cinfo, 1); -+ jpeg_read_header(&cinfo, TRUE); - - if (jpegError) goto AbortDecompressJpeg16; - -@@ -581,7 +581,7 @@ - - JpegSetSrcManager(&cinfo, compressedData, compressedLen); - -- jpeg_read_header(&cinfo, 1); -+ jpeg_read_header(&cinfo, TRUE); - - if (jpegError) goto AbortDecompressJpeg24; - -@@ -718,7 +718,7 @@ - - JpegSetSrcManager(&cinfo, compressedData, compressedLen); - -- jpeg_read_header(&cinfo, 1); -+ jpeg_read_header(&cinfo, TRUE); - - if (jpegError) goto AbortDecompressJpeg32; - -@@ -833,7 +833,7 @@ - jpegSrcManager.bytes_in_buffer = jpegBufferLen; - jpegSrcManager.next_input_byte = (JOCTET *)jpegBufferPtr; - -- return 1; -+ return TRUE; - } - - static void JpegSkipInputData(j_decompress_ptr cinfo, long num_bytes) diff --git a/debian/patches/026_nxcomp_honour-optflags.full+lite.patch b/debian/patches/026_nxcomp_honour-optflags.full+lite.patch deleted file mode 100644 index a2713a1bc..000000000 --- a/debian/patches/026_nxcomp_honour-optflags.full+lite.patch +++ /dev/null @@ -1,31 +0,0 @@ -Description: Honour compiler/linker option flags -Forwarded: pending -Author: Orion Poplawski -diff -up a/nxcomp/configure.in b/nxcomp/configure.in ---- a/nxcomp/configure.in 2012-11-10 06:40:55.000000000 -0700 -+++ b/nxcomp/configure.in 2012-12-11 13:13:19.390229196 -0700 -@@ -7,8 +7,8 @@ AC_PREREQ(2.13) - - dnl Set our default compilation flags. - --CXXFLAGS="-O3 -fno-rtti -fno-exceptions" --CFLAGS="-O3" -+CXXFLAGS="$CXXFLAGS -O3 -fno-rtti -fno-exceptions" -+CFLAGS="$CFLAGS -O3" - - dnl Reset default linking directives. - -diff -up a/nxproxy/configure.in b/nxproxy/configure.in ---- a/nxproxy/configure.in 2012-11-10 06:40:55.000000000 -0700 -+++ b/nxproxy/configure.in 2012-12-11 13:16:19.955301045 -0700 -@@ -7,8 +7,8 @@ AC_PREREQ(2.13) - - dnl Reset default compilation flags. - --CXXFLAGS="-O3" --CPPFLAGS="-O3" -+CXXFLAGS="$CXXFLAGS -O3" -+CPPFLAGS="$CPPFLAGS -O3" - - dnl Prefer headers and libraries from nx-X11 if present. - diff --git a/debian/patches/026_nxcompext_honour-optflags.full.patch b/debian/patches/026_nxcompext_honour-optflags.full.patch deleted file mode 100644 index 4d5df3e6b..000000000 --- a/debian/patches/026_nxcompext_honour-optflags.full.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: Honour compiler/linker option flags -Forwarded: pending -Author: Orion Poplawski -diff -up a/nxcompext/configure.in b/nxcompext/configure.in ---- a/nxcompext/configure.in 2012-11-10 06:40:55.000000000 -0700 -+++ b/nxcompext/configure.in 2012-12-11 13:15:26.712576302 -0700 -@@ -7,8 +7,8 @@ AC_PREREQ(2.13) - - dnl Reset default compilation flags. - --CXXFLAGS="-O3" --CFLAGS="-O3" -+CXXFLAGS="$CXXFLAGS -O3" -+CFLAGS="$CFLAGS -O3" - - dnl Reset default linking directives. - diff --git a/debian/patches/026_nxcompshad_honour-optflags.full.patch b/debian/patches/026_nxcompshad_honour-optflags.full.patch deleted file mode 100644 index ea1d2ad80..000000000 --- a/debian/patches/026_nxcompshad_honour-optflags.full.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: Honour compiler/linker option flags -Forwarded: pending -Author: Orion Poplawski -diff -up a/nxcompshad/configure.in b/nxcompshad/configure.in ---- a/nxcompshad/configure.in 2012-11-10 06:40:56.000000000 -0700 -+++ b/nxcompshad/configure.in 2012-12-11 13:13:25.915196300 -0700 -@@ -7,8 +7,8 @@ AC_PREREQ(2.13) - - dnl Reset default compilation flags. - --CXXFLAGS="-O3" --CPPFLAGS="-O3" -+CXXFLAGS="$CXXFLAGS -O3" -+CPPFLAGS="$CPPFLAGS -O3" - - dnl Reset default linking directives. - diff --git a/debian/patches/027_nxcomp_abstract-X11-socket.full+lite.patch b/debian/patches/027_nxcomp_abstract-X11-socket.full+lite.patch deleted file mode 100644 index 4c457c5d5..000000000 --- a/debian/patches/027_nxcomp_abstract-X11-socket.full+lite.patch +++ /dev/null @@ -1,59 +0,0 @@ -Description: Add X11 abstract socket support to nxcomp/nxproxy -Author: Mike Gabriel - -diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp -index 92b6fc2..d86809d 100644 ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -4250,6 +4250,39 @@ int SetupDisplaySocket(int &xServerAddrFamily, sockaddr *&xServerAddr, - // where the socket will be created. - // - -+ // Try abstract X11 socket first (via a test connect), if that fails -+ // fall back to Unix domain socket file. -+ -+ #ifdef __linux__ -+ int testSocketFD; -+ testSocketFD = socket(xServerAddrFamily, SOCK_STREAM, PF_UNSPEC); -+ -+ int len = sprintf(unixSocketName + 1, "/tmp/.X11-unix/X%d", xPort); -+ unixSocketName[0] = '\0'; -+ -+ sockaddr_un *xServerAddrABSTRACT = new sockaddr_un; -+ memset(xServerAddrABSTRACT, 0, xServerAddrLength); -+ xServerAddrABSTRACT -> sun_family = AF_UNIX; -+ memcpy(xServerAddrABSTRACT -> sun_path, unixSocketName, len+1); -+ xServerAddrLength = len +3; -+ -+ int ret = connect(testSocketFD, (struct sockaddr *) xServerAddrABSTRACT, xServerAddrLength); -+ if (ret == 0) { -+ -+ cerr << "Info" << ": Using abstract X11 socket in kernel namespace " -+ << "for accessing DISPLAY=:" << xPort << ".\n"; -+ -+ close(testSocketFD); -+ xServerAddr = (sockaddr *) xServerAddrABSTRACT; -+ return 1; -+ -+ } else { -+ -+ cerr << "Info" << ": Falling back to file system X11 socket " -+ << "for accessing DISPLAY=:" << xPort << ".\n"; -+ -+ #endif -+ - struct stat statInfo; - - char unixSocketDir[DEFAULT_STRING_LENGTH]; -@@ -4322,6 +4355,11 @@ int SetupDisplaySocket(int &xServerAddrFamily, sockaddr *&xServerAddr, - - xServerAddr = (sockaddr *) xServerAddrUNIX; - xServerAddrLength = sizeof(sockaddr_un); -+ -+ #ifdef __linux__ -+ -+ } -+ #endif - } - else - { diff --git a/debian/patches/028_nx-X11_abstract-kernel-sockets.full.patch b/debian/patches/028_nx-X11_abstract-kernel-sockets.full.patch deleted file mode 100644 index 279f9a9af..000000000 --- a/debian/patches/028_nx-X11_abstract-kernel-sockets.full.patch +++ /dev/null @@ -1,321 +0,0 @@ -Author: Mike Gabriel -Description: Support abstract local sockets for Linux systems -Abstract: - Relevant code taken from xtrans 1.2.7 on 2014-06-11. - ---- a/nx-X11/lib/xtrans/Xtranssock.c -+++ b/nx-X11/lib/xtrans/Xtranssock.c -@@ -172,6 +172,8 @@ - sock_init();\ - IBMsockInit = 1;\ - } -+ -+ - #undef EINTR - #define EINTR SOCEINTR - #undef EINVAL -@@ -192,6 +194,10 @@ - #define SocketInitOnce() /**/ - #endif - -+#if defined(linux) -+#define HAVE_ABSTRACT_SOCKETS -+#endif -+ - #define MIN_BACKLOG 128 - #ifdef SOMAXCONN - #if SOMAXCONN > MIN_BACKLOG -@@ -532,7 +538,7 @@ - - void TRANS(SocketRejectConnection) (XtransConnInfo ciptr) - { -- size_t sa_l = sizeof(struct sockaddr); -+ socklen_t sa_l = sizeof(struct sockaddr); - struct sockaddr sa; - fd_set fs; - struct timeval t; -@@ -914,9 +920,11 @@ - struct sockaddr_in socknamev4; - void *socknamePtr; - #if defined(SVR4) || defined(__SCO__) -+# define SOCKLEN_T_PTR void* - size_t namelen; - #else -- int namelen; -+# define SOCKLEN_T_PTR socklen_t* -+ socklen_t namelen; - #endif - - PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0); -@@ -935,7 +943,7 @@ - } - - if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr, -- (void *)&namelen) < 0) -+ (SOCKLEN_T_PTR)&namelen) < 0) - { - #ifdef WIN32 - errno = WSAGetLastError(); -@@ -1477,23 +1485,28 @@ - - #ifdef UNIXCONN - static int --set_sun_path(const char *port, const char *upath, char *path) -+set_sun_path(const char *port, const char *upath, char *path, int abstract) - { - struct sockaddr_un s; - int maxlen = sizeof(s.sun_path) - 1; -+ const char *at = ""; - - if (!port || !*port || !path) - return -1; - -- if (*port == '/') { /* a full pathname */ -- if (strlen(port) > maxlen) -- return -1; -- sprintf(path, "%s", port); -- } else { -- if (strlen(port) + strlen(upath) > maxlen) -- return -1; -- sprintf(path, "%s%s", upath, port); -- } -+#ifdef HAVE_ABSTRACT_SOCKETS -+ if (port[0] == '@') -+ upath = ""; -+ else if (abstract) -+ at = "@"; -+#endif -+ -+ if (*port == '/') /* a full pathname */ -+ upath = ""; -+ -+ if (strlen(port) + strlen(upath) > maxlen) -+ return -1; -+ snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port); - return 0; - } - #endif -@@ -1726,6 +1739,12 @@ - int oldUmask; - int status; - unsigned int mode; -+ char tmpport[108]; -+ -+ int abstract = 0; -+#ifdef HAVE_ABSTRACT_SOCKETS -+ abstract = ciptr->transptr->flags & TRANS_ABSTRACT; -+#endif - - PRMSG (2, "SocketUNIXCreateListener(%s)\n", - port ? port : "NULL", 0, 0); -@@ -1741,11 +1760,11 @@ - mode = 0777; - #endif - #ifdef NX_TRANS_SOCKET -- if (trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) { -+ if (!abstract && trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) { - PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", - _NXGetUnixDir(UNIX_DIR), errno, 0); - #else -- if (trans_mkdir(UNIX_DIR, mode) == -1) { -+ if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) { - PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", - UNIX_DIR, errno, 0); - #endif -@@ -1754,13 +1773,18 @@ - } - #endif - -+ memset(&sockname, 0, sizeof(sockname)); - sockname.sun_family = AF_UNIX; - -+ if (!(port && *port)) { -+ snprintf (tmpport, sizeof(tmpport), "%s%ld", UNIX_PATH, (long)getpid()); -+ port = tmpport; -+ } - if (port && *port) { - #ifdef NX_TRANS_SOCKET -- if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path) != 0) { -+ if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path, abstract) != 0) { - #else -- if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { -+ if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) { - #endif - PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; -@@ -1784,7 +1808,12 @@ - fprintf(stderr, "SocketUNIXCreateListener: Unlinking path [%s] for ciptr at [%p].\n", - sockname.sun_path, (void *) ciptr); - #endif -- unlink (sockname.sun_path); -+ if (abstract) { -+ sockname.sun_path[0] = '\0'; -+ namelen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&sockname.sun_path[1]); -+ } -+ else -+ unlink (sockname.sun_path); - - if ((status = TRANS(SocketCreateListener) (ciptr, - (struct sockaddr *) &sockname, namelen, flags)) < 0) -@@ -1814,6 +1843,9 @@ - return TRANS_CREATE_LISTENER_FAILED; - } - -+ if (abstract) -+ sockname.sun_path[0] = '@'; -+ - ciptr->family = sockname.sun_family; - ciptr->addrlen = namelen; - memcpy (ciptr->addr, &sockname, ciptr->addrlen); -@@ -1823,7 +1855,6 @@ - return 0; - } - -- - static int - TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr) - -@@ -1836,15 +1867,20 @@ - struct stat statb; - int status = TRANS_RESET_NOOP; - unsigned int mode; -+ int abstract = 0; -+#ifdef HAVE_ABSTRACT_SOCKETS -+ abstract = ciptr->transptr->flags & TRANS_ABSTRACT; -+#endif - - PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0); - -- if (stat (unsock->sun_path, &statb) == -1 || -+ if (!abstract && ( -+ stat (unsock->sun_path, &statb) == -1 || - ((statb.st_mode & S_IFMT) != - #if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK) - S_IFIFO)) - #else -- S_IFSOCK)) -+ S_IFSOCK))) - #endif - { - int oldUmask = umask (0); -@@ -2034,6 +2070,11 @@ - } - - -+ /* -+ * if the socket is abstract, we already modified the address to have a -+ * @ instead of the initial NUL, so no need to do that again here. -+ */ -+ - newciptr->addrlen = ciptr->addrlen; - memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); - -@@ -2626,6 +2667,12 @@ - struct sockaddr_un sockname; - int namelen; - -+ -+ int abstract = 0; -+#ifdef HAVE_ABSTRACT_SOCKETS -+ abstract = ciptr->transptr->flags & TRANS_ABSTRACT; -+#endif -+ - #if defined(hpux) && defined(X11_t) - struct sockaddr_un old_sockname; - int old_namelen; -@@ -2674,9 +2721,9 @@ - sockname.sun_family = AF_UNIX; - - #ifdef NX_TRANS_SOCKET -- if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path) != 0) { -+ if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path, abstract) != 0) { - #else -- if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { -+ if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) { - #endif - PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); - return TRANS_CONNECT_FAILED; -@@ -2722,6 +2769,14 @@ - #endif - - /* -+ * Adjust the socket path if using abstract sockets. -+ * Done here because otherwise all the strlen() calls above would fail. -+ */ -+ -+ if (abstract) -+ sockname.sun_path[0] = '\0'; -+ -+ /* - * Do the connect() - */ - -@@ -2757,12 +2812,18 @@ - * should try again. - */ - -- if (olderrno == ENOENT || olderrno == EINTR) -- return TRANS_TRY_CONNECT_AGAIN; -- else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) -+ if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) - return TRANS_IN_PROGRESS; -- else -- { -+ else if (olderrno == EINTR) -+ return TRANS_TRY_CONNECT_AGAIN; -+ else if (olderrno == ENOENT || olderrno == ECONNREFUSED) -+ /* If opening as abstract failed, try again normally */ -+ if (abstract) { -+ ciptr->transptr->flags &= ~(TRANS_ABSTRACT); -+ return TRANS_TRY_CONNECT_AGAIN; -+ } else { -+ return TRANS_CONNECT_FAILED; -+ } else { - PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n", - EGET(),0, 0); - -@@ -2791,6 +2852,9 @@ - return TRANS_CONNECT_FAILED; - } - -+ if (abstract) -+ sockname.sun_path[0] = '@'; -+ - ciptr->family = AF_UNIX; - ciptr->addrlen = namelen; - ciptr->peeraddrlen = namelen; -@@ -3323,7 +3387,11 @@ - Xtransport TRANS(SocketLocalFuncs) = { - /* Socket Interface */ - "local", -+#ifdef HAVE_ABSTRACT_SOCKETS -+ TRANS_ABSTRACT, -+#else - 0, -+#endif - #ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), - #endif /* TRANS_CLIENT */ -@@ -3369,7 +3437,7 @@ - Xtransport TRANS(SocketUNIXFuncs) = { - /* Socket Interface */ - "unix", --#if !defined(LOCALCONN) -+#if !defined(LOCALCONN) && !defined(HAVE_ABSTRACT_SOCKETS) - TRANS_ALIAS, - #else - 0, ---- a/nx-X11/lib/xtrans/Xtransint.h -+++ b/nx-X11/lib/xtrans/Xtransint.h -@@ -374,9 +374,10 @@ - #define TRANS_DISABLED (1<<2) /* Don't open this one */ - #define TRANS_NOLISTEN (1<<3) /* Don't listen on this one */ - #define TRANS_NOUNLINK (1<<4) /* Dont unlink transport endpoints */ -+#define TRANS_ABSTRACT (1<<5) /* Use abstract sockets if available */ - - /* Flags to preserve when setting others */ --#define TRANS_KEEPFLAGS (TRANS_NOUNLINK) -+#define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT) - - /* - * readv() and writev() don't exist or don't work correctly on some diff --git a/debian/patches/029_nxcomp_ppc64.full+lite.patch b/debian/patches/029_nxcomp_ppc64.full+lite.patch deleted file mode 100644 index 9d454d5db..000000000 --- a/debian/patches/029_nxcomp_ppc64.full+lite.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: Fix BIGENDIAN issue in nxcomp (relevant on PPC64 arch) -Author: Mihai Moldovan - ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -6832,9 +6832,9 @@ - { - sockaddr_in newAddr; - -- size_t addrLen = sizeof(sockaddr_in); -+ socklen_t addrLen = sizeof(sockaddr_in); - -- newFD = accept(proxyFD, (sockaddr *) &newAddr, (socklen_t *) &addrLen); -+ newFD = accept(proxyFD, (sockaddr *) &newAddr, &addrLen); - - if (newFD == -1) - { diff --git a/debian/patches/0300_nxagent_set-wm-class.full.patch b/debian/patches/0300_nxagent_set-wm-class.full.patch new file mode 100644 index 000000000..70b1c9212 --- /dev/null +++ b/debian/patches/0300_nxagent_set-wm-class.full.patch @@ -0,0 +1,60 @@ +Description: Set WM_CLASS to X2GoAgent/NXAgent + Depending on the binary name of the agent either NXAgent + or X2GoAgent is set as WM_Class. + . + This is needed for some window managers (like the one shipped with + Maemo) + . + The original WM_CLASS patch has been taken from the FreeNX patch + series, author unknown. + . + The nxagent/x2goagent has been done by the X2Go Project, author + see below. +Forwarded: not-needed +Author: Oleksandr Shneyder +Last-Update: 2012-01-11 +--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c +@@ -1762,6 +1762,42 @@ + nxagentDefaultWindows[pScreen->myNum]); + #endif + ++ /* ++ * Setting WM_CLASS to "X2GoAgent" when running in X2Go Agent mode ++ * we need it to properly display all window parameters by some WMs ++ * (for example on Maemo) ++ */ ++ if(nxagentX2go) ++ { ++ #ifdef TEST ++ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n", ++ nxagentDefaultWindows[pScreen->myNum]); ++ #endif ++ XClassHint hint; ++ hint.res_name=malloc(strlen("X2GoAgent")+1); ++ hint.res_class=malloc(strlen("X2GoAgent")+1); ++ strcpy(hint.res_name,"X2GoAgent"); ++ strcpy(hint.res_class,"X2GoAgent"); ++ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint); ++ free(hint.res_name); ++ free(hint.res_class); ++ } else { ++ #ifdef TEST ++ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n", ++ nxagentDefaultWindows[pScreen->myNum]); ++ #endif ++ ++ XClassHint hint; ++ hint.res_name=malloc(strlen("NXAgent")+1); ++ hint.res_class=malloc(strlen("NXAgent")+1); ++ strcpy(hint.res_name,"NXAgent"); ++ strcpy(hint.res_class,"NXAgent"); ++ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint); ++ free(hint.res_name); ++ free(hint.res_class); ++ } ++ ++ + if (nxagentOption(Fullscreen)) + { + nxagentFullscreenWindow = nxagentDefaultWindows[pScreen->myNum]; diff --git a/debian/patches/0301_nx-X11_use-shared-libs.full.patch b/debian/patches/0301_nx-X11_use-shared-libs.full.patch new file mode 100644 index 000000000..200147449 --- /dev/null +++ b/debian/patches/0301_nx-X11_use-shared-libs.full.patch @@ -0,0 +1,106 @@ +Description: Use shared libraries + Many distributions have a policy to reduce code duplications. + One means to avoid such duplications is to use shared libraries + instead of using libs that are ofter shipped for convenience. + . + Fedora: + http://fedoraproject.org/wiki/Packaging:Guidelines#Shared_Libraries + . + Debian (Section 10.7.4 of Debian policy): + http://www.debian.org/doc/debian-policy/ch-files.html +Forwarded: pending... +Author: Jan Engelhardt +Last-Update: 2012-02-14 +--- + nx-X11/config/cf/host.def | 11 ++++++----- + nx-X11/programs/Xserver/Imakefile | 6 +++--- + nx-X11/programs/nxauth/Imakefile | 2 +- + 3 files changed, 10 insertions(+), 9 deletions(-) + +Index: nx-X11/config/cf/host.def +=================================================================== +--- a/nx-X11/config/cf/host.def ++++ b/nx-X11/config/cf/host.def +@@ -138,7 +138,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de + #define BuildRenderLibrary YES + #define SharedLibFreetype2 YES + #define NormalLibFreetype2 YES +-#define FontLibSharedFreeType NO ++#define FontLibSharedFreeType YES + #endif + + /* +@@ -649,6 +649,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de + * + #define XserverStaticFontLib NO + */ ++#define XserverStaticFontLib YES + + /* + * To enable binary compatibility with previous versions of the font +@@ -733,7 +734,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de + #define BuildXKB YES + #define BuildXKBlib YES + +-#define SharedLibXau NO ++#define SharedLibXau YES + + /* + * If you are running NetBSD 0.9C or later, and have the aperture driver +@@ -956,9 +957,9 @@ XCOMM $XFree86: xc/config/cf/xf86site.de + #define BuildXterm YES + */ + +-#define SharedLibXau NO ++#define SharedLibXau YES + +-#define SharedLibXdmcp NO ++#define SharedLibXdmcp YES + + #define BuildXaw7 YES + +@@ -976,7 +977,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de + #define BuildFontServer NO + #define BuildFreeType NO + #define BuildXTrueType NO +-#define FontLibSharedFreeType NO ++#define FontLibSharedFreeType YES + #endif + + #if !defined(NXZaurusXServer) && defined(NXiPAQXServer) +Index: nx-X11/programs/Xserver/Imakefile +=================================================================== +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -1013,15 +1013,15 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTS + #if defined(SunArchitecture) + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ + -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite ++ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp + #elif defined(cygwinArchitecture) + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ + -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ +- -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst ++ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp + #else + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ + -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama ++ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp + #endif + + #endif +Index: nx-X11/programs/nxauth/Imakefile +=================================================================== +--- a/nx-X11/programs/nxauth/Imakefile ++++ b/nx-X11/programs/nxauth/Imakefile +@@ -26,7 +26,7 @@ XCOMM $XFree86: xc/programs/xauth/Imakef + + INCLUDES=-I../../lib + DEPLIBS = $(DEPXAUTHLIB) +- LOCAL_LIBRARIES = ../../exports/lib/libXau.a ++ LOCAL_LIBRARIES = $(XAUTHLIB) + SRCS = xauth.c gethost.c process.c parsedpy.c + OBJS = xauth.o gethost.o process.o parsedpy.o + CONN_DEFINES = $(CONNECTION_FLAGS) diff --git a/debian/patches/0302_nx-X11_xkbbasedir-detection.full.patch b/debian/patches/0302_nx-X11_xkbbasedir-detection.full.patch new file mode 100644 index 000000000..dac3d8a08 --- /dev/null +++ b/debian/patches/0302_nx-X11_xkbbasedir-detection.full.patch @@ -0,0 +1,84 @@ +Description: Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir +Author: Mike Gabriel +Abstract: + In recent (as of 2014/06) X.org release, the keymap.dir file + has become obsolete. Let's test for the xkb/rules/base file + instead. +--- a/nx-X11/programs/Xserver/xkb/ddxLoad.c ++++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c +@@ -180,7 +180,7 @@ + + #define NX_XKB_BASE_DIRECTORY "/usr/lib/X11/xkb" + #define NX_XKB_ALTERNATE_BASE_DIRECTORY "/usr/share/X11/xkb" +-#define NX_KEYMAP_DIR_FILE "keymap.dir" ++#define NX_XKB_RULES_BASE_FILE "rules/base" + #define NX_ALT_XKBCOMP_PATH "/usr/bin" + + static char _NXXkbBasePath[PATH_MAX]; +@@ -189,43 +189,43 @@ + static int NXVerifyXkbBaseDirectory(const char *dirPath) + { + int size; +- char *keymapDirFilePath; +- struct stat keymapDirFileStat; ++ char *rulesBaseFilePath; ++ struct stat rulesBaseFileStat; + + /* +- * If keymap.dir file +- * is not present into +- * Xkb Base Directory, ++ * If rules/base file ++ * is not present inside ++ * the Xkb Base Directory, + * we suppose that the + * path is not valid. + */ + + size = strlen(dirPath) + strlen("/") + +- strlen(NX_KEYMAP_DIR_FILE) + 1; ++ strlen(NX_XKB_RULES_BASE_FILE) + 1; + +- if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL) ++ if ((rulesBaseFilePath = malloc((size + 1) * sizeof(char))) == NULL) + { + FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n"); + } + +- strcpy(keymapDirFilePath, dirPath); +- strcat(keymapDirFilePath, "/"); +- strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE); ++ strcpy(rulesBaseFilePath, dirPath); ++ strcat(rulesBaseFilePath, "/"); ++ strcat(rulesBaseFilePath, NX_XKB_RULES_BASE_FILE); + + #ifdef TEST + fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n", +- keymapDirFilePath); ++ rulesBaseFilePath); + #endif + +- if (stat(keymapDirFilePath, &keymapDirFileStat) != 0) ++ if (stat(rulesBaseFilePath, &rulesBaseFileStat) != 0) + { + + #ifdef TEST + fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n", +- keymapDirFilePath); ++ rulesBaseFilePath); + #endif + +- free(keymapDirFilePath); ++ free(rulesBaseFilePath); + + return 0; + } +@@ -235,7 +235,7 @@ + dirPath); + #endif + +- free(keymapDirFilePath); ++ free(rulesBaseFilePath); + + return 1; + } diff --git a/debian/patches/030_nx-X11_configure-args.full.patch b/debian/patches/030_nx-X11_configure-args.full.patch deleted file mode 100644 index 67184d330..000000000 --- a/debian/patches/030_nx-X11_configure-args.full.patch +++ /dev/null @@ -1,51 +0,0 @@ -Description: Allow to pass in configure args. - Allow to pass in configure args. -Forward: pending -Author: Jan Engelhardt -Last-Update: 2012-02-14 ---- - nx-X11/lib/X11/Imakefile | 6 ++++-- - nx-X11/programs/Xserver/Imakefile | 4 +++- - 2 files changed, 7 insertions(+), 2 deletions(-) - -Index: nx-X11/lib/X11/Imakefile -=================================================================== ---- a/nx-X11/lib/X11/Imakefile -+++ b/nx-X11/lib/X11/Imakefile -@@ -1147,15 +1147,17 @@ ks_tables.h: $(XINCLUDESRC)/keysymdef.h - - includes:: ks_tables.h - -+CONFIGURE ?= ./configure -+ - #if NXLibraries - - $(NX_XCOMPCONFIGTARGET): - cd ../../../nxcomp && \ -- ./configure -+ ${CONFIGURE} - - $(NX_XCOMPEXTCONFIGTARGET): - cd ../../../nxcompext && \ -- ./configure -+ ${CONFIGURE} - - #ifdef SunArchitecture - $(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) -Index: nx-X11/programs/Xserver/Imakefile -=================================================================== ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -1036,9 +1036,11 @@ NX_XSHADOWLIBDIR = $(XTOP)/../nxcomps - NX_XSHADOWLIBTARGET = $(NX_XSHADOWLIBDIR)/$(NX_XSHADOWLIBNAME) - NX_XSHADOWCONFIGTARGET = $(NX_XSHADOWLIBDIR)/config.status - -+CONFIGURE ?= ./configure -+ - $(NX_XSHADOWCONFIGTARGET): - cd $(NX_XSHADOWLIBDIR) && \ -- ./configure -+ ${CONFIGURE} - - #ifdef SunArchitecture - $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) diff --git a/debian/patches/031_nx-X11_parallel-make.full.patch b/debian/patches/031_nx-X11_parallel-make.full.patch deleted file mode 100644 index 496020545..000000000 --- a/debian/patches/031_nx-X11_parallel-make.full.patch +++ /dev/null @@ -1,200 +0,0 @@ -Description: Enable parallel make - Restore ability to build things in parallel. - (${MAKE} must always appear in the rule directly, and not be - hidden through expansions of other variables to get this to work.) -Forward: pending -Author: Jan Engelhardt -Last-Update: 2012-01-26 22:29:13.993994227 +0100 - ---- - nx-X11/Makefile | 64 +++++++++++++++++----------------- - nx-X11/config/imake/Makefile.ini | 1 - nx-X11/lib/X11/Imakefile | 12 ++---- - nx-X11/programs/Xserver/Imakefile | 4 +- - 10 files changed, 60 insertions(+), 69 deletions(-) - ---- a/nx-X11/Makefile -+++ b/nx-X11/Makefile -@@ -32,8 +32,8 @@ - VERSPROG = $(CONFIGSRC)/util/printver.exe - - all: -- @$(MAKE_CMD) xmakefile-exists || $(MAKE) all-initial -- @$(MAKE_CMD) $@ -+ @${MAKE} ${MAKE_OPTS} xmakefile-exists || $(MAKE) all-initial -+ @${MAKE} ${MAKE_OPTS} $@ - - all-initial: - @echo Please use make World, or on NT use nmake World.Win32. -@@ -57,8 +57,8 @@ - @date - @echo "" - @if [ -f xmakefile ]; then \ -- $(MAKE_CMD) -k distclean || \ -- $(MAKE_CMD) -k clean || \ -+ ${MAKE} ${MAKE_OPTS} -k distclean || \ -+ ${MAKE} ${MAKE_OPTS} -k clean || \ - $(RM) xmakefile; \ - fi - @if [ ! -f $(IRULESRC)/host.def ]; then \ -@@ -84,14 +84,14 @@ - # fi - cd $(IMAKESRC) && $(MAKE) $(FLAGS) clean - $(MAKE) $(MFLAGS) Makefile.boot -- $(MAKE_CMD) $(MFLAGS) version.def -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) version.def - $(MAKE) $(MFLAGS) Makefile.boot -- $(MAKE_CMD) $(MFLAGS) VerifyOS -- $(MAKE_CMD) $(MFLAGS) Makefiles -- $(MAKE_CMD) $(MFLAGS) BOOTSTRAPSUBDIRS= clean -- $(MAKE_CMD) $(MFLAGS) includes -- $(MAKE_CMD) $(MFLAGS) depend -- $(MAKE_CMD) $(MFLAGS) $(WORLDOPTS) World -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) VerifyOS -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) Makefiles -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) BOOTSTRAPSUBDIRS= clean -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) includes -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) depend -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) $(WORLDOPTS) World - @echo "" - @date - @echo "" -@@ -154,15 +154,15 @@ - -if exist xmakefile.bak del xmakefile.bak - -if exist xmakefile ren xmakefile xmakefile.bak - $(IMAKE:/=\) -s xmakefile -I$(IRULESRC) $(IMAKE_DEFINES) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) -- $(MAKE_CMD) $(MFLAGS) VerifyOS -- $(MAKE_CMD) $(MFLAGS) Makefiles -- $(MAKE_CMD) $(MFLAGS) clean -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) VerifyOS -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) Makefiles -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) clean - cd $(CONFIGSRC)\util - $(MAKE) mkdirhier.exe - cd ..\.. -- $(MAKE_CMD) $(MFLAGS) includes -- $(MAKE_CMD) $(MFLAGS) depend -- $(MAKE_CMD) $(MFLAGS) $(WIN32WORLDOPTS) -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) includes -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) depend -+ ${MAKE} ${MAKE_OPTS} $(MFLAGS) $(WIN32WORLDOPTS) - @echo : - @echo : - @echo Full build of $(RELEASE) complete. -@@ -198,38 +198,38 @@ - # a copy of every rule that might be invoked at top level - - clean: -- -$(MAKE_CMD) $@ -+ -${MAKE_CMD} ${MAKE_OPTS} $@ - find config -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done - find lib -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done - find programs -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done - find include -type f | egrep '.*/Makefile$$' | while read makefile; do rm -f $$makefile; done - rm -f config/cf/{version.def,date.def} - dangerous_strip_clean: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - distclean: -- -$(MAKE_CMD) $@ -+ -${MAKE} ${MAKE_OPTS} $@ - $(RM) xmakefile $(IRULESRC)/version.def $(IRULESRC)/date.def - depend: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - Everything: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - external.ln: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - includes: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - install.sdk: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - install.ln: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - install.man: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - install: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - Makefiles: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - man_keywords: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - tags: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ - VerifyOS: -- $(MAKE_CMD) $@ -+ ${MAKE} ${MAKE_OPTS} $@ ---- a/nx-X11/config/imake/Makefile.ini -+++ b/nx-X11/config/imake/Makefile.ini -@@ -21,7 +21,6 @@ - SHELL = /bin/sh - RM = rm -f - MV = mv --MAKE = make - RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \ - tags TAGS make.log - NPROC = 1 ---- a/nx-X11/lib/X11/Imakefile -+++ b/nx-X11/lib/X11/Imakefile -@@ -1161,25 +1161,23 @@ - - #ifdef SunArchitecture - $(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) -- cd $(NX_XCOMPLIBDIR) && \ -- gmake -+ ${MAKE} -C $(NX_XCOMPLIBDIR) - - $(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) -- cd ../../../nxcompext && \ -- gmake -+ ${MAKE} -C ../../../nxcompext - - #else - $(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) -- cd $(NX_XCOMPLIBDIR) && \ -- make -+ ${MAKE} -C $(NX_XCOMPLIBDIR) - --$(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) -- cd ../../../nxcompext && \ -- make -+$(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) $(NX_XCOMPLIBTARGET) lib$(LIBNAME).so.$(SOXLIBREV) -+ ${MAKE} -C ../../../nxcompext - - #endif - --depend:: $(NX_XCOMPLIBTARGET) -+depend:: -+ -+lib$(LIBNAME).so.$(SOXLIBREV): $(NX_XCOMPLIBTARGET) - - all:: $(NX_XCOMPLIBTARGET) - ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -1045,11 +1045,11 @@ - #ifdef SunArchitecture - $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) - cd $(NX_XSHADOWLIBDIR) && \ -- gmake -+ ${MAKE} - #else - $(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) - cd $(NX_XSHADOWLIBDIR) && \ -- rm -f *.o && make -+ rm -f *.o && ${MAKE} - #endif - - ServerTarget(nxagent,$(NX_XSHADOWLIBTARGET) $(NXAGENTDIRS),$(NXAGENTOBJS), \ - diff --git a/debian/patches/0320_nxagent_configurable-keystrokes.full.patch b/debian/patches/0320_nxagent_configurable-keystrokes.full.patch new file mode 100644 index 000000000..c799c8b93 --- /dev/null +++ b/debian/patches/0320_nxagent_configurable-keystrokes.full.patch @@ -0,0 +1,1031 @@ +Author: Alexander Wuerstlein +Description: Make nxagent-specific keyboard bindings configurable + Replaces the hardcoded nxagent keybindings by a configurable + table of keybindings. The default configuration is the same as the + original one, to maintain compatibility. A user/administrator can either + specify a command line parameter, environment variable or place a file + in ~/.nx/config/keystrokes.cfg or /etc/nxagent/keystrokes.cfg to reconfigure + these keybindings. + . + The configuration file format is XML, a dependency on libxml2 is added + to allow parsing the configuration. +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -1013,15 +1013,18 @@ + #if defined(SunArchitecture) + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ + -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp ++ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp \ ++`pkg-config --libs libxml-2.0` + #elif defined(cygwinArchitecture) + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ + -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ +- -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp ++ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp \ ++`pkg-config --libs libxml-2.0` + #else + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ + -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp ++ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp \ ++`pkg-config --libs libxml-2.0` + #endif + + #endif +--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile ++++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile +@@ -142,7 +142,8 @@ + -I../../miext/damage -I../../miext/cw \ + -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ +- $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) ++ $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ ++ `pkg-config --cflags-only-I libxml-2.0` + #ifdef SunArchitecture + INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ + -I../../../../extras/Mesa/include \ +@@ -152,7 +153,8 @@ + -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ + -I../../miext/damage -I../../miext/cw \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ +- $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) ++ $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ ++ `pkg-config --cflags-only-I libxml-2.0` + #else + #ifdef cygwinArchitecture + INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ +@@ -162,7 +164,8 @@ + -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ + -I../../../../extras/Mesa/include \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ +- $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) ++ $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ ++ `pkg-config --cflags-only-I libxml-2.0` + #endif + #endif + +--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +@@ -28,8 +28,15 @@ + #include "Keystroke.h" + #include "Drawable.h" + ++#include ++ ++#include ++#include ++ + extern Bool nxagentWMIsRunning; + extern Bool nxagentIpaq; ++extern char *nxagentKeystrokeFile; ++Bool nxagentKeystrokeFileParsed = False; + + #ifdef NX_DEBUG_INPUT + int nxagentDebugInputDevices = 0; +@@ -47,297 +54,528 @@ + #undef DEBUG + #undef DUMP + +-int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) +-{ +- KeySym sym; +- int index = 0; + +- *result = doNothing; ++/* this table is used to parse actions given on the command line or in the ++ * config file, therefore indices have to match the enum in Keystroke.h */ ++char * nxagentSpecialKeystrokeNames[] = { ++ "end_marker", ++ "close_session", ++ "switch_all_screens", ++ "minimize", ++ "left", ++ "up", ++ "right", ++ "down", ++ "resize", ++ "defer", ++ "ignore", ++ "force_synchronization", ++ ++ "debug_tree", ++ "regions_on_screen", ++ "test_input", ++ "deactivate_input_devices_grab", ++ ++ "fullscreen", ++ "viewport_move_left", ++ "viewport_move_up", ++ "viewport_move_right", ++ "viewport_move_down", ++ NULL, ++}; ++ ++struct nxagentSpecialKeystrokeMap default_map[] = { ++ /* stroke, modifierMask, modifierAltMeta, keysym */ ++ {KEYSTROKE_DEBUG_TREE, ControlMask, 1, XK_q}, ++ {KEYSTROKE_DEBUG_TREE, ControlMask, 1, XK_Q}, ++ {KEYSTROKE_CLOSE_SESSION, ControlMask, 1, XK_t}, ++ {KEYSTROKE_CLOSE_SESSION, ControlMask, 1, XK_T}, ++ {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, 1, XK_f}, ++ {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, 1, XK_F}, ++ {KEYSTROKE_MINIMIZE, ControlMask, 1, XK_m}, ++ {KEYSTROKE_MINIMIZE, ControlMask, 1, XK_M}, ++ {KEYSTROKE_LEFT, ControlMask, 1, XK_Left}, ++ {KEYSTROKE_LEFT, ControlMask, 1, XK_KP_Left}, ++ {KEYSTROKE_UP, ControlMask, 1, XK_Up}, ++ {KEYSTROKE_UP, ControlMask, 1, XK_KP_Up}, ++ {KEYSTROKE_RIGHT, ControlMask, 1, XK_Right}, ++ {KEYSTROKE_RIGHT, ControlMask, 1, XK_KP_Right}, ++ {KEYSTROKE_DOWN, ControlMask, 1, XK_Down}, ++ {KEYSTROKE_DOWN, ControlMask, 1, XK_KP_Down}, ++ {KEYSTROKE_RESIZE, ControlMask, 1, XK_r}, ++ {KEYSTROKE_RESIZE, ControlMask, 1, XK_R}, ++ {KEYSTROKE_DEFER, ControlMask, 1, XK_e}, ++ {KEYSTROKE_DEFER, ControlMask, 1, XK_E}, ++ {KEYSTROKE_IGNORE, ControlMask, 1, XK_BackSpace}, ++ {KEYSTROKE_IGNORE, 0, 0, XK_Terminate_Server}, ++ {KEYSTROKE_FORCE_SYNCHRONIZATION, ControlMask, 1, XK_j}, ++ {KEYSTROKE_FORCE_SYNCHRONIZATION, ControlMask, 1, XK_J}, ++ {KEYSTROKE_REGIONS_ON_SCREEN, ControlMask, 1, XK_a}, ++ {KEYSTROKE_REGIONS_ON_SCREEN, ControlMask, 1, XK_A}, ++ {KEYSTROKE_TEST_INPUT, ControlMask, 1, XK_x}, ++ {KEYSTROKE_TEST_INPUT, ControlMask, 1, XK_X}, ++ {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, 1, XK_y}, ++ {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, 1, XK_Y}, ++ {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, 1, XK_f}, ++ {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, 1, XK_F}, ++ {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, 1, XK_Left}, ++ {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, 1, XK_KP_Left}, ++ {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, 1, XK_Up}, ++ {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, 1, XK_KP_Up}, ++ {KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, 1, XK_Right}, ++ {KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, 1, XK_KP_Right}, ++ {KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, 1, XK_Down}, ++ {KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, 1, XK_KP_Down}, ++ {KEYSTROKE_END_MARKER, 0, 0, 0}, ++}; ++struct nxagentSpecialKeystrokeMap *map = default_map; + +- /* +- * I don't know how much hard work is doing this operation. +- * Do we need a cache ? ++static int modifier_matches(unsigned int mask, int compare_alt_meta, unsigned int state) ++{ ++ /* nxagentAltMetaMask needs special handling ++ * it seems to me its an and-ed mask of all possible meta and alt keys ++ * somehow... ++ * ++ * otherwise this function would be just a simple bitop + */ ++ int ret = 1; + +- sym = XKeycodeToKeysym(nxagentDisplay, X -> keycode, index); ++ if (compare_alt_meta) { ++ if (! (state & nxagentAltMetaMask)) { ++ ret = 0; ++ } + +- if (sym == XK_VoidSymbol || sym == NoSymbol) +- { +- return 0; ++ mask &= ~nxagentAltMetaMask; + } + +- #ifdef TEST +- fprintf(stderr, "nxagentCheckSpecialKeystroke: got code %x - state %x - sym %lx\n", +- X -> keycode, X -> state, sym); +- #endif +- +- /* +- * Check special keys. +- */ +- +- /* +- * FIXME: We should use the keysym instead that the keycode +- * here. +- */ ++ /* all modifiers except meta/alt have to match exactly, extra bits are evil */ ++ if ((mask & state) != mask) { ++ ret = 0; ++ } + +- if (X -> keycode == 130 && nxagentIpaq) +- { +- *result = doStartKbd; ++ return ret; ++} + +- return 1; +- } ++static int read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystrokeMap *ret) ++{ ++ int successful = 0; ++ struct nxagentSpecialKeystrokeMap new = {0, 0, 0, 0}; ++ xmlAttr *attr; + +- if ((X -> state & nxagentAltMetaMask) && +- ((X -> state & (ControlMask | ShiftMask)) == ControlMask)) ++ for (attr = node->properties; attr; attr = attr->next) + { +- switch (sym) ++ /* ignore attributes without data (which should never happen anyways) */ ++ if (attr->children->content == NULL) + { +- #ifdef DEBUG_TREE +- +- case XK_q: +- case XK_Q: +- { +- *result = doDebugTree; +- +- break; +- } +- +- #endif /* DEBUG_TREE */ +- +- case XK_t: +- case XK_T: +- { +- *result = doCloseSession; +- +- break; +- } +- case XK_f: +- case XK_F: ++ char *aname = (attr->name)?(attr->name):"unknown"; ++ fprintf(stderr, "attribute %s with NULL value", aname); ++ continue; ++ } ++ if (strcmp((char *)attr->name, "action") == 0) ++ { ++ int i; ++ for (i = 0; nxagentSpecialKeystrokeNames[i] != NULL; i++) + { +- if (nxagentOption(Rootless) == False) ++ if (strcmp(nxagentSpecialKeystrokeNames[i],(char *)attr->children->content) == 0) + { +- *result = doSwitchAllScreens; ++ /* this relies on the values of enum nxagentSpecialKeystroke and the ++ * indices of nxagentSpecialKeystrokeNames being in sync */ ++ new.stroke = i; ++ break; + } +- +- break; + } +- case XK_m: +- case XK_M: ++ continue; ++ } ++ else if (strcmp((char *)attr->name, "key") == 0) ++ { ++ new.keysym = XStringToKeysym((char *)attr->children->content); ++ /* NoSymbol is usually 0, but could there be weird implementations? */ ++ if (new.keysym == NoSymbol) + { +- if (nxagentOption(Rootless) == False) +- { +- *result = doMinimize; +- } +- +- break; ++ new.keysym = 0; + } +- case XK_Left: +- case XK_KP_Left: +- { +- if (nxagentOption(Rootless) == False && +- nxagentOption(DesktopResize) == False) +- { +- *result = doViewportLeft; +- } ++ continue; ++ } + +- break; +- } +- case XK_Up: +- case XK_KP_Up: +- { +- if (nxagentOption(Rootless) == False && +- nxagentOption(DesktopResize) == False) +- { +- *result = doViewportUp; +- } ++ /* ignore attributes with value="0" or "false", everything else is interpreted as true */ ++ if (strcmp((char *)attr->children->content, "0") == 0 || strcmp((char *)attr->children->content, "false") == 0) ++ continue; + +- break; +- } +- case XK_Right: +- case XK_KP_Right: +- { +- if (nxagentOption(Rootless) == False && +- nxagentOption(DesktopResize) == False) +- { +- *result = doViewportRight; +- } ++ if (strcmp((char *)attr->name, "Mod1") == 0) ++ { ++ new.modifierMask |= Mod1Mask; ++ } ++ else if (strcmp((char *)attr->name, "Mod2") == 0) ++ { ++ new.modifierMask |= Mod2Mask; ++ } ++ else if (strcmp((char *)attr->name, "Mod3") == 0) ++ { ++ new.modifierMask |= Mod3Mask; ++ } ++ else if (strcmp((char *)attr->name, "Mod4") == 0) ++ { ++ new.modifierMask |= Mod4Mask; ++ } ++ else if (strcmp((char *)attr->name, "Control") == 0) ++ { ++ new.modifierMask |= ControlMask; ++ } ++ else if (strcmp((char *)attr->name, "Shift") == 0) ++ { ++ new.modifierMask |= ShiftMask; ++ } ++ else if (strcmp((char *)attr->name, "Lock") == 0) ++ { ++ new.modifierMask |= LockMask; ++ } ++ else if (strcmp((char *)attr->name, "AltMeta") == 0) ++ { ++ new.modifierAltMeta = 1; ++ } ++ } + +- break; +- } +- case XK_Down: +- case XK_KP_Down: +- { +- if (nxagentOption(Rootless) == 0 && +- nxagentOption(DesktopResize) == 0) +- { +- *result = doViewportDown; +- } ++ if (new.stroke != 0 && new.keysym != 0) ++ { ++ /* keysym and stroke are required, everything else is optional */ ++ successful = 1; ++ memcpy(ret, &new, sizeof(struct nxagentSpecialKeystrokeMap)); ++ } ++ return successful; ++} + +- break; +- } +- case XK_R: +- case XK_r: +- { +- if (nxagentOption(Rootless) == 0) +- { +- *result = doSwitchResizeMode; +- } ++/* ++ * searches a keystroke xml file ++ * ++ * search order: ++ * - '-keystrokefile' commandline parameter ++ * - $NXAGENT_KEYSTROKEFILE environment variable ++ * - $HOME/.nx/config/keystrokes.cfg ++ * - /etc/nxagent/keystrokes.cfg ++ * - hardcoded traditional NX default settings ++ */ ++static void parse_keystroke_file(void) ++{ ++ char *filename = NULL; + +- break; +- } +- case XK_E: +- case XK_e: +- { +- *result = doSwitchDeferMode; ++ char *homefile = "/.nx/config/keystrokes.cfg"; ++ char *etcfile = "/etc/nxagent/keystrokes.cfg"; + +- break; ++ if (nxagentKeystrokeFile != NULL && access(nxagentKeystrokeFile, R_OK) == 0) ++ { ++ filename = strdup(nxagentKeystrokeFile); ++ if (filename == NULL) ++ { ++ fprintf(stderr, "malloc failed"); ++ exit(EXIT_FAILURE); ++ } ++ } ++ else if ((filename = getenv("NXAGENT_KEYSTROKEFILE")) != NULL && access(filename, R_OK) == 0) ++ { ++ filename = strdup(filename); ++ if (filename == NULL) ++ { ++ fprintf(stderr, "malloc failed"); ++ exit(EXIT_FAILURE); ++ } ++ } ++ else ++ { ++ char *homedir = getenv("HOME"); ++ filename = NULL; ++ if (homedir != NULL) ++ { ++ homedir = strdup(homedir); ++ if (homedir == NULL) ++ { ++ fprintf(stderr, "malloc failed"); ++exit(EXIT_FAILURE); + } +- case XK_BackSpace: +- case XK_Terminate_Server: ++ filename = calloc(1, strlen(homefile) + strlen(homedir) + 1); ++ if (filename == NULL) + { +- /* +- * Discard Ctrl-Alt-BackSpace key. +- */ +- +- return 1; +- +- break; ++ fprintf(stderr, "malloc failed"); ++ exit(EXIT_FAILURE); + } +- +- case XK_J: +- case XK_j: ++ strcpy(filename, homedir); ++ strcpy(filename + strlen(homedir), homefile); ++ if (homedir) + { +- nxagentForceSynchronization = 1; +- +- return 1; ++ free(homedir); + } ++ } + +- #ifdef DUMP +- +- case XK_A: +- case XK_a: ++ if (access(filename, R_OK) == 0) ++ { ++ /* empty */ ++ } ++ else if (access(etcfile, R_OK) == 0) ++ { ++ if (filename) ++ free(filename); ++ filename = strdup(etcfile); ++ if (filename == NULL) + { +- /* +- * Used to test the lazy encoding. +- */ +- +- nxagentRegionsOnScreen(); +- +- return 1; ++ fprintf(stderr, "malloc failed"); ++ exit(EXIT_FAILURE); + } ++ } ++ else ++ { ++ if (filename) ++free(filename); ++ filename = NULL; ++ } ++ } + +- #endif +- +- #ifdef NX_DEBUG_INPUT ++ /* now we know which file to read, if any */ ++ if (filename) ++ { ++ xmlDoc *doc = NULL; ++ xmlNode *root = NULL; ++ LIBXML_TEST_VERSION ++ doc = xmlReadFile(filename, NULL, 0); ++ if (doc != NULL) ++ { ++ xmlNode *cur = NULL; ++ root = xmlDocGetRootElement(doc); + +- case XK_X: +- case XK_x: ++ for (cur = root; cur; cur = cur->next) + { +- /* +- * Used to test the input devices state. +- */ ++ if (cur->type == XML_ELEMENT_NODE && strcmp((char *)cur->name, "keystrokes") == 0) ++{ ++ xmlNode *bindings = NULL; ++ int num = 0; ++ int idx = 0; + +- if (X -> type == KeyPress) +- { +- if (nxagentDebugInputDevices == 0) ++ for (bindings = cur->children; bindings; bindings = bindings->next) + { +- fprintf(stderr, "Info: Turning input devices debug ON.\n"); +- +- nxagentDebugInputDevices = 1; ++ if (bindings->type == XML_ELEMENT_NODE && strcmp((char *)bindings->name, "keystroke") == 0) ++ { ++ num++; ++ } + } +- else ++ map = calloc((num + 1), sizeof(struct nxagentSpecialKeystrokeMap)); ++ if (map == NULL) + { +- fprintf(stderr, "Info: Turning input devices debug OFF.\n"); +- +- nxagentDebugInputDevices = 0; +- +- nxagentLastInputDevicesDumpTime = 0; ++ fprintf(stderr, "malloc failed"); ++ exit(EXIT_FAILURE); + } +- } +- +- return 1; +- } + +- case XK_Y: +- case XK_y: +- { +- /* +- * Used to deactivate input devices grab. +- */ ++ for (bindings = cur->children; bindings; bindings = bindings->next) ++ { ++ if (bindings->type == XML_ELEMENT_NODE && strcmp((char *)bindings->name, "keystroke") == 0) ++ { ++ int res = 0; ++ res = read_binding_from_xmlnode(bindings, &(map[idx])); ++ if (res) ++ idx++; ++ } ++ } + +- if (X -> type == KeyPress) +- { +- nxagentDeactivateInputDevicesGrabs(); ++ map[idx].stroke = KEYSTROKE_END_MARKER; + } +- +- return 1; + } + ++ xmlFreeDoc(doc); ++ xmlCleanupParser(); ++ } ++ else ++ { ++ #ifdef DEBUG ++ fprintf("XML parsing for %s failed\n", filename); + #endif + } ++ free(filename); + } +- else if ((X -> state & nxagentAltMetaMask) && +- ((X -> state & (ControlMask | ShiftMask)) == (ControlMask | +- ShiftMask))) ++} ++ ++static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) ++{ ++ KeySym keysym = XKeycodeToKeysym(nxagentDisplay, X->keycode, 0); ++ struct nxagentSpecialKeystrokeMap *cur = map; ++ ++ if (! nxagentKeystrokeFileParsed) + { +- switch (sym) +- { +- case XK_f: +- case XK_F: +- { +- if (nxagentOption(Rootless) == 0) +- { +- *result = doSwitchFullscreen; +- } ++ parse_keystroke_file(); ++ nxagentKeystrokeFileParsed = True; ++ } + +- break; +- } +- case XK_Left: +- case XK_KP_Left: +- { +- if (nxagentOption(Rootless) == 0 && +- nxagentOption(DesktopResize) == 0) +- { +- *result = doViewportMoveLeft; +- } ++ enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING; + +- break; +- } +- case XK_Up: +- case XK_KP_Up: +- { +- if (nxagentOption(Rootless) == 0 && +- nxagentOption(DesktopResize) == 0) +- { +- *result = doViewportMoveUp; +- } ++ while (cur->stroke != KEYSTROKE_END_MARKER) { ++ if (cur->keysym == keysym && modifier_matches(cur->modifierMask, cur->modifierAltMeta, X->state)) { ++ return cur->stroke; ++ } ++ cur++; ++ } + +- break; +- } +- case XK_Right: +- case XK_KP_Right: +- { +- if (nxagentOption(Rootless) == 0 && +- nxagentOption(DesktopResize) == 0) +- { +- *result = doViewportMoveRight; +- } ++ return ret; ++} + +- break; +- } +- case XK_Down: +- case XK_KP_Down: +- { +- if (nxagentOption(Rootless) == 0 && +- nxagentOption(DesktopResize) == 0) +- { +- *result = doViewportMoveDown; +- } ++int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ++{ ++ KeySym sym; ++ int index = 0; ++ enum nxagentSpecialKeystroke stroke = find_keystroke(X); + +- break; +- } +- } ++ *result = doNothing; ++ ++ /* ++ * I don't know how much hard work is doing this operation. ++ * Do we need a cache ? ++ */ ++ ++ sym = XKeycodeToKeysym(nxagentDisplay, X -> keycode, index); ++ ++ if (sym == XK_VoidSymbol || sym == NoSymbol) ++ { ++ return 0; + } + ++ #ifdef TEST ++ fprintf(stderr, "nxagentCheckSpecialKeystroke: got code %x - state %x - sym %lx\n", ++ X -> keycode, X -> state, sym); ++ #endif ++ ++ /* ++ * Check special keys. ++ */ ++ ++ /* ++ * FIXME: We should use the keysym instead that the keycode ++ * here. ++ */ ++ ++ if (X -> keycode == 130 && nxagentIpaq) ++ { ++ *result = doStartKbd; ++ ++ return 1; ++ } ++ ++ switch (stroke) { ++ case KEYSTROKE_DEBUG_TREE: ++ #ifdef DEBUG_TREE ++ *result = doDebugTree; ++ #endif ++ break; ++ case KEYSTROKE_CLOSE_SESSION: ++ *result = doCloseSession; ++ break; ++ case KEYSTROKE_SWITCH_ALL_SCREENS: ++ if (nxagentOption(Rootless) == False) { ++ *result = doSwitchAllScreens; ++ } ++ break; ++ case KEYSTROKE_MINIMIZE: ++ if (nxagentOption(Rootless) == False) { ++ *result = doMinimize; ++ } ++ break; ++ case KEYSTROKE_LEFT: ++ if (nxagentOption(Rootless) == False && ++ nxagentOption(DesktopResize) == False) { ++ *result = doViewportLeft; ++ } ++ break; ++ case KEYSTROKE_UP: ++ if (nxagentOption(Rootless) == False && ++ nxagentOption(DesktopResize) == False) { ++ *result = doViewportUp; ++ } ++ break; ++ case KEYSTROKE_RIGHT: ++ if (nxagentOption(Rootless) == False && ++ nxagentOption(DesktopResize) == False) { ++ *result = doViewportRight; ++ } ++ break; ++ case KEYSTROKE_DOWN: ++ if (nxagentOption(Rootless) == False && ++ nxagentOption(DesktopResize) == False) { ++ *result = doViewportDown; ++ } ++ break; ++ case KEYSTROKE_RESIZE: ++ if (nxagentOption(Rootless) == False) { ++ *result = doSwitchResizeMode; ++ } ++ break; ++ case KEYSTROKE_DEFER: ++ *result = doSwitchDeferMode; ++ break; ++ case KEYSTROKE_IGNORE: ++ /* this is used e.g. to ignore C-A-Backspace aka XK_Terminate_Server */ ++ return 1; ++ break; ++ case KEYSTROKE_FORCE_SYNCHRONIZATION: ++ nxagentForceSynchronization = 1; ++ break; ++ case KEYSTROKE_REGIONS_ON_SCREEN: ++ #ifdef DUMP ++ nxagentRegionsOnScreen(); ++ #endif ++ break; ++ case KEYSTROKE_TEST_INPUT: ++ /* ++ * Used to test the input devices state. ++ */ ++ #ifdef NX_DEBUG_INPUT ++ if (X -> type == KeyPress) { ++ if (nxagentDebugInputDevices == 0) { ++ fprintf(stderr, "Info: Turning input devices debug ON.\n"); ++ nxagentDebugInputDevices = 1; ++ } else { ++ fprintf(stderr, "Info: Turning input devices debug OFF.\n"); ++ nxagentDebugInputDevices = 0; ++ nxagentLastInputDevicesDumpTime = 0; ++ } ++ } ++ return 1; ++ #endif ++ break; ++ case KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB: ++ #ifdef NX_DEBUG_INPUT ++ if (X->type == KeyPress) { ++ nxagentDeactivateInputDevicesGrab(); ++ } ++ return 1; ++ #endif ++ break; ++ case KEYSTROKE_FULLSCREEN: ++ if (nxagentOption(Rootless) == 0) { ++ *result = doSwitchFullscreen; ++ } ++ break; ++ case KEYSTROKE_VIEWPORT_MOVE_LEFT: ++ if (nxagentOption(Rootless) == 0 && ++ nxagentOption(DesktopResize) == 0) { ++ *result = doViewportMoveLeft; ++ } ++ break; ++ case KEYSTROKE_VIEWPORT_MOVE_UP: ++ if (nxagentOption(Rootless) == 0 && ++ nxagentOption(DesktopResize) == 0) { ++ *result = doViewportMoveUp; ++ } ++ break; ++ case KEYSTROKE_VIEWPORT_MOVE_RIGHT: ++ if (nxagentOption(Rootless) == 0 && ++ nxagentOption(DesktopResize) == 0) { ++ *result = doViewportMoveRight; ++ } ++ break; ++ case KEYSTROKE_VIEWPORT_MOVE_DOWN: ++ if (nxagentOption(Rootless) == 0 && ++ nxagentOption(DesktopResize) == 0) { ++ *result = doViewportMoveDown; ++ } ++ break; ++ case KEYSTROKE_NOTHING: /* do nothing. difference to KEYSTROKE_IGNORE is the return value */ ++ case KEYSTROKE_END_MARKER: /* just to make gcc STFU */ ++ case KEYSTROKE_MAX: ++ break; ++ } + return (*result == doNothing) ? 0 : 1; + } +--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h +@@ -24,4 +24,51 @@ + + unsigned int nxagentAltMetaMask; + ++/* keep this sorted, do not rely on any numerical value in this enum, and be aware ++ * that KEYSTROKE_MAX may be used in a malloc */ ++ ++/* also be aware that if changing any numerical values, you also need to change values ++ * Keystroke.c nxagentSpecialKeystrokeNames */ ++enum nxagentSpecialKeystroke { ++ /* 0 is used as end marker */ ++ KEYSTROKE_END_MARKER = 0, ++ KEYSTROKE_CLOSE_SESSION = 1, ++ KEYSTROKE_SWITCH_ALL_SCREENS = 2, ++ KEYSTROKE_MINIMIZE = 3, ++ KEYSTROKE_LEFT = 4, ++ KEYSTROKE_UP = 5, ++ KEYSTROKE_RIGHT = 6, ++ KEYSTROKE_DOWN = 7, ++ KEYSTROKE_RESIZE = 8, ++ KEYSTROKE_DEFER = 9, ++ KEYSTROKE_IGNORE = 10, ++ KEYSTROKE_FORCE_SYNCHRONIZATION = 11, ++ ++ /* stuff used for debugging, probably not useful for most people */ ++ KEYSTROKE_DEBUG_TREE = 12, ++ KEYSTROKE_REGIONS_ON_SCREEN = 13, ++ KEYSTROKE_TEST_INPUT = 14, ++ KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB = 15, ++ ++ KEYSTROKE_FULLSCREEN = 16, ++ KEYSTROKE_VIEWPORT_MOVE_LEFT = 17, ++ KEYSTROKE_VIEWPORT_MOVE_UP = 18, ++ KEYSTROKE_VIEWPORT_MOVE_RIGHT = 19, ++ KEYSTROKE_VIEWPORT_MOVE_DOWN = 20, ++ ++ KEYSTROKE_NOTHING = 21, ++ ++ /* insert more here, increment KEYSTROKE_MAX accordingly. ++ * then update string translation below */ ++ ++ KEYSTROKE_MAX=22, ++}; ++ ++struct nxagentSpecialKeystrokeMap { ++ enum nxagentSpecialKeystroke stroke; ++ unsigned int modifierMask; /* everything except alt/meta */ ++ int modifierAltMeta; /* modifier combination should include alt/meta */ ++ KeySym keysym; ++}; ++ + #endif /* __Keystroke_H__ */ +--- /dev/null ++++ b/README.keystrokes +@@ -0,0 +1,83 @@ ++Configurable keybindings in nxagent ++ ++Keybindings in the redistributed x2go version of nxagent can now be configured ++by the user. This is done via a configuration file. ++ ++File location ++------------- ++ ++nxagent searches for the configuration file in the following order: ++- in the location given by the '-keystrokefile' command line parameter ++- in the location given by the NXAGENT_KEYSTROKEFILE environment variable ++- in ~/.nx/config/keystrokes.cfg ++- in /etc/nxagent/keystrokes.cfg ++ ++If none of those files is accessible, the default configuration is used which ++is the same as the old, traditional nxagent keybindings. ++ ++File format ++----------- ++ ++The configuration file is XML with the following format: ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++Each 'action' defines an action to be executed when receiving that keystroke. A ++list of possible actions is given below. Some of those actions are only ++available with debug builds of nxagent. ++ ++Keys are given as a combination of 'key' and (optionally) a number of ++modifiers. The key attribute is evaluated into a X11 key via the usual ++XStringToKeysym function. A list of possible keys can be found in ++/usr/include/X11/keysymdef.h, the names are specified without the leading ++'XK_'. Evaluation is case-sensitive, so, 'space' and 'Escape' will work while ++'Space' and 'escape' won't. ++ ++Modifiers are given as boolean attributes, possible modifiers are Mod1, Mod2, ++Mod3, Mod4, Control, Shift, Lock. Sensible combinations strongly depend on your ++keyboard configuration, but usually you will need Mod1 and Control. Boolean in ++this context means '0', 'false' and an unspecified attribute are false, anything ++else is considered true. ++ ++Everything in this file is case-sensitive. Unknown lines are ignored. ++Keybindings are evaluated from top to bottom, so if a keybinding matches, other ++keybindings further down will be ignored. The contents of the file replaces the ++default keybindings, and only one file is read, no merging between different ++configuration files is done. This also means that an empty or invalid configuration ++file deactivates all keybindings. ++ ++List of possible 'action' attributes: ++------------------------------------- ++ ++close_session ++switch_all_screens ++minimize ++left ++up ++right ++down ++resize ++defer ++ignore ++fullscreen ++viewport_move_left ++viewport_move_up ++viewport_move_right ++viewport_move_down ++ ++Only in builds with certain debugging options enabled, ignored otherwise: ++force_synchronization ++debug_tree ++regions_on_screen ++test_input ++deactivate_input_devices_grab +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c +@@ -149,6 +149,8 @@ + + char nxagentVerbose = 0; + ++char *nxagentKeystrokeFile = NULL; ++ + int ddxProcessArgument(int argc, char *argv[], int i) + { + /* +@@ -1022,6 +1024,20 @@ + return 1; + } + ++ if (!strcmp(argv[i], "-keystrokefile")) ++ { ++ if (i + 1 < argc) ++ { ++ if (NULL != (nxagentKeystrokeFile = strdup(argv[i + 1]))) ++ { ++ return 2; ++ } else { ++ FatalError("malloc failed"); ++ } ++ } ++ return 0; ++ } ++ + return 0; + } + +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h +@@ -83,4 +83,6 @@ + + extern int nxagentRemoteMajor; + ++extern char *nxagentKeystrokeFile; ++ + #endif /* __Args_H__ */ diff --git a/debian/patches/0321_nxagent_x2go-specific-keystroke-config.full.patch b/debian/patches/0321_nxagent_x2go-specific-keystroke-config.full.patch new file mode 100644 index 000000000..795f10b76 --- /dev/null +++ b/debian/patches/0321_nxagent_x2go-specific-keystroke-config.full.patch @@ -0,0 +1,25 @@ +Description: Adapt paths of keystrokes.cfg if nxagent runs as x2goagent +Author: Horst Schirmeier + +--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +@@ -27,6 +27,7 @@ + #include "Options.h" + #include "Keystroke.h" + #include "Drawable.h" ++#include "Init.h" /* extern int nxagentX2go */ + + #include + +@@ -261,6 +262,11 @@ static void parse_keystroke_file(void) + char *homefile = "/.nx/config/keystrokes.cfg"; + char *etcfile = "/etc/nxagent/keystrokes.cfg"; + ++ if (nxagentX2go) { ++ homefile = "/.x2go/config/keystrokes.cfg"; ++ etcfile = "/etc/x2go/keystrokes.cfg"; ++ } ++ + if (nxagentKeystrokeFile != NULL && access(nxagentKeystrokeFile, R_OK) == 0) + { + filename = strdup(nxagentKeystrokeFile); diff --git a/debian/patches/0400_nxcomp-version.full+lite.patch b/debian/patches/0400_nxcomp-version.full+lite.patch new file mode 100644 index 000000000..703cec823 --- /dev/null +++ b/debian/patches/0400_nxcomp-version.full+lite.patch @@ -0,0 +1,240 @@ +Description: Allow version 4-digit version comparison/handshake +Author: Nito Martinez +--- a/nxcomp/Control.cpp ++++ b/nxcomp/Control.cpp +@@ -15,6 +15,7 @@ + /* */ + /**************************************************************************/ + ++#include "NX.h" + #include "NXpack.h" + + #include "Control.h" +@@ -594,44 +595,17 @@ + RemoteVersionMajor = -1; + RemoteVersionMinor = -1; + RemoteVersionPatch = -1; ++ RemoteVersionMaintenancePatch = -1; + + CompatVersionMajor = -1; + CompatVersionMinor = -1; + CompatVersionPatch = -1; ++ CompatVersionMaintenancePatch = -1; + +- char version[32]; +- +- strcpy(version, VERSION); +- +- char *value; +- +- value = strtok(version, "."); +- +- for (int i = 0; value != NULL && i < 3; i++) +- { +- switch (i) +- { +- case 0: +- +- LocalVersionMajor = atoi(value); +- +- break; +- +- case 1: +- +- LocalVersionMinor = atoi(value); +- +- break; +- +- case 2: +- +- LocalVersionPatch = atoi(value); +- +- break; +- } +- +- value = strtok(NULL, "."); +- } ++ LocalVersionMajor = NXMajorVersion(); ++ LocalVersionMinor = NXMinorVersion(); ++ LocalVersionPatch = NXPatchVersion(); ++ LocalVersionMaintenancePatch = NXMaintenancePatchVersion(); + + #ifdef TEST + *logofs << "Control: Major version is " << LocalVersionMajor +--- a/nxcomp/Control.h ++++ b/nxcomp/Control.h +@@ -299,17 +299,26 @@ + // Version number of local and remote proxy. + // + ++ /* ++ * LocalVersionMaintenancePatch, RemoteVersionMaintenancePatch ++ * CompatVersionMaintenancePatch ++ * ++ * currently not used, for future compatibility checks ++ */ + int LocalVersionMajor; + int LocalVersionMinor; + int LocalVersionPatch; ++ int LocalVersionMaintenancePatch; + + int RemoteVersionMajor; + int RemoteVersionMinor; + int RemoteVersionPatch; ++ int RemoteVersionMaintenancePatch; + + int CompatVersionMajor; + int CompatVersionMinor; + int CompatVersionPatch; ++ int CompatVersionMaintenancePatch; + + // + // Which unpack methods are implemented in proxy? +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -14250,7 +14250,8 @@ + cerr << "NXPROXY - " << "Version " + << control -> LocalVersionMajor << "." + << control -> LocalVersionMinor << "." +- << control -> LocalVersionPatch; ++ << control -> LocalVersionPatch << "." ++ << control -> LocalVersionMaintenancePatch; + + cerr << endl; + } +--- a/nxcomp/Makefile.in ++++ b/nxcomp/Makefile.in +@@ -105,7 +105,8 @@ + + CSRC = MD5.c \ + Pack.c \ +- Vars.c ++ Vars.c \ ++ Version.c + + CXXSRC = Loop.cpp \ + Children.cpp \ +--- a/nxcomp/NX.h ++++ b/nxcomp/NX.h +@@ -442,6 +442,12 @@ + + extern void NXTransCleanup(void) __attribute__((noreturn)); + ++extern const char* NXVersion(); ++extern int NXMajorVersion(); ++extern int NXMinorVersion(); ++extern int NXPatchVersion(); ++extern int NXMaintenancePatchVersion(); ++ + #ifdef __cplusplus + } + #endif +--- /dev/null ++++ b/nxcomp/Version.c +@@ -0,0 +1,106 @@ ++/**************************************************************************/ ++/* */ ++/* Copyright (C) 2014 Qindel http://qindel.com and QVD http://theqvd.com */ ++/* */ ++/* 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 3 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, see . */ ++/* */ ++/* Additional permission under GNU GPL version 3 section 7 */ ++/* */ ++/* If you modify this Program, or any covered work, by linking or */ ++/* combining it with [name of library] (or a modified version of that */ ++/* library), containing parts covered by the terms of [name of library's */ ++/* license], the licensors of this Program grant you additional */ ++/* permission to convey the resulting work. {Corresponding Source for a */ ++/* non-source form of such a combination shall include the source code */ ++/* for the parts of [name of library] used as well as that of the covered */ ++/* work.} */ ++/* */ ++/* */ ++/**************************************************************************/ ++ ++#include ++#include ++#include ++#include "NX.h" ++ ++ ++static int _NXVersionMajor = -1; ++static int _NXVersionMinor = -1; ++static int _NXVersionPatch = -1; ++static int _NXVersionMaintenancePatch = -1; ++ ++ ++const char* NXVersion() { ++ const char *version = VERSION; ++ return version; ++} ++ ++void _parseNXVersion() { ++ char version[32]; ++ int i; ++ strcpy(version, VERSION); ++ ++ char *value; ++ /* Reset values to 0 if undefined */ ++ _NXVersionMajor = _NXVersionMinor = _NXVersionPatch = _NXVersionMaintenancePatch = 0; ++ ++ ++#define NXVERSIONSEPARATOR "." ++ value = strtok(version, NXVERSIONSEPARATOR); ++ ++ for (i = 0; value != NULL && i < 4; i++) ++ { ++ switch (i) ++ { ++ case 0: ++ _NXVersionMajor = atoi(value); ++ break; ++ ++ case 1: ++ _NXVersionMinor = atoi(value); ++ break; ++ ++ case 2: ++ _NXVersionPatch = atoi(value); ++ break; ++ ++ case 3: ++ _NXVersionMaintenancePatch = atoi(value); ++ break; ++ } ++ ++ value = strtok(NULL, NXVERSIONSEPARATOR); ++ } ++} ++ ++int NXMajorVersion() { ++ if (_NXVersionMajor == -1) ++ _parseNXVersion(); ++ return _NXVersionMajor; ++} ++int NXMinorVersion() { ++ if (_NXVersionMinor == -1) ++ _parseNXVersion(); ++ return _NXVersionMinor; ++} ++int NXPatchVersion() { ++ if (_NXVersionPatch == -1) ++ _parseNXVersion(); ++ return _NXVersionPatch; ++} ++int NXMaintenancePatchVersion() { ++ if (_NXVersionMaintenancePatch == -1) ++ _parseNXVersion(); ++ return _NXVersionMaintenancePatch; ++} diff --git a/debian/patches/0401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch b/debian/patches/0401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch new file mode 100644 index 000000000..ab16864df --- /dev/null +++ b/debian/patches/0401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch @@ -0,0 +1,1870 @@ +--- a/nxcomp/ClientChannel.cpp ++++ b/nxcomp/ClientChannel.cpp +@@ -447,6 +447,26 @@ + } + } + ++ // Get other bits of the header, so will not need to refer to them again ++ unsigned char inputDataByte = inputMessage[1]; ++ unsigned int buffer2 = GetUINT(inputMessage + 2, bigEndian_); ++ unsigned int inputDataSize = buffer2 - 1; ++ if (buffer2 == 0) ++ { ++ // BIG-REQUESTS ++ inputMessage += 4; ++ inputLength -= 4; ++ inputDataSize = GetULONG(inputMessage, bigEndian_) - 2; ++ } ++ if (inputLength != (4 * (inputDataSize + 1))) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead: inputLength=" << inputLength ++ << " mismatch inputDataSize=" << inputDataSize ++ << ".\n" << logofs_flush; ++ #endif ++ } ++ + // + // Go to the message's specific encoding. + // +@@ -455,6 +475,11 @@ + { + case X_AllocColor: + { ++ #ifdef WARNING ++ if (inputLength < 14) ++ *logofs << "handleRead: X_AllocColor inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, + clientCache_ -> colormapCache); + const unsigned char *nextSrc = inputMessage + 8; +@@ -476,6 +501,11 @@ + break; + case X_ReparentWindow: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_ReparentWindow inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), +@@ -486,6 +516,11 @@ + break; + case X_ChangeProperty: + { ++ #ifdef WARNING ++ if (inputLength < 24) ++ *logofs << "handleRead: X_ChangeProperty inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + MessageStore *messageStore = clientStore_ -> + getRequestStore(X_ChangeProperty); + +@@ -501,8 +536,36 @@ + encodeBuffer.encodeCachedValue(format, 8, + clientCache_ -> changePropertyFormatCache); + unsigned int dataLength = GetULONG(inputMessage + 20, bigEndian_); ++ ++ // Self-preserving sanity check (otherwise we crash and dump core): ++ // some clients do this when not getting their beloved BIG-REQUESTS. ++ unsigned int maxLength = 0; ++ if (format == 8) ++ { ++ maxLength = inputLength - 24; ++ } ++ else if (format == 32) ++ { ++ maxLength = (inputLength - 24) >> 2; ++ } ++ else if (format == 16) ++ { ++ maxLength = (inputLength - 24) >> 1; ++ } ++ if (dataLength > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_ChangeProperty bogus dataLength=" << dataLength ++ << " set to " << maxLength ++ << " when format=" << (int)format ++ << " inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ dataLength = maxLength; ++ } ++ + encodeBuffer.encodeValue(dataLength, 32, 6); +- encodeBuffer.encodeValue(inputMessage[1], 2); ++ encodeBuffer.encodeValue(inputDataByte, 2); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 8, bigEndian_), 29, +@@ -533,7 +596,7 @@ + nextSrc += 4; + } + } +- else ++ else if (format == 16) + { + for (unsigned int i = 0; i < dataLength; i++) + { +@@ -541,6 +604,13 @@ + nextSrc += 2; + } + } ++ else ++ { ++ #ifdef WARNING ++ *logofs << "ChangeProperty bogus format=" << (int)format ++ << ".\n" << logofs_flush; ++ #endif ++ } + } + break; + case X_SendEvent: +@@ -551,6 +621,11 @@ + // ratio. + // + ++ #ifdef WARNING ++ if (inputLength < 44) ++ *logofs << "handleRead: X_SendEvent inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + MessageStore *messageStore = clientStore_ -> + getRequestStore(X_SendEvent); + +@@ -562,7 +637,7 @@ + break; + } + +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + unsigned int window = GetULONG(inputMessage + 4, bigEndian_); + + if (window == 0 || window == 1) +@@ -599,7 +674,12 @@ + break; + case X_ChangeWindowAttributes: + { +- encodeBuffer.encodeValue((inputLength - 12) >> 2, 4); ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_ChangeWindowAttributes inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ encodeBuffer.encodeValue(inputDataSize - 2, 4); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + unsigned int bitmask = GetULONG(inputMessage + 8, bigEndian_); +@@ -621,6 +701,11 @@ + break; + case X_ClearArea: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_ClearArea inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -654,7 +739,7 @@ + break; + } + +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + const unsigned char *nextSrc = inputMessage + 8; +@@ -668,6 +753,11 @@ + break; + case X_CloseFont: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_CloseFont inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + unsigned int font = GetULONG(inputMessage + 4, bigEndian_); + encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); + clientCache_ -> lastFont = font; +@@ -675,6 +765,11 @@ + break; + case X_ConfigureWindow: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_ConfigureWindow inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + MessageStore *messageStore = clientStore_ -> + getRequestStore(X_ConfigureWindow); + +@@ -708,6 +803,11 @@ + break; + case X_ConvertSelection: + { ++ #ifdef WARNING ++ if (inputLength < 24) ++ *logofs << "handleRead: X_ConvertSelection inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, + clientCache_ -> convertSelectionRequestorCache, 9); + const unsigned char* nextSrc = inputMessage + 8; +@@ -725,6 +825,11 @@ + break; + case X_CopyArea: + { ++ #ifdef WARNING ++ if (inputLength < 28) ++ *logofs << "handleRead: X_CopyArea inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -793,6 +898,11 @@ + break; + case X_CopyGC: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_CopyGC inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int s_g_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -814,6 +924,11 @@ + break; + case X_CopyPlane: + { ++ #ifdef WARNING ++ if (inputLength < 32) ++ *logofs << "handleRead: X_CopyPlane inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, + bigEndian_), clientCache_ -> drawableCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, +@@ -833,6 +948,11 @@ + break; + case X_CreateGC: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_CreateGC inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -917,6 +1037,11 @@ + break; + case X_ChangeGC: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_ChangeGC inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -998,14 +1123,19 @@ + break; + case X_CreatePixmap: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_CreatePixmap inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + +- *logofs << "handleRead: X_CreatePixmap depth " << (unsigned) inputMessage[1] ++ *logofs << "handleRead: X_CreatePixmap depth " << (unsigned) inputDataByte + << ", pixmap id " << GetULONG(inputMessage + 4, bigEndian_) + << ", drawable " << GetULONG(inputMessage + 8, bigEndian_) + << ", width " << GetUINT(inputMessage + 12, bigEndian_) + << ", height " << GetUINT(inputMessage + 14, bigEndian_) +- << ", size " << GetUINT(inputMessage + 2, bigEndian_) << 2 ++ << ", length " << inputLength + << ".\n" << logofs_flush; + + unsigned int p_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1042,6 +1172,11 @@ + break; + case X_CreateWindow: + { ++ #ifdef WARNING ++ if (inputLength < 32) ++ *logofs << "handleRead: X_CreateWindow inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int w_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1054,7 +1189,7 @@ + #endif + + unsigned bitmask = GetULONG(inputMessage + 28, bigEndian_); +- encodeBuffer.encodeCachedValue((unsigned int) inputMessage[1], 8, ++ encodeBuffer.encodeCachedValue((unsigned int) inputDataByte, 8, + clientCache_ -> depthCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), + clientCache_ -> windowCache); +@@ -1098,6 +1233,11 @@ + break; + case X_DeleteProperty: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_DeleteProperty inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + encodeBuffer.encodeValue(GetULONG(inputMessage + 8, bigEndian_), 29, 9); +@@ -1105,6 +1245,11 @@ + break; + case X_FillPoly: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_FillPoly inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1138,7 +1283,7 @@ + break; + } + +- unsigned int numPoints = ((inputLength - 16) >> 2); ++ unsigned int numPoints = (inputDataSize - 3); + + if (control -> isProtoStep10() == 1) + { +@@ -1209,7 +1354,12 @@ + break; + case X_FreeColors: + { +- unsigned int numPixels = GetUINT(inputMessage + 2, bigEndian_) - 3; ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_FreeColors inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ unsigned int numPixels = inputDataSize - 2; + encodeBuffer.encodeValue(numPixels, 16, 4); + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, + clientCache_ -> colormapCache); +@@ -1225,12 +1375,22 @@ + break; + case X_FreeCursor: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_FreeCursor inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), + 29, clientCache_ -> cursorCache, 9); + } + break; + case X_FreeGC: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_FreeGC inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1284,6 +1444,11 @@ + break; + case X_FreePixmap: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_FreePixmap inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int p_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1318,6 +1483,11 @@ + break; + case X_GetAtomName: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_GetAtomName inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeValue(GetULONG(inputMessage + 4, bigEndian_), 29, 9); + + sequenceQueue_.push(clientSequence_, inputOpcode); +@@ -1327,6 +1497,11 @@ + break; + case X_GetGeometry: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_GetGeometry inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> drawableCache); + +@@ -1351,6 +1526,11 @@ + break; + case X_GetKeyboardMapping: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_GetKeyboardMapping inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeValue((unsigned int) inputMessage[4], 8); + encodeBuffer.encodeValue((unsigned int) inputMessage[5], 8); + +@@ -1361,6 +1541,11 @@ + break; + case X_GetProperty: + { ++ #ifdef WARNING ++ if (inputLength < 24) ++ *logofs << "handleRead: X_GetProperty inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + MessageStore *messageStore = clientStore_ -> + getRequestStore(X_GetProperty); + +@@ -1378,7 +1563,7 @@ + break; + } + +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + unsigned int property = GetULONG(inputMessage + 8, bigEndian_); +@@ -1394,6 +1579,11 @@ + break; + case X_GetSelectionOwner: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_GetSelectionOwner inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, + clientCache_ -> getSelectionOwnerSelectionCache, 9); + +@@ -1404,7 +1594,12 @@ + break; + case X_GrabButton: + { +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ #ifdef WARNING ++ if (inputLength < 24) ++ *logofs << "handleRead: X_GrabButton inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, +@@ -1423,7 +1618,12 @@ + break; + case X_GrabPointer: + { +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ #ifdef WARNING ++ if (inputLength < 24) ++ *logofs << "handleRead: X_GrabPointer inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, +@@ -1448,7 +1648,12 @@ + break; + case X_GrabKeyboard: + { +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_GrabKeyboard inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> windowCache); + unsigned int timestamp = GetULONG(inputMessage + 8, bigEndian_); +@@ -1471,6 +1676,11 @@ + break; + case X_PolyText8: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_PolyText8 inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1555,6 +1765,11 @@ + break; + case X_PolyText16: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_PolyText16 inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1639,6 +1854,11 @@ + break; + case X_ImageText8: + { ++ #ifdef WARNING ++ if (inputLength < 16 + (unsigned int)inputDataByte) ++ *logofs << "handleRead: X_ImageText8 inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1673,7 +1893,7 @@ + break; + } + +- unsigned int textLength = (unsigned int) inputMessage[1]; ++ unsigned int textLength = (unsigned int) inputDataByte; + encodeBuffer.encodeCachedValue(textLength, 8, + clientCache_ -> imageTextLengthCache, 4); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, +@@ -1706,6 +1926,11 @@ + break; + case X_ImageText16: + { ++ #ifdef WARNING ++ if (inputLength < 16 + (unsigned int)inputDataByte) ++ *logofs << "handleRead: X_ImageText16 inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -1740,7 +1965,7 @@ + break; + } + +- unsigned int textLength = (unsigned int) inputMessage[1]; ++ unsigned int textLength = (unsigned int) inputDataByte; + encodeBuffer.encodeCachedValue(textLength, 8, + clientCache_ -> imageTextLengthCache, 4); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, +@@ -1773,6 +1998,11 @@ + break; + case X_InternAtom: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_InternAtom inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + MessageStore *messageStore = clientStore_ -> + getRequestStore(X_InternAtom); + +@@ -1796,8 +2026,18 @@ + } + + unsigned int nameLength = GetUINT(inputMessage + 4, bigEndian_); ++ unsigned int maxLength = inputLength - 8; ++ if (nameLength > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_InternAtom bogus nameLength=" << nameLength ++ << " set to " << maxLength ++ << ".\n" << logofs_flush; ++ #endif ++ nameLength = maxLength; ++ } + encodeBuffer.encodeValue(nameLength, 16, 6); +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + const unsigned char *nextSrc = inputMessage + 8; + + if (control -> isProtoStep7() == 1) +@@ -1827,7 +2067,22 @@ + break; + case X_ListFonts: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_ListFonts inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + unsigned int textLength = GetUINT(inputMessage + 6, bigEndian_); ++ unsigned int maxLength = inputLength - 8; ++ if (textLength > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_ListFonts bogus textLength=" << textLength ++ << " set to " << maxLength ++ << ".\n" << logofs_flush; ++ #endif ++ textLength = maxLength; ++ } + encodeBuffer.encodeValue(textLength, 16, 6); + encodeBuffer.encodeValue(GetUINT(inputMessage + 4, bigEndian_), 16, 6); + const unsigned char* nextSrc = inputMessage + 8; +@@ -1853,7 +2108,22 @@ + case X_LookupColor: + case X_AllocNamedColor: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_AllocNamedColor inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + unsigned int textLength = GetUINT(inputMessage + 8, bigEndian_); ++ unsigned int maxLength = inputLength - 12; ++ if (textLength > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_AllocNamedColor bogus textLength=" << textLength ++ << " set to " << maxLength ++ << ".\n" << logofs_flush; ++ #endif ++ textLength = maxLength; ++ } + encodeBuffer.encodeValue(textLength, 16, 6); + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), + 29, clientCache_ -> colormapCache); +@@ -1886,6 +2156,11 @@ + case X_QueryPointer: + case X_QueryTree: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_MapWindow...X_QueryTree inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + if (inputOpcode == X_DestroyWindow) +@@ -1923,7 +2198,22 @@ + break; + case X_OpenFont: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_OpenFont inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + unsigned int nameLength = GetUINT(inputMessage + 8, bigEndian_); ++ unsigned int maxLength = inputLength - 12; ++ if (nameLength > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_InternAtom bogus nameLength=" << nameLength ++ << " set to " << maxLength ++ << ".\n" << logofs_flush; ++ #endif ++ nameLength = maxLength; ++ } + encodeBuffer.encodeValue(nameLength, 16, 7); + unsigned int font = GetULONG(inputMessage + 4, bigEndian_); + encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); +@@ -1947,6 +2237,11 @@ + break; + case X_PolyFillRectangle: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolyFillRectangle inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2034,6 +2329,11 @@ + break; + case X_PolyFillArc: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolyFillArc inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2135,6 +2435,11 @@ + break; + case X_PolyArc: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolyArc inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2236,6 +2541,11 @@ + break; + case X_PolyPoint: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolyPoint inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2269,8 +2579,8 @@ + break; + } + +- encodeBuffer.encodeValue(GetUINT(inputMessage + 2, bigEndian_) - 3, 16, 4); +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ encodeBuffer.encodeValue(inputDataSize - 2, 32, 4); ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> drawableCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), +@@ -2303,6 +2613,11 @@ + break; + case X_PolyLine: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolyLine inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2336,8 +2651,8 @@ + break; + } + +- encodeBuffer.encodeValue(GetUINT(inputMessage + 2, bigEndian_) - 3, 16, 4); +- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); ++ encodeBuffer.encodeValue(inputDataSize - 2, 32, 4); ++ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, + bigEndian_), clientCache_ -> drawableCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, +@@ -2370,8 +2685,12 @@ + break; + case X_PolyRectangle: + { +- encodeBuffer.encodeValue((GetUINT(inputMessage + 2, +- bigEndian_) - 3) >> 1, 16, 3); ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolyRectangle inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ encodeBuffer.encodeValue((inputDataSize - 2) >> 1, 32, 3); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, + bigEndian_), clientCache_ -> drawableCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, +@@ -2391,6 +2710,11 @@ + break; + case X_PolySegment: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_PolySegment inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2424,8 +2748,7 @@ + break; + } + +- encodeBuffer.encodeValue((GetUINT(inputMessage + 2, +- bigEndian_) - 3) >> 1, 16, 4); ++ encodeBuffer.encodeValue((inputDataSize - 2) >> 1, 32, 4); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, + bigEndian_), clientCache_ -> drawableCache); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, +@@ -2491,6 +2814,11 @@ + break; + case X_PutImage: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_PutImage inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2522,7 +2850,12 @@ + break; + case X_QueryBestSize: + { +- encodeBuffer.encodeValue((unsigned int)inputMessage[1], 2); ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_QueryBestSize inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif ++ encodeBuffer.encodeValue((unsigned int)inputDataByte, 2); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, + bigEndian_), clientCache_ -> drawableCache); + encodeBuffer.encodeValue(GetUINT(inputMessage + 8, bigEndian_), 16, 8); +@@ -2535,10 +2868,15 @@ + break; + case X_QueryColors: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_QueryColors inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + // Differential encoding. + encodeBuffer.encodeBoolValue(1); + +- unsigned int numColors = ((inputLength - 8) >> 2); ++ unsigned int numColors = (inputDataSize - 1); + encodeBuffer.encodeValue(numColors, 16, 5); + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, + clientCache_ -> colormapCache); +@@ -2567,15 +2905,20 @@ + break; + case X_QueryExtension: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_QueryExtension inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TEST + + char data[256]; + + int length = GetUINT(inputMessage + 4, bigEndian_); + +- if (length > 256) ++ if (length > 255) + { +- length = 256; ++ length = 255; + } + + strncpy(data, (char *) inputMessage + 8, length); +@@ -2588,6 +2931,16 @@ + #endif + + unsigned int nameLength = GetUINT(inputMessage + 4, bigEndian_); ++ unsigned int maxLength = inputLength - 8; ++ if (nameLength > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_QueryExtension bogus nameLength=" << nameLength ++ << " set to " << maxLength ++ << ".\n" << logofs_flush; ++ #endif ++ nameLength = maxLength; ++ } + encodeBuffer.encodeValue(nameLength, 16, 6); + const unsigned char *nextSrc = inputMessage + 8; + +@@ -2614,6 +2967,11 @@ + break; + case X_QueryFont: + { ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: X_QueryFont inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + unsigned int font = GetULONG(inputMessage + 4, bigEndian_); + encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); + clientCache_ -> lastFont = font; +@@ -2625,6 +2983,11 @@ + break; + case X_SetClipRectangles: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_SetClipRectangles inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + MessageStore *messageStore = clientStore_ -> + getRequestStore(X_SetClipRectangles); + +@@ -2636,7 +2999,7 @@ + break; + } + +- unsigned int numRectangles = ((inputLength - 12) >> 3); ++ unsigned int numRectangles = ((inputDataSize - 2) >> 1); + + if (control -> isProtoStep9() == 1) + { +@@ -2647,7 +3010,7 @@ + encodeBuffer.encodeValue(numRectangles, 13, 4); + } + +- encodeBuffer.encodeValue((unsigned int) inputMessage[1], 2); ++ encodeBuffer.encodeValue((unsigned int) inputDataByte, 2); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), + clientCache_ -> gcCache); + encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, +@@ -2668,7 +3031,22 @@ + break; + case X_SetDashes: + { ++ #ifdef WARNING ++ if (inputLength < 12) ++ *logofs << "handleRead: X_SetDashes inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + unsigned int numDashes = GetUINT(inputMessage + 10, bigEndian_); ++ unsigned int maxLength = inputLength - 12; ++ if (numDashes > maxLength) ++ { ++ #ifdef WARNING ++ *logofs << "handleRead X_SetDashes bogus numDashes=" << numDashes ++ << " set to " << maxLength ++ << ".\n" << logofs_flush; ++ #endif ++ numDashes = maxLength; ++ } + encodeBuffer.encodeCachedValue(numDashes, 16, + clientCache_ -> setDashesLengthCache, 5); + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), +@@ -2683,6 +3061,11 @@ + break; + case X_SetSelectionOwner: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_SetSelectionOwner inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, + clientCache_ -> setSelectionOwnerCache, 9); + encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 8, bigEndian_), 29, +@@ -2693,6 +3076,11 @@ + break; + case X_TranslateCoords: + { ++ #ifdef WARNING ++ if (inputLength < 16) ++ *logofs << "handleRead: X_TranslateCoords inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2764,6 +3152,11 @@ + break; + case X_GetImage: + { ++ #ifdef WARNING ++ if (inputLength < 20) ++ *logofs << "handleRead: X_GetImage inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -2802,7 +3195,7 @@ + } + + // Format. +- encodeBuffer.encodeValue((unsigned int) inputMessage[1], 2); ++ encodeBuffer.encodeValue((unsigned int) inputDataByte, 2); + // Drawable. + encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, + bigEndian_), clientCache_ -> drawableCache); +@@ -2869,6 +3262,11 @@ + } + else if (inputOpcode == opcodeStore_ -> putPackedImage) + { ++ #ifdef WARNING ++ if (inputLength < 24) ++ *logofs << "handleRead: putPackedImage inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + #ifdef TARGETS + + unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); +@@ -3004,7 +3402,7 @@ + << ".\n" << logofs_flush; + #endif + +- encodeBuffer.encodeCachedValue(*(inputMessage + 1), 8, ++ encodeBuffer.encodeCachedValue(inputDataByte, 8, + clientCache_ -> resourceCache); + } + else if (inputOpcode == opcodeStore_ -> freeUnpack) +@@ -3015,7 +3413,7 @@ + << ".\n" << logofs_flush; + #endif + +- encodeBuffer.encodeCachedValue(*(inputMessage + 1), 8, ++ encodeBuffer.encodeCachedValue(inputDataByte, 8, + clientCache_ -> resourceCache); + } + else if (inputOpcode == opcodeStore_ -> getControlParameters) +@@ -3130,6 +3528,11 @@ + // Enable or disable expose events + // coming from the real server. + // ++ #ifdef WARNING ++ if (inputLength < 8) ++ *logofs << "handleRead: setExposeParameters inputLength=" << inputLength ++ << ".\n" << logofs_flush; ++ #endif + + encodeBuffer.encodeBoolValue(*(inputMessage + 4)); + encodeBuffer.encodeBoolValue(*(inputMessage + 5)); +@@ -3198,10 +3601,10 @@ + { + if (hit) + { +- statistics -> addRenderCachedRequest(*(inputMessage + 1)); ++ statistics -> addRenderCachedRequest(inputDataByte); + } + +- statistics -> addRenderRequestBits(*(inputMessage + 1), inputLength << 3, bits); ++ statistics -> addRenderRequestBits(inputDataByte, inputLength << 3, bits); + } + + } // End if (firstRequest_)... else ... +@@ -4548,10 +4951,10 @@ + // + + /* +-FIXME: Recover the sequence number if the proxy ++Fixed as below? - FIXME: Recover the sequence number if the proxy + is not connected to an agent. + */ +- if (serverSequence_ > lastSequence_ || ++ if (SequenceNumber_x_gt_y(serverSequence_, lastSequence_) || + control -> SessionMode != session_proxy) + { + #ifdef DEBUG +@@ -4564,7 +4967,7 @@ + lastSequence_ = serverSequence_; + } + #ifdef DEBUG +- else if (serverSequence_ < lastSequence_) ++ else if (SequenceNumber_x_gt_y(lastSequence_, serverSequence_)) + { + // + // Use our last auto-generated sequence. +@@ -5003,6 +5406,12 @@ + break; + default: + { ++ // BEWARE: not only inputOpcode == GenericEvent but also ++ // others not handled above, at least: ++ // GraphicsExpose 13 ++ // MapRequest 20 ++ // ConfigureRequest 23 ++ // and any beyond LASTEvent. + #ifdef TEST + *logofs << "handleWrite: Using generic event compression " + << "for OPCODE#" << (unsigned int) outputOpcode +@@ -5014,11 +5423,51 @@ + + for (unsigned int i = 0; i < 14; i++) + { +- decodeBuffer.decodeCachedValue(value, 16, +- *serverCache_ -> genericEventIntCache[i]); ++ //decodeBuffer.decodeCachedValue(value, 16, ++ // *serverCache_ -> genericEventIntCache[i]); ++ if ( ! (decodeBuffer.decodeCachedValue(value, 16, ++ *serverCache_ -> genericEventIntCache[i])) ) ++ { ++ #ifdef WARNING ++ *logofs << "decodeCachedValue failed for GenEvt:" ++ << " buffer length=" << length ++ << " i=" << i ++ << "\n" << logofs_flush; ++ #endif ++ break; ++ } + + PutUINT(value, outputMessage + i * 2 + 4, bigEndian_); + } ++ // Handle "X Generic Event Extension" ++ // Extra data is not cached... ++ if (outputOpcode == GenericEvent && *(outputMessage+1) != 0 && outputLength == 32) ++ { ++ unsigned int extraOutputLength = (GetULONG(outputMessage + 4, bigEndian_) << 2); ++ if (extraOutputLength > 0 && extraOutputLength < 100*1024*1024) ++ { ++ // Extend buffer for the extra data ++ outputMessage = writeBuffer_.addMessage(extraOutputLength); ++ // Decode data and write into buffer at new position ++ for (unsigned int i = 0; i < (extraOutputLength>>1); i++) ++ { ++ //decodeBuffer.decodeValue(value, 16); ++ if ( ! (decodeBuffer.decodeValue(value, 16)) ) ++ { ++ #ifdef WARNING ++ *logofs << "decodeValue failed for GenEvt:" ++ << " extraOutputLength=" << extraOutputLength ++ << " buffer length=" << length ++ << " i=" << i ++ << "\n" << logofs_flush; ++ #endif ++ break; ++ } ++ PutUINT(value, outputMessage + i * 2, bigEndian_); ++ } ++ } ++ } ++ + } + } // End of switch (outputOpcode)... + +@@ -6892,7 +7341,7 @@ + } + else + { +- if (serverSequence_ > lastSequence_) ++ if (SequenceNumber_x_gt_y(serverSequence_, lastSequence_)) + { + #ifdef DEBUG + *logofs << "handleNotify: Updating last event's sequence " +@@ -6904,7 +7353,7 @@ + lastSequence_ = serverSequence_; + } + #ifdef DEBUG +- else if (serverSequence_ < lastSequence_) ++ else if (SequenceNumber_x_gt_y(lastSequence_, serverSequence_)) + { + // + // Use our last auto-generated sequence. +--- a/nxcomp/ClientReadBuffer.cpp ++++ b/nxcomp/ClientReadBuffer.cpp +@@ -119,15 +119,34 @@ + + dataLength = (GetUINT(start + 2, bigEndian_) << 2); + +- if (dataLength < 4) ++ if (dataLength == 0) // or equivalently (dataLength < 4) + { +- #ifdef TEST +- *logofs << "ClientReadBuffer: WARNING! Assuming length 4 " +- << "for suspicious message of length " << dataLength +- << ".\n" << logofs_flush; +- #endif ++ // BIG-REQUESTS extension ++ if (size < 8) ++ { ++ remaining_ = 8 - size; ++ return 0; ++ } + +- dataLength = 4; ++ dataLength = (GetULONG(start + 4, bigEndian_) << 2); ++ ++// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere ++// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. ++ if (dataLength < 8 || dataLength > 100*1024*1024) ++ { ++ #ifdef WARNING ++ *logofs << "BIG-REQUESTS with unacceptable dataLength=" ++ << dataLength << ", now set to 8.\n" << logofs_flush; ++ #endif ++ dataLength = 8; ++ } ++ else if (dataLength < 4*64*1024) ++ { ++ #ifdef WARNING ++ *logofs << "BIG-REQUESTS with silly dataLength=" ++ << dataLength << ".\n" << logofs_flush; ++ #endif ++ } + } + } + +--- a/nxcomp/DecodeBuffer.cpp ++++ b/nxcomp/DecodeBuffer.cpp +@@ -78,34 +78,45 @@ + { + if (!endOkay) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [A] " +- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) +- << " end_ = " << (end_ - buffer_) << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [A] in decodeValue(), returning 0:" ++ << " nextSrc_ = " << (nextSrc_ - buffer_) ++ << " end_ = " << (end_ - buffer_) ++ << ".\n" << logofs_flush; + #endif +- +- // +- // Label "context" is just used to identify +- // the routine which detected the problem in +- // present source file. +- // +- +- cerr << "Error" << ": Failure decoding data in context [A].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [A] " ++ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) ++ // << " end_ = " << (end_ - buffer_) << ".\n" ++ // << logofs_flush; ++ //#endif ++ //// ++ //// Label "context" is just used to identify ++ //// the routine which detected the problem in ++ //// present source file. ++ //// ++ //cerr << "Error" << ": Failure decoding data in context [A].\n"; ++ //HandleAbort(); + } + +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [B] " +- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) +- << " end_ = " << (end_ - buffer_) << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [B] in decodeValue(), returning 0:" ++ << " nextSrc_ = " << (nextSrc_ - buffer_) ++ << " end_ = " << (end_ - buffer_) ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [B].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [B] " ++ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) ++ // << " end_ = " << (end_ - buffer_) << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [B].\n"; ++ //HandleAbort(); + } + + lastBit = (nextSrcChar & srcMask_); +@@ -134,28 +145,40 @@ + { + if (!endOkay) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [C] " +- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) +- << " end_ = " << (end_ - buffer_) << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [C] in decodeValue(), returning 0:" ++ << " nextSrc_ = " << (nextSrc_ - buffer_) ++ << " end_ = " << (end_ - buffer_) ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [C].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [C] " ++ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) ++ // << " end_ = " << (end_ - buffer_) << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [C].\n"; ++ //HandleAbort(); + } + +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [D] " +- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) +- << " end_ = " << (end_ - buffer_) << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [D] in decodeValue(), returning 0:" ++ << " nextSrc_ = " << (nextSrc_ - buffer_) ++ << " end_ = " << (end_ - buffer_) ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [D].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [D] " ++ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) ++ // << " end_ = " << (end_ - buffer_) << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [D].\n"; ++ //HandleAbort(); + } + + unsigned char moreData = (nextSrcChar & srcMask_); +@@ -212,16 +235,24 @@ + + if (nextSrc_ >= end_) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [E] " +- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) +- << " end_ = " << (end_ - buffer_) << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [E] in decodeCachedValue(), returning 0:" ++ << " nextSrc_ = " << (nextSrc_ - buffer_) ++ << " end_ = " << (end_ - buffer_) ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [E].\n"; +- +- HandleAbort(); ++ // Failed: return value 0 ++ value = 0; ++ // Failed: return 0, though our callers do not check that... ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [E] " ++ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) ++ // << " end_ = " << (end_ - buffer_) << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [E].\n"; ++ //HandleAbort(); + } + + unsigned int index = 0; +@@ -237,30 +268,33 @@ + nextSrc_++; + if (nextSrc_ >= end_) + { +- if (!endOkay) +- { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [F] " +- << "in decodeCachedValue() nextSrc_ = " +- << (nextSrc_ - buffer_) << " end_ = " +- << (end_ - buffer_) << ".\n" << logofs_flush; +- #endif +- +- cerr << "Error" << ": Failure decoding data in context [F].\n"; +- +- HandleAbort(); +- } +- +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [G] " +- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) +- << " end_ = " << (end_ - buffer_) << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [G] in decodeCachedValue(), returning 0:" ++ << " nextSrc_ = " << (nextSrc_ - buffer_) ++ << " end_ = " << (end_ - buffer_) ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [G].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //if (!endOkay) ++ //{ ++ // #ifdef PANIC ++ // *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [F] " ++ // << "in decodeCachedValue() nextSrc_ = " ++ // << (nextSrc_ - buffer_) << " end_ = " ++ // << (end_ - buffer_) << ".\n" << logofs_flush; ++ // #endif ++ // cerr << "Error" << ": Failure decoding data in context [F].\n"; ++ // HandleAbort(); ++ //} ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [G] " ++ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) ++ // << " end_ = " << (end_ - buffer_) << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [G].\n"; ++ //HandleAbort(); + } + + nextSrcChar = *nextSrc_; +@@ -288,15 +322,20 @@ + return 1; + } + +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " +- << "in decodeCacheValue() with no value found.\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [H] in decodeCachedValue(), returning 0:" ++ << " no value found" ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [H].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " ++ // << "in decodeCacheValue() with no value found.\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [H].\n"; ++ //HandleAbort(); + } + else + { +@@ -323,15 +362,20 @@ + return 1; + } + +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " +- << "in decodeCacheValue() with no value found.\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [F] in decodeCachedValue(), returning 0:" ++ << " no value found" ++ << " .\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [H].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " ++ // << "in decodeCacheValue() with no value found.\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [H].\n"; ++ //HandleAbort(); + } + } + } +@@ -344,16 +388,22 @@ + + if (index > cache.getSize()) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [I] " +- << "in decodeCachedValue() index = " << index +- << " cache size = " << cache.getSize() << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [I] in decodeCachedValue(), returning 0:" ++ << " index = " << index ++ << " cache size = " << cache.getSize() ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [I].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [I] " ++ // << "in decodeCachedValue() index = " << index ++ // << " cache size = " << cache.getSize() << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [I].\n"; ++ //HandleAbort(); + } + + value = cache.get(index); +@@ -401,16 +451,22 @@ + { + if (!endOkay) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [K] " +- << "in decodeCachedValue() nextSrc_ " +- << (nextSrc_ - buffer_) << " end_ " << (end_ - buffer_) ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [K] in decodeCachedValue(), returning 0:" ++ << " nextSrc_ " << (nextSrc_ - buffer_) ++ << " end_ " << (end_ - buffer_) + << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [K].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [K] " ++ // << "in decodeCachedValue() nextSrc_ " ++ // << (nextSrc_ - buffer_) << " end_ " << (end_ - buffer_) ++ // << ".\n" << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [K].\n"; ++ //HandleAbort(); + } + + #ifdef TEST +@@ -446,15 +502,20 @@ + } + else + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [M] " +- << "in decodeValue() with index = 2.\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [M] in decodeCachedValue(), returning 0:" ++ << "with index = 2" ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [M].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [M] " ++ // << "in decodeValue() with index = 2.\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [M].\n"; ++ //HandleAbort(); + } + } + else +@@ -466,16 +527,22 @@ + + if (index > cache.getSize()) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [N] " +- << "in decodeCachedValue() " << "index = " << index +- << " cache size = " << cache.getSize() << ".\n" +- << logofs_flush; ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [N] in decodeCachedValue(), returning 0:" ++ << " index = " << index ++ << " cache size = " << cache.getSize() ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [N].\n"; +- +- HandleAbort(); ++ value = 0; ++ return 0; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [N] " ++ // << "in decodeCachedValue() " << "index = " << index ++ // << " cache size = " << cache.getSize() << ".\n" ++ // << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [N].\n"; ++ //HandleAbort(); + } + + value = cache.get(index); +@@ -538,16 +605,22 @@ + } + else if (end_ - nextSrc_ < (int) numBytes) + { +- #ifdef PANIC +- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [P] " +- << "in decodeMemory() " << "with length " << numBytes ++ #ifdef WARNING ++ *logofs << "DecodeBuffer: Error [P] in decodeMemory(), returning NULL:" ++ << " with length " << numBytes + << " and " << (end_ - nextSrc_) +- << " bytes remaining.\n" << logofs_flush; ++ << " bytes remaining" ++ << ".\n" << logofs_flush; + #endif +- +- cerr << "Error" << ": Failure decoding data in context [P].\n"; +- +- HandleAbort(); ++ return NULL; ++ //#ifdef PANIC ++ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [P] " ++ // << "in decodeMemory() " << "with length " << numBytes ++ // << " and " << (end_ - nextSrc_) ++ // << " bytes remaining.\n" << logofs_flush; ++ //#endif ++ //cerr << "Error" << ": Failure decoding data in context [P].\n"; ++ //HandleAbort(); + } + + nextSrc_ += numBytes; +--- a/nxcomp/DecodeBuffer.h ++++ b/nxcomp/DecodeBuffer.h +@@ -30,7 +30,8 @@ + #include "ActionCacheCompat.h" + #include "PositionCacheCompat.h" + +-#define DECODE_BUFFER_OVERFLOW_SIZE 4194304 ++// See WriteBuffer.h and EncodeBuffer.h ++#define DECODE_BUFFER_OVERFLOW_SIZE 104857600 + + #define DECODE_BUFFER_POSTFIX_SIZE 1 + +--- a/nxcomp/EncodeBuffer.h ++++ b/nxcomp/EncodeBuffer.h +@@ -33,10 +33,10 @@ + // + // This should match the maximum size of + // a single message added to write buffer +-// (see WriteBuffer.h). ++// (see WriteBuffer.h and DecodeBuffer.h). + // + +-#define ENCODE_BUFFER_OVERFLOW_SIZE 4194304 ++#define ENCODE_BUFFER_OVERFLOW_SIZE 104857600 + + // + // Adjust for the control messages and the +--- a/nxcomp/SequenceQueue.h ++++ b/nxcomp/SequenceQueue.h +@@ -18,6 +18,22 @@ + #ifndef SequenceQueue_H + #define SequenceQueue_H + ++inline int SequenceNumber_x_gt_y(unsigned int x, unsigned int y) ++{ ++ // For two sequence numbers x and y, determine whether (x > y). ++ // Sequence numbers are the trailing 16 bits of a bigger number: ++ // need to handle wraparound, e.g. 0 is 65536, just after 65535. ++ if (x != (x & 0x00ffff)) return 0; ++ if (y != (y & 0x00ffff)) return 0; ++ // Closeness when comparison makes sense: arbitrarily set at 16*1024 ++ if ((x > y) && ((x-y) < 16*1024)) return 1; ++ // Wrapped value ++ unsigned int w = x + 64*1024; ++ // We know that w>y but test left for symmetry ++ if ((w > y) && ((w-y) < 16*1024)) return 1; ++ return 0; ++} ++ + // + // List of outstanding request messages which + // are waiting for a reply. This class is used +--- a/nxcomp/ServerChannel.cpp ++++ b/nxcomp/ServerChannel.cpp +@@ -104,7 +104,8 @@ + // + + #define HIDE_MIT_SHM_EXTENSION +-#define HIDE_BIG_REQUESTS_EXTENSION ++// HIDE_BIG_REQUESTS_EXTENSION : No good to hide, some clients may send crap instead... ++#undef HIDE_BIG_REQUESTS_EXTENSION + #define HIDE_XFree86_Bigfont_EXTENSION + #undef HIDE_SHAPE_EXTENSION + #undef HIDE_XKEYBOARD_EXTENSION +@@ -1412,6 +1413,9 @@ + + unsigned int inputSequence = GetUINT(inputMessage + 2, bigEndian_); + ++ // Sometimes we get inputSequence=0 or =256 when inputOpcode=11=X_UnmapSubwindows ++ // Seems weird... but is "normal" and is to be accepted. ++ + // + // Check if this is an event which we can discard. + // +@@ -1905,6 +1909,12 @@ + break; + default: + { ++ // BEWARE: not only inputOpcode == GenericEvent but also ++ // others not handled above, at least: ++ // GraphicsExpose 13 ++ // MapRequest 20 ++ // ConfigureRequest 23 ++ // and any beyond LASTEvent. + #ifdef TEST + *logofs << "handleRead: Using generic event compression " + << "for OPCODE#" << (unsigned int) inputOpcode +@@ -1919,6 +1929,16 @@ + encodeBuffer.encodeCachedValue(GetUINT(inputMessage + i * 2 + 4, bigEndian_), + 16, *serverCache_ -> genericEventIntCache[i]); + } ++ // Handle "X Generic Event Extension" ++ // Cannot cache extra data... ++// FIXME: BUG ALERT: is it OK to have the first 32 bytes cached, but not the rest? ++ if (inputOpcode == GenericEvent && inputLength > 32) ++ { ++ for (unsigned int i = 14; i < ((inputLength-4)>>1); i++) ++ { ++ encodeBuffer.encodeValue(GetUINT(inputMessage + i * 2 + 4, bigEndian_), 16); ++ } ++ } + } + + } // switch (inputOpcode)... +@@ -3756,7 +3776,7 @@ + } + + unsigned int numPoints; +- decodeBuffer.decodeValue(numPoints, 16, 4); ++ decodeBuffer.decodeValue(numPoints, 32, 4); + outputLength = (numPoints << 2) + 12; + outputMessage = writeBuffer_.addMessage(outputLength); + unsigned int relativeCoordMode; +@@ -3802,7 +3822,7 @@ + } + + unsigned int numPoints; +- decodeBuffer.decodeValue(numPoints, 16, 4); ++ decodeBuffer.decodeValue(numPoints, 32, 4); + outputLength = (numPoints << 2) + 12; + outputMessage = writeBuffer_.addMessage(outputLength); + unsigned int relativeCoordMode; +@@ -3839,7 +3859,7 @@ + case X_PolyRectangle: + { + unsigned int numRectangles; +- decodeBuffer.decodeValue(numRectangles, 16, 3); ++ decodeBuffer.decodeValue(numRectangles, 32, 3); + outputLength = (numRectangles << 3) + 12; + outputMessage = writeBuffer_.addMessage(outputLength); + decodeBuffer.decodeXidValue(value, clientCache_ -> drawableCache); +@@ -3869,7 +3889,7 @@ + } + + unsigned int numSegments; +- decodeBuffer.decodeValue(numSegments, 16, 4); ++ decodeBuffer.decodeValue(numSegments, 32, 4); + outputLength = (numSegments << 3) + 12; + outputMessage = writeBuffer_.addMessage(outputLength); + decodeBuffer.decodeXidValue(value, clientCache_ -> drawableCache); +@@ -4590,7 +4610,29 @@ + + *outputMessage = (unsigned char) outputOpcode; + +- PutUINT(outputLength >> 2, outputMessage + 2, bigEndian_); ++ if (outputLength < 4*64*1024) ++ PutUINT(outputLength >> 2, outputMessage + 2, bigEndian_); ++ else ++ { ++ // Handle BIG-REQUESTS ++ PutUINT(0, outputMessage + 2, bigEndian_); ++// FIXME: BUG ALERT: following write may not work well, ++// particularly with un-flushed messages. ++if (outputMessage != writeBuffer_.getData()) ++{ ++*logofs << "PSz BUG handleWrite BIG-REQUESTS:" ++ << " have " << (unsigned int)(outputMessage - writeBuffer_.getData()) ++ << " bytes in buffer" ++ << ", write immediate of 4-byte header will not work well" ++ << "\n" << logofs_flush; ++} ++// But, it works well enough in my testing... ++ // Write first four bytes ++ if (transport_ -> write(write_immediate, outputMessage, 4) < 0) ++ return -1; ++ // Replace with new 4-byte length ++ PutULONG(1 + (outputLength >> 2), outputMessage, bigEndian_); ++ } + + #if defined(TEST) || defined(OPCODES) + *logofs << "handleWrite: Handled request OPCODE#" +@@ -5912,7 +5954,7 @@ + unsigned char opcode = *lastMotion_; + unsigned int size = 32; + +- if (GetUINT(buffer + 2, bigEndian_) < serverSequence_) ++ if (SequenceNumber_x_gt_y(serverSequence_, GetUINT(buffer + 2, bigEndian_))) + { + PutUINT(serverSequence_, (unsigned char *) buffer + 2, bigEndian_); + } +--- a/nxcomp/ServerReadBuffer.cpp ++++ b/nxcomp/ServerReadBuffer.cpp +@@ -108,14 +108,21 @@ + { + dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); + } ++ else if (*start == GenericEvent && *(start+1) != 0) ++ { ++ // X Generic Event Extension ++ dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); ++ } + else + { + dataLength = 32; + } + +- if (dataLength < 32) ++// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere ++// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. ++ if (dataLength < 32 || dataLength > 100*1024*1024) + { +- #ifdef TEST ++ #ifdef WARNING + *logofs << "ServerReadBuffer: WARNING! Assuming length 32 " + << "for suspicious message of length " << dataLength + << ".\n" << logofs_flush; +--- a/nxcomp/WriteBuffer.h ++++ b/nxcomp/WriteBuffer.h +@@ -32,8 +32,14 @@ + // This is likely to be a reply to a X_ListFonts where + // user has a large amount of installed fonts. + // ++// Used also for messages sent, and should accommodate any BIG-REQUESTS. ++// Value was 4MB = 4194304, changed to 100MB = 104857600. ++// See also sanity check limits (set same, to 100*1024*1024) in ++// ClientReadBuffer.cpp ServerReadBuffer.cpp and ClientChannel.cpp, and ++// ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE elsewhere. ++// + +-#define WRITE_BUFFER_OVERFLOW_SIZE 4194304 ++#define WRITE_BUFFER_OVERFLOW_SIZE 104857600 + + class WriteBuffer + { diff --git a/debian/patches/051_nxcomp_macos105-fdisset.full+lite.patch b/debian/patches/051_nxcomp_macos105-fdisset.full+lite.patch deleted file mode 100644 index 6b78a6bc2..000000000 --- a/debian/patches/051_nxcomp_macos105-fdisset.full+lite.patch +++ /dev/null @@ -1,82 +0,0 @@ -Description: workaround for Mac OS X 10.5 - The Mac OS X 10.5 SDK requires the second argument of FD_ISSET to be - writeable, although it does only access the data. Given that we have a - const pointer for a const struct, copy and pass that. - . - Note that this is merely a workaround for OS X 10.5, as 10.6 and later - define the second argument of FD_ISSET as const struct const *foo, too. - . - It is safe, as data is accessed read-only by FD_ISSET, even on 10.5. -Forward: pending -Author: Mihai Moldovan ---- - nxcomp/Agent.h | 28 ++++++++++++++++++++-------- - 1 files changed, 20 insertions(+), 8 deletions(-) - ---- a/nxcomp/Agent.h -+++ b/nxcomp/Agent.h -@@ -149,30 +149,38 @@ - - int remoteCanRead(const fd_set * const readSet) - { -+ // OS X 10.5 requires the second argument to be non-const, so copy readSet. -+ // It's safe though, as FD_ISSET does not operate on it. -+ fd_set readWorkSet = *readSet; -+ - #if defined(TEST) || defined(INFO) - *logofs << "Agent: remoteCanRead() is " << -- (FD_ISSET(remoteFd_, readSet) && transport_ -> dequeuable() != 0) -- << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, readSet) -+ (FD_ISSET(remoteFd_, &readWorkSet) && transport_ -> dequeuable() != 0) -+ << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, &readWorkSet) - << " and dequeuable " << transport_ -> dequeuable() - << ".\n" << logofs_flush; - #endif - -- return (FD_ISSET(remoteFd_, readSet) && -+ return (FD_ISSET(remoteFd_, &readWorkSet) && - transport_ -> dequeuable() != 0); - } - - int remoteCanWrite(const fd_set * const writeSet) - { -+ // OS X 10.5 requires the second argument to be non-const, so copy writeSet. -+ // It's safe though, as FD_ISSET does not operate on it. -+ fd_set writeWorkSet = *writeSet; -+ - #if defined(TEST) || defined(INFO) - *logofs << "Agent: remoteCanWrite() is " << -- (FD_ISSET(remoteFd_, writeSet) && transport_ -> -+ (FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> - queuable() != 0 && canRead_ == 1) << " with FD_ISSET() " -- << (int) FD_ISSET(remoteFd_, writeSet) << " queueable " -+ << (int) FD_ISSET(remoteFd_, &writeWorkSet) << " queueable " - << transport_ -> queuable() << " channel can read " - << canRead_ << ".\n" << logofs_flush; - #endif - -- return (FD_ISSET(remoteFd_, writeSet) && -+ return (FD_ISSET(remoteFd_, &writeWorkSet) && - transport_ -> queuable() != 0 && - canRead_ == 1); - } -@@ -203,13 +211,17 @@ - - int proxyCanRead(const fd_set * const readSet) - { -+ // OS X 10.5 requires the second argument to be non-const, so copy readSet. -+ // It's safe though, as FD_ISSET does not operate on it. -+ fd_set readWorkSet = *readSet; -+ - #if defined(TEST) || defined(INFO) - *logofs << "Agent: proxyCanRead() is " -- << ((int) FD_ISSET(proxy -> getFd(), readSet) -+ << ((int) FD_ISSET(proxy -> getFd(), &readWorkSet) - << ".\n" << logofs_flush; - #endif - -- return (FD_ISSET(proxy -> getFd(), readSet)); -+ return (FD_ISSET(proxy -> getFd(), &readWorkSet)); - } - - int enqueueData(const char *data, const int size) const diff --git a/debian/patches/052_nxcomp_macos10-nxauth-location.full+lite.patch b/debian/patches/052_nxcomp_macos10-nxauth-location.full+lite.patch deleted file mode 100644 index 813363e69..000000000 --- a/debian/patches/052_nxcomp_macos10-nxauth-location.full+lite.patch +++ /dev/null @@ -1,41 +0,0 @@ -Description: Fix nxauth location on Mac OS X 10 -Author: Mihai Moldovan - ---- a/nxcomp/Auth.cpp -+++ b/nxcomp/Auth.cpp -@@ -217,22 +217,31 @@ - - // - // Use the nxauth command on Windows and the Mac, xauth -- // on all the other platforms. On Windows and on the Mac -- // we assume that the nxauth command is located under -- // bin in the client installation directory. On all the -+ // on all the other platforms. On Windows we assume that -+ // the nxauth command is located under bin in the client -+ // installation directory. On Mac OS X we assume that the -+ // command is located directly in the client installation -+ // directory, to make bundle shipping easier. On all the - // other platforms we use the default xauth command that - // is in our path. - // - - char command[DEFAULT_STRING_LIMIT]; - -- #if defined(__CYGWIN32__) || defined(__APPLE__) -+ #if defined(__CYGWIN32__) - - snprintf(command, DEFAULT_STRING_LIMIT - 1, - "%s/bin/nxauth", control -> SystemPath); - - *(command + DEFAULT_STRING_LIMIT - 1) = '\0'; - -+ #elif defined(__APPLE__) -+ -+ snprintf(command, DEFAULT_STRING_LIMIT - 1, -+ "%s/nxauth", control -> SystemPath); -+ -+ *(command + DEFAULT_STRING_LIMIT - 1) = '\0'; -+ - #else - - strcpy(command, "xauth"); diff --git a/debian/patches/053_nx-X11_no-xcomp1-install-target.full.patch b/debian/patches/053_nx-X11_no-xcomp1-install-target.full.patch deleted file mode 100644 index acf9374e5..000000000 --- a/debian/patches/053_nx-X11_no-xcomp1-install-target.full.patch +++ /dev/null @@ -1,32 +0,0 @@ -Description: Avoid building libXcomp.so.1 (which is identical to libXcomp.so.3) -Author: Orion Poplawski - ---- a/nx-X11/lib/X11/Imakefile 2013-01-04 05:25:49.000000000 -0700 -+++ b/nx-X11/lib/X11/Imakefile 2013-01-15 15:26:07.969167259 -0700 -@@ -63,7 +63,6 @@ NX_XCOMPLIBDIR = $(XTOP)/../nxcomp - NX_XCOMPLIBLINK = Xcomp - NX_XCOMPLIBTARGET = $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) - NX_REQUIREDLIBS = -L$(NX_XCOMPLIBDIR) -l$(NX_XCOMPLIBLINK) --NX_XCOMPDEPTARGET = $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) - NX_XCOMPCONFIGTARGET = $(NX_XCOMPLIBDIR)/config.status - - NX_XCOMPEXTLIBDIR = $(XTOP)/../nxcompext -@@ -1181,17 +1180,9 @@ lib$(LIBNAME).so.$(SOXLIBREV): $(NX_XCOM - - all:: $(NX_XCOMPLIBTARGET) - --$(NX_XCOMPDEPTARGET): -- ln -s $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) -- ln -s $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME).1 $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME).1 -- - depend:: $(NX_XCOMPLIBTARGET) - --all:: $(NX_XCOMPDEPTARGET) $(NX_XCOMPEXTLIBTARGET) -- --clean:: -- rm -f $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) -- rm -f $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME).1 -+all:: $(NX_XCOMPEXTLIBTARGET) - - #endif - diff --git a/debian/patches/054_nx-X11_ppc64-ftbfs.full.patch b/debian/patches/054_nx-X11_ppc64-ftbfs.full.patch deleted file mode 100644 index d60426e91..000000000 --- a/debian/patches/054_nx-X11_ppc64-ftbfs.full.patch +++ /dev/null @@ -1,14 +0,0 @@ -Description: Fix FTBFS on ppc64 architecture -Author: Orion Poplawski -diff -up a/nx-X11/lib/GL/mesa/main/Imakefile.inc b/nx-X11/lib/GL/mesa/main/Imakefile.inc ---- a/nx-X11/lib/GL/mesa/main/Imakefile.inc 2014-01-04 13:39:35.000000000 -0700 -+++ b/nx-X11/lib/GL/mesa/main/Imakefile.inc 2014-01-24 12:04:00.085272615 -0700 -@@ -1,5 +1,8 @@ - XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ - -+/* gcc on ppc64 defines this, causes macro recursion with pixel below */ -+#undef pixel -+ - #ifndef MesaBuildDir - #define MesaBuildDir $(GLXLIBSRC)/mesa/main/ - #endif diff --git a/debian/patches/055_nx-X11_imake-Werror-format-security.full.patch b/debian/patches/055_nx-X11_imake-Werror-format-security.full.patch deleted file mode 100644 index 6e5b4c80e..000000000 --- a/debian/patches/055_nx-X11_imake-Werror-format-security.full.patch +++ /dev/null @@ -1,1090 +0,0 @@ -Description: Fix FTBFS when compiled with -Werror=format-security -Author: Orion Poplawski -diff -up a/nx-X11/config/imake/imake.c b/nx-X11/config/imake/imake.c ---- a/nx-X11/config/imake/imake.c 2014-01-04 13:39:35.000000000 -0700 -+++ b/nx-X11/config/imake/imake.c 2014-01-24 13:55:53.940697330 -0700 -@@ -7,8 +7,6 @@ - * be passed to the template file. * - * * - ***************************************************************************/ --/* $XFree86: xc/config/imake/imake.c,v 3.63tsi Exp $ */ -- - /* - * - Copyright (c) 1985, 1986, 1987, 1998 The Open Group -@@ -153,23 +151,14 @@ in this Software without prior written a - #endif - #include - #include --#ifdef MONOLITH --# include "Xosdefs.h" --#else --# include --#endif -+#include -+#include -+#include - #include - #include - #ifdef WIN32 - # include "Xw32defs.h" - #endif --#if 0 --#ifndef X_NOT_POSIX --# ifndef _POSIX_SOURCE --# define _POSIX_SOURCE --# endif --#endif --#endif - #include - #include - #ifdef X_NOT_POSIX -@@ -231,22 +220,16 @@ typedef union wait waitType; - # define WIFEXITED(w) waitCode(w) - # endif - #endif /* X_NOT_POSIX */ --# include --#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ --char *malloc(), *realloc(); --#endif /* macII */ -+#include - #include - #ifdef __minix_vmd --#define USE_FREOPEN 1 -+# define USE_FREOPEN 1 - #endif - --#if !((defined(sun) && !defined(SVR4)) || defined(macII)) --#define USE_STRERROR 1 --#endif - #ifndef WIN32 --#include -+# include - #else --#include -+# include - #endif - #ifndef SYS_NMLN - # ifdef _SYS_NMLN -@@ -256,39 +239,22 @@ char *malloc(), *realloc(); - # endif - #endif - #if defined(linux) || defined(__GNU__) || defined(__GLIBC__) --#include --#include -+# include -+# include - #endif - #ifdef __QNX__ --#include --#endif -- --/* -- * This define of strerror is copied from (and should be identical to) -- * Xos.h, which we don't want to include here for bootstrapping reasons. -- */ --#ifndef USE_STRERROR --# ifndef strerror --extern char *sys_errlist[]; --extern int sys_nerr; --# define strerror(n) \ -- (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error") --# endif -+# include - #endif - - #if defined(__NetBSD__) /* see code clock in init() below */ --#include --#endif -- --#if !(defined(Lynx) || defined(__Lynx__) || (defined(SVR4) && !defined(sun))) && !defined (__CYGWIN__) --#define HAS_MKSTEMP -+# include - #endif - - typedef unsigned char boolean; - #define TRUE 1 - #define FALSE 0 - --# include "imakemdep.h" -+#include "imakemdep.h" - #ifdef CROSSCOMPILE - # include "imakemdep_cpp.h" - #endif -@@ -305,7 +271,7 @@ int xvariables[10]; - #endif - - #ifndef PATH_MAX --#define PATH_MAX 1024 -+# define PATH_MAX 1024 - #endif - - /* -@@ -331,11 +297,13 @@ void KludgeOutputLine(char **), KludgeRe - # endif - #endif - --char *cpp = NULL; -+const char *cpp = NULL; - --char *tmpMakefile = "/tmp/Imf.XXXXXX"; --char *tmpImakefile = "/tmp/IIf.XXXXXX"; --char *make_argv[ ARGUMENTS ] = { -+const char *tmpMakefile; -+const char *tmpMakefileTemplate = "/tmp/Imf.XXXXXX"; -+const char *tmpImakefile; -+const char *tmpImakefileTemplate = "/tmp/IIf.XXXXXX"; -+const char *make_argv[ ARGUMENTS ] = { - #ifdef WIN32 - "nmake" - #else -@@ -345,53 +313,53 @@ char *make_argv[ ARGUMENTS ] = { - - int make_argindex; - int cpp_argindex; --char *Imakefile = NULL; --char *Makefile = "Makefile"; --char *Template = "Imake.tmpl"; --char *ImakefileC = "Imakefile.c"; -+const char *Imakefile = NULL; -+const char *Makefile = "Makefile"; -+const char *Template = "Imake.tmpl"; -+const char *ImakefileC = "Imakefile.c"; - boolean haveImakefileC = FALSE; --char *cleanedImakefile = NULL; --char *program; --char *FindImakefile(char *Imakefile); --char *ReadLine(FILE *tmpfd, char *tmpfname); --char *CleanCppInput(char *imakefile); --char *Strdup(char *cp); -+const char *cleanedImakefile = NULL; -+const char *program; -+const char *FindImakefile(const char *Imakefile); -+char *ReadLine(FILE *tmpfd, const char *tmpfname); -+const char *CleanCppInput(const char *imakefile); -+char *Strdup(const char *cp); - char *Emalloc(int size); --void LogFatalI(char *s, int i), LogFatal(char *x0, char *x1), -- LogMsg(char *x0, char *x1); -+void LogFatal(const char *x0, ...) _X_ATTRIBUTE_PRINTF(1, 2); -+void LogMsg(const char *x0, ...) _X_ATTRIBUTE_PRINTF(1, 2); - - void showit(FILE *fd); - void wrapup(void); - void init(void); --void AddMakeArg(char *arg); --void AddCppArg(char *arg); -+void AddMakeArg(const char *arg); -+void AddCppArg(const char *arg); - #ifdef CROSSCOMPILE - char *CrossCompileCPP(void); - #endif - void SetOpts(int argc, char **argv); --void CheckImakefileC(char *masterc); --void cppit(char *imakefile, char *template, char *masterc, -- FILE *outfd, char *outfname); -+void CheckImakefileC(const char *masterc); -+void cppit(const char *imakefile, const char *template, const char *masterc, -+ FILE *outfd, const char *outfname); - void makeit(void); --void CleanCppOutput(FILE *tmpfd, char *tmpfname); -+void CleanCppOutput(FILE *tmpfd, const char *tmpfname); - boolean isempty(char *line); --void writetmpfile(FILE *fd, char *buf, int cnt, char *fname); -+void writetmpfile(FILE *fd, const char *buf, int cnt, const char *fname); - #ifdef SIGNALRETURNSINT - int catch(int sig); - #else - void catch(int sig); - #endif --void showargs(char **argv); --boolean optional_include(FILE *inFile, char *defsym, char *fname); --void doit(FILE *outfd, char *cmd, char **argv); -+void showargs(const char **argv); -+boolean optional_include(FILE *inFile, const char *defsym, const char *fname); -+void doit(FILE *outfd, const char *cmd, const char **argv); - boolean define_os_defaults(FILE *inFile); - #ifdef CROSSCOMPILE - static void get_cross_compile_dir(FILE *inFile); - #endif - #ifdef CROSSCOMPILEDIR --char *CrossCompileDir = CROSSCOMPILEDIR; -+const char *CrossCompileDir = CROSSCOMPILEDIR; - #else --char *CrossCompileDir = ""; -+const char *CrossCompileDir = ""; - #endif - boolean CrossCompiling = FALSE; - -@@ -428,24 +396,25 @@ main(int argc, char *argv[]) - if ((tmpfd = fopen(tmpMakefile, "w+")) == NULL) - LogFatal("Cannot create temporary file %s.", tmpMakefile); - } else { --#ifdef HAS_MKSTEMP -+#ifdef HAVE_MKSTEMP - int fd; - #endif -- tmpMakefile = Strdup(tmpMakefile); --#ifndef HAS_MKSTEMP -- if (mktemp(tmpMakefile) == NULL || -- (tmpfd = fopen(tmpMakefile, "w+")) == NULL) { -- LogFatal("Cannot create temporary file %s.", tmpMakefile); -+ char *tmpMakefileName = Strdup(tmpMakefileTemplate); -+#ifndef HAVE_MKSTEMP -+ if (mktemp(tmpMakefileName) == NULL || -+ (tmpfd = fopen(tmpMakefileName, "w+")) == NULL) { -+ LogFatal("Cannot create temporary file %s.", tmpMakefileName); - } - #else -- fd = mkstemp(tmpMakefile); -+ fd = mkstemp(tmpMakefileName); - if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) { - if (fd != -1) { -- unlink(tmpMakefile); close(fd); -+ unlink(tmpMakefileName); close(fd); - } -- LogFatal("Cannot create temporary file %s.", tmpMakefile); -+ LogFatal("Cannot create temporary file %s.", tmpMakefileName); - } - #endif -+ tmpMakefile = tmpMakefileName; - } - AddMakeArg("-f"); - AddMakeArg( tmpMakefile ); -@@ -498,7 +467,7 @@ void - catch(int sig) - { - errno = 0; -- LogFatalI("Signal %d.", sig); -+ LogFatal("Signal %d.", sig); - } - - /* -@@ -572,21 +541,21 @@ init(void) - } - - void --AddMakeArg(char *arg) -+AddMakeArg(const char *arg) - { - errno = 0; - if (make_argindex >= ARGUMENTS-1) -- LogFatal("Out of internal storage.", ""); -+ LogFatal("Out of internal storage."); - make_argv[ make_argindex++ ] = arg; - make_argv[ make_argindex ] = NULL; - } - - void --AddCppArg(char *arg) -+AddCppArg(const char *arg) - { - errno = 0; - if (cpp_argindex >= ARGUMENTS-1) -- LogFatal("Out of internal storage.", ""); -+ LogFatal("Out of internal storage."); - cpp_argv[ cpp_argindex++ ] = arg; - cpp_argv[ cpp_argindex ] = NULL; - } -@@ -618,7 +587,7 @@ SetOpts(int argc, char **argv) - else { - argc--, argv++; - if (! argc) -- LogFatal("No description arg after -f flag", ""); -+ LogFatal("No description arg after -f flag"); - Imakefile = argv[0]; - } - } else if (argv[0][1] == 's') { -@@ -628,7 +597,7 @@ SetOpts(int argc, char **argv) - else { - argc--, argv++; - if (!argc) -- LogFatal("No description arg after -s flag", ""); -+ LogFatal("No description arg after -s flag"); - Makefile = ((argv[0][0] == '-') && !argv[0][1]) ? - NULL : argv[0]; - } -@@ -642,7 +611,7 @@ SetOpts(int argc, char **argv) - else { - argc--, argv++; - if (! argc) -- LogFatal("No description arg after -T flag", ""); -+ LogFatal("No description arg after -T flag"); - Template = argv[0]; - } - } else if (argv[0][1] == 'C') { -@@ -651,7 +620,7 @@ SetOpts(int argc, char **argv) - else { - argc--, argv++; - if (! argc) -- LogFatal("No imakeCfile arg after -C flag", ""); -+ LogFatal("No imakeCfile arg after -C flag"); - ImakefileC = argv[0]; - } - } else if (argv[0][1] == 'v') { -@@ -667,10 +636,10 @@ SetOpts(int argc, char **argv) - if (!cpp) - { - AddCppArg("-E"); --#ifdef __GNUC__ -+# ifdef __GNUC__ - if (verbose) - AddCppArg("-v"); --#endif -+# endif - cpp = DEFAULT_CC; - } - # else -@@ -686,8 +655,8 @@ SetOpts(int argc, char **argv) - AddCppArg(ImakefileC); - } - --char * --FindImakefile(char *Imakefile) -+const char * -+FindImakefile(const char *Imakefile) - { - if (Imakefile) { - if (access(Imakefile, R_OK) < 0) -@@ -695,7 +664,7 @@ FindImakefile(char *Imakefile) - } else { - if (access("Imakefile", R_OK) < 0) { - if (access("imakefile", R_OK) < 0) -- LogFatal("No description file.", ""); -+ LogFatal("No description file."); - else - Imakefile = "imakefile"; - } else -@@ -704,44 +673,50 @@ FindImakefile(char *Imakefile) - return(Imakefile); - } - --void --LogFatalI(char *s, int i) -+static void _X_ATTRIBUTE_PRINTF(1, 0) -+vLogMsg(const char *fmt, va_list args) - { -- /*NOSTRICT*/ -- LogFatal(s, (char *)(long)i); -+ int error_number = errno; -+ -+ if (error_number) { -+ fprintf(stderr, "%s: ", program); -+ fprintf(stderr, "%s\n", strerror(error_number)); -+ } -+ fprintf(stderr, "%s: ", program); -+ vfprintf(stderr, fmt, args); -+ fprintf(stderr, "\n"); - } - - void --LogFatal(char *x0, char *x1) -+LogFatal(const char *fmt, ...) - { - static boolean entered = FALSE; -+ va_list args; - - if (entered) - return; - entered = TRUE; - -- LogMsg(x0, x1); -+ va_start(args, fmt); -+ vLogMsg(fmt, args); -+ va_end(args); - fprintf(stderr, " Stop.\n"); - wrapup(); - exit(1); - } - - void --LogMsg(char *x0, char *x1) -+LogMsg(const char *fmt, ...) - { -- int error_number = errno; -+ va_list args; - -- if (error_number) { -- fprintf(stderr, "%s: ", program); -- fprintf(stderr, "%s\n", strerror(error_number)); -- } -- fprintf(stderr, "%s: ", program); -- fprintf(stderr, x0, x1); -- fprintf(stderr, "\n"); -+ va_start(args, fmt); -+ vLogMsg(fmt, args); -+ va_end(args); - } - - void --showargs(char **argv) -+showargs(const char **argv) - { - for (; *argv; argv++) - fprintf(stderr, "%s ", *argv); -@@ -751,7 +726,7 @@ showargs(char **argv) - #define ImakefileCHeader "/* imake - temporary file */" - - void --CheckImakefileC(char *masterc) -+CheckImakefileC(const char *masterc) - { - char mkcbuf[1024]; - FILE *inFile; -@@ -767,7 +742,8 @@ CheckImakefileC(char *masterc) - fclose(inFile); - LogFatal("Refuse to overwrite: %s", masterc); - } -- fclose(inFile); -+ else -+ fclose(inFile); - } - } - -@@ -778,7 +754,7 @@ CheckImakefileC(char *masterc) - #define OverrideWarning "Warning: local file \"%s\" overrides global macros." - - boolean --optional_include(FILE *inFile, char *defsym, char *fname) -+optional_include(FILE *inFile, const char *defsym, const char *fname) - { - errno = 0; - if (access(fname, R_OK) == 0) { -@@ -790,7 +766,7 @@ optional_include(FILE *inFile, char *def - } - - void --doit(FILE *outfd, char *cmd, char **argv) -+doit(FILE *outfd, const char *cmd, const char **argv) - { - int pid; - waitType status; -@@ -805,18 +781,18 @@ doit(FILE *outfd, char *cmd, char **argv - if (status < 0) - LogFatal("Cannot spawn %s.", cmd); - if (status > 0) -- LogFatalI("Exit code %d.", status); -+ LogFatal("Exit code %d.", status); - #else - pid = fork(); - if (pid < 0) -- LogFatal("Cannot fork.", ""); -+ LogFatal("Cannot fork."); - if (pid) { /* parent... simply wait */ - while (wait(&status) > 0) { - errno = 0; - if (WIFSIGNALED(status)) -- LogFatalI("Signal %d.", waitSig(status)); -+ LogFatal("Signal %d.", waitSig(status)); - if (WIFEXITED(status) && waitCode(status)) -- LogFatalI("Exit code %d.", waitCode(status)); -+ LogFatal("Exit code %d.", waitCode(status)); - } - } - else { /* child... dup and exec cmd */ -@@ -832,7 +808,7 @@ doit(FILE *outfd, char *cmd, char **argv - - #if !defined WIN32 - static void --parse_utsname(struct utsname *name, char *fmt, char *result, char *msg) -+parse_utsname(struct utsname *name, const char *fmt, char *result, const char *msg) - { - char buf[SYS_NMLN * 5 + 1]; - char *ptr = buf; -@@ -892,7 +868,7 @@ parse_utsname(struct utsname *name, char - - /* Just in case... */ - if (strlen(buf) >= sizeof(buf)) -- LogFatal("Buffer overflow parsing uname.", ""); -+ LogFatal("Buffer overflow parsing uname."); - - /* Parse the buffer. The sscanf() return value is rarely correct. */ - *result = '\0'; -@@ -978,13 +954,23 @@ const char *libc_c= - static void - get_libc_version(FILE *inFile) - { -- char aout[] = "/tmp/imakeXXXXXX"; -+ char aout[4096], *tmpdir; - FILE *fp; - const char *format = "%s -o %s -x c -"; - char *cc; - int len; - char *command; - -+ /* If $TMPDIR is defined and has an acceptable length, -+ * use that as tmp dir, else use /tmp. That fixes -+ * problems with /tmp mounted "noexec". -+ */ -+ if((tmpdir = getenv("TMPDIR")) != NULL && strlen(tmpdir) < (4096-13)) -+ strcpy(aout, tmpdir); -+ else -+ strcpy(aout, "/tmp"); -+ strcat(aout, "/imakeXXXXXX"); -+ - /* Pre-create temp file safely */ - { - /* Linux + ELF has mkstemp() */ -@@ -1000,7 +986,8 @@ get_libc_version(FILE *inFile) - cc = "gcc"; - len = strlen (aout) + strlen (format) + strlen (cc); - if (len < 128) len = 128; -- command = alloca (len); -+ if((command = alloca (len)) == NULL) -+ abort(); - - if (snprintf (command , len, format, cc, aout) == len) - abort (); -@@ -1015,12 +1002,16 @@ get_libc_version(FILE *inFile) - abort (); - - while (fgets (command, len, fp)) -- fprintf (inFile, command); -+ fputs (command, inFile); - - len = pclose (fp); - remove (aout); -- if (len) -- abort (); -+ if (len) { -+ /* handwave furiously */ -+ printf("#define DefaultLinuxCLibMajorVersion 6\n"); -+ printf("#define DefaultLinuxCLibMinorVersion 12\n"); -+ printf("#define DefaultLinuxCLibTeenyVersion 0\n"); -+ } - } - #endif - -@@ -1031,14 +1022,14 @@ get_stackprotector(FILE *inFile) - FILE *fp; - char *cc; - char command[1024], buf[1024]; -- -+ - cc = getenv("CC"); - if (cc == NULL) { - cc = "cc"; - } - snprintf(command, sizeof(command), "%s -v 2>&1", cc); - fp = popen(command, "r"); -- if (fp == NULL) -+ if (fp == NULL) - abort(); - while (fgets(buf, sizeof(buf), fp)) { - if (strstr(buf, "propolice") != NULL) { -@@ -1046,11 +1037,10 @@ get_stackprotector(FILE *inFile) - break; - } - } -- if (pclose(fp)) -- abort(); -+ pclose(fp); - } - #endif -- -+ - - #if defined CROSSCOMPILE || defined linux || defined(__GLIBC__) - static void -@@ -1058,9 +1048,9 @@ get_distrib(FILE *inFile) - { - struct stat sb; - -- static char* suse = "/etc/SuSE-release"; -- static char* redhat = "/etc/redhat-release"; -- static char* debian = "/etc/debian_version"; -+ static const char* suse = "/etc/SuSE-release"; -+ static const char* redhat = "/etc/redhat-release"; -+ static const char* debian = "/etc/debian_version"; - - fprintf (inFile, "%s\n", "#define LinuxUnknown 0"); - fprintf (inFile, "%s\n", "#define LinuxSuSE 1"); -@@ -1076,14 +1066,14 @@ get_distrib(FILE *inFile) - fprintf (inFile, "%s\n", "#define LinuxWare 11"); - fprintf (inFile, "%s\n", "#define LinuxYggdrasil 12"); - --#ifdef CROSSCOMPILE -+# ifdef CROSSCOMPILE - if (CrossCompiling) { - fprintf (inFile, "%s\n", - "#define DefaultLinuxDistribution LinuxUnknown"); - fprintf (inFile, "%s\n", "#define DefaultLinuxDistName Unknown"); - return; - } --#endif -+# endif - if (lstat (suse, &sb) == 0) { - fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxSuSE"); - fprintf (inFile, "%s\n", "#define DefaultLinuxDistName SuSE"); -@@ -1116,7 +1106,7 @@ get_ld_version(FILE *inFile) - int ldmajor, ldminor; - const char *ld = "ld -v"; - --#ifdef CROSSCOMPILE -+# ifdef CROSSCOMPILE - if (CrossCompiling) { - char cmd[PATH_MAX]; - strcpy (cmd, CrossCompileDir); -@@ -1124,7 +1114,7 @@ get_ld_version(FILE *inFile) - strcat (cmd,ld); - ldprog = popen (cmd, "r"); - } else --#endif -+# endif - ldprog = popen (ld, "r"); - - if (ldprog) { -@@ -1192,7 +1182,7 @@ get_binary_format(FILE *inFile) - * Returns: 0 if successful, -1 if not. - */ - static int --ask_sun_compiler_for_versions(const char *cmd, const char *path, -+ask_sun_compiler_for_versions(const char *cmd, const char *path, - int *cmajor, int *cminor) - { - char buf[BUFSIZ]; -@@ -1201,7 +1191,7 @@ ask_sun_compiler_for_versions(const char - FILE* ccproc; - const char vflag[] = " -V 2>&1"; - int retval = -1; -- -+ - int len = strlen(cmd) + sizeof(vflag); - - if (path != NULL) { -@@ -1229,7 +1219,7 @@ ask_sun_compiler_for_versions(const char - } - } - if (retval != 0) { -- fprintf(stderr, -+ fprintf(stderr, - "warning: could not parse version number in output of:\n" - " %s\n", cmdtorun); - } -@@ -1247,23 +1237,22 @@ get_sun_compiler_versions (FILE *inFile) - { - const char* sunpro_path = "/opt/SUNWspro/bin"; - int cmajor, cminor, found = 0; -- struct stat sb; - - /* If cross-compiling, only check CrossCompilerDir for compilers. -- * If not cross-compiling, first check cc in users $PATH, -+ * If not cross-compiling, first check cc in users $PATH, - * then try /opt/SUNWspro if not found in the users $PATH - */ - --#if defined CROSSCOMPILE -+# if defined CROSSCOMPILE - if (CrossCompiling) { - if (ask_sun_compiler_for_versions("cc", CrossCompileDir, - &cmajor, &cminor) == 0) { - found = 1; - } -- } -+ } - else --#endif -- { -+# endif -+ { - if (ask_sun_compiler_for_versions("cc", NULL, &cmajor, &cminor) == 0) { - found = 1; - } else if (ask_sun_compiler_for_versions("cc", sunpro_path, -@@ -1282,22 +1271,22 @@ get_sun_compiler_versions (FILE *inFile) - - /* Now do it again for C++ compiler (CC) */ - found = 0; --#if defined CROSSCOMPILE -+# if defined CROSSCOMPILE - if (CrossCompiling) { - if (ask_sun_compiler_for_versions("CC", CrossCompileDir, - &cmajor, &cminor) == 0) { - found = 1; - } -- } -+ } - else --#endif -- { -+# endif -+ { - if (ask_sun_compiler_for_versions("CC", NULL, &cmajor, &cminor) == 0) { - found = 1; - } else if (ask_sun_compiler_for_versions("CC", sunpro_path, - &cmajor, &cminor) == 0) { - found = 1; -- fprintf(inFile, -+ fprintf(inFile, - "#define DefaultSunProCplusplusCompilerDir %s", sunpro_path); - } - } -@@ -1318,7 +1307,7 @@ static void - get_gcc_version(FILE *inFile, char *name) - { - fprintf (inFile, "#define HasGcc 1\n"); --#ifdef CROSSCOMPILE -+# ifdef CROSSCOMPILE - if (CrossCompiling) - { - if (gnu_c > 1) { -@@ -1329,20 +1318,20 @@ get_gcc_version(FILE *inFile, char *name - fprintf (inFile, "#define GccMajorVersion %d\n", gnu_c); - fprintf (inFile, "#define GccMinorVersion %d\n", gnu_c_minor); - } else --#endif -+# endif - { --#if __GNUC__ > 1 -+# if __GNUC__ > 1 - fprintf (inFile, "#define HasGcc2 1\n"); --# if __GNUC__ > 2 -+# if __GNUC__ > 2 - fprintf (inFile, "#define HasGcc3 1\n"); -+# endif - # endif --#endif - fprintf (inFile, "#define GccMajorVersion %d\n", __GNUC__); - fprintf (inFile, "#define GccMinorVersion %d\n", __GNUC_MINOR__); - } --#if defined(HAS_MERGE_CONSTANTS) -+# if defined(HAS_MERGE_CONSTANTS) - fprintf (inFile, "#define HasGccMergeConstants %d\n", HAS_MERGE_CONSTANTS); --#endif -+# endif - } - #endif - -@@ -1350,8 +1339,8 @@ static boolean - get_gcc(char *cmd) - { - struct stat sb; -- static char* gcc_path[] = { --# if defined(linux) || \ -+ static const char* gcc_path[] = { -+#if defined(linux) || \ - defined(__NetBSD__) || \ - defined(__OpenBSD__) || \ - defined(__FreeBSD__) || \ -@@ -1362,14 +1351,14 @@ get_gcc(char *cmd) - defined(__GNU__) || \ - defined(__GLIBC__) - "/usr/bin/cc", /* for Linux PostIncDir */ --# endif -+#endif - "/usr/local/bin/gcc", - "/opt/gnu/bin/gcc", - "/usr/pkg/bin/gcc" - }; - - #ifdef CROSSCOMPILE -- static char* cross_cc_name[] = { -+ static const char* cross_cc_name[] = { - "cc", - "gcc" - }; -@@ -1399,7 +1388,7 @@ get_gcc(char *cmd) - return FALSE; - } - --#if defined CROSSCOMPILE || !defined __UNIXOS2__ -+#ifdef CROSSCOMPILE - static void - get_gcc_incdir(FILE *inFile, char* name) - { -@@ -1428,14 +1417,14 @@ get_gcc_incdir(FILE *inFile, char* name) - boolean - define_os_defaults(FILE *inFile) - { --#if defined CROSSCOMPILE || ( !defined(WIN32) && !defined(__UNIXOS2__) ) --#ifdef CROSSCOMPILE --#ifdef __GNUC__ -+#if defined CROSSCOMPILE || !defined(WIN32) -+# ifdef CROSSCOMPILE -+# ifdef __GNUC__ - if (1) --#else -+# else - if ((sys != win32) && (sys != emx)) --#endif --#endif -+# endif -+# endif - { - # if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \ - defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV)) -@@ -1444,16 +1433,16 @@ define_os_defaults(FILE *inFile) - char buf[SYS_NMLN * 5 + 1]; - - /* Obtain the system information. */ --#ifdef CROSSCOMPILE -+# ifdef CROSSCOMPILE - if (!CrossCompiling) --#endif -+# endif - { - if (uname(&uts_name) < 0) -- LogFatal("Cannot invoke uname", ""); -+ LogFatal("Cannot invoke uname"); - else - name = &uts_name; - } --#if defined CROSSCOMPILE && (defined linux || defined(__GLIBC__)) -+# if defined CROSSCOMPILE && (defined linux || defined(__GLIBC__)) - else { - strncpy(uts_name.sysname,cross_uts_sysname,SYS_NMLN); - strncpy(uts_name.release,cross_uts_release,SYS_NMLN); -@@ -1461,14 +1450,14 @@ define_os_defaults(FILE *inFile) - strncpy(uts_name.machine,cross_uts_machine,SYS_NMLN); - name = &uts_name; - } --#endif --# ifdef __FreeBSD__ -+# endif -+# ifdef __FreeBSD__ - /* Override for compiling in chroot of other OS version, such as - * in the bento build cluster. - */ - { - char *e; -- if ((e = getenv("OSREL")) != NULL && -+ if ((e = getenv("OSREL")) != NULL && - strlen(name->sysname) + strlen(e) + 1 < SYS_NMLN) { - strcpy(name->release, e); - strcpy(name->version, name->sysname); -@@ -1476,7 +1465,7 @@ define_os_defaults(FILE *inFile) - strcat(name->version, e); - } - } --# endif -+# endif - - # if defined DEFAULT_OS_NAME - # if defined CROSSCOMPILE -@@ -1648,10 +1637,8 @@ define_os_defaults(FILE *inFile) - char name[PATH_MAX]; - if (get_gcc(name)) { - get_gcc_version (inFile,name); --# if defined CROSSCOMPILE || !defined __UNIXOS2__ --# if defined CROSSCOMPILE -+# if defined CROSSCOMPILE - if (sys != emx) --# endif - get_gcc_incdir(inFile,name); - # endif - } -@@ -1664,7 +1651,7 @@ define_os_defaults(FILE *inFile) - get_binary_format(inFile); - # endif - } --#endif /* !WIN32 && !__UNIXOS2__*/ -+#endif /* !WIN32 */ - #if defined WIN32 - # ifdef CROSSCOMPILE - else if (sys == win32 && !CrossCompiling) -@@ -1688,8 +1675,6 @@ define_os_defaults(FILE *inFile) - #endif /* WIN32 */ - #ifdef CROSSCOMPILE - else if (sys == emx) --#endif --#if defined CROSSCOMPILE || defined __UNIXOS2__ - { - fprintf(inFile, "#define DefaultOSMajorVersion 4\n"); - fprintf(inFile, "#define DefaultOSMinorVersion 0\n"); -@@ -1703,8 +1688,8 @@ define_os_defaults(FILE *inFile) - } - - void --cppit(char *imakefile, char *template, char *masterc, -- FILE *outfd, char *outfname) -+cppit(const char *imakefile, const char *template, const char *masterc, -+ FILE *outfd, const char *outfname) - { - FILE *inFile; - -@@ -1721,8 +1706,11 @@ cppit(char *imakefile, char *template, c - fprintf(inFile, IncludeFmt, ImakeTmplSym) < 0 || - optional_include(inFile, "IMAKE_ADMIN_MACROS", "adminmacros") || - optional_include(inFile, "IMAKE_LOCAL_MACROS", "localmacros") || -- fflush(inFile) || -- fclose(inFile)) -+ fflush(inFile)) { -+ fclose(inFile); -+ LogFatal("Cannot write to %s.", masterc); -+ } -+ else if (fclose(inFile)) - LogFatal("Cannot write to %s.", masterc); - /* - * Fork and exec cpp -@@ -1737,8 +1725,8 @@ makeit(void) - doit(NULL, make_argv[0], make_argv); - } - --char * --CleanCppInput(char *imakefile) -+const char * -+CleanCppInput(const char *imakefile) - { - FILE *outFile = NULL; - FILE *inFile; -@@ -1792,28 +1780,29 @@ CleanCppInput(char *imakefile) - strcmp(ptoken, "pragma") && - strcmp(ptoken, "undef")) { - if (outFile == NULL) { --#ifdef HAS_MKSTEMP -+#ifdef HAVE_MKSTEMP - int fd; - #endif -- tmpImakefile = Strdup(tmpImakefile); --#ifndef HAS_MKSTEMP -- if (mktemp(tmpImakefile) == NULL || -- (outFile = fopen(tmpImakefile, "w+")) == NULL) { -+ char *tmpImakefileName = Strdup(tmpImakefileTemplate); -+#ifndef HAVE_MKSTEMP -+ if (mktemp(tmpImakefileName) == NULL || -+ (outFile = fopen(tmpImakefileName, "w+")) == NULL) { - LogFatal("Cannot open %s for write.", -- tmpImakefile); -+ tmpImakefileName); - } - #else -- fd=mkstemp(tmpImakefile); -+ fd=mkstemp(tmpImakefileName); - if (fd != -1) - outFile = fdopen(fd, "w"); - if (outFile == NULL) { - if (fd != -1) { -- unlink(tmpImakefile); close(fd); -+ unlink(tmpImakefileName); close(fd); - } - LogFatal("Cannot open %s for write.", -- tmpImakefile); -+ tmpImakefileName); - } - #endif -+ tmpImakefile = tmpImakefileName; - } - writetmpfile(outFile, punwritten, pbuf-punwritten, - tmpImakefile); -@@ -1838,7 +1827,7 @@ CleanCppInput(char *imakefile) - } - - void --CleanCppOutput(FILE *tmpfd, char *tmpfname) -+CleanCppOutput(FILE *tmpfd, const char *tmpfname) - { - char *input; - int blankline = 0; -@@ -1960,7 +1949,7 @@ isempty(char *line) - - /*ARGSUSED*/ - char * --ReadLine(FILE *tmpfd, char *tmpfname) -+ReadLine(FILE *tmpfd, const char *tmpfname) - { - static boolean initialized = FALSE; - static char *buf, *pline, *end; -@@ -1988,10 +1977,10 @@ ReadLine(FILE *tmpfd, char *tmpfname) - fseek(tmpfd, 0, 0); - #if defined(SYSV) || defined(WIN32) || defined(USE_FREOPEN) - tmpfd = freopen(tmpfname, "w+", tmpfd); --#ifdef WIN32 -+# ifdef WIN32 - if (! tmpfd) /* if failed try again */ - tmpfd = freopen(tmpfname, "w+", fp); --#endif -+# endif - if (! tmpfd) - LogFatal("cannot reopen %s\n", tmpfname); - #else /* !SYSV */ -@@ -1999,8 +1988,6 @@ ReadLine(FILE *tmpfd, char *tmpfname) - #endif /* !SYSV */ - initialized = TRUE; - fprintf (tmpfd, "# Makefile generated by imake - do not edit!\n"); -- fprintf (tmpfd, "# %s\n", -- "$Xorg: imake.c,v 1.6 2001/02/09 02:03:15 xorgcvs Exp $"); - } - - for (p1 = pline; p1 < end; p1++) { -@@ -2036,7 +2023,7 @@ ReadLine(FILE *tmpfd, char *tmpfname) - } - - void --writetmpfile(FILE *fd, char *buf, int cnt, char *fname) -+writetmpfile(FILE *fd, const char *buf, int cnt, const char *fname) - { - if (fwrite(buf, sizeof(char), cnt, fd) == -1) - LogFatal("Cannot write to %s.", fname); -@@ -2048,7 +2035,7 @@ Emalloc(int size) - char *p; - - if ((p = malloc(size)) == NULL) -- LogFatalI("Cannot allocate %d bytes", size); -+ LogFatal("Cannot allocate %d bytes", size); - return(p); - } - -@@ -2066,10 +2053,10 @@ KludgeOutputLine(char **pline) - break; - case ' ': /*May need a tab*/ - default: --#ifdef CROSSCOMPILE -+# ifdef CROSSCOMPILE - if (inline_syntax) --#endif --#if defined CROSSCOMPILE || defined INLINE_SYNTAX -+# endif -+# if defined CROSSCOMPILE || defined INLINE_SYNTAX - { - if (*p == '<' && p[1] == '<') { /* inline file close */ - InInline--; -@@ -2077,7 +2064,7 @@ KludgeOutputLine(char **pline) - break; - } - } --#endif -+# endif - /* - * The following cases should not be treated as beginning of - * rules: -@@ -2116,26 +2103,26 @@ KludgeOutputLine(char **pline) - quotechar = ']'; - break; - case '=': --#ifdef CROSSCOMPILE -+# ifdef CROSSCOMPILE - if (remove_cpp_leadspace) --#endif --#if defined CROSSCOMPILE || defined REMOVE_CPP_LEADSPACE -+# endif -+# if defined CROSSCOMPILE || defined REMOVE_CPP_LEADSPACE - { - if (!InRule && **pline == ' ') { - while (**pline == ' ') - (*pline)++; - } - } --#endif -+# endif - goto breakfor; --#if defined CROSSCOMPILE || defined INLINE_SYNTAX -+# if defined CROSSCOMPILE || defined INLINE_SYNTAX - case '<': - if (inline_syntax) { - if (p[1] == '<') /* inline file start */ - InInline++; - } - break; --#endif -+# endif - case ':': - if (p[1] == '=') - goto breakfor; -@@ -2159,7 +2146,7 @@ KludgeResetRule(void) - } - #endif - char * --Strdup(char *cp) -+Strdup(const char *cp) - { - char *new = Emalloc(strlen(cp) + 1); - diff --git a/debian/patches/056_nx-X11_Werror-format-security.full.patch b/debian/patches/056_nx-X11_Werror-format-security.full.patch deleted file mode 100644 index a047de774..000000000 --- a/debian/patches/056_nx-X11_Werror-format-security.full.patch +++ /dev/null @@ -1,107 +0,0 @@ -Description: Fix -Werror=format-security errors -Author: Orion Poplawski -Abstract: - The below patch fixes more -Werror=format-security errors. - Interestingly, most of the errors only showed up on our arm builds. No - idea why. ---- a/nx-X11/lib/xtrans/Xtransint.h -+++ b/nx-X11/lib/xtrans/Xtransint.h -@@ -444,7 +444,7 @@ - int hack= 0, saveerrno=errno; \ - struct timeval tp;\ - gettimeofday(&tp,0); \ -- ErrorF(__xtransname); \ -+ ErrorF("%s",__xtransname); \ - ErrorF(x+hack,a,b,c); \ - ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ - errno=saveerrno; \ -@@ -454,7 +454,7 @@ - int hack= 0, saveerrno=errno; \ - struct timeval tp;\ - gettimeofday(&tp,0); \ -- fprintf(stderr, __xtransname); fflush(stderr); \ -+ fprintf(stderr, "%s",__xtransname); fflush(stderr); \ - fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ - fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ - fflush(stderr); \ -@@ -466,14 +466,14 @@ - /* Use ErrorF() for the X server */ - #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ - int hack= 0, saveerrno=errno; \ -- ErrorF(__xtransname); \ -+ ErrorF("%s",__xtransname); \ - ErrorF(x+hack,a,b,c); \ - errno=saveerrno; \ - } else ((void)0) - #else - #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ - int hack= 0, saveerrno=errno; \ -- fprintf(stderr, __xtransname); fflush(stderr); \ -+ fprintf(stderr, "%s",__xtransname); fflush(stderr); \ - fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ - errno=saveerrno; \ - } else ((void)0) ---- a/nx-X11/programs/nxauth/process.c -+++ b/nx-X11/programs/nxauth/process.c -@@ -974,7 +974,7 @@ - char *hex; - - hex = bintohex(len, cp); -- fprintf(fp, hex); -+ fprintf(fp, "%s", hex); - free(hex); - } - ---- a/nx-X11/programs/Xserver/GL/glx/glximports.c -+++ b/nx-X11/programs/Xserver/GL/glx/glximports.c -@@ -110,12 +110,12 @@ - - void __glXImpWarning(__GLcontext *gc, char *msg) - { -- ErrorF((char *)msg); -+ ErrorF("%s",(char *)msg); - } - - void __glXImpFatal(__GLcontext *gc, char *msg) - { -- ErrorF((char *)msg); -+ ErrorF("%s",(char *)msg); - __glXAbort(); - } - ---- a/nx-X11/programs/Xserver/hw/nxagent/Error.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c -@@ -232,7 +232,7 @@ - - int nxagentExitHandler(const char *message) - { -- FatalError(message); -+ FatalError("%s", message); - - return 0; - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Init.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c -@@ -481,7 +481,7 @@ - - nxagentStartRedirectToClientsLog(); - -- fprintf(stderr, buffer); -+ fprintf(stderr, "%s", buffer); - - nxagentEndRedirectToClientsLog(); - } ---- a/nx-X11/programs/Xserver/os/log.c -+++ b/nx-X11/programs/Xserver/os/log.c -@@ -692,9 +692,9 @@ - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); -- LogWrite(-1, err); -+ LogWrite(-1, "%s", err); - } else -- LogWrite(-1, strerror(saveErrno)); -+ LogWrite(-1, "%s", strerror(saveErrno)); - } - - void diff --git a/debian/patches/057_nx-X11_sanitize-eventmasks.full.patch b/debian/patches/057_nx-X11_sanitize-eventmasks.full.patch deleted file mode 100644 index 9c1171712..000000000 --- a/debian/patches/057_nx-X11_sanitize-eventmasks.full.patch +++ /dev/null @@ -1,70 +0,0 @@ -Description: Create Windows and fix drawing issues on Big Endian 64bit systems -Author: Mihai Moldovan -Abstract: - Multiple endiannes issues were setting incorrect event masks when creating and - drawing X11 windows. - . - This time, a smaller integer has been casted to a bigger one and passed to some - function actually setting its value. - . - This meant, that garbage from stack was attached to the smaller integer value, - putting unknown memory into the lower bytes of the bigger integer. - . - Fix this by creating a big, initialized temporary variable, let the function do - its magic on that one and pass the value back to the smaller variable--and - cross your fingers the smaller variable can hold it without overrunning. (The - last bit is a design issue we can't really fix and has been around even before - this patch.) - ---- a/nx-X11/programs/Xserver/hw/nxagent/Window.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c -@@ -327,7 +327,10 @@ - - if (mask & CWEventMask) - { -- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetEventMask(pWin, &tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - } - #ifdef WARNING - else -@@ -2891,7 +2894,10 @@ - - if (mask & CWEventMask) - { -- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetEventMask(pWin, &tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - } - #ifdef WARNING - else -@@ -3352,7 +3358,10 @@ - - if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) - { -- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetEventMask(pWin, &tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - - XChangeWindowAttributes(nxagentDisplay, nxagentWindow(pWin), mask, &attributes); - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c -@@ -1665,7 +1665,10 @@ - - attributes.background_pixel = nxagentBlackPixel; - -- nxagentGetDefaultEventMask((Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetDefaultEventMask(&tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - - attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); - diff --git a/debian/patches/0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch b/debian/patches/0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch new file mode 100644 index 000000000..7c21c6fe5 --- /dev/null +++ b/debian/patches/0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch @@ -0,0 +1,1183 @@ +Description: Unique Library Names Patch + Patch from the RPM folks... + . + We really want to make use of rpm's automatic dependency finding. + Binaries are scanned for DT_NEEDED entries, the latter of which are + then used for populating the "Requires"-type deps. The "nxagent" + binary for example would require libX11.so.6. That incurs problems: + . + 1. A package manager told to install nxagent could select xorg-x11 + rather than nx-libs, even though nxagent depends on the NX version. + . + 2. A package manager told to install $some_program could select nx-libs + rather than xorg-x11 (since both provide libX11.so.6), but, since + the NX library is in an obscure directory, running $some_program + would fail as libX11.so.6 is not found. + . + To solve this, give the NX libraries unique names different from the + Xorg ones. +Forward: pending +Author: Jan Engelhardt +Last-Update: 2012-02-15 +--- + nx-X11/config/cf/Imake.rules | 12 - + nx-X11/config/cf/X11.tmpl | 240 ++++++++++---------- + nx-X11/config/cf/lnxLib.rules | 16 - + nx-X11/config/cf/lnxLib.tmpl | 4 + nx-X11/lib/X11/Imakefile | 2 + nx-X11/lib/XRes/Imakefile | 2 + nx-X11/lib/Xau/Imakefile | 2 + nx-X11/lib/Xcomposite/Imakefile | 2 + nx-X11/lib/Xcomposite/xcomposite.pc.in | 2 + nx-X11/lib/Xcursor/Imakefile | 2 + nx-X11/lib/Xcursor/xcursor.pc.in | 2 + nx-X11/lib/Xdamage/Imakefile | 2 + nx-X11/lib/Xdamage/xdamage.pc.in | 2 + nx-X11/lib/Xdmcp/Imakefile | 2 + nx-X11/lib/Xext/Imakefile | 2 + nx-X11/lib/Xfixes/Imakefile | 2 + nx-X11/lib/Xfixes/xfixes.pc.in | 2 + nx-X11/lib/Xinerama/Imakefile | 2 + nx-X11/lib/Xpm/Imakefile | 2 + nx-X11/lib/Xrandr/Imakefile | 2 + nx-X11/lib/Xrender/Imakefile | 2 + nx-X11/lib/Xrender/xrender.pc.in | 2 + nx-X11/lib/Xtst/Imakefile | 2 + nx-X11/lib/font/Imakefile | 2 + nx-X11/lib/oldX/Imakefile | 2 + nx-X11/lib/xkbfile/Imakefile | 2 + nx-X11/lib/xkbui/Imakefile | 2 + nx-X11/programs/Xserver/Imakefile | 18 - + nxcompext/Makefile.in | 4 + nxcompshad/Makefile.in | 4 + 103 files changed, 294 insertions(+), 294 deletions(-) + +--- a/nx-X11/config/cf/Imake.rules ++++ b/nx-X11/config/cf/Imake.rules +@@ -2124,9 +2124,9 @@ + */ + #ifndef ProjectUnsharedFontLibReferences + #define ProjectUnsharedFontLibReferences() @@\ +-DEPFONTLIB = _UseCat($(USRLIBDIR)/,XBuildLibDir/,LibraryTargetName(Xfont)) @@\ +-FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lXfont @@\ +-LintLibReferences(XFONT,Xfont,$(FONTLIBSRC)) ++DEPFONTLIB = _UseCat($(USRLIBDIR)/,XBuildLibDir/,LibraryTargetName(NX_Xfont)) @@\ ++FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lNX_Xfont @@\ ++LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) + #endif + + /* +@@ -2142,9 +2142,9 @@ + #ifndef SharedFontLibReferences + #define SharedFontLibReferences() @@\ + SOFONTREV = SharedFontRev @@\ +-DEPFONTLIB = SharedLibDependencies(Xfont,$(FONTLIBSRC),SOFONTREV) @@\ +-FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lXfont @@\ +-LintLibReferences(XFONT,Xfont,$(FONTLIBSRC)) ++DEPFONTLIB = SharedLibDependencies(NX_Xfont,$(FONTLIBSRC),SOFONTREV) @@\ ++FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lNX_Xfont @@\ ++LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) + #endif + + /* +--- a/nx-X11/config/cf/X11.tmpl ++++ b/nx-X11/config/cf/X11.tmpl +@@ -1835,9 +1835,9 @@ + #ifndef SharedX11Rev + #define SharedX11Rev 6.2 + #endif +-SharedLibReferences(XONLY,X11,$(XLIBSRC),SOXLIBREV,SharedX11Rev) ++SharedLibReferences(XONLY,NX_X11,$(XLIBSRC),SOXLIBREV,SharedX11Rev) + #else +-ProjectUnsharedLibReferences(XONLY,X11,$(XLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XONLY,NX_X11,$(XLIBSRC),XBuildLibDir) + #endif + /* Common alternate spellings */ + DEPXLIBONLY = $(DEPXONLYLIB) +@@ -2466,9 +2466,9 @@ + #ifndef SharedXextRev + #define SharedXextRev 6.4 + #endif +-SharedLibReferences(EXTENSION,Xext,$(XEXTLIBSRC),SOXEXTREV,SharedXextRev) ++SharedLibReferences(EXTENSION,NX_Xext,$(XEXTLIBSRC),SOXEXTREV,SharedXextRev) + #else +-ProjectUnsharedLibReferences(EXTENSION,Xext,$(XEXTLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(EXTENSION,NX_Xext,$(XEXTLIBSRC),XBuildLibDir) + #endif + LINTEXTENSIONLIB = $(LINTEXTENSION) + DEPXLIB = $(DEPEXTENSIONLIB) $(DEPXONLYLIB) +@@ -2480,9 +2480,9 @@ + #ifndef SharedXssRev + #define SharedXssRev 1.0 + #endif +-SharedLibReferences(XSS,Xss,$(XSSLIBSRC),SOXSSREV,SharedXssRev) ++SharedLibReferences(XSS,NX_Xss,$(XSSLIBSRC),SOXSSREV,SharedXssRev) + #else +-ProjectUnsharedLibReferences(XSS,Xss,$(XSSLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XSS,NX_Xss,$(XSSLIBSRC),XBuildLibDir) + #endif + + XXF86MISCLIBSRC = $(LIBSRC)/Xxf86misc +@@ -2490,9 +2490,9 @@ + #ifndef SharedXxf86miscRev + #define SharedXxf86miscRev 1.1 + #endif +-SharedLibReferences(XXF86MISC,Xxf86misc,$(XXF86MISCLIBSRC),SOXXF86MISCREV,SharedXxf86miscRev) ++SharedLibReferences(XXF86MISC,NX_Xxf86misc,$(XXF86MISCLIBSRC),SOXXF86MISCREV,SharedXxf86miscRev) + #else +-ProjectUnsharedLibReferences(XXF86MISC,Xxf86misc,$(XXF86MISCLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XXF86MISC,NX_Xxf86misc,$(XXF86MISCLIBSRC),XBuildLibDir) + #endif + + XXF86VMLIBSRC = $(LIBSRC)/Xxf86vm +@@ -2500,9 +2500,9 @@ + #ifndef SharedXxf86vmRev + #define SharedXxf86vmRev 1.0 + #endif +-SharedLibReferences(XXF86VM,Xxf86vm,$(XXF86VMLIBSRC),SOXXF86VMREV,SharedXxf86vmRev) ++SharedLibReferences(XXF86VM,NX_Xxf86vm,$(XXF86VMLIBSRC),SOXXF86VMREV,SharedXxf86vmRev) + #else +-ProjectUnsharedLibReferences(XXF86VM,Xxf86vm,$(XXF86VMLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XXF86VM,NX_Xxf86vm,$(XXF86VMLIBSRC),XBuildLibDir) + #endif + + XXF86DGALIBSRC = $(LIBSRC)/Xxf86dga +@@ -2510,9 +2510,9 @@ + #ifndef SharedXxf86dgaRev + #define SharedXxf86dgaRev 1.0 + #endif +-SharedLibReferences(XXF86DGA,Xxf86dga,$(XXF86DGALIBSRC),SOXXF86DGAREV,SharedXxf86dgaRev) ++SharedLibReferences(XXF86DGA,NX_Xxf86dga,$(XXF86DGALIBSRC),SOXXF86DGAREV,SharedXxf86dgaRev) + #else +-ProjectUnsharedLibReferences(XXF86DGA,Xxf86dga,$(XXF86DGALIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XXF86DGA,NX_Xxf86dga,$(XXF86DGALIBSRC),XBuildLibDir) + #endif + + #if BuildDmxLibrary +@@ -2544,9 +2544,9 @@ + #ifndef SharedXxf86rushRev + #define SharedXxf86rushRev 1.0 + #endif +-SharedLibReferences(XXF86RUSH,Xxf86rush,$(XXF86RUSHLIBSRC),SOXXF86RUSHREV,SharedXxf86rushRev) ++SharedLibReferences(XXF86RUSH,NX_Xxf86rush,$(XXF86RUSHLIBSRC),SOXXF86RUSHREV,SharedXxf86rushRev) + #else +-ProjectUnsharedLibReferences(XXF86RUSH,Xxf86rush,$(XXF86RUSHLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XXF86RUSH,NX_Xxf86rush,$(XXF86RUSHLIBSRC),XBuildLibDir) + #endif + + +@@ -2555,9 +2555,9 @@ + #ifndef SharedXvRev + #define SharedXvRev 1.0 + #endif +-SharedLibReferences(XV,Xv,$(XVLIBSRC),SOXVREV,SharedXvRev) ++SharedLibReferences(XV,NX_Xv,$(XVLIBSRC),SOXVREV,SharedXvRev) + #else +-ProjectUnsharedLibReferences(XV,Xv,$(XVLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XV,NX_Xv,$(XVLIBSRC),XBuildLibDir) + #endif + + +@@ -2566,9 +2566,9 @@ + #ifndef SharedXvMCRev + #define SharedXvMCRev 1.0 + #endif +-SharedLibReferences(XVMC,XvMC,$(XVMCLIBSRC),SOXVMCREV,SharedXvMCRev) ++SharedLibReferences(XVMC,NX_XvMC,$(XVMCLIBSRC),SOXVMCREV,SharedXvMCRev) + #else +-ProjectUnsharedLibReferences(XVMC,XvMC,$(XVMCLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XVMC,NX_XvMC,$(XVMCLIBSRC),XBuildLibDir) + #endif + + XINERAMALIBSRC = $(LIBSRC)/Xinerama +@@ -2576,9 +2576,9 @@ + #ifndef SharedXineramaRev + #define SharedXineramaRev 1.0 + #endif +-SharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),SOXINERAMAREV,SharedXineramaRev) ++SharedLibReferences(XINERAMA,NX_Xinerama,$(XINERAMALIBSRC),SOXINERAMAREV,SharedXineramaRev) + #else +-ProjectUnsharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XINERAMA,NX_Xinerama,$(XINERAMALIBSRC),XBuildLibDir) + #endif + + XRESLIBSRC = $(LIBSRC)/XRes +@@ -2586,9 +2586,9 @@ + #ifndef SharedXResRev + #define SharedXResRev 1.0 + #endif +-SharedLibReferences(XRES,XRes,$(XRESLIBSRC),SOXRESREV,SharedXResRev) ++SharedLibReferences(XRES,NX_XRes,$(XRESLIBSRC),SOXRESREV,SharedXResRev) + #else +-ProjectUnsharedLibReferences(XRES,XRes,$(XRESLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XRES,NX_XRes,$(XRESLIBSRC),XBuildLibDir) + #endif + + DMXLIBSRC = $(LIBSRC)/dmx +@@ -2596,9 +2596,9 @@ + #ifndef SharedDmxRev + #define SharedDmxRev 1.0 + #endif +-SharedLibReferences(DMX,dmx,$(DMXLIBSRC),SODMXREV,SharedDmxRev) ++SharedLibReferences(DMX,NX_dmx,$(DMXLIBSRC),SODMXREV,SharedDmxRev) + #else +-ProjectUnsharedLibReferences(DMX,dmx,$(DMXLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(DMX,NX_dmx,$(DMXLIBSRC),XBuildLibDir) + #endif + + DPSLIBSRC = $(LIBSRC)/dps +@@ -2606,9 +2606,9 @@ + #ifndef SharedDpsRev + #define SharedDpsRev 1.0 + #endif +-SharedLibReferences(DPS,dps,$(DPSLIBSRC),SODPSREV,SharedDpsRev) ++SharedLibReferences(DPS,NX_dps,$(DPSLIBSRC),SODPSREV,SharedDpsRev) + #else +-ProjectUnsharedLibReferences(DPS,dps,$(DPSLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(DPS,NX_dps,$(DPSLIBSRC),XBuildLibDir) + #endif + + DPSTKLIBSRC = $(LIBSRC)/dpstk +@@ -2616,9 +2616,9 @@ + #ifndef SharedDpsTkRev + #define SharedDpsTkRev 1.0 + #endif +-SharedLibReferences(DPSTK,dpstk,$(DPSTKLIBSRC),SODPSTKREV,SharedDpsTkRev) ++SharedLibReferences(DPSTK,NX_dpstk,$(DPSTKLIBSRC),SODPSTKREV,SharedDpsTkRev) + #else +-ProjectUnsharedLibReferences(DPSTK,dpstk,$(DPSTKLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(DPSTK,NX_dpstk,$(DPSTKLIBSRC),XBuildLibDir) + #endif + + PSRESLIBSRC = $(LIBSRC)/psres +@@ -2626,9 +2626,9 @@ + #ifndef SharedPSResRev + #define SharedPSResRev 1.0 + #endif +-SharedLibReferences(PSRES,psres,$(PSRESLIBSRC),SOPSRESREV,SharedPSResRev) ++SharedLibReferences(PSRES,NX_psres,$(PSRESLIBSRC),SOPSRESREV,SharedPSResRev) + #else +-ProjectUnsharedLibReferences(PSRES,psres,$(PSRESLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(PSRES,NX_psres,$(PSRESLIBSRC),XBuildLibDir) + #endif + + GLULIBSRC = $(LIBSRC)/GLU +@@ -2636,9 +2636,9 @@ + #ifndef SharedGluRev + #define SharedGluRev 1.3 + #endif +-SharedLibReferences(GLU,GLU,$(GLULIBSRC),SOGLUREV,SharedGluRev) ++SharedLibReferences(GLU,NX_GLU,$(GLULIBSRC),SOGLUREV,SharedGluRev) + #else +-ProjectUnsharedLibReferences(GLU,GLU,$(GLULIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(GLU,NX_GLU,$(GLULIBSRC),XBuildLibDir) + #endif + + GLXLIBSRC = $(LIBSRC)/GL +@@ -2646,18 +2646,18 @@ + #ifndef SharedGlxRev + #define SharedGlxRev 1.2 + #endif +-SharedLibReferences(GLX,GL,$(GLXLIBSRC),SOGLREV,SharedGlxRev) ++SharedLibReferences(GLX,NX_GL,$(GLXLIBSRC),SOGLREV,SharedGlxRev) + #else +-ProjectUnsharedLibReferences(GLX,GL,$(GLXLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(GLX,NX_GL,$(GLXLIBSRC),XBuildLibDir) + #endif + GLWIDGETSRC = $(LIBSRC)/GLw + #if SharedLibGLw + #ifndef SharedGLwRev + #define SharedGLwRev 1.0 /* used to name the shared library */ + #endif +-SharedDSLibReferences(GLW,GLw,$(GLWIDGETSRC),SOGLWREV,SharedGLwRev) ++SharedDSLibReferences(GLW,NX_GLw,$(GLWIDGETSRC),SOGLWREV,SharedGLwRev) + #else +-ProjectUnsharedLibReferences(GLW,GLw,$(GLWIDGETSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(GLW,NX_GLw,$(GLWIDGETSRC),XBuildLibDir) + #endif + + XRENDERLIBSRC = $(LIBSRC)/Xrender +@@ -2665,9 +2665,9 @@ + #ifndef SharedXrenderRev + #define SharedXrenderRev 1.2.2 + #endif +-SharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),SOXRENDERREV,SharedXrenderRev) ++SharedLibReferences(XRENDER,NX_Xrender,$(XRENDERLIBSRC),SOXRENDERREV,SharedXrenderRev) + #else +-ProjectUnsharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XRENDER,NX_Xrender,$(XRENDERLIBSRC),XBuildLibDir) + #endif + + XRANDRLIBSRC = $(LIBSRC)/Xrandr +@@ -2675,9 +2675,9 @@ + #ifndef SharedXrandrRev + #define SharedXrandrRev 2.0 + #endif +-SharedLibReferences(XRANDR,Xrandr,$(XRANDRLIBSRC),SOXRANDRREV,SharedXrandrRev) ++SharedLibReferences(XRANDR,NX_Xrandr,$(XRANDRLIBSRC),SOXRANDRREV,SharedXrandrRev) + #else +-ProjectUnsharedLibReferences(XRANDR,Xrandr,$(XRANDRLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XRANDR,NX_Xrandr,$(XRANDRLIBSRC),XBuildLibDir) + #endif + + XFIXESLIBSRC = $(LIBSRC)/Xfixes +@@ -2685,9 +2685,9 @@ + #ifndef SharedXfixesRev + #define SharedXfixesRev 3.0 + #endif +-SharedLibReferences(XFIXES,Xfixes,$(XFIXESLIBSRC),SOXFIXESREV,SharedXfixesRev) ++SharedLibReferences(XFIXES,NX_Xfixes,$(XFIXESLIBSRC),SOXFIXESREV,SharedXfixesRev) + #else +-ProjectUnsharedLibReferences(XFIXES,Xfixes,$(XFIXESLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XFIXES,NX_Xfixes,$(XFIXESLIBSRC),XBuildLibDir) + #endif + + XDAMAGELIBSRC = $(LIBSRC)/Xdamage +@@ -2695,9 +2695,9 @@ + #ifndef SharedXdamageRev + #define SharedXdamageRev 1.0 + #endif +-SharedLibReferences(XDAMAGE,Xdamage,$(XDAMAGELIBSRC),SOXDAMAGEREV,SharedXdamageRev) ++SharedLibReferences(XDAMAGE,NX_Xdamage,$(XDAMAGELIBSRC),SOXDAMAGEREV,SharedXdamageRev) + #else +-ProjectUnsharedLibReferences(XDAMAGE,Xdamage,$(XDAMAGELIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XDAMAGE,NX_Xdamage,$(XDAMAGELIBSRC),XBuildLibDir) + #endif + + XCOMPOSITELIBSRC = $(LIBSRC)/Xcomposite +@@ -2705,9 +2705,9 @@ + #ifndef SharedXcompositeRev + #define SharedXcompositeRev 1.0 + #endif +-SharedLibReferences(XCOMPOSITE,Xcomposite,$(XCOMPOSITELIBSRC),SOXCOMPOSITEREV,SharedXcompositeRev) ++SharedLibReferences(XCOMPOSITE,NX_Xcomposite,$(XCOMPOSITELIBSRC),SOXCOMPOSITEREV,SharedXcompositeRev) + #else +-ProjectUnsharedLibReferences(XCOMPOSITE,Xcomposite,$(XCOMPOSITELIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XCOMPOSITE,NX_Xcomposite,$(XCOMPOSITELIBSRC),XBuildLibDir) + #endif + + XEVIELIBSRC = $(LIBSRC)/Xevie +@@ -2715,9 +2715,9 @@ + #ifndef SharedXevieRev + #define SharedXevieRev 1.0 + #endif +-SharedLibReferences(XEVIE,Xevie,$(XEVIELIBSRC),SOXEVIEREV,SharedXevieRev) ++SharedLibReferences(XEVIE,NX_Xevie,$(XEVIELIBSRC),SOXEVIEREV,SharedXevieRev) + #else +-ProjectUnsharedLibReferences(XEVIE,Xevie,$(XEVIELIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XEVIE,NX_Xevie,$(XEVIELIBSRC),XBuildLibDir) + #endif + + XCURSORLIBSRC = $(LIBSRC)/Xcursor +@@ -2725,9 +2725,9 @@ + #ifndef SharedXcursorRev + #define SharedXcursorRev 1.0.2 + #endif +-SharedLibReferences(XCURSOR,Xcursor,$(XCURSORLIBSRC),SOXCURSORREV,SharedXcursorRev) ++SharedLibReferences(XCURSOR,NX_Xcursor,$(XCURSORLIBSRC),SOXCURSORREV,SharedXcursorRev) + #else +-ProjectUnsharedLibReferences(XCURSOR,Xcursor,$(XCURSORLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XCURSOR,NX_Xcursor,$(XCURSORLIBSRC),XBuildLibDir) + #endif + + APPLEWMLIBSRC = $(LIBSRC)/apple +@@ -2735,9 +2735,9 @@ + #ifndef SharedAppleWMRev + #define SharedAppleWMRev 1.0 + #endif +-SharedLibReferences(APPLEWM,AppleWM,$(APPLEWMLIBSRC),SOAPPLEWMREV,SharedAppleWMRev) ++SharedLibReferences(APPLEWM,NX_AppleWM,$(APPLEWMLIBSRC),SOAPPLEWMREV,SharedAppleWMRev) + #else +-ProjectUnsharedLibReferences(APPLEWM,AppleWM,$(APPLEWMLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(APPLEWM,NX_AppleWM,$(APPLEWMLIBSRC),XBuildLibDir) + #endif + + WINDOWSWMLIBSRC = $(LIBSRC)/windows +@@ -2745,9 +2745,9 @@ + #ifndef SharedWindowsWMRev + #define SharedWindowsWMRev 1.0 + #endif +-SharedLibReferences(WINDOWSWM,WindowsWM,$(WINDOWSWMLIBSRC),SOWINDOWSWMREV,SharedWindowsWMRev) ++SharedLibReferences(WINDOWSWM,NX_WindowsWM,$(WINDOWSWMLIBSRC),SOWINDOWSWMREV,SharedWindowsWMRev) + #else +-ProjectUnsharedLibReferences(WINDOWSWM,WindowsWM,$(WINDOWSWMLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(WINDOWSWM,NX_WindowsWM,$(WINDOWSWMLIBSRC),XBuildLibDir) + #endif + + # ifndef SharedLibXfontcache +@@ -2768,9 +2768,9 @@ + #ifndef SharedXfontcacheRev + #define SharedXfontcacheRev 1.2 + #endif +-SharedLibReferences(XFONTCACHE,Xfontcache,$(XFONTCACHELIBSRC),SOXFONTCACHEREV,SharedXfontcacheRev) ++SharedLibReferences(XFONTCACHE,NX_Xfontcache,$(XFONTCACHELIBSRC),SOXFONTCACHEREV,SharedXfontcacheRev) + #else +-ProjectUnsharedLibReferences(XFONTCACHE,Xfontcache,$(XFONTCACHELIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XFONTCACHE,NX_Xfontcache,$(XFONTCACHELIBSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXau +@@ -2790,12 +2790,12 @@ + #ifndef SharedXauRev + #define SharedXauRev 6.0 + #endif +-SharedLibReferences(XAUTH,Xau,$(XAUTHSRC),SOXAUTHREV,SharedXauRev) ++SharedLibReferences(XAUTH,NX_Xau,$(XAUTHSRC),SOXAUTHREV,SharedXauRev) + #else + #if !UseInstalledXauLib +-ProjectUnsharedLibReferences(XAUTH,Xau,$(XAUTHSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XAUTH,NX_Xau,$(XAUTHSRC),XBuildLibDir) + #else +-ProjectUnsharedLibReferences(XAUTH,Xau,$(XAUTHSRC),$(USRLIBDIR)) ++ProjectUnsharedLibReferences(XAUTH,NX_Xau,$(XAUTHSRC),$(USRLIBDIR)) + #endif + #endif + +@@ -2816,12 +2816,12 @@ + #ifndef SharedXdmcpRev + #define SharedXdmcpRev 6.0 + #endif +-SharedLibReferences(XDMCP,Xdmcp,$(XDMCPLIBSRC),SOXDMCPREV,SharedXdmcpRev) ++SharedLibReferences(XDMCP,NX_Xdmcp,$(XDMCPLIBSRC),SOXDMCPREV,SharedXdmcpRev) + #else + #if !UseInstalledXdmcpLib +-ProjectUnsharedLibReferences(XDMCP,Xdmcp,$(XDMCPLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XDMCP,NX_Xdmcp,$(XDMCPLIBSRC),XBuildLibDir) + #else +-ProjectUnsharedLibReferences(XDMCP,Xdmcp,$(XDMCPLIBSRC),$(USRLIBDIR)) ++ProjectUnsharedLibReferences(XDMCP,NX_Xdmcp,$(XDMCPLIBSRC),$(USRLIBDIR)) + #endif + #endif + +@@ -2842,9 +2842,9 @@ + #ifndef SharedXmuRev + #define SharedXmuRev 6.2 + #endif +-SharedDSLibReferences(XMU,Xmu,$(XMUSRC),SOXMUREV,SharedXmuRev) ++SharedDSLibReferences(XMU,NX_Xmu,$(XMUSRC),SOXMUREV,SharedXmuRev) + #else +-ProjectUnsharedLibReferences(XMU,Xmu,$(XMUSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XMU,NX_Xmu,$(XMUSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXmuu +@@ -2864,9 +2864,9 @@ + #ifndef SharedXmuuRev + #define SharedXmuuRev 1.0 + #endif +-SharedLibReferences(XMUU,Xmuu,$(XMUUSRC),SOXMUUREV,SharedXmuuRev) ++SharedLibReferences(XMUU,NX_Xmuu,$(XMUUSRC),SOXMUUREV,SharedXmuuRev) + #else +-ProjectUnsharedLibReferences(XMUU,Xmuu,$(XMUUSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XMUU,NX_Xmuu,$(XMUUSRC),XBuildLibDir) + #endif + + #ifndef SharedOldX +@@ -2886,9 +2886,9 @@ + #ifndef SharedOldXRev + #define SharedOldXRev 6.0 + #endif +-SharedLibReferences(OLDX,oldX,$(OLDXLIBSRC),SOOLDXREV,SharedOldXRev) ++SharedLibReferences(OLDX,NX_oldX,$(OLDXLIBSRC),SOOLDXREV,SharedOldXRev) + #else +-ProjectUnsharedLibReferences(OLDX,oldX,$(OLDXLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(OLDX,NX_oldX,$(OLDXLIBSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXp +@@ -2908,9 +2908,9 @@ + #ifndef SharedXpRev + #define SharedXpRev 6.2 + #endif +-SharedLibReferences(XP,Xp,$(XPLIBSRC),SOXPREV,SharedXpRev) ++SharedLibReferences(XP,NX_Xp,$(XPLIBSRC),SOXPREV,SharedXpRev) + #else +-ProjectUnsharedLibReferences(XP,Xp,$(XPLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XP,NX_Xp,$(XPLIBSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXt +@@ -2930,9 +2930,9 @@ + #ifndef SharedXtRev + #define SharedXtRev 6.0 + #endif +-SharedDSLibReferences(XTOOLONLY,Xt,$(TOOLKITSRC),SOXTREV,SharedXtRev) ++SharedDSLibReferences(XTOOLONLY,NX_Xt,$(TOOLKITSRC),SOXTREV,SharedXtRev) + #else +-ProjectUnsharedLibReferences(XTOOLONLY,Xt,$(TOOLKITSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XTOOLONLY,NX_Xt,$(TOOLKITSRC),XBuildLibDir) + #endif + DEPXTOOLLIB = $(DEPXTOOLONLYLIB) $(DEPSMLIB) $(DEPICELIB) + XTOOLLIB = $(XTOOLONLYLIB) $(SMLIB) $(ICELIB) +@@ -2956,9 +2956,9 @@ + #ifndef SharedXaRev + #define SharedXaRev 1.0 + #endif +-SharedLibReferences(XA,Xa,$(XALIBSRC),SOXAREV,SharedXaRev) ++SharedLibReferences(XA,NX_Xa,$(XALIBSRC),SOXAREV,SharedXaRev) + #else +-UnsharedLibReferences(XA,Xa,$(XALIBSRC)) ++UnsharedLibReferences(XA,NX_Xa,$(XALIBSRC)) + #endif + + #ifndef BuildXaw +@@ -2985,9 +2985,9 @@ + #ifndef SharedXawRev + #define SharedXawRev 8.0 + #endif +-SharedDSLibReferences(XAW,Xaw,$(AWIDGETSRC),SOXAWREV,SharedXawRev) ++SharedDSLibReferences(XAW,NX_Xaw,$(AWIDGETSRC),SOXAWREV,SharedXawRev) + #else +-ProjectUnsharedLibReferences(XAW,Xaw,$(AWIDGETSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XAW,NX_Xaw,$(AWIDGETSRC),XBuildLibDir) + #endif + #endif + +@@ -3013,14 +3013,14 @@ + #ifndef SharedXaw7Rev + #define SharedXaw7Rev 7.0 + #endif +-SharedDSLibReferences(XAW7,Xaw,$(AWIDGET7SRC),SOXAW7REV,SharedXaw7Rev) ++SharedDSLibReferences(XAW7,NX_Xaw,$(AWIDGET7SRC),SOXAW7REV,SharedXaw7Rev) + #if !BuildXaw +-SharedDSLibReferences(XAW,Xaw,$(AWIDGET7SRC),SOXAWREV,SharedXawRev) ++SharedDSLibReferences(XAW,NX_Xaw,$(AWIDGET7SRC),SOXAWREV,SharedXawRev) + #endif + #else +-ProjectUnsharedLibReferences(XAW7,Xaw,$(AWIDGET7SRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XAW7,NX_Xaw,$(AWIDGET7SRC),XBuildLibDir) + #if !BuildXaw +-ProjectUnsharedLibReferences(XAW,Xaw,$(AWIDGET7SRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XAW,NX_Xaw,$(AWIDGET7SRC),XBuildLibDir) + #endif + #endif + #endif +@@ -3048,14 +3048,14 @@ + #ifndef SharedXaw6Rev + #define SharedXaw6Rev 6.1 + #endif +-SharedDSLibReferences(XAW6,Xaw,$(AWIDGET6SRC),SOXAW6REV,SharedXaw6Rev) ++SharedDSLibReferences(XAW6,NX_Xaw,$(AWIDGET6SRC),SOXAW6REV,SharedXaw6Rev) + #if !BuildXaw && !BuildXaw7 +-SharedDSLibReferences(XAW,Xaw,$(AWIDGET6SRC),SOXAWREV,SharedXawRev) ++SharedDSLibReferences(XAW,NX_Xaw,$(AWIDGET6SRC),SOXAWREV,SharedXawRev) + #endif + #else +-ProjectUnsharedLibReferences(XAW6,Xaw,$(AWIDGET6SRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XAW6,NX_Xaw,$(AWIDGET6SRC),XBuildLibDir) + #if !BuildXaw && !BuildXaw7 +-ProjectUnsharedLibReferences(XAW,Xaw,$(AWIDGET6SRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XAW,NX_Xaw,$(AWIDGET6SRC),XBuildLibDir) + #endif + #endif + #endif +@@ -3077,9 +3077,9 @@ + #ifndef SharedXiRev + #define SharedXiRev 6.0 + #endif +-SharedLibReferences(XI,Xi,$(XILIBSRC),SOXINPUTREV,SharedXiRev) ++SharedLibReferences(XI,NX_Xi,$(XILIBSRC),SOXINPUTREV,SharedXiRev) + #else +-ProjectUnsharedLibReferences(XI,Xi,$(XILIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XI,NX_Xi,$(XILIBSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXtst +@@ -3099,12 +3099,12 @@ + #ifndef SharedXtstRev + #define SharedXtstRev 6.1 + #endif +-SharedLibReferences(XTEST,Xtst,$(XTESTLIBSRC),SOXTESTREV,SharedXtstRev) ++SharedLibReferences(XTEST,NX_Xtst,$(XTESTLIBSRC),SOXTESTREV,SharedXtstRev) + #else +-ProjectUnsharedLibReferences(XTEST,Xtst,$(XTESTLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XTEST,NX_Xtst,$(XTESTLIBSRC),XBuildLibDir) + #endif + +-ProjectUnsharedLibReferences(XBSD,Xbsd,$(LIBSRC)/Xbsd,XBuildLibDir) ++ProjectUnsharedLibReferences(XBSD,NX_Xbsd,$(LIBSRC)/Xbsd,XBuildLibDir) + + #ifndef SharedLibICE + #define SharedLibICE HasSharedLibraries +@@ -3123,9 +3123,9 @@ + #ifndef SharedICERev + #define SharedICERev 6.4 + #endif +-SharedLibReferences(ICE,ICE,$(ICESRC),SOICEREV,SharedICERev) ++SharedLibReferences(ICE,NX_ICE,$(ICESRC),SOICEREV,SharedICERev) + #else +-ProjectUnsharedLibReferences(ICE,ICE,$(ICESRC),XBuildLibDir) ++ProjectUnsharedLibReferences(ICE,NX_ICE,$(ICESRC),XBuildLibDir) + #endif + + #ifndef SharedLibSM +@@ -3145,9 +3145,9 @@ + #ifndef SharedSMRev + #define SharedSMRev 6.0 + #endif +-SharedLibReferences(SM,SM,$(SMSRC),SOSMREV,SharedSMRev) ++SharedLibReferences(SM,NX_SM,$(SMSRC),SOSMREV,SharedSMRev) + #else +-ProjectUnsharedLibReferences(SM,SM,$(SMSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(SM,NX_SM,$(SMSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXkey +@@ -3167,9 +3167,9 @@ + #ifndef SharedXkeyRev + #define SharedXkeyRev 6.0 + #endif +-SharedLibReferences(XKEY,Xkey,$(XKEYSRC),SOXKEYREV,SharedXkeyRev) ++SharedLibReferences(XKEY,NX_Xkey,$(XKEYSRC),SOXKEYREV,SharedXkeyRev) + #else +-ProjectUnsharedLibReferences(XKEY,Xkey,$(XKEYSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XKEY,NX_Xkey,$(XKEYSRC),XBuildLibDir) + #endif + + #ifndef SharedLibFS +@@ -3189,9 +3189,9 @@ + #ifndef SharedFSRev + #define SharedFSRev 6.0 + #endif +-SharedLibReferences(FS,FS,$(FSLIBSRC),SOFSREV,SharedFSRev) ++SharedLibReferences(FS,NX_FS,$(FSLIBSRC),SOFSREV,SharedFSRev) + #else +-ProjectUnsharedLibReferences(FS,FS,$(FSLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(FS,NX_FS,$(FSLIBSRC),XBuildLibDir) + #endif + + #ifndef SharedLibFont +@@ -3212,14 +3212,14 @@ + #define SharedFontRev 1.5 + #endif + SharedFontLibReferences() +-XCOMM SharedLibReferences(XFONT,Xfont,$(FONTLIBSRC),SOFONTREV,SharedFontRev) ++XCOMM SharedLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC),SOFONTREV,SharedFontRev) + #else + ProjectUnsharedFontLibReferences() +-XCOMM ProjectUnsharedLibReferences(XFONT,Xfont,$(FONTLIBSRC),XBuildLibDir) ++XCOMM ProjectUnsharedLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC),XBuildLibDir) + #endif + + FONTSTUBLIBSRC = $(FONTLIBSRC)/stubs +-ProjectUnsharedLibReferences(FONTSTUB,fntstubs,$(FONTSUBLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(FONTSTUB,NX_fntstubs,$(FONTSUBLIBSRC),XBuildLibDir) + DEPFONTLIB = $(DEPXFONTLIB) $(DEPFONTSTUBLIB) + FONTLIB = $(XFONTLIB) $(FONTSTUBLIB) $(FREETYPE2LIB) + +@@ -3241,9 +3241,9 @@ + #ifndef SharedFontEncRev + #define SharedFontEncRev 1.0 + #endif +-SharedLibReferences(XFONTENC,fontenc,$(FONTENCLIBSRC),SOFONTENCREV,SharedFontEncRev) ++SharedLibReferences(XFONTENC,NX_fontenc,$(FONTENCLIBSRC),SOFONTENCREV,SharedFontEncRev) + #else +-ProjectUnsharedLibReferences(XFONTENC,fontenc,$(FONTENCLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XFONTENC,NX_fontenc,$(FONTENCLIBSRC),XBuildLibDir) + #endif + + #ifndef SharedLibXpm +@@ -3263,9 +3263,9 @@ + #ifndef SharedXpmRev + #define SharedXpmRev 4.11 + #endif +-SharedLibReferences(XPM,Xpm,$(XPMLIBSRC),SOXPMREV,SharedXpmRev) ++SharedLibReferences(XPM,NX_Xpm,$(XPMLIBSRC),SOXPMREV,SharedXpmRev) + #else +-ProjectUnsharedLibReferences(XPM,Xpm,$(XPMLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XPM,NX_Xpm,$(XPMLIBSRC),XBuildLibDir) + #endif + + #if UseFreetype2 +@@ -3313,9 +3313,9 @@ + #define SharedFreetype2Rev 9.0 + #endif + #endif +-SharedLibReferences(FREETYPE2,freetype,$(FREETYPE2LIBSRC),SOFREETYPE2REV,SharedFreetype2Rev) ++SharedLibReferences(FREETYPE2,NX_freetype,$(FREETYPE2LIBSRC),SOFREETYPE2REV,SharedFreetype2Rev) + #else +-ProjectUnsharedLibReferences(FREETYPE2,freetype,$(FREETYPE2LIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(FREETYPE2,NX_freetype,$(FREETYPE2LIBSRC),XBuildLibDir) + #endif + + #ifdef UseInstalled +@@ -3470,9 +3470,9 @@ + #define SharedExpatRev 4.0 + #endif + #endif +-SharedLibReferences(EXPAT,expat,$(EXPATLIBSRC),SOEXPATREV,SharedExpatRev) ++SharedLibReferences(EXPAT,NX_expat,$(EXPATLIBSRC),SOEXPATREV,SharedExpatRev) + #else +-ProjectUnsharedLibReferences(EXPAT,expat,$(EXPATLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(EXPAT,NX_expat,$(EXPATLIBSRC),XBuildLibDir) + #endif + + #if UseExpat +@@ -3552,9 +3552,9 @@ + #ifndef SharedXft1Rev + #define SharedXft1Rev 1.1 + #endif +-SharedLibReferences(XFT1,Xft,$(XFT1LIBSRC),SOXFT1REV,SharedXft1Rev) ++SharedLibReferences(XFT1,NX_Xft,$(XFT1LIBSRC),SOXFT1REV,SharedXft1Rev) + #else +-ProjectUnsharedLibReferences(XFT1,Xft,$(XFT1LIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XFT1,NX_Xft,$(XFT1LIBSRC),XBuildLibDir) + #endif + + #ifndef Xft1ClientDepLibs +@@ -3589,9 +3589,9 @@ + #ifndef SharedXftRev + #define SharedXftRev 2.1.2 + #endif +-SharedLibReferences(XFT,Xft,$(XFTLIBSRC),SOXFTREV,SharedXftRev) ++SharedLibReferences(XFT,NX_Xft,$(XFTLIBSRC),SOXFTREV,SharedXftRev) + #else +-ProjectUnsharedLibReferences(XFT,Xft,$(XFTLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XFT,NX_Xft,$(XFTLIBSRC),XBuildLibDir) + #endif + + #ifndef XftClientDepLibs +@@ -3622,9 +3622,9 @@ + #ifndef SharedFontconfigRev + #define SharedFontconfigRev 1.0.4 + #endif +-SharedLibReferences(FONTCONFIG,fontconfig,$(FONTCONFIGLIBSRC),SOFONTCONFIGREV,SharedFontconfigRev) ++SharedLibReferences(FONTCONFIG,NX_fontconfig,$(FONTCONFIGLIBSRC),SOFONTCONFIGREV,SharedFontconfigRev) + #else +-ProjectUnsharedLibReferences(FONTCONFIG,fontconfig,$(FONTCONFIGLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(FONTCONFIG,NX_fontconfig,$(FONTCONFIGLIBSRC),XBuildLibDir) + #endif + + #ifdef UseInstalled +@@ -3827,9 +3827,9 @@ + # ifndef SharedxkbfileRev + # define SharedxkbfileRev 1.0 + # endif +-SharedLibReferences(XKBFILE,xkbfile,$(XKBFILESRC),SOXKBFILEREV, SharedxkbfileRev) ++SharedLibReferences(XKBFILE,NX_xkbfile,$(XKBFILESRC),SOXKBFILEREV, SharedxkbfileRev) + #else +-ProjectUnsharedLibReferences(XKBFILE,xkbfile,$(XKBFILELIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XKBFILE,NX_xkbfile,$(XKBFILELIBSRC),XBuildLibDir) + #endif + + #if BuildXKBlib +@@ -3899,9 +3899,9 @@ + # ifndef SharedxkbuiRev + # define SharedxkbuiRev 1.0 + # endif +-SharedLibReferences(XKBUI,xkbui,$(XKBUISRC),SOXKBUIREV, SharedxkbuiRev) ++SharedLibReferences(XKBUI,NX_xkbui,$(XKBUISRC),SOXKBUIREV, SharedxkbuiRev) + #else +-ProjectUnsharedLibReferences(XKBUI,xkbui,$(XKBUILIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XKBUI,NX_xkbui,$(XKBUILIBSRC),XBuildLibDir) + #endif + + #ifndef XkbuiLibs +@@ -3974,9 +3974,9 @@ + #ifndef SharedXTrapRev + #define SharedXTrapRev 6.4 + #endif +-SharedLibReferences(XTRAP,XTrap,$(XTRAPLIBSRC),SOXTRAPREV,SharedXTrapRev) ++SharedLibReferences(XTRAP,NX_XTrap,$(XTRAPLIBSRC),SOXTRAPREV,SharedXTrapRev) + #else +-ProjectUnsharedLibReferences(XTRAP,XTrap,$(XTRAPLIBSRC),XBuildLibDir) ++ProjectUnsharedLibReferences(XTRAP,NX_XTrap,$(XTRAPLIBSRC),XBuildLibDir) + #endif + + #ifndef NeedDefaultDepLibs +--- a/nx-X11/config/cf/lnxLib.rules ++++ b/nx-X11/config/cf/lnxLib.rules +@@ -389,7 +389,7 @@ + XCOMM libX11.so (X11, SM, ICE) + JUMP_ROOT_X11 = $(XLIBSRC) + JUMP_IS_HOST_X11 = YES +-JUMP_STUBLIBS_X11 = libX11.sa libSM.sa libICE.sa ++JUMP_STUBLIBS_X11 = libNX_X11.sa libNX_SM.sa libNX_ICE.sa + JUMP_SIBDIRS_X11 = $(JUMP_ROOT_SM) $(JUMP_ROOT_ICE) + JUMP_DIR_X11 = $(JUMP_ROOT_X11)/shared + JUMP_DEFS_X11 = $(XDMAUTHDEFS) $(XKB_DEFINES) +@@ -400,9 +400,9 @@ + JUMP_ADDRESS_X11 = 0x60200000 + JUMP_JUMPTABLESIZE_X11 = 0x4000 + JUMP_GOTSIZE_X11 = 4096 +-JUMP_STUBNAMES_X11 = libX11 libSM libICE ++JUMP_STUBNAMES_X11 = libNX_X11 libNX_SM libNX_ICE + JUMP_STUBS_IMPORT_X11 = $(LIBC_SA) +-JUMP_SIBARS_X11 = jump/libSM.a~ jump/libICE.a~ ++JUMP_SIBARS_X11 = jump/libNX_SM.a~ jump/libNX_ICE.a~ + JUMP_LDLIBS_X11 = $(JUMP_SIBARS_X11) $(JUMP_LDLIBS_libc) + + XCOMM libSM (part of libX11.so) +@@ -435,9 +435,9 @@ + JUMP_GOTSIZE_Xt = 4096 + JUMP_STUBNAMES_Xt = libXt libXmu libXext libXi libXtst libXp + JUMP_STUBS_IMPORT_Xt = $(JUMP_STUBS_IMPORT_X11) +-JUMP_SIBARS_Xt = jump/libXmu.a~ jump/libXext.a~ jump/libXi.a~ jump/libXtst.a~ jump/libXp.a~ +-JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_ICE)/libICE.sa \ +- $(JUMP_ROOT_SM)/libSM.sa $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_libc) ++JUMP_SIBARS_Xt = jump/libNX_Xmu.a~ jump/libNX_Xext.a~ jump/libNX_Xi.a~ jump/libNX_Xtst.a~ jump/libNX_Xp.a~ ++JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_ICE)/libNX_ICE.sa \ ++ $(JUMP_ROOT_SM)/libNX_SM.sa $(JUMP_ROOT_X11)/libNX_X11.sa $(JUMP_LDLIBS_libc) + + XCOMM libXmu (part of libXt.so) + JUMP_ROOT_Xmu = $(XMUSRC) +@@ -485,8 +485,8 @@ + JUMP_GOTSIZE_Xaw = 4096 + JUMP_STUBNAMES_Xaw = libXaw + JUMP_STUBS_IMPORT_Xaw = $(JUMP_STUBS_IMPORT_X11) +-JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \ +- $(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \ ++JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libNX_Xt.sa $(JUMP_ROOT_Xt)/libNX_Xmu.sa \ ++ $(JUMP_ROOT_Xt)/libNX_Xext.sa $(JUMP_ROOT_X11)/libNX_X11.sa \ + $(JUMP_LDLIBS_libc) + + # endif /* !UseInstalled */ +--- a/nx-X11/config/cf/lnxLib.tmpl ++++ b/nx-X11/config/cf/lnxLib.tmpl +@@ -9,7 +9,7 @@ + + #ifndef FixupLibReferences + #define FixupLibReferences() @@\ +-XMULIBONLY = -lXmu @@\ ++XMULIBONLY = -lNX_Xmu @@\ + XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB) + #endif + +@@ -66,7 +66,7 @@ + + #ifndef FixupLibReferences + #define FixupLibReferences() @@\ +-XMULIB = -lXmu $(XLIB) ++XMULIB = -lNX_Xmu $(XLIB) + #endif + + #endif /* UseElfFormat */ +--- a/nx-X11/lib/X11/Imakefile ++++ b/nx-X11/lib/X11/Imakefile +@@ -82,7 +82,7 @@ + #define DoExtraLib SharedLibX11 + #define DoDebugLib DebugLibX11 + #define DoProfileLib ProfileLibX11 +-#define LibName X11 ++#define LibName NX_X11 + #define SoRev SOXLIBREV + #define HugeLibrary YES + #define IncSubdir X11 +--- a/nx-X11/lib/XRes/Imakefile ++++ b/nx-X11/lib/XRes/Imakefile +@@ -4,7 +4,7 @@ + #define DoSharedLib SharedLibXRes + #define DoDebugLib DebugLibXRes + #define DoProfileLib ProfileLibXRes +-#define LibName XRes ++#define LibName NX_XRes + #define SoRev SOXRESREV + #define LibHeaders NO + +--- a/nx-X11/lib/Xau/Imakefile ++++ b/nx-X11/lib/Xau/Imakefile +@@ -10,7 +10,7 @@ + #define DoExtraLib SharedLibXau + #define DoDebugLib DebugLibXau + #define DoProfileLib ProfileLibXau +-#define LibName Xau ++#define LibName NX_Xau + #define SoRev SOXAUTHREV + #define IncSubdir X11 + +--- a/nx-X11/lib/Xcomposite/Imakefile ++++ b/nx-X11/lib/Xcomposite/Imakefile +@@ -14,7 +14,7 @@ + #define DoDebugLib DebugLibXcomposite + #define DoProfileLib ProfileLibXcomposite + +-#define LibName Xcomposite ++#define LibName NX_Xcomposite + #define SoRev SOXCOMPOSITEREV + #define IncSubdir X11 + #define IncSubSubdir extensions +--- a/nx-X11/lib/Xcomposite/xcomposite.pc.in ++++ b/nx-X11/lib/Xcomposite/xcomposite.pc.in +@@ -7,4 +7,4 @@ + Description: X Composite Library + Version: @VERSION@ + Cflags: -I${includedir} @XCOMPOSITE_CFLAGS@ @X_CFLAGS@ +-Libs: -L${libdir} -lXcomposite @XCOMPOSITE_LIBS@ @X_LIBS@ ++Libs: -L${libdir} -lNX_Xcomposite @XCOMPOSITE_LIBS@ @X_LIBS@ +--- a/nx-X11/lib/Xcursor/Imakefile ++++ b/nx-X11/lib/Xcursor/Imakefile +@@ -15,7 +15,7 @@ + #define DoDebugLib DebugLibXcursor + #define DoProfileLib ProfileLibXcursor + +-#define LibName Xcursor ++#define LibName NX_Xcursor + #define SoRev SOXCURSORREV + #define IncSubdir X11 + #define IncSubSubdir Xcursor +--- a/nx-X11/lib/Xcursor/xcursor.pc.in ++++ b/nx-X11/lib/Xcursor/xcursor.pc.in +@@ -12,4 +12,4 @@ + Version: @VERSION@ + Requires: xrender + Cflags: -I${includedir} ${xrendercflags} ${xcflags} +-Libs: -L${libdir} -lXcursor ${xrenderlibs} ${xlibs} ++Libs: -L${libdir} -lNX_Xcursor ${xrenderlibs} ${xlibs} +--- a/nx-X11/lib/Xdamage/Imakefile ++++ b/nx-X11/lib/Xdamage/Imakefile +@@ -14,7 +14,7 @@ + #define DoDebugLib DebugLibXdamage + #define DoProfileLib ProfileLibXdamage + +-#define LibName Xdamage ++#define LibName NX_Xdamage + #define SoRev SOXDAMAGEREV + #define IncSubdir X11 + #define IncSubSubdir extensions +--- a/nx-X11/lib/Xdamage/xdamage.pc.in ++++ b/nx-X11/lib/Xdamage/xdamage.pc.in +@@ -7,4 +7,4 @@ + Description: X Damage Library + Version: @VERSION@ + Cflags: -I${includedir} @XDAMAGE_CFLAGS@ @X_CFLAGS@ +-Libs: -L${libdir} -lXdamage @XDAMAGE_LIBS@ @X_LIBS@ ++Libs: -L${libdir} -lNX_Xdamage @XDAMAGE_LIBS@ @X_LIBS@ +--- a/nx-X11/lib/Xdmcp/Imakefile ++++ b/nx-X11/lib/Xdmcp/Imakefile +@@ -10,7 +10,7 @@ + #define DoExtraLib SharedLibXdmcp + #define DoDebugLib DebugLibXdmcp + #define DoProfileLib ProfileLibXdmcp +-#define LibName Xdmcp ++#define LibName NX_Xdmcp + #define SoRev SOXDMCPREV + #define IncSubdir X11 + +--- a/nx-X11/lib/Xext/Imakefile ++++ b/nx-X11/lib/Xext/Imakefile +@@ -10,7 +10,7 @@ + #define DoExtraLib SharedLibXext + #define DoDebugLib DebugLibXext + #define DoProfileLib ProfileLibXext +-#define LibName Xext ++#define LibName NX_Xext + #define SoRev SOXEXTREV + #define LibHeaders NO + +--- a/nx-X11/lib/Xfixes/Imakefile ++++ b/nx-X11/lib/Xfixes/Imakefile +@@ -14,7 +14,7 @@ + #define DoDebugLib DebugLibXfixes + #define DoProfileLib ProfileLibXfixes + +-#define LibName Xfixes ++#define LibName NX_Xfixes + #define SoRev SOXFIXESREV + #define IncSubdir X11 + #define IncSubSubdir extensions +--- a/nx-X11/lib/Xfixes/xfixes.pc.in ++++ b/nx-X11/lib/Xfixes/xfixes.pc.in +@@ -7,4 +7,4 @@ + Description: X Fixes Library + Version: @VERSION@ + Cflags: -I${includedir} @X_CFLAGS@ +-Libs: -L${libdir} -lXfixes @X_LIBS@ ++Libs: -L${libdir} -lNX_Xfixes @X_LIBS@ +--- a/nx-X11/lib/Xinerama/Imakefile ++++ b/nx-X11/lib/Xinerama/Imakefile +@@ -4,7 +4,7 @@ + #define DoSharedLib SharedLibXinerama + #define DoDebugLib DebugLibXinerama + #define DoProfileLib ProfileLibXinerama +-#define LibName Xinerama ++#define LibName NX_Xinerama + #define SoRev SOXINERAMAREV + #define LibHeaders NO + +--- a/nx-X11/lib/Xpm/Imakefile ++++ b/nx-X11/lib/Xpm/Imakefile +@@ -12,7 +12,7 @@ + #define DoDebugLib DebugLibXpm + #define DoProfileLib ProfileLibXpm + #define HasSharedData NO +-#define LibName Xpm ++#define LibName NX_Xpm + #define SoRev SOXPMREV + #define IncSubdir X11 + +--- a/nx-X11/lib/Xrandr/Imakefile ++++ b/nx-X11/lib/Xrandr/Imakefile +@@ -5,7 +5,7 @@ + #define DoSharedLib SharedLibXrandr + #define DoDebugLib DebugLibXrandr + #define DoProfileLib ProfileLibXrandr +-#define LibName Xrandr ++#define LibName NX_Xrandr + #define SoRev SOXRANDRREV + #define IncSubdir X11 + #define IncSubSubdir extensions +--- a/nx-X11/lib/Xrender/Imakefile ++++ b/nx-X11/lib/Xrender/Imakefile +@@ -74,7 +74,7 @@ + #define DoSharedLib SharedLibXrender + #define DoDebugLib DebugLibXrender + #define DoProfileLib ProfileLibXrender +-#define LibName Xrender ++#define LibName NX_Xrender + #define SoRev SOXRENDERREV + + #ifdef XBuildIncDir +--- a/nx-X11/lib/Xrender/xrender.pc.in ++++ b/nx-X11/lib/Xrender/xrender.pc.in +@@ -8,4 +8,4 @@ + Version: @VERSION@ + Requires: @X_REQUIRES@ + Cflags: -I${includedir} @RENDER_CFLAGS@ @X_NON_PKG_CFLAGS@ +-Libs: -L${libdir} -lXrender @X_NON_PKG_LIBS@ ++Libs: -L${libdir} -lNX_Xrender @X_NON_PKG_LIBS@ +--- a/nx-X11/lib/Xtst/Imakefile ++++ b/nx-X11/lib/Xtst/Imakefile +@@ -10,7 +10,7 @@ + #define DoExtraLib SharedLibXtst + #define DoDebugLib DebugLibXtst + #define DoProfileLib ProfileLibXtst +-#define LibName Xtst ++#define LibName NX_Xtst + #define SoRev SOXTESTREV + #define LibHeaders NO + +--- a/nx-X11/lib/font/Imakefile ++++ b/nx-X11/lib/font/Imakefile +@@ -31,7 +31,7 @@ + STUBDIRS = stubs + #endif + +-LIBNAME = Xfont ++LIBNAME = NX_Xfont + SOREV = $(SOFONTREV) + + #ifndef SeparateSharedCompile +--- a/nx-X11/lib/oldX/Imakefile ++++ b/nx-X11/lib/oldX/Imakefile +@@ -10,7 +10,7 @@ + #define DoExtraLib SharedOldX + #define DoDebugLib DebugOldX + #define DoProfileLib ProfileOldX +-#define LibName oldX ++#define LibName NX_oldX + #define SoRev SOOLDXREV + #define IncSubdir X11 + +--- a/nx-X11/lib/xkbfile/Imakefile ++++ b/nx-X11/lib/xkbfile/Imakefile +@@ -11,7 +11,7 @@ + #define DoDebugLib DebugLibxkbfile + #define DoProfileLib ProfileLibxkbfile + #define HasSharedData NO +-#define LibName xkbfile ++#define LibName NX_xkbfile + #define SoRev SOXKBFILEREV + #define IncSubdir X11 + #define IncSubSubdir extensions +--- a/nx-X11/lib/xkbui/Imakefile ++++ b/nx-X11/lib/xkbui/Imakefile +@@ -6,7 +6,7 @@ + #define DoDebugLib DebugLibxkbui + #define DoProfileLib ProfileLibxkbui + #define HasSharedData NO +-#define LibName xkbui ++#define LibName NX_xkbui + #define SoRev SOXKBUIREV + #define IncSubdir X11 + #define IncSubSubdir extensions +--- a/nx-X11/programs/Xserver/Imakefile ++++ b/nx-X11/programs/Xserver/Imakefile +@@ -313,7 +313,7 @@ + FONTBASE = $(FONTLIBSRC)/fontbase.o \ + $(FONTLIBSRC)/LibraryTargetName(fontbase) + #if XserverStaticFontLib +- FONT = $(FONTLIBSRC)/LibraryTargetName(Xfont) $(FREETYPE2LIB) ++ FONT = $(FONTLIBSRC)/LibraryTargetName(NX_Xfont) $(FREETYPE2LIB) + #else + FONT = $(LDPRELIB) $(XFONTLIB) $(FREETYPE2LIB) + #endif +@@ -994,7 +994,7 @@ + dix/main.o + #endif + +-XPMLIB = -lXpm ++XPMLIB = -lNX_Xpm + NXAGENT = hw/nxagent/LibraryTargetName(nxagent) + NXAGENTLIBS = PreFbLibs $(NXAGENT) FbPostFbLibs $(NXAGENT) $(MI) + NXAGENTSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) +@@ -1012,18 +1012,18 @@ + + #if defined(SunArchitecture) + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ +- -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp \ ++ -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lNX_Xrender -lNX_Xfixes \ ++ -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xdmcp \ + `pkg-config --libs libxml-2.0` + #elif defined(cygwinArchitecture) + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ +- -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ +- -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp \ ++ -lXcomp -lXcompext -lNX_Xrender -lX11 -lNX_Xext -lNX_Xcomposite -lNX_Xfixes \ ++ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdmcp \ + `pkg-config --libs libxml-2.0` + #else + NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ +- -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ +- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp \ ++ -lXcomp -lXcompext -lXcompshad -lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xfixes \ ++ -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xinerama -lNX_Xdmcp \ + `pkg-config --libs libxml-2.0` + #endif + +@@ -1078,7 +1078,7 @@ + else exit 0; fi + $(CCLINK) -o nxagent_static_nolibs -Wl,-Bstatic $(LDOPTIONS) $(NXAGENTOBJS) \ + $(NXAGENTLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER) $(LDLIBS) $(FONTLIBS) \ +- $(LDPRELIBS) $(SYSLIBS) -Wl,-Bdynamic -lXext -lX11 $(EXTRA_LOAD_FLAGS) ++ $(LDPRELIBS) $(SYSLIBS) -Wl,-Bdynamic -lNX_Xext -lNX_X11 $(EXTRA_LOAD_FLAGS) + #endif /* NXAgentServer */ + + #if defined(XnonServer) && XnonServer +--- a/nxcompext/Makefile.in ++++ b/nxcompext/Makefile.in +@@ -42,12 +42,12 @@ + CCDEFINES = + + LDFLAGS = @LDFLAGS@ -L../nxcomp +-LIBS = @LIBS@ -lz -lX11 -lXcomp ++LIBS = @LIBS@ -lz -lNX_X11 -lXcomp + + # + # Only if THREADS is defined + # +-# LIBS = @LIBS@ -lz -ljpeg -lpthread -lX11 -lXcomp ++# LIBS = @LIBS@ -lz -ljpeg -lpthread -lNX_X11 -lXcomp + # + + srcdir = @srcdir@ +--- a/nxcompshad/Makefile.in ++++ b/nxcompshad/Makefile.in +@@ -48,7 +48,7 @@ + CCDEFINES = + + LDFLAGS = @LDFLAGS@ +-LIBS = @LIBS@ -lX11 ++LIBS = @LIBS@ -lNX_X11 + + # + # Only if THREADS is defined. +@@ -139,7 +139,7 @@ + + else + +-EXTRALIBS = -lXtst -lXrandr -lXdamage ++EXTRALIBS = -lNX_Xtst -lNX_Xrandr -lNX_Xdamage + + all: depend $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) + diff --git a/debian/patches/0601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch b/debian/patches/0601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch new file mode 100644 index 000000000..dbb2e85b0 --- /dev/null +++ b/debian/patches/0601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch @@ -0,0 +1,99 @@ +Description: Do not build bundled libraries. +Author: Orion Poplawski +Abstract: + This commit has been submitted by Orion in two + portions. One was submitted to X2Go BTS and created + on Wed, 10 Jul 2013. + . + The other portion has been taken from the Fedora + package by Mike Gabriel and worked into this + patch on Fri, 06 Dec 2013. +--- + nx-X11/config/cf/host.def | 10 +++++++--- + nx-X11/lib/font/include/Imakefile | 2 +- + 2 files changed, 8 insertions(+), 4 deletions(-) + +--- a/nx-X11/config/cf/host.def ++++ b/nx-X11/config/cf/host.def +@@ -311,6 +311,7 @@ + * + #define BuildFreeType NO + */ ++#define BuildFreeType NO + + /* + * To set non-default build options for the underlying FreeType libraries, +@@ -892,7 +893,7 @@ + * + #define HasFreetype2 NO + */ +-#define HasFreetype2 NO ++#define HasFreetype2 YES + + /* + * To use a FreeType library already installed outside the default search +@@ -909,7 +910,7 @@ + * + #define HasFontconfig NO + */ +-#define HasFontconfig NO ++#define HasFontconfig YES + + /* + * To use a Fontconfig library already installed outside the default search +@@ -925,7 +926,7 @@ + * + #define HasExpat NO + */ +-#define HasExpat NO ++#define HasExpat YES + + /* + * To use a Expat library already installed outside the default search +@@ -961,7 +962,7 @@ + + #define SharedLibXdmcp YES + +-#define BuildXaw7 YES ++#define BuildXaw7 NO + + #else /* #if !defined(NXZaurusXServer) && !defined(NXiPAQXServer) && !defined(DarwinArchitecture) */ + +@@ -1019,3 +1020,11 @@ + #endif + + #endif /* #if !defined(NXZaurusXServer) && !defined(NXiPAQXServer) && !defined(DarwinArchitecture) */ ++ ++#define BuildRman NO ++#define BuildFontEncLib NO ++#define BuildXcursorLibrary NO ++#define BuildXftLibrary NO ++#define BuildXft1Library NO ++#define SharedLibFont NO ++#define BuildLoadableXlibI18n NO +--- a/nx-X11/lib/font/include/Imakefile ++++ b/nx-X11/lib/font/include/Imakefile +@@ -1,5 +1,5 @@ + XCOMM $Xorg$ +- HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h fontenc.h \ ++ HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h \ + fontencc.h fontmisc.h fontmod.h fontshow.h fontutil.h \ + fontxlfd.h + all:: +--- a/nx-X11/lib/Imakefile ++++ b/nx-X11/lib/Imakefile +@@ -213,14 +213,8 @@ + + #if BuildLibraries + OLDXLIBDIR = oldX +-ICELIBDIR = ICE +-SMLIBDIR = SM +-XTLIBDIR = Xt +-XMULIBDIR = Xmu +-XMUULIBDIR = Xmuu + XPMLIBDIR = Xpm + XTSTLIBDIR = Xtst +-FSLIBDIR = FS + #endif + + diff --git a/debian/patches/0602_nx-X11_initgroups.full.patch b/debian/patches/0602_nx-X11_initgroups.full.patch new file mode 100644 index 000000000..182b378dc --- /dev/null +++ b/debian/patches/0602_nx-X11_initgroups.full.patch @@ -0,0 +1,67 @@ +Description: Be compliant with POS36-C: Observe correct revocation order while relinquishing privileges +Author: Orion Poplawski +Abstract: + The Fedora review of NX (redistributed) caught the following rpmlint issue: + . + This executable is calling setuid and setgid without setgroups or initgroups. + There is a high probability this mean it didn't relinquish all groups, and this + would be a potential security issue to be fixed. Seek POS36-C on the web for + details about the problem. + . + Ref POS36-C: + https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges + . + This patch adds initgroups() calls to the code to initialize the supplemental group list. +diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c +index 7e62654..9b2431a 100644 +--- a/nx-X11/programs/Xserver/os/utils.c ++++ b/nx-X11/programs/Xserver/os/utils.c +@@ -112,6 +112,9 @@ OR PERFORMANCE OF THIS SOFTWARE. + #include + #include /* for isspace */ + #include ++#include ++#include ++#include + + #if defined(DGUX) + #include +@@ -1770,6 +1773,7 @@ System(char *command) + void (*csig)(int); + #endif + int status; ++ struct passwd *pwent; + + if (!command) + return(1); +@@ -1791,6 +1795,9 @@ System(char *command) + case -1: /* error */ + p = -1; + case 0: /* child */ ++ pwent = getpwuid(getuid()); ++ if (initgroups(pwent->pw_name,getgid()) == -1) ++ _exit(127); + if (setgid(getgid()) == -1) + _exit(127); + if (setuid(getuid()) == -1) +diff --git a/nxcomp/Pipe.cpp b/nxcomp/Pipe.cpp +index 7238d0c..aacbbae 100644 +--- a/nxcomp/Pipe.cpp ++++ b/nxcomp/Pipe.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "Pipe.h" + #include "Misc.h" +@@ -234,6 +235,8 @@ FILE *Popen(char * const parameters[], const char *type) + // Child. + // + ++ struct passwd *pwent = getpwuid(getuid()); ++ if (pwent) initgroups(pwent->pw_name,getgid()); + setgid(getgid()); + setuid(getuid()); + diff --git a/debian/patches/0603_nx-X11_compilation_warnings.full.patch b/debian/patches/0603_nx-X11_compilation_warnings.full.patch new file mode 100644 index 000000000..3656461b6 --- /dev/null +++ b/debian/patches/0603_nx-X11_compilation_warnings.full.patch @@ -0,0 +1,38 @@ +Description: Handle some serious compilation warnings +Author: Mirraz Mirraz +--- a/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c 2013-08-30 20:18:40.000000000 +0600 ++++ b/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c 2013-09-30 18:39:42.357560169 +0600 +@@ -3259,7 +3259,6 @@ + vp->SrcReg[0].Swizzle = SWIZZLE_NOOP; + vp->SrcReg[1].Swizzle = SWIZZLE_NOOP; + vp->SrcReg[2].Swizzle = SWIZZLE_NOOP; +- vp->SrcReg[3].Swizzle = SWIZZLE_NOOP; + vp->DstReg.WriteMask = 0xf; + + switch (type) { +--- a/nx-X11/lib/X11/imLcPrs.c 2013-08-30 20:18:40.000000000 +0600 ++++ b/nx-X11/lib/X11/imLcPrs.c 2013-09-30 19:02:56.925125678 +0600 +@@ -589,7 +589,7 @@ + + l = _Xmbstoutf8(local_utf8_buf, rhs_string_mb, LOCAL_UTF8_BUFSIZE - 1); + if (l == LOCAL_UTF8_BUFSIZE - 1) { +- local_wc_buf[l] = '\0'; ++ local_utf8_buf[l] = '\0'; + } + if( (rhs_string_utf8 = (char *)Xmalloc(l + 1)) == NULL ) { + Xfree( rhs_string_wc ); +--- a/nx-X11/programs/Xserver/xkb/ddxLoad.c 2013-08-30 20:18:40.000000000 +0600 ++++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c 2013-09-30 18:56:27.358995920 +0600 +@@ -37,6 +37,12 @@ + #include + #include + #include ++ ++/* stat() */ ++#include ++#include ++#include ++ + #define NEED_EVENTS 1 + #include + #include diff --git a/debian/patches/0605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch b/debian/patches/0605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch new file mode 100644 index 000000000..60f33ce3f --- /dev/null +++ b/debian/patches/0605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch @@ -0,0 +1,52 @@ +Description: In Types.h, don't use STL internals on libc++. +Author: Clemens Lang +Abstract: + The nx-libs-lite package does not compile on OS X Mavericks because + Apple's clang compilers now default to compiling against the libc++ STL + rather than (their outdated copy of) libstdc++. + . + While the compiler still allows changing that, we should not rely on + this being possible forever. + . + The compiler chokes in Types.h, specifically the clear() methods in + subclasses of vectors that use implementation details of the GNU STL. + The attached patch fixes these compilation issues by not overriding the + clear() method when compiling against libc++, since the libc++ headers + seem to do essentially the same as the overriden method. +--- a/nxcomp/Types.h 2013-11-05 01:35:22.000000000 +0100 ++++ b/nxcomp/Types.h 2013-11-05 01:37:30.000000000 +0100 +@@ -55,6 +55,9 @@ + return &*(vector < unsigned char >::begin()); + } + ++ // Avoid overriding clear() when using libc++. Fiddling with STL internals ++ // doesn't really seem like a good idea to me anyway. ++ #ifndef _LIBCPP_VECTOR + void clear() + { + #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) +@@ -95,12 +98,16 @@ + + #endif /* #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) */ + } ++ #endif /* #ifdef _LIBCPP_VECTOR */ + }; + + class T_messages : public vector < Message * > + { + public: + ++ // Avoid overriding clear() when using libc++. Fiddling with STL internals ++ // doesn't really seem like a good idea to me anyway. ++ #ifndef _LIBCPP_VECTOR + void clear() + { + #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) +@@ -141,6 +148,7 @@ + + #endif /* #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) */ + } ++ #endif /* #ifndef _LIBCPP_VECTOR */ + }; + + typedef md5_byte_t * T_checksum; diff --git a/debian/patches/0606_nx-X11_build-on-aarch64.full.patch b/debian/patches/0606_nx-X11_build-on-aarch64.full.patch new file mode 100644 index 000000000..bda43399a --- /dev/null +++ b/debian/patches/0606_nx-X11_build-on-aarch64.full.patch @@ -0,0 +1,77 @@ +Description: Provide build support for aarch64 architecture +Author: Orion Poplawski +--- a/nx-X11/config/cf/Imake.cf ++++ b/nx-X11/config/cf/Imake.cf +@@ -908,6 +908,9 @@ + # endif + # undef __ARMEB__ + # endif ++# ifdef __aarch64__ ++# define Arm64Architecture ++# endif + # ifdef mc68000 + # define Mc68020Architecture + # undef mc68000 +--- a/nx-X11/config/cf/linux.cf ++++ b/nx-X11/config/cf/linux.cf +@@ -844,6 +844,16 @@ + # define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines + #endif /* Arm32Achitecture */ + ++#ifdef Arm64Architecture ++# define DefaultCCOptions ++# ifndef OptimizedCDebugFlags ++# define OptimizedCDebugFlags -O3 ++# endif ++# define LinuxMachineDefines -D__aarch64__ -U__arm -Uarm ++# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME ++# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines ++#endif /* Arm64Achitecture */ ++ + #ifdef HPArchitecture + # define OptimizedCDebugFlags -O2 GccAliasingArgs + # define LinuxMachineDefines -D__hppa__ +--- a/nx-X11/config/cf/Imake.tmpl ++++ b/nx-X11/config/cf/Imake.tmpl +@@ -526,6 +526,10 @@ + #define ByteOrder X_BIG_ENDIAN + #elif defined(Arm32Architecture) + #define ByteOrder X_LITTLE_ENDIAN ++#elif defined(Arm64ebArchitecture) ++#define ByteOrder X_BIG_ENDIAN ++#elif defined(Arm64Architecture) ++#define ByteOrder X_LITTLE_ENDIAN + #elif defined(RsArchitecture) + #define ByteOrder X_BIG_ENDIAN + #elif defined(PpcArchitecture) || defined(Ppc64Architecture) +--- a/nx-X11/programs/Xserver/include/servermd.h ++++ b/nx-X11/programs/Xserver/include/servermd.h +@@ -154,6 +154,28 @@ + + #endif /* __arm32__ */ + ++#ifdef __aarch64__ ++ ++#ifdef __AARCH64EL__ ++#define IMAGE_BYTE_ORDER LSBFirst ++#define BITMAP_BIT_ORDER LSBFirst ++#endif ++#ifdef __AARCH64EB__ ++#define IMAGE_BYTE_ORDER MSBFirst ++#define BITMAP_BIT_ORDER MSBFirst ++#endif ++ ++# if defined(XF86MONOVGA) || defined(XF86VGA16) ++# define BITMAP_SCANLINE_UNIT 8 ++# endif ++ ++#define GLYPHPADBYTES 4 ++#define GETLEFTBITS_ALIGNMENT 1 ++#define LARGE_INSTRUCTION_CACHE ++#define AVOID_MEMORY_READ ++ ++#endif /* __aarch64__ */ ++ + #if defined (hpux) || defined __hppa__ + + #define IMAGE_BYTE_ORDER MSBFirst diff --git a/debian/patches/0607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch b/debian/patches/0607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch new file mode 100644 index 000000000..535671fef --- /dev/null +++ b/debian/patches/0607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch @@ -0,0 +1,14 @@ +Description: Detection for Mac OS X's launchd service on Mac OS X 10.10 and beyond +Author: Mike Gabriel + +--- a/nxcomp/Loop.cpp ++++ b/nxcomp/Loop.cpp +@@ -4183,7 +4183,7 @@ + + #ifdef __APPLE__ + +- if (strncasecmp(display, "/tmp/launch", 11) == 0) ++ if ((strncasecmp(display, "/tmp/launch", 11) == 0) || (strncasecmp(display, "/private/tmp/com.apple.launchd", 30) == 0)) + { + #ifdef TEST + *logofs << "Loop: Using launchd service on socket '" diff --git a/debian/patches/0990_fix-DEBUG-and-TEST-builds.full.patch b/debian/patches/0990_fix-DEBUG-and-TEST-builds.full.patch new file mode 100644 index 000000000..23c8508a2 --- /dev/null +++ b/debian/patches/0990_fix-DEBUG-and-TEST-builds.full.patch @@ -0,0 +1,69 @@ +Author: Mihai Moldovan +Description: Several fixes for building debug versions of NX +Abstract: + (1) In nx-X11/programs/Xserver/dix: + . + Fix several compile errors when specifying -DDEBUG globally. Previous GCC + versions were more liberal and the code thus compiled. + . + Also initialize/reset a count variable correctly. + . + . + (2) In nx-X11/programs/Xserver/hw/nxagent/Render.c: + . + Check for pSrc->pDrawable to exist instead of having nxagent segfault when + it does not. + . + This enables the possibility of compiling all nxagent modules in TEST mode. + +--- a/nx-X11/programs/Xserver/dix/dixfonts.c ++++ b/nx-X11/programs/Xserver/dix/dixfonts.c +@@ -2203,7 +2203,7 @@ + byte = 0; + for (l = 0; l <= (cip->metrics.rightSideBearing - + cip->metrics.leftSideBearing); l++) { +- if (maskTab[l & 7] & row[l >> 3]) ++ if (maskTab[l & 7] & (((int*)row)[l >> 3])) + putchar('X'); + else + putchar('.'); +--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c +@@ -1678,10 +1678,11 @@ + + #ifdef TEST + +- fprintf(stderr, "nxagentTrapezoids: Source is a [%s] of geometry [%d,%d].\n", +- (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), +- pSrc -> pDrawable -> width, pSrc -> pDrawable -> height); +- ++ if (pSrc->pDrawable) { ++ fprintf(stderr, "nxagentTrapezoids: Source is a [%s] of geometry [%d,%d].\n", ++ (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), ++ pSrc -> pDrawable -> width, pSrc -> pDrawable -> height); ++ } + if (pSrc ->pDrawable != pDst -> pDrawable) + { + fprintf(stderr, "nxagentTrapezoids: Destination is a [%s] of geometry [%d,%d].\n", +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c +@@ -735,7 +735,7 @@ + + client->sequence++; + #ifdef DEBUG +- if (client->requestLogIndex == MAX_REQUEST_LOG) ++ if ((client->requestLogIndex >= MAX_REQUEST_LOG) || (client->requestLogIndex <= 0)) + client->requestLogIndex = 0; + client->requestLog[client->requestLogIndex] = MAJOROP; + client->requestLogIndex++; +--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c +@@ -2351,7 +2351,7 @@ + byte = 0; + for (l = 0; l <= (cip->metrics.rightSideBearing - + cip->metrics.leftSideBearing); l++) { +- if (maskTab[l & 7] & row[l >> 3]) ++ if (maskTab[l & 7] & (((int *)row)[l >> 3])) + putchar('X'); + else + putchar('.'); diff --git a/debian/patches/0991_fix-hr-typos.full+lite.patch b/debian/patches/0991_fix-hr-typos.full+lite.patch new file mode 100644 index 000000000..4ff18462e --- /dev/null +++ b/debian/patches/0991_fix-hr-typos.full+lite.patch @@ -0,0 +1,97 @@ +Description: Fix several typos in nxcomp +Author: Mike Gabriel + +--- a/nxcomp/CHANGELOG ++++ b/nxcomp/CHANGELOG +@@ -668,7 +668,7 @@ + + nxcomp-2.0.0-69 + +-- Changed the format of the persistent cache to accomodate the new ++- Changed the format of the persistent cache to accommodate the new + encoding of the render opcodes. Caches from the 1.4.0 and 1.5.0 + should be still loaded and saved correctly when connected to and + old version of the library. +--- a/nxcomp/ClientReadBuffer.cpp ++++ b/nxcomp/ClientReadBuffer.cpp +@@ -29,7 +29,7 @@ + // + // Even if the pending data is not + // enough to make a complete message, +- // resize the buffer to accomodate ++ // resize the buffer to accommodate + // it all. + // + +--- a/nxcomp/EncodeBuffer.cpp ++++ b/nxcomp/EncodeBuffer.cpp +@@ -505,12 +505,12 @@ + { + #ifdef PANIC + *logofs << "EncodeBuffer: PANIC! Error in context [C] " +- << "growing buffer to accomodate " << numBytes ++ << "growing buffer to accommodate " << numBytes + << " bytes .\n" << logofs_flush; + #endif + + cerr << "Error" << ": Error in context [C] " +- << "growing encode buffer to accomodate " ++ << "growing encode buffer to accommodate " + << numBytes << " bytes.\n"; + + HandleAbort(); +--- a/nxcomp/GenericChannel.cpp ++++ b/nxcomp/GenericChannel.cpp +@@ -210,7 +210,7 @@ + // All data has been read from the read buffer. + // We still need to mark the end of the encode + // buffer just before sending the frame. This +- // allows us to accomodate multiple reads in ++ // allows us to accommodate multiple reads in + // a single frame. + // + +--- a/nxcomp/ProxyReadBuffer.cpp ++++ b/nxcomp/ProxyReadBuffer.cpp +@@ -50,7 +50,7 @@ + // + // Even if the readable data is not + // enough to make a complete message, +- // resize the buffer to accomodate ++ // resize the buffer to accommodate + // it all. + // + +--- a/nxcomp/ServerReadBuffer.cpp ++++ b/nxcomp/ServerReadBuffer.cpp +@@ -46,7 +46,7 @@ + // + // Even if the readable data is not + // enough to make a complete message, +- // resize the buffer to accomodate ++ // resize the buffer to accommodate + // it all. + // + +--- a/nxcomp/Transport.h ++++ b/nxcomp/Transport.h +@@ -226,7 +226,7 @@ + protected: + + // +- // Make room in the buffer to accomodate ++ // Make room in the buffer to accommodate + // at least size bytes. + // + +--- a/nxcomp/Types.h ++++ b/nxcomp/Types.h +@@ -179,7 +179,7 @@ + typedef list < int > T_list; + + // +-// Used to accomodate data to be read and ++// Used to accommodate data to be read and + // written to a socket. + // + diff --git a/debian/patches/0991_fix-hr-typos.full.patch b/debian/patches/0991_fix-hr-typos.full.patch new file mode 100644 index 000000000..3836adf55 --- /dev/null +++ b/debian/patches/0991_fix-hr-typos.full.patch @@ -0,0 +1,36 @@ +Description: Fix several typos in nx-X11 +Author: Mike Gabriel + +--- a/nx-X11/extras/Mesa/src/mesa/main/debug.c ++++ b/nx-X11/extras/Mesa/src/mesa/main/debug.c +@@ -43,7 +43,7 @@ + "GL_QUAD_STRIP", + "GL_POLYGON", + "outside begin/end", +- "inside unkown primitive", ++ "inside unknown primitive", + "unknown state" + }; + +--- a/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c ++++ b/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c +@@ -4106,7 +4106,7 @@ + if (*inst++ != REVISION) { + _mesa_set_program_error (ctx, 0, "Grammar version mismatch"); + _mesa_error(ctx, GL_INVALID_OPERATION, +- "glProgramStringARB(Grammar verison mismatch)"); ++ "glProgramStringARB(Grammar version mismatch)"); + err = GL_TRUE; + } + else { +--- a/nx-X11/ChangeLog.X.org ++++ b/nx-X11/ChangeLog.X.org +@@ -12733,7 +12733,7 @@ + * programs/xkill/xkill.c: (get_window_id): + Changed cursor for the 'kill' action from XC_draped_box to + XC_Pirate. If you don't like it we can change it back +- (original author unkown). ++ (original author unknown). + + * programs/xman/vendor.h: + Added 'pic' to the man page rendering command pipeline diff --git a/debian/patches/0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch b/debian/patches/0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch new file mode 100644 index 000000000..62c85cfb2 --- /dev/null +++ b/debian/patches/0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch @@ -0,0 +1,367 @@ +Description: Unbrand NX Agent Startup Screen / Brand X2Go Agent Startup Screen + When launched with NX Agent flavour, the startup screen gets unbranded by + this patch (the !M logo does not get shown). + . + When launched with X2Go Agent flavour, the startup screen gets branded + with the X2GO logo. +Forwarded: not-needed +Author: Oleksandr Shneyder +Last-Update: 2012-01-11 +--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c +@@ -35,6 +35,7 @@ + #include "Windows.h" + #include "Atoms.h" + #include "Trap.h" ++#include "Init.h" + + /* + * Set here the required log level. +@@ -53,6 +54,7 @@ + int nxagentLogoWhite; + int nxagentLogoRed; + int nxagentLogoBlack; ++int nxagentLogoGray; + + void nxagentPaintLogo(Window win, GC gc, int scale, int width, int height); + +@@ -166,6 +168,15 @@ + XPoint m[12]; + int w, h, c, w2, h2; + ++ /* ++ * Show only X2GO Logo when running as X2Go Agent ++ */ ++ if(! nxagentX2go) ++ { ++ nxagentPixmapLogo = 0L; ++ return; ++ } ++ + #ifdef DEBUG + fprintf(stderr, "nxagenShowtLogo: Got called.\n"); + #endif +@@ -218,75 +229,146 @@ + XSetForeground(nxagentDisplay, gc, nxagentLogoRed); + XSetBackground(nxagentDisplay, gc, nxagentLogoWhite); + +- rect[0].x = w2-10*c; rect[0].y = h2-8*c; +- rect[1].x = w2-10*c; rect[1].y = h2+8*c; +- rect[2].x = w2+10*c; rect[2].y = h2+8*c; +- rect[3].x = w2+10*c; rect[3].y = h2-8*c; ++ /* ++ * Draw X2GO Logo ++ */ + ++ /* ++ * Begin 'X'. ++ */ ++ ++ XSetForeground(nxagentDisplay, gc, nxagentLogoGray); ++ XSetBackground(nxagentDisplay, gc, nxagentLogoWhite); ++ rect[0].x = w2-7*c; rect[0].y = h2-5*c; ++ rect[1].x = w2-8*c; rect[1].y = h2-5*c; ++ rect[2].x = w2-4*c; rect[2].y = h2+3*c; ++ rect[3].x = w2-3*c; rect[3].y = h2+3*c; + XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + +- #ifdef NXAGENT_LOGO_DEBUG +- fprintf(stderr, "filled red rect\n"); +- #endif ++ rect[0].x = w2-4*c; rect[0].y = h2-5*c; ++ rect[1].x = w2-3*c; rect[1].y = h2-5*c; ++ rect[2].x = w2-7*c; rect[2].y = h2+3*c; ++ rect[3].x = w2-8*c; rect[3].y = h2+3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + +- rect[0].x = w2-9*c; rect[0].y = h2-7*c; +- rect[1].x = w2-9*c; rect[1].y = h2+7*c; +- rect[2].x = w2+9*c; rect[2].y = h2+7*c; +- rect[3].x = w2+9*c; rect[3].y = h2-7*c; ++ /* ++ * End 'X'. ++ */ + +- XSetForeground(nxagentDisplay, gc, nxagentLogoWhite); +- XSetBackground(nxagentDisplay, gc, nxagentLogoRed); ++ /* ++ * Start '2'. ++ */ ++ ++ rect[0].x = w2-2*c; rect[0].y = h2-5*c; ++ rect[1].x = w2-1*c; rect[1].y = h2-5*c; ++ rect[2].x = w2-1*c; rect[2].y = h2-3*c; ++ rect[3].x = w2-2*c; rect[3].y = h2-3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); ++ ++ rect[0].x = w2-2*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+2*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+2*c; rect[2].y = h2-4*c; ++ rect[3].x = w2-2*c; rect[3].y = h2-4*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + ++ rect[0].x = w2+1*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+2*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+2*c; rect[2].y = h2-2*c; ++ rect[3].x = w2+1*c; rect[3].y = h2-2*c; + XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + ++ rect[0].x = w2+2*c; rect[0].y = h2-2*c; ++ rect[1].x = w2+1*c; rect[1].y = h2-2*c; ++ rect[2].x = w2-2*c; rect[2].y = h2+2*c; ++ rect[3].x = w2-1*c; rect[3].y = h2+2*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); ++ ++ ++ rect[0].x = w2-2*c; rect[0].y = h2+2*c; ++ rect[1].x = w2+2*c; rect[1].y = h2+2*c; ++ rect[2].x = w2+2*c; rect[2].y = h2+3*c; ++ rect[3].x = w2-2*c; rect[3].y = h2+3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + /* +- * Begin 'M'. ++ * End '2'. + */ + +- m[0].x = w2-3*c; m[0].y = h2-5*c; +- m[1].x = w2+7*c; m[1].y = h2-5*c; +- m[2].x = w2+7*c; m[2].y = h2+5*c; +- m[3].x = w2+5*c; m[3].y = h2+5*c; +- m[4].x = w2+5*c; m[4].y = h2-3*c; +- m[5].x = w2+3*c; m[5].y = h2-3*c; +- m[6].x = w2+3*c; m[6].y = h2+5*c; +- m[7].x = w2+1*c; m[7].y = h2+5*c; +- m[8].x = w2+1*c; m[8].y = h2-3*c; +- m[9].x = w2-1*c; m[9].y = h2-3*c; +- m[10].x = w2-1*c; m[10].y = h2+5*c; +- m[11].x = w2-3*c; m[11].y = h2+5*c; ++ /* ++ * Start 'G'. ++ */ + +- XSetForeground(nxagentDisplay, gc, nxagentLogoRed); +- XSetBackground(nxagentDisplay, gc, nxagentLogoWhite); ++ rect[0].x = w2+3*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+7*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+7*c; rect[2].y = h2-4*c; ++ rect[3].x = w2+3*c; rect[3].y = h2-4*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + +- XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, m, 12, Nonconvex, CoordModeOrigin); ++ rect[0].x = w2+3*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+4*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+4*c; rect[2].y = h2+3*c; ++ rect[3].x = w2+3*c; rect[3].y = h2+3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + ++ rect[0].x = w2+3*c; rect[0].y = h2+2*c; ++ rect[1].x = w2+7*c; rect[1].y = h2+2*c; ++ rect[2].x = w2+7*c; rect[2].y = h2+3*c; ++ rect[3].x = w2+3*c; rect[3].y = h2+3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); ++ ++ rect[0].x = w2+6*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+7*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+7*c; rect[2].y = h2-3*c; ++ rect[3].x = w2+6*c; rect[3].y = h2-3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); ++ ++ rect[0].x = w2+6*c; rect[0].y = h2-0*c; ++ rect[1].x = w2+7*c; rect[1].y = h2-0*c; ++ rect[2].x = w2+7*c; rect[2].y = h2+3*c; ++ rect[3].x = w2+6*c; rect[3].y = h2+3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); ++ ++ rect[0].x = w2+5*c; rect[0].y = h2-1*c; ++ rect[1].x = w2+7*c; rect[1].y = h2-1*c; ++ rect[2].x = w2+7*c; rect[2].y = h2+0*c; ++ rect[3].x = w2+5*c; rect[3].y = h2+0*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + /* +- * End 'M'. ++ * End 'G'. + */ + + /* +- * Begin '!'. ++ * Start 'O'. + */ + +- rect[0].x = w2-7*c; rect[0].y = h2-5*c; +- rect[1].x = w2-5*c; rect[1].y = h2-5*c; +- rect[2].x = w2-5*c; rect[2].y = h2+2*c; +- rect[3].x = w2-7*c; rect[3].y = h2+2*c; ++ rect[0].x = w2+8*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+12*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+12*c; rect[2].y = h2-4*c; ++ rect[3].x = w2+8*c; rect[3].y = h2-4*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + ++ rect[0].x = w2+8*c; rect[0].y = h2+3*c; ++ rect[1].x = w2+12*c; rect[1].y = h2+3*c; ++ rect[2].x = w2+12*c; rect[2].y = h2+2*c; ++ rect[3].x = w2+8*c; rect[3].y = h2+2*c; + XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + +- rect[0].x = w2-7*c; rect[0].y = h2+3*c; +- rect[1].x = w2-5*c; rect[1].y = h2+3*c; +- rect[2].x = w2-5*c; rect[2].y = h2+5*c; +- rect[3].x = w2-7*c; rect[3].y = h2+5*c; ++ rect[0].x = w2+8*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+9*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+9*c; rect[2].y = h2+3*c; ++ rect[3].x = w2+8*c; rect[3].y = h2+3*c; ++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + ++ rect[0].x = w2+11*c; rect[0].y = h2-5*c; ++ rect[1].x = w2+12*c; rect[1].y = h2-5*c; ++ rect[2].x = w2+12*c; rect[2].y = h2+3*c; ++ rect[3].x = w2+11*c; rect[3].y = h2+3*c; + XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); + + /* +- * End 'M'. ++ * End 'O'. + */ + ++ + XSetWindowBackgroundPixmap(nxagentDisplay, win, nxagentPixmapLogo); + + #ifdef NXAGENT_LOGO_DEBUG +--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c +@@ -1430,22 +1430,10 @@ + g = pV.green_mask; + b = pV.blue_mask; + +- if (!pV.red_mask || !pV.green_mask || !pV.blue_mask) +- { +- nxagentLogoBlack = 0x000000; +- nxagentLogoRed = 0xff0000; +- nxagentLogoWhite = 0xffffff; +- } +- else +- { +- for (or=0, off=0x800000; (r&(off>>or)) == 0; or++); +- for (og=0, off=0x800000; (g&(off>>og)) == 0; og++); +- for (ob=0, off=0x800000; (b&(off>>ob)) == 0; ob++); +- +- nxagentLogoRed = nxagentLogoColor(0xff0000); +- nxagentLogoBlack = nxagentLogoColor(0x000000); +- nxagentLogoWhite = 0xffffff; +- } ++ nxagentLogoBlack = 0x000000; ++ nxagentLogoRed = 0xff0000; ++ nxagentLogoWhite = 0xffffff; ++ nxagentLogoGray = 0x222222; + + #ifdef WATCH + +@@ -2696,22 +2684,10 @@ + g = pV.green_mask; + b = pV.blue_mask; + +- if (!pV.red_mask || !pV.green_mask || !pV.blue_mask) +- { +- nxagentLogoBlack = 0x000000; +- nxagentLogoRed = 0xff0000; +- nxagentLogoWhite = 0xffffff; +- } +- else +- { +- for (or=0, off=0x800000; (r&(off>>or)) == 0; or++); +- for (og=0, off=0x800000; (g&(off>>og)) == 0; og++); +- for (ob=0, off=0x800000; (b&(off>>ob)) == 0; ob++); +- +- nxagentLogoRed = nxagentLogoColor(0xff0000); +- nxagentLogoBlack = nxagentLogoColor(0x000000); +- nxagentLogoWhite = 0xffffff; +- } ++ nxagentLogoBlack = 0x000000; ++ nxagentLogoRed = 0xff0000; ++ nxagentLogoWhite = 0xffffff; ++ nxagentLogoGray = 0x222222; + + useXpmIcon = nxagentMakeIcon(nxagentDisplay, &nxagentIconPixmap, &nxagentIconShape); + +--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.h ++++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.h +@@ -33,6 +33,7 @@ + extern int nxagentLogoWhite; + extern int nxagentLogoRed; + extern int nxagentLogoBlack; ++extern int nxagentLogoGray; + + extern Window nxagentSplashWindow; + +--- a/nx-X11/programs/Xserver/os/oscolor.c ++++ b/nx-X11/programs/Xserver/os/oscolor.c +@@ -53,7 +53,19 @@ + #include + #include + +-static char* nxAltRgbPaths[] = {"/etc/nxagent/rgb", "/usr/share/nx/rgb", "/usr/local/share/nx/rgb", "/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; ++/* FIXME: we need more intelligent code (like provided by the nxagentX2go ++ * var in hw/nxagent/Init.h) to detect our current runtime mode (running ++ * as x2goagent, running as nxagent) ++ */ ++static char* nxAltRgbPaths[] = {"/etc/x2go/rgb", \ ++ "/usr/share/x2go/rgb", \ ++ "/usr/local/share/x2go/rgb", \ ++ "/etc/nxagent/rgb", \ ++ "/usr/share/nx/rgb", \ ++ "/usr/local/share/nx/rgb", \ ++ "/usr/NX/share/rgb", \ ++ "/usr/share/X11/rgb", \ ++ "/etc/X11/rgb"}; + static char _NXRgbPath[1024]; + + #endif +--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +@@ -62,6 +62,7 @@ + + #include "globals.h" + #include "property.h" ++#include "Init.h" + + #include + +@@ -138,8 +139,11 @@ + #ifndef XKB_ALTERNATE_BASE_DIRECTORY + #define XKB_ALTERNATE_BASE_DIRECTORY "/usr/X11R6/lib/X11/xkb" + #endif +-#ifndef XKB_CONFIG_FILE +-#define XKB_CONFIG_FILE "/etc/nxagent/nxagent.keyboard" ++#ifndef XKB_CONFIG_FILE_NX ++#define XKB_CONFIG_FILE_NX "/etc/nxagent/nxagent.keyboard" ++#endif ++#ifndef XKB_CONFIG_FILE_X2GO ++#define XKB_CONFIG_FILE_X2GO "/etc/x2go/x2goagent.keyboard" + #endif + #ifndef XKB_DFLT_RULES_FILE + #define XKB_DFLT_RULES_FILE "xfree86" +@@ -988,7 +992,10 @@ + + XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); + +- nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE); ++ if (nxagentX2go) ++ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); ++ else ++ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); + + nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char)); + +@@ -997,7 +1004,10 @@ + FatalError("nxagentKeyboardProc: malloc failed."); + } + +- strcpy(nxagentXkbConfigFilePath, XKB_CONFIG_FILE); ++ if (nxagentX2go) ++ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); ++ else ++ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); + + #ifdef TEST + fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n", diff --git a/debian/patches/101_nxagent_set-rgb-path.full.patch b/debian/patches/101_nxagent_set-rgb-path.full.patch deleted file mode 100644 index 9d20bee24..000000000 --- a/debian/patches/101_nxagent_set-rgb-path.full.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: FHS path fix for rgb file - This patch is needed on Debian only, not reporting this path - addition to upstream. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-01-12 ---- a/nx-X11/programs/Xserver/os/oscolor.c -+++ b/nx-X11/programs/Xserver/os/oscolor.c -@@ -53,7 +53,7 @@ - #include - #include - --static char* nxAltRgbPaths[] = {"/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; -+static char* nxAltRgbPaths[] = {"/etc/nxagent/rgb", "/usr/share/nx/rgb", "/usr/local/share/nx/rgb", "/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; - static char _NXRgbPath[1024]; - - #endif diff --git a/debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch b/debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch deleted file mode 100644 index 0d11f2f0a..000000000 --- a/debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: FHS path fix for SecurityPolicy file - This patch is needed on Debian only, not reporting this path - change to upstream. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-01-12 ---- a/nx-X11/programs/Xserver/Xext/security.c -+++ b/nx-X11/programs/Xserver/Xext/security.c -@@ -86,7 +86,7 @@ - - #ifdef NXAGENT_SERVER - --#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" -+#define NX_ALTERNATIVEPOLICYFILE "/usr/share/nx/SecurityPolicy" - - #endif - diff --git a/debian/patches/102_xserver-xext_set-securitypolicy-path.full.patch b/debian/patches/102_xserver-xext_set-securitypolicy-path.full.patch deleted file mode 100644 index 9d27a372f..000000000 --- a/debian/patches/102_xserver-xext_set-securitypolicy-path.full.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: FHS path fix for SecurityPolicy file - This patch is needed for Tarball installation mode of NX (redistributed) - only, not reporting this path change to upstream. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-01-12 ---- a/nx-X11/programs/Xserver/Xext/security.c -+++ b/nx-X11/programs/Xserver/Xext/security.c -@@ -86,7 +86,7 @@ - - #ifdef NXAGENT_SERVER - --#define NX_ALTERNATIVEPOLICYFILE "/usr/lib/xserver/SecurityPolicy" -+#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" - - #endif - diff --git a/debian/patches/103_nxagent_set-X0-config-path.full.patch b/debian/patches/103_nxagent_set-X0-config-path.full.patch deleted file mode 100644 index eb705ca81..000000000 --- a/debian/patches/103_nxagent_set-X0-config-path.full.patch +++ /dev/null @@ -1,40 +0,0 @@ -Description: FHS path fix for keyboard config file - This patch is needed for Tarball installation and on Distros like - Debian, not reporting this path addition to upstream. - . - Originally contributed by FreeNX Team. -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c -@@ -136,7 +136,7 @@ - #define XKB_ALTERNATE_BASE_DIRECTORY "/usr/X11R6/lib/X11/xkb" - #endif - #ifndef XKB_CONFIG_FILE --#define XKB_CONFIG_FILE "X0-config.keyboard" -+#define XKB_CONFIG_FILE "/etc/nxagent/nxagent.keyboard" - #endif - #ifndef XKB_DFLT_RULES_FILE - #define XKB_DFLT_RULES_FILE "xfree86" -@@ -985,8 +985,7 @@ - - XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); - -- nxagentXkbConfigFilePathSize = strlen(XkbBaseDirectory) + -- strlen(XKB_CONFIG_FILE) + 1; -+ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE); - - nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char)); - -@@ -995,9 +994,7 @@ - FatalError("nxagentKeyboardProc: malloc failed."); - } - -- strcpy(nxagentXkbConfigFilePath, XkbBaseDirectory); -- strcat(nxagentXkbConfigFilePath, "/"); -- strcat(nxagentXkbConfigFilePath, XKB_CONFIG_FILE); -+ strcpy(nxagentXkbConfigFilePath, XKB_CONFIG_FILE); - - #ifdef TEST - fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n", diff --git a/debian/patches/105_nxagent_export-remote-keyboard-config.full.patch b/debian/patches/105_nxagent_export-remote-keyboard-config.full.patch deleted file mode 100644 index 389feaf92..000000000 --- a/debian/patches/105_nxagent_export-remote-keyboard-config.full.patch +++ /dev/null @@ -1,96 +0,0 @@ -Description: Export remote keyboard configuration to session directory - Let nxagent write the keyboard configuration to /keyboard - and make it available within the NX session. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: pending... -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/hw/nxagent/Error.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c -@@ -497,7 +497,7 @@ - return rootPath; - } - --char *nxagentGetSessionPath() -+char *nxagentGetSessionPath(void) - { - - char *rootPath; ---- a/nx-X11/programs/Xserver/hw/nxagent/Error.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h -@@ -34,4 +34,6 @@ - - void nxagentEndRedirectToClientsLog(void); - -+char *nxagentGetSessionPath(void); -+ - #endif /* __Error_H__ */ ---- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c -@@ -52,6 +52,7 @@ - #include "Keyboard.h" - #include "Events.h" - #include "Options.h" -+#include "Error.h" - - #include "NXlib.h" - -@@ -72,6 +73,8 @@ - - #include "Xatom.h" - -+#include -+ - static int nxagentXkbGetNames(char **rules, char **model, char **layout, - char **variant, char **options); - -@@ -1790,6 +1793,48 @@ - } - #endif - -+ if (drulesLen != 0) -+ { -+ char *sessionpath = nxagentGetSessionPath(); -+ if (sessionpath != NULL){ -+ int keyboard_file_path_size = strlen(sessionpath) + strlen("/keyboard"); -+ char *keyboard_file_path = malloc((keyboard_file_path_size + 1) * sizeof(char)); -+ FILE *keyboard_file; -+ if ( keyboard_file_path == NULL) -+ { -+ FatalError("nxagentKeyboardProc: malloc failed."); -+ } -+ strcpy(keyboard_file_path, sessionpath); -+ strcat(keyboard_file_path, "/keyboard"); -+ if ((keyboard_file = fopen(keyboard_file_path, "w")) != NULL) { -+ if ( drules != NULL ) -+ fprintf(keyboard_file, "rules=%s\n", drules); -+ if ( dmodel != NULL ) -+ fprintf(keyboard_file, "model=%s\n", dmodel); -+ if ( dlayout != NULL ) -+ fprintf(keyboard_file, "layout=%s\n", dlayout); -+ if ( dvariant != NULL ) -+ fprintf(keyboard_file, "variant=%s\n", dvariant); -+ if ( doptions != NULL ) -+ fprintf(keyboard_file, "options=%s\n", doptions); -+ fclose(keyboard_file); -+ fprintf(stderr, "keyboard file created\n"); -+ } -+ else { -+ int save_err = errno; -+ fprintf(stderr, "keyboard file not created: %s\n", strerror(save_err)); -+ } -+ free(keyboard_file_path); -+ } -+ else { -+ fprintf(stderr, "SessionPath not defined\n"); -+ } -+ } -+ else -+ { -+ fprintf(stderr, "Failed to create the keyboard file\n"); -+ } -+ - if (nxagentOption(ClientOs) == ClientOsLinux && - drules != NULL && dmodel != NULL && - (strcmp(drules, "evdev") == 0 || diff --git a/debian/patches/106_nxagent_utf8-copy-clipboard.full.patch b/debian/patches/106_nxagent_utf8-copy-clipboard.full.patch deleted file mode 100644 index 9c0a047d6..000000000 --- a/debian/patches/106_nxagent_utf8-copy-clipboard.full.patch +++ /dev/null @@ -1,52 +0,0 @@ -Description: UTF-8 Clipboard copying - Enable UTF-8 clipboard copies. - . - Originally contributed by FreeNX Team (dimbor). -Forwarded: not-yet -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c -@@ -166,7 +166,9 @@ - - if (target == XA_STRING) return True; - if (target == serverTEXT) return True; -- -+ /* by dimbor */ -+ if (target == serverUTF8_STRING) return True; -+ - return False; - } - -@@ -402,7 +404,12 @@ - lastServerProperty = X->xselectionrequest.property; - lastServerRequestor = X->xselectionrequest.requestor; - lastServerTarget = X->xselectionrequest.target; -- lastServerTime = X->xselectionrequest.time; -+ -+ /* by dimbor */ -+ if (lastServerTarget != XA_STRING) -+ lastServerTarget = serverUTF8_STRING; -+ -+ lastServerTime = X->xselectionrequest.time; - - x.u.u.type = SelectionRequest; - x.u.selectionRequest.time = GetTimeInMillis(); -@@ -424,11 +431,12 @@ - - x.u.selectionRequest.selection = CurrentSelections[i].selection; - -- /* -- * x.u.selectionRequest.target = X->xselectionrequest.target; -- */ -- -- x.u.selectionRequest.target = XA_STRING; -+ /* by dimbor (idea from zahvatov) */ -+ if (X->xselectionrequest.target != XA_STRING) -+ x.u.selectionRequest.target = clientUTF8_STRING; -+ else -+ x.u.selectionRequest.target = XA_STRING; -+ - x.u.selectionRequest.property = clientCutProperty; - - (void) TryClientEvents(lastSelectionOwner[i].client, &x, 1, diff --git a/debian/patches/107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch b/debian/patches/107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch deleted file mode 100644 index 129cb707e..000000000 --- a/debian/patches/107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch +++ /dev/null @@ -1,47 +0,0 @@ -Description: Prevent sending COMPOUND_TEXT - Do not send COMPOUND_TEXT to client. - . - Originally contributed by FreeNX Team (dimbor). -Forwarded: not-yet -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c -@@ -1226,10 +1226,11 @@ - Atom xa_STRING[4]; - xEvent x; - -+ /* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */ - xa_STRING[0] = XA_STRING; -- xa_STRING[1] = clientTEXT; -- xa_STRING[2] = clientCOMPOUND_TEXT; -- xa_STRING[3] = clientUTF8_STRING; -+ xa_STRING[1] = clientUTF8_STRING; -+ xa_STRING[2] = clientTEXT; -+ xa_STRING[3] = clientCOMPOUND_TEXT; - - ChangeWindowProperty(pWin, - property, ---- a/nx-X11/programs/Xserver/hw/nxagent/Image.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c -@@ -644,6 +644,10 @@ - pDrawable -> depth != 1 && - nxagentOption(DeferLevel) >= 1) - { -+ /* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/ -+ if (dstHeight > 16) -+ { -+ /* -------------------------------------------------------------------------------- */ - #ifdef TEST - fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] " - "for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1, -@@ -654,6 +658,9 @@ - nxagentMarkCorruptedRegion(pDrawable, pRegion); - - goto nxagentPutImageEnd; -+ /* --- changed by dimbor ---*/ -+ } -+ /* ------------------------- */ - } - - if (pDrawable -> type == DRAWABLE_WINDOW && diff --git a/debian/patches/108_nxagent_wine-close-delay.full.patch b/debian/patches/108_nxagent_wine-close-delay.full.patch deleted file mode 100644 index 7a9c18cf2..000000000 --- a/debian/patches/108_nxagent_wine-close-delay.full.patch +++ /dev/null @@ -1,60 +0,0 @@ -Description: Wine Close Delay - Wine close delay. - . - Originally contributed by FreeNX Team (dimbor). -Forwarded: not-yet -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/hw/nxagent/Window.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c -@@ -176,6 +176,14 @@ - - static int nxagentForceExposure(WindowPtr pWin, pointer ptr); - -+/* by dimbor */ -+typedef struct -+{ -+ CARD32 state; -+ Window icon; -+} -+nxagentWMStateRec; -+ - /* - * This is currently unused. - */ -@@ -1861,6 +1869,17 @@ - nxagentAddConfiguredWindow(pWin, CWStackingOrder); - nxagentAddConfiguredWindow(pWin, CW_Shape); - -+ /* add by dimbor */ -+ if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) -+ { -+ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True); -+ nxagentWMStateRec wmState; -+ wmState.state = 1; /* NormalState */ -+ wmState.icon = None; -+ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success) -+ fprintf(stderr, "nxagentRealizeWindow: Additing WM_STATE fail.\n"); -+ } -+ - #ifdef SHAPE - - /* -@@ -1907,6 +1926,17 @@ - return True; - } - -+ /* add by dimbor */ -+ if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) -+ { -+ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True); -+ nxagentWMStateRec wmState; -+ wmState.state = 3; /* WithdrawnState */ -+ wmState.icon = None; -+ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success) -+ fprintf(stderr, "nxagentUnRealizeWindow: Changing WM_STATE failed.\n"); -+ } -+ - XUnmapWindow(nxagentDisplay, nxagentWindow(pWin)); - - return True; diff --git a/debian/patches/110_nxagent_createpixmap-bounds-check.full.patch b/debian/patches/110_nxagent_createpixmap-bounds-check.full.patch deleted file mode 100644 index d65862bdc..000000000 --- a/debian/patches/110_nxagent_createpixmap-bounds-check.full.patch +++ /dev/null @@ -1,44 +0,0 @@ -Description: Avoid large pixmaps - It is allowed to try and allocate a pixmap which is larger than - 32767 in either dimension. However, all of the framebuffer code - is buggy and does not reliably draw to such big pixmaps, basically - because the Region data structure operates with signed shorts - for the rectangles in it. - . - Furthermore, several places in the X server computes the - size in bytes of the pixmap and tries to store it in an - integer. This integer can overflow and cause the allocated size - to be much smaller. - . - So, such big pixmaps are rejected here with a BadAlloc - . - Originally contributed by FreeNX Team -Forwarded: pending... -Author: Mike Gabriel -Last-Update: 2011-12-31 ---- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c -@@ -1973,6 +1973,23 @@ - client->errorValue = 0; - return BadValue; - } -+ if (stuff->width > 32767 || stuff->height > 32767) -+ { -+ /* It is allowed to try and allocate a pixmap which is larger than -+ * 32767 in either dimension. However, all of the framebuffer code -+ * is buggy and does not reliably draw to such big pixmaps, basically -+ * because the Region data structure operates with signed shorts -+ * for the rectangles in it. -+ * -+ * Furthermore, several places in the X server computes the -+ * size in bytes of the pixmap and tries to store it in an -+ * integer. This integer can overflow and cause the allocated size -+ * to be much smaller. -+ * -+ * So, such big pixmaps are rejected here with a BadAlloc -+ */ -+ return BadAlloc; -+ } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; diff --git a/debian/patches/200_nxagent_check-binary-x2go-flavour.full.patch b/debian/patches/200_nxagent_check-binary-x2go-flavour.full.patch deleted file mode 100644 index c69202088..000000000 --- a/debian/patches/200_nxagent_check-binary-x2go-flavour.full.patch +++ /dev/null @@ -1,64 +0,0 @@ -Description: Detect nxagent/x2goagent flavour - Whether the agent runs in X2Go or NX mode is decide by the - name of the binary that executes the code. - . - Binary name equal to nxagent -> (Free)NX flavour - Binary name equal to x2goagent -> X2Go flavour -Forwarded: not-needed -Author: Oleksandr Shneyder -Last-Update: 2012-01-11 ---- a/nx-X11/programs/Xserver/hw/nxagent/Init.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c -@@ -177,6 +177,29 @@ - - int nxagentDoFullGeneration = 1; - -+ /* -+ * 1 if agent running as X2goAgent -+ * 0 if NX Agent -+ */ -+int nxagentX2go; -+ -+/* -+ * Checking if agent is x2go agent -+ */ -+ -+void checkX2goAgent() -+{ -+ extern const char *__progname; -+ if( strcasecmp(__progname,"x2goagent") == 0) -+ { -+ fprintf(stderr, "\nrunning as X2Go Agent\n"); -+ nxagentX2go=1; -+ } -+ else -+ nxagentX2go=0; -+} -+ -+ - /* - * Called at X server's initialization. - */ -@@ -193,6 +216,11 @@ - #endif - - /* -+ * Check if we running as X2Go Agent -+ */ -+ checkX2goAgent(); -+ -+ /* - * Print our pid and version information. - */ - ---- a/nx-X11/programs/Xserver/hw/nxagent/Init.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h -@@ -37,6 +37,8 @@ - extern int nxagentBackingStore; - extern int nxagentSaveUnder; - -+extern int nxagentX2go; -+ - extern ServerGrabInfoRec nxagentGrabServerInfo; - - #endif /* __Init_H__ */ diff --git a/debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch b/debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch deleted file mode 100644 index 48e4c4a4b..000000000 --- a/debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch +++ /dev/null @@ -1,219 +0,0 @@ -Description: X2Go icon when run with x2goagent flavour - Depending on the binary name of the agent either nxagent.xpm - or x2go.xpm is used as window icon. -Forwarded: not-needed -Author: Oleksandr Shneyder -Last-Update: 2012-01-11 ---- a/nx-X11/programs/Xserver/hw/nxagent/Display.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c -@@ -77,6 +77,7 @@ - #include "NXlib.h" - - #include NXAGENT_ICON_NAME -+#include X2GOAGENT_ICON_NAME - - /* - * Set here the required log level. -@@ -1941,12 +1942,29 @@ - Bool success = False; - XlibPixmap IconPixmap; - XlibPixmap IconShape; -+ char* agent_icon_name; -+ char* agentIconData; - -- snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", NXAGENT_ICON_NAME); -+ /* -+ * selecting x2go icon when running as X2Go agent -+ */ -+ if(nxagentX2go) -+ { -+ agent_icon_name=X2GOAGENT_ICON_NAME; -+ agentIconData=x2goagentIconData; -+ } -+ else -+ { -+ agent_icon_name=NXAGENT_ICON_NAME; -+ agentIconData=nxagentIconData; -+ } -+ -+ -+ snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", agent_icon_name); - - if ((icon_fp = fopen(default_path, "r")) == NULL) - { -- icon_fp = nxagentLookForIconFile(NXAGENT_ICON_NAME, "r", icon_path); -+ icon_fp = nxagentLookForIconFile(agent_icon_name, "r", icon_path); - - if (icon_fp != NULL) - { -@@ -1985,7 +2003,7 @@ - { - status = XpmCreatePixmapFromData(display, - DefaultRootWindow(display), -- nxagentIconData, -+ agentIconData, - &IconPixmap, - &IconShape, - NULL); ---- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h -@@ -24,6 +24,8 @@ - - #define NXAGENT_ICON_NAME "nxagent.xpm" - -+#define X2GOAGENT_ICON_NAME "x2go.xpm" -+ - #define NXAGENT_PLACEHOLDER_NAME "nxmissing.xpm" - - #endif /* __Icons_H__ */ ---- /dev/null -+++ b/nx-X11/programs/Xserver/hw/nxagent/x2go.xpm -@@ -0,0 +1,148 @@ -+/* XPM */ -+static char *x2goagentIconData[]={ -+"128 128 17 1", -+". c None", -+"m c #323232", -+"l c #323232", -+"f c #323232", -+"e c #323232", -+"o c #323232", -+"# c #323232", -+"h c #323232", -+"i c #323232", -+"n c #323232", -+"d c #323232", -+"a c #323232", -+"g c #323232", -+"j c #323232", -+"b c #323232", -+"k c #323232", -+"c c #323232", -+".....#abccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbde.....", -+"...fbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccgf...", -+"..#ccccaheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeijccckf..", -+".ecccgl..................................................................................................................ejcckf.", -+".bccd.....................................................................................................................mdccg.", -+"#cca.......................................................................................................................mjcce", -+"gckm........................................................................................................................eccd", -+"ccn..........................................................................................................................jcb", -+"cce..........................................................................................................................icc", -+"ccm..........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc............................................meeee..........................................................................ecc", -+"cc.........eeeeeeeeoiiiiiiiinggggggggjccccccccccccc....#ggggggggggggggggggggggggggggf.............ggggggggggggggggggggggf....ecc", -+"cc....meeeeoiiiiiiiinggggggggjccccccccccccccccccccc....icccccccccccccccccccccccccccce.............cccccccccccccccccccccce....ecc", -+"cc....................................meeeeeeeeoiii....icccccccccccccccccccccccccccce.............cccccccccccccccccccccce....ecc", -+"cc.......................................................menbccccccccccccccccccbhe..................logccccccccccccghe.......ecc", -+"cc...........................................................iccccccccccccccccdm.......................#cccccccccke..........ecc", -+"cc..............................................lee...........#cccccccccccccckm.........................jccccccckm...........ecc", -+"cc........feeeeeeeeoiiiiiiiiiaggggggggjcccccccccccc............icccccccccccccd..........................icccccccf............ecc", -+"cc....meeeeeoiiiiiiiinggggggggjcccccccccccccccccccciiiiii#m.....jcccccccccccci..........................icccccci.............ecc", -+"cc......................................eeeeeeeeeiiiiiiiiigl....eccccccccccccd..........................dcccccj..............ecc", -+"cc...............................................................dcccccccccccj..........................bccccce..............ecc", -+"cc...............................................................lccccccccccccl........................lccccca...............ecc", -+"cc.............................................meeeeeeee#iiiie....dccccccccccch........................icccccl...............ecc", -+"cc.........meeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccb....ecccccccccccb........................bccccn................ecc", -+"cc....meeeeiiiiiiiiiaggggggggbcccccccccccccccccccccccccccccccc#....gccccccccccco......................#cccckm................ecc", -+"cc....................................meeeeeeeeeiiiiiiiiiaggggd....#cccccccccccg......................bcccci.................ecc", -+"cc..................................................................bcccccccccccf....................#cccckm.................ecc", -+"cc..................................................................hcccccccccccd...................mkcccci..................ecc", -+"cc............................................meeeeeeeeoiiiiiiiil...mkcccccccccccl..................icccckm..................ecc", -+"cc.........eeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccccccn....dccccccccccci.................mkcccci...................ecc", -+"cc....meeeeeiiiiiiiiiaggggggggbccccccccccccccccccccccccccccccccckm...lccccccccccck.................icccckm...................ecc", -+"cc.....................................leeeeeeeeoiiiiiiiiigggggggo....accccccccccc#...............mkcccch....................ecc", -+"cc....................................................................ecccccccccccb...............iccccb.....................ecc", -+"cc.....................................................................jccccccccccce.............mkcccc#.....................ecc", -+"cc.............................................meeeeeeeeehiiiiiiii#....#ccccccccccca.............nccccb......................ecc", -+"cc........feeeeeeee#iiiiiiiiigggggggggkccccccccccccccccccccccccccccl....kcccccccccccl...........lccccc#......................ecc", -+"cc....meeeeeoiiiiiiiiigggggggggkcccccccccccccccccccccccccccccccccccd....icccccccccccd...........dccccb.......................ecc", -+"cc......................................leeeeeeeeoiiiiiiiingggggggga....mccccccccccckm.........lccccc#.......................ecc", -+"cc.......................................................................dccccccccccch.........dccccb........................ecc", -+"cc.......................................................................lcccccccccccb........lccccc#........................ecc", -+"cc.............................................meeeeeeeeoiiiiiiiingggo....gccccccccccc#.......dccccg.........................ecc", -+"cc.........meeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccccccccccg....occcccccccccg......lccccce.........................ecc", -+"cc....meeeeiiiiiiiiiaggggggggbcccccccccccccccccccccccccccccccccccccccce....bccccccccccce.....gccccg..........................ecc", -+"cc....................................meeeeeeeeeiiiiiiiiigggggggggkcccd....#cccccccccccd....eccccce..........................ecc", -+"cc.........................................................................mkcccccccccccl...gccccg...........................ecc", -+"cc..........................................................................nccccccccccci..eccccce...........................ecc", -+"cc............................................meeeeeeeeoiiiiiiiingggggggm...lccccccccccckm.gccccg............................ecc", -+"cc.........eeeeeeeeoiiiiiiiinggggggggjcccccccccccccccccccccccccccccccccc#....dccccccccccc#eccccce............................ecc", -+"cc....meeeeeiiiiiiiiiaggggggggkcccccccccccccccccccccccccccccccccccccccccb....ecccccccccccbgccccg.............................ecc", -+"cc.....................................leeeeeeeeoiiiiiiiiigggggggggkccccco....gccccccccccccccccl.............................ecc", -+"cc............................................................................#cccccccccccccccd..............................ecc", -+"cc.............................................................................bccccccccccccccl..............................ecc", -+"cc.............................................leeeeeeeeeiiiiiiiiiagggggggi....icccccccccccccd...............................ecc", -+"cc........feeeeeeee#iiiiiiiingggggggggkccccccccccccccccccccccccccccccccccckm...mkccccccccccccl...............................ecc", -+"cc....meeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccccccccccci....dccccccccccca................................ecc", -+"cc......................................leeeeeeeeoiiiiiiiiigggggggggccccccck....lccccccccccckm...............................ecc", -+"cc...............................................................................accccccccccc#...............................ecc", -+"cc...............................................................................ecccccccccccb...............................ecc", -+"cc............................................leeeeeeeeeiiiiiiiiiaggggggggbcce....bccccccccccce..............................ecc", -+"cc.......feeeeeeee#iiiiiiiiigggggggggkcccccccccccccccccccccccccccccccccccccccd....#cccccccccccg..............................ecc", -+"cc....meeeeeeoiiiiiiiingggggggggccccccccccccccccccccccccccccccccccccccccccccccl....kcccccccccccl.............................ecc", -+"cc.......................................feeeeeeeehiiiiiiiidggggggggbccccccccci....ncccccccccccd.............................ecc", -+"cc...........................................................................mm....bccccccccccccm............................ecc", -+"cc................................................................................#ccccccccccccci............................ecc", -+"cc..........................................leeeeeeee#iiiiiiiidggggggggbcccccl....bccccccccccccck............................ecc", -+"cc......feeeeeeeehiiiiiiiiaggggggggkccccccccccccccccccccccccccccccccccccccccd....#ccccccccccccccc#...........................ecc", -+"cc....meeeeeee#iiiiiiiidggggggggjcccccccccccccccccccccccccccccccccccccccccccl....bcccccccccccccccb...........................ecc", -+"cc.......................................meeeeeeeeeiiiiiiiiigggggggggkcccccd....#cccccbccccccccccce..........................ecc", -+"cc..............................................................................bccccdhcccccccccccg..........................ecc", -+"cc.............................................................................#ccccclmkcccccccccccl.........................ecc", -+"cc..........................................meeeeeeeeeiiiiiiiiiaggggggggbkm....bccccd..ncccccccccccd.........................ecc", -+"cc.....leeeeeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccccci....hcccckl..lccccccccccccm........................ecc", -+"cc....meeeeeeeehiiiiiiiidggggggggbcccccccccccccccccccccccccccccccccccccckm...mkcccci....dccccccccccci........................ecc", -+"cc........................................leeeeeeee#iiiiiiiinggggggggjcci....icccckm....eccccccccccck........................ecc", -+"cc..........................................................................mkcccci......gccccccccccc#.......................ecc", -+"cc..........................................................................icccckm......#cccccccccccb.......................ecc", -+"cc.........................................leeeeeeeeoiiiiiiiiigggggggga....mkcccci........bccccccccccce......................ecc", -+"cc....meeeeeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccci....icccckm........hcccccccccccg......................ecc", -+"cc.....feeeeeeeehiiiiiiiiaggggggggkcccccccccccccccccccccccccccccccccckm...mkcccci.........mkcccccccccccl.....................ecc", -+"cc.........................................feeeeeeeehiiiiiiiiagggggggh....icccckm..........icccccccccccd.....................ecc", -+"cc.......................................................................mkcccci...........lccccccccccccm....................ecc", -+"cc.......................................................................icccckm............dccccccccccci....................ecc", -+"cc...........................................eeeeeeeeehiiiiiiiidggga....mkcccci.............fccccccccccck....................ecc", -+"cc......feeeeeeee#iiiiiiiingggggggggccccccccccccccccccccccccccccccci....iccccb...............gccccccccccc#...................ecc", -+"cc....meeeeeeeoiiiiiiiiigggggggggbcccccccccccccccccccccccccccccccckm...mkcccc#...............occcccccccccb...................ecc", -+"cc........................................meeeeeeeeeiiiiiiiiidgggg#....iccccb.................bccccccccccce..................ecc", -+"cc....................................................................mkcccc#.................#cccccccccccg..................ecc", -+"cc....................................................................iccccb..................mkcccccccccccl.................ecc", -+"cc..........................................eeeeeeeeeiiiiiiiiiaga....mkcccc#...................icccccccccccd.................ecc", -+"cc.....leeeeeeee#iiiiiiiinggggggggjccccccccccccccccccccccccccccci....iccccb....................lccccccccccccm................ecc", -+"cc....meeeeeeee#iiiiiiiiigggggggggkcccccccccccccccccccccccccccckm...mkcccc#.....................dccccccccccci................ecc", -+"cc.........................................leeeeeeeeoiiiiiiiiiah....iccccb......................lccccccccccck................ecc", -+"cc.................................................................mkcccc#.......................gccccccccccc#...............ecc", -+"cc.................................................................dccccj........................ecccccccccccj...............ecc", -+"cc..........................................leeeeeeeeeiiiiiiih....lccccce.........................bccccccccccce..............ecc", -+"cc....meeeeeeeeeiiiiiiiiidgggggggggcccccccccccccccccccccccccci....dccccg..........................#ccccccccccca..............ecc", -+"cc.....feeeeeeeeiiiiiiiinggggggggbcccccccccccccccccccccccccckm...lccccce...........................kcccccccccccl.............ecc", -+"cc........................................leeeeeeeehiiiiiiiih....dccccg............................ncccccccccccd.............ecc", -+"cc..............................................................lccccce............................fccccccccccccf............ecc", -+"cc..............................................................dccccb..............................jcccccccccccg............ecc", -+"cc.........................................meeeeeeeeoiiiiil....lcccccn..............................icccccccccccce...........ecc", -+"cc......feeeeeeeehiiiiiiiigggggggggccccccccccccccccjgggggo.....gccccc#..............................eccccccccccccbm..........ecc", -+"cc....meeeeeeeoiiiiiiiiidgggggggggccccccccccccccccc...........hcccccco...............................cccccccccccccn..........ecc", -+"cc.........................................leeeeeee..........ecccccccn..............................lcccccccccccccc#.........ecc", -+"cc..........................................................#kccccccckf.............................nccccccccccccccc#........ecc", -+"cc........................................................ldcccccccccck#m.........................lncccccccccccccccccdl......ecc", -+"cc.........................................feeeeeee....ogjcccccccccccccccggi..................oggbcccccccccccccccccccccja....ecc", -+"cc.....leeeeeeee#iiiiiiiidggggggggbcccccccccccccccc....icccccccccccccccccccg..................icccccccccccccccccccccccccc....ecc", -+"cc....meeeeeeeehiiiiiiiiaggggggggkccccccccccccccccc....icccccccccccccccccccg..................icccccccccccccccccccccccccc....ecc", -+"cc........................................feeeeeeee..........................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cc...........................................................................................................................ecc", -+"cce..........................................................................................................................hcc", -+"ccn..........................................................................................................................acb", -+"jcb.........................................................................................................................lcca", -+"hcci........................................................................................................................acc#", -+"mkcc#......................................................................................................................dccb.", -+".occci...................................................................................................................macccf.", -+"..#cccbne.............................................................................................................menkccc#..", -+"...okccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbe...", -+"....mhjccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccg#....."}; diff --git a/debian/patches/202_nx-X11_enable-xinerama.full.patch b/debian/patches/202_nx-X11_enable-xinerama.full.patch deleted file mode 100644 index 6845ec51e..000000000 --- a/debian/patches/202_nx-X11_enable-xinerama.full.patch +++ /dev/null @@ -1,292 +0,0 @@ -Description: Enable Xinerama support for NX - This patch adds Xinerama awareness to NX agent windows. - . - The advantage of Xinerama awareness is that an NX session window - will only maximize to the dimensions of the active physical - display. -Forwarded: pending -Author: Oleksandr Shneyder -Last-Update: 2012-01-13 ---- a/nx-X11/config/cf/host.def -+++ b/nx-X11/config/cf/host.def -@@ -686,7 +686,7 @@ - * - #define BuildXinerama NO - */ --#define BuildXinerama NO -+#define BuildXinerama YES - - /* - * If you don't want to build support for the GLX extension, uncomment this. ---- a/nx-X11/config/cf/X11.tmpl -+++ b/nx-X11/config/cf/X11.tmpl -@@ -456,7 +456,7 @@ - #define BuildXinerama NO - #endif - #ifndef BuildXineramaLibrary --#define BuildXineramaLibrary (BuildXinerama && !BuildServersOnly) -+#define BuildXineramaLibrary (BuildXinerama) - #endif - #ifndef BuildDmxDevelTools - #define BuildDmxDevelTools NO ---- a/nx-X11/lib/Xinerama/Xinerama.c -+++ b/nx-X11/lib/Xinerama/Xinerama.c -@@ -34,7 +34,7 @@ - #include - #include - #include -- -+#include - - static XExtensionInfo _panoramiX_ext_info_data; - static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data; -@@ -249,6 +249,16 @@ - xXineramaIsActiveReq *req; - XExtDisplayInfo *info = find_display (dpy); - -+ -+ FILE* fptr; -+ if((fptr=fopen(getenv("NX_XINERAMA_CONF"),"r"))!=NULL) { -+ fclose (fptr); -+ return True; -+ } -+ else { -+ return False; -+ } -+ - if(!XextHasExtension(info)) - return False; /* server doesn't even have the extension */ - -@@ -266,7 +276,6 @@ - return rep.state; - } - --#include - - XineramaScreenInfo * - XineramaQueryScreens( -@@ -279,39 +288,72 @@ - xXineramaQueryScreensReq *req; - XineramaScreenInfo *scrnInfo = NULL; - -- PanoramiXCheckExtension (dpy, info, 0); -+ int i; -+ int x,y,w,h; -+ FILE* fptr; -+ if((fptr=fopen(getenv("NX_XINERAMA_CONF"),"r"))==NULL) { -+ PanoramiXCheckExtension (dpy, info, 0); -+ LockDisplay (dpy); -+ GetReq (XineramaQueryScreens, req); -+ req->reqType = info->codes->major_opcode; -+ req->panoramiXReqType = X_XineramaQueryScreens; -+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { -+ UnlockDisplay (dpy); -+ SyncHandle (); -+ return NULL; -+ } -+ if(rep.number) { -+ if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number))) { -+ xXineramaScreenInfo scratch; -+ int i; -+ -+ for(i = 0; i < rep.number; i++) { -+ _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo); -+ scrnInfo[i].screen_number = i; -+ scrnInfo[i].x_org = scratch.x_org; -+ scrnInfo[i].y_org = scratch.y_org; -+ scrnInfo[i].width = scratch.width; -+ scrnInfo[i].height = scratch.height; -+ } -+ -+ *number = rep.number; -+ } else { -+ _XEatData(dpy, rep.length << 2); -+ } -+ } - -- LockDisplay (dpy); -- GetReq (XineramaQueryScreens, req); -- req->reqType = info->codes->major_opcode; -- req->panoramiXReqType = X_XineramaQueryScreens; -- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); -- return NULL; -- } - -- if(rep.number) { -- if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number))) { -- xXineramaScreenInfo scratch; -- int i; -- -- for(i = 0; i < rep.number; i++) { -- _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo); -- scrnInfo[i].screen_number = i; -- scrnInfo[i].x_org = scratch.x_org; -- scrnInfo[i].y_org = scratch.y_org; -- scrnInfo[i].width = scratch.width; -- scrnInfo[i].height = scratch.height; -- } -+ } else { - -- *number = rep.number; -- } else -- _XEatData(dpy, rep.length << 2); -+ i=0; -+ while(!feof(fptr)) { -+ w=h=0; -+ fscanf(fptr,"%d %d %d %d",&x,&y,&w,&h); -+ if(w&&h) -+ i++; -+ } -+ rewind(fptr); -+ *number=i; -+ if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * i))) { -+ i=0; -+ while(!feof(fptr)){ -+ w=h=0; -+ fscanf(fptr,"%d %d %d %d",&x,&y,&w,&h); -+ if(w&&h){ -+ scrnInfo[i].screen_number=i; -+ scrnInfo[i].x_org=x; -+ scrnInfo[i].y_org=y; -+ scrnInfo[i].width=w; -+ scrnInfo[i].height=h; -+ i++; -+ } -+ } -+ } -+ fclose(fptr); - } - -- UnlockDisplay (dpy); -- SyncHandle (); - return scrnInfo; - } - ---- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile -+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile -@@ -206,7 +206,7 @@ - -UNX_DEBUG_INPUT \ - -DRANDR_10_INTERFACE \ - -DRANDR_12_INTERFACE \ -- -UPANORAMIX \ -+ -DPANORAMIX \ - -UDEBUG_TREE - - all:: $(OBJS) ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c -@@ -275,17 +275,19 @@ - case xv_PutVideo: - #ifdef PANORAMIX - if(!noPanoramiXExtension) -- result = (XineramaXvPutVideo(client)); break; -+ result = (XineramaXvPutVideo(client)); - else - #endif -- result = (ProcXvPutVideo(client)); break; -+ result = (ProcXvPutVideo(client)); -+ break; - case xv_PutStill: - #ifdef PANORAMIX - if(!noPanoramiXExtension) -- result = (XineramaXvPutStill(client)); break -+ result = (XineramaXvPutStill(client)); - else - #endif -- result = (ProcXvPutStill(client)); break; -+ result = (ProcXvPutStill(client)); -+ break; - case xv_GetVideo: result = (ProcXvGetVideo(client)); break; - case xv_GetStill: result = (ProcXvGetStill(client)); break; - case xv_GrabPort: result = (ProcXvGrabPort(client)); break; -@@ -295,35 +297,39 @@ - case xv_StopVideo: - #ifdef PANORAMIX - if(!noPanoramiXExtension) -- result = (XineramaXvStopVideo(client)); break; -+ result = (XineramaXvStopVideo(client)); - else - #endif -- result = (ProcXvStopVideo(client)); break; -+ result = (ProcXvStopVideo(client)); -+ break; - case xv_SetPortAttribute: - #ifdef PANORAMIX - if(!noPanoramiXExtension) -- result = (XineramaXvSetPortAttribute(client)); break; -+ result = (XineramaXvSetPortAttribute(client)); - else - #endif -- result = (ProcXvSetPortAttribute(client)); break; -+ result = (ProcXvSetPortAttribute(client)); -+ break; - case xv_GetPortAttribute: result = (ProcXvGetPortAttribute(client)); break; - case xv_QueryBestSize: result = (ProcXvQueryBestSize(client)); break; - case xv_QueryPortAttributes: result = (ProcXvQueryPortAttributes(client)); break; - case xv_PutImage: - #ifdef PANORAMIX - if(!noPanoramiXExtension) -- result = (XineramaXvPutImage(client)); break; -+ result = (XineramaXvPutImage(client)); - else - #endif -- result = (ProcXvPutImage(client)); break; -+ result = (ProcXvPutImage(client)); -+ break; - #ifdef MITSHM - case xv_ShmPutImage: - #ifdef PANORAMIX - if(!noPanoramiXExtension) -- result = (XineramaXvShmPutImage(client)); break; -+ result = (XineramaXvShmPutImage(client)); - else - #endif -- result = (ProcXvShmPutImage(client)); break; -+ result = (ProcXvShmPutImage(client)); -+ break; - #endif - case xv_QueryImageAttributes: result = (ProcXvQueryImageAttributes(client)); break; - case xv_ListImageFormats: result = (ProcXvListImageFormats(client)); break; ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -1021,7 +1021,7 @@ - #else - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -+ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama - #endif - - #endif ---- a/nx-X11/programs/Xserver/Xext/panoramiX.c -+++ b/nx-X11/programs/Xserver/Xext/panoramiX.c -@@ -1045,16 +1045,7 @@ - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; --#if 1 -- { -- /* The following hack fools clients into thinking that Xinerama -- * is disabled even though it is not. */ -- extern Bool PanoramiXExtensionDisabledHack; -- rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack; -- } --#else - rep.state = !noPanoramiXExtension; --#endif - if (client->swapped) { - register int n; - swaps (&rep.sequenceNumber, n); ---- a/nx-X11/programs/Xserver/Xext/panoramiX.h -+++ b/nx-X11/programs/Xserver/Xext/panoramiX.h -@@ -44,7 +44,7 @@ - #define _PANORAMIX_H_ - - #include --#include "gcstruct.h" -+/*#include "gcstruct.h"*/ - - - typedef struct _PanoramiXData { diff --git a/debian/patches/203_nxagent_disable-rootless-exit.full.patch b/debian/patches/203_nxagent_disable-rootless-exit.full.patch deleted file mode 100644 index 74579f4d8..000000000 --- a/debian/patches/203_nxagent_disable-rootless-exit.full.patch +++ /dev/null @@ -1,63 +0,0 @@ -Description: Add -norootlessexit cmdline option to nxagent -Author: Oleksandr Shneyder - ---- a/nx-X11/programs/Xserver/hw/nxagent/Args.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c -@@ -672,6 +672,12 @@ - return 1; - } - -+ if (!strcmp(argv[i], "-norootlessexit")) { -+ nxagentChangeOption(NoRootlessExit, True); -+ return 1; -+ } -+ -+ - if (!strcmp(argv[i], "-noonce")) - { - nxagentOnce = False; -@@ -1855,6 +1861,7 @@ - ErrorF("The NX system adds the following arguments:\n"); - ErrorF("-forcenx force use of NX protocol messages assuming communication through nxproxy\n"); - ErrorF("-timeout int auto-disconnect timeout in seconds (minimum allowed: 60)\n"); -+ ErrorF("-norootlessexit don't exit if there are no clients in rootless mode\n"); - #ifdef RENDER - ErrorF("-norender disable the use of the render extension\n"); - ErrorF("-nocomposite disable the use of the composite extension\n"); ---- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c -@@ -219,7 +219,7 @@ - - if (nxagentOption(Rootless) && - nxagentLastWindowDestroyed && nxagentRootlessDialogPid == 0 && -- now > nxagentLastWindowDestroyedTime + 30 * 1000) -+ now > nxagentLastWindowDestroyedTime + 30 * 1000 && !nxagentOption(NoRootlessExit)) - { - #ifdef WARNING - fprintf(stderr, "nxagentBlockHandler: No application running. Closing the session.\n"); ---- a/nx-X11/programs/Xserver/hw/nxagent/Options.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c -@@ -56,6 +56,7 @@ - nxagentOptions.Persistent = 1; - nxagentOptions.Rootless = UNDEFINED; - nxagentOptions.Fullscreen = UNDEFINED; -+ nxagentOptions.NoRootlessExit = False; - - nxagentOptions.X = 0; - nxagentOptions.Y = 0; ---- a/nx-X11/programs/Xserver/hw/nxagent/Options.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h -@@ -381,6 +381,13 @@ - - int ImageRateLimit; - -+ /* -+ * True if agent should not exit if there are no -+ * clients in rootless mode -+ */ -+ -+ int NoRootlessExit; -+ - } AgentOptionsRec; - - typedef AgentOptionsRec *AgentOptionsPtr; diff --git a/debian/patches/204_nxagent_repaint-solidpict.full.patch b/debian/patches/204_nxagent_repaint-solidpict.full.patch deleted file mode 100644 index 139a46ad3..000000000 --- a/debian/patches/204_nxagent_repaint-solidpict.full.patch +++ /dev/null @@ -1,53 +0,0 @@ -Description: Fix repainting of SolidFill pictures with libcairo > 1.12.x -Author: Oleksandr Shneyder -diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c ---- a/nx-X11/programs/Xserver/hw/nxagent/Render.c 2012-05-16 18:05:07.000000000 +0200 -+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c 2012-09-20 20:53:37.893459269 +0200 -@@ -2689,11 +2689,17 @@ void nxagentReconnectPicture(pointer p0, - #endif - } - -- if (!pForm) -+ if (!pForm && pPicture->pSourcePict) - { -- *pBool = False; -- -- return; -+ /*possible we need to add support for other picture types, for example gradients...*/ -+ switch(pPicture->pSourcePict->type) -+ { -+ case SourcePictTypeSolidFill: -+ nxagentPicturePriv(pPicture) -> picture = XRenderCreateSolidFill(nxagentDisplay, -+ (const XRenderColor*) &pPicture->pSourcePict->solidFill.fullColor); -+ break; -+ } -+ return; - } - - #ifdef TEST -diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c 2010-11-11 21:18:00.000000000 +0100 -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c 2012-09-20 20:54:50.209817849 +0200 -@@ -1137,6 +1137,10 @@ CreateSolidPicture (Picture pid, xRender - } - pPicture->pSourcePict->type = SourcePictTypeSolidFill; - pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); -+ pPicture->pSourcePict->solidFill.fullColor.alpha=color->alpha; -+ pPicture->pSourcePict->solidFill.fullColor.red=color->red; -+ pPicture->pSourcePict->solidFill.fullColor.green=color->green; -+ pPicture->pSourcePict->solidFill.fullColor.blue=color->blue; - return pPicture; - } - -diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h 2010-10-22 16:04:24.000000000 +0200 -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h 2012-09-20 20:55:31.106020653 +0200 -@@ -95,6 +95,7 @@ typedef struct _PictTransform { - typedef struct _PictSolidFill { - unsigned int type; - CARD32 color; -+ xRenderColor fullColor; - } PictSolidFill, *PictSolidFillPtr; - - typedef struct _PictGradientStop { - diff --git a/debian/patches/205_nxagent_refresh-adsl.full.patch b/debian/patches/205_nxagent_refresh-adsl.full.patch deleted file mode 100644 index 4840ea7ce..000000000 --- a/debian/patches/205_nxagent_refresh-adsl.full.patch +++ /dev/null @@ -1,14 +0,0 @@ -Description: Fix refresh errors on Win2012 RDP connections with speed=ADSL -Author: Oleksandr Shneyder -diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c ---- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c 2014-05-06 12:52:35.082288455 +0200 -+++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c 2014-05-06 12:54:00.258710819 +0200 -@@ -339,7 +339,7 @@ FIXME: The popup could be synchronized w - */ - - if ((pDstDrawable -> type == DRAWABLE_PIXMAP && -- nxagentOption(DeferLevel) > 0) || nxagentOption(DeferLevel) >= 2) -+ nxagentOption(DeferLevel) > 0) || nxagentOption(DeferLevel) >= 3) - { - pClipRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, - width, height); diff --git a/debian/patches/206_nxagent_clipboard-as-nxoption.full.patch b/debian/patches/206_nxagent_clipboard-as-nxoption.full.patch deleted file mode 100644 index 12b51dc0e..000000000 --- a/debian/patches/206_nxagent_clipboard-as-nxoption.full.patch +++ /dev/null @@ -1,53 +0,0 @@ -Descripion: Add -clipboard cmdline option to nxagent -Author: Mike Gabriel - ---- a/nx-X11/programs/Xserver/hw/nxagent/Args.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c -@@ -984,7 +984,7 @@ - - if (!strcmp(argv[i], "-clipboard")) - { -- if (!strcmp(argv[i+1], "both")) -+ if ((!strcmp(argv[i+1], "both")) || (!strcmp(argv[i+1], "1"))) - { - nxagentChangeOption(Clipboard, ClipboardBoth); - } -@@ -996,7 +996,7 @@ - { - nxagentChangeOption(Clipboard, ClipboardServer); - } -- else if (!strcmp(argv[i+1], "none")) -+ else if ((!strcmp(argv[i+1], "none")) || (!strcmp(argv[i+1], "1"))) - { - nxagentChangeOption(Clipboard, ClipboardNone); - } -@@ -1255,6 +1255,29 @@ - - return; - } -+ else if (strcmp(name, "clipboard") == 0) -+ { -+ if ((strcmp(value, "both") == 0) || (strcmp(value, "1") == 0)) -+ { -+ nxagentChangeOption(Clipboard, ClipboardBoth); -+ } -+ else if (strcmp(value, "client") == 0) -+ { -+ nxagentChangeOption(Clipboard, ClipboardClient); -+ } -+ else if (strcmp(value, "server") == 0) -+ { -+ nxagentChangeOption(Clipboard, ClipboardServer); -+ } -+ else if ((strcmp(value, "none") == 0) || (strcmp(value, "0") == 0)) -+ { -+ nxagentChangeOption(Clipboard, ClipboardNone); -+ } -+ else -+ { -+ nxagentChangeOption(Clipboard, ClipboardBoth); -+ } -+ } - else - { - #ifdef DEBUG diff --git a/debian/patches/207_nxagent_fix-xfixes-selection.full.patch b/debian/patches/207_nxagent_fix-xfixes-selection.full.patch deleted file mode 100644 index 712b36914..000000000 --- a/debian/patches/207_nxagent_fix-xfixes-selection.full.patch +++ /dev/null @@ -1,33 +0,0 @@ -Description: Fix XFIXES selection handling (copy and paste via middle mouse button). -Abstract: - When nxagent has the XFIXES extension enabled copy and - paste from outside applications to applications within the session - that rely on XFixesSelectSelectionInput (e.g. qt applications like - konsole) did never receive any notifications because the nxagent did - not register itself at the real X server to receive them. Fixes Bug - #585. -Author: Ulrich Sibiller - -Index: nx-libs/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c -=================================================================== ---- nx-libs.orig/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c 2014-11-04 22:42:50.893569624 +0100 -+++ nx-libs/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c 2014-11-04 22:42:50.893569624 +0100 -@@ -1556,10 +1556,14 @@ - fprintf(stderr, "nxagentInitClipboard: Registering for XFixesSelectionNotify events.\n"); - #endif - -- XFixesSelectSelectionInput(nxagentDisplay, iWindow, nxagentClipboardAtom, -- XFixesSetSelectionOwnerNotifyMask | -- XFixesSelectionWindowDestroyNotifyMask | -- XFixesSelectionClientCloseNotifyMask); -+ for (i = 0; i < nxagentMaxSelections; i++) -+ { -+ XFixesSelectSelectionInput(nxagentDisplay, iWindow, -+ lastSelectionOwner[i].selection, -+ XFixesSetSelectionOwnerNotifyMask | -+ XFixesSelectionWindowDestroyNotifyMask | -+ XFixesSelectionClientCloseNotifyMask); -+ } - - nxagentXFixesInfo.Initialized = 1; - } diff --git a/debian/patches/209_x2goagent_add-man-page.full.patch b/debian/patches/209_x2goagent_add-man-page.full.patch deleted file mode 100644 index 310fa87d6..000000000 --- a/debian/patches/209_x2goagent_add-man-page.full.patch +++ /dev/null @@ -1,41 +0,0 @@ -Description: Add x2goagent man page -Author: Mike Gabriel - ---- /dev/null -+++ b/nx-X11/programs/Xserver/hw/nxagent/man/x2goagent.1 -@@ -0,0 +1,35 @@ -+.TH x2goagent 1 -+.SH NAME -+x2goagent \- X2Go Agent. -+.SH SYNOPSIS -+.B x2goagent -+.I "[options]" -+ -+.SH DESCRIPTION -+\fBx2goagent\fR is an Xnest-like X server for remote application/desktop access. -+.PP -+\fBx2goagent\fR implements a very efficient compression of the X11 protocol. -+.PP -+This increases performance when using X applications over high latency and -+low bandwidth networks, while providing a local (LAN-like) usage experience -+even if connecting from off-site locations (via cable modem or GSM). -+.PP -+\fBx2goagent\fR is not designed to be used as a standalone application. -+It has to be launched on the server side by the X2Go server software. -+.PP -+Available clients are -+\fBx2goclient\fR, \fBpyhoca-gui\fR and \fBpyhoca-gui\fR (using the -+Python X2Go API). -+ -+.SH OPTIONS -+.TP -+.B \--help -+Lists all others options that are not listed here. -+ -+.SH FURTHER READINGS -+Information on X2Go: http://wiki.x2go.org -+.PP -+Information on NX: http://www.nomachine.com -+ -+.SH AUTHOR -+This manual page was written by Mike Gabriel . diff --git a/debian/patches/210_nxagent_save_session_state.full.patch b/debian/patches/210_nxagent_save_session_state.full.patch deleted file mode 100644 index 223d0bc7a..000000000 --- a/debian/patches/210_nxagent_save_session_state.full.patch +++ /dev/null @@ -1,176 +0,0 @@ -Description: Save session state in file -Author: Oleksandr Shneyder - ---- a/nx-X11/programs/Xserver/hw/nxagent/Args.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c -@@ -60,6 +60,7 @@ - #endif - #include "Handlers.h" - #include "Error.h" -+#include "Reconnect.h" - - /* - * NX includes and definitions. -@@ -1090,6 +1091,11 @@ - - return; - } -+ else if (!strcmp(name, "state")) -+ { -+ setStatePath(value); -+ return; -+ } - else if (!strcmp(name, "fullscreen")) - { - if (nxagentReconnectTrap == True) -@@ -1369,6 +1375,11 @@ - validateString(nxagentOptionFile)); - #endif - -+ /* -+ * Init statePath -+ */ -+ setStatePath(""); -+ - if (nxagentOptionFile == NULL) - { - return; ---- a/nx-X11/programs/Xserver/hw/nxagent/Init.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c -@@ -63,7 +63,7 @@ - - #include "NX.h" - #include "NXlib.h" -- -+#include "Reconnect.h" - /* - * Set here the required log level. - */ -@@ -233,6 +233,7 @@ - fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid()); - - fprintf(stderr, "Session: Starting session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("STARTING"); - } - - /* ---- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c -@@ -118,6 +118,33 @@ - - static enum RECONNECTION_STEP failedStep; - -+#include -+ -+/* -+ * Path of state File -+ */ -+char stateFile[PATH_MAX]; -+ -+ -+void setStatePath(char* path) -+{ -+ strncpy(stateFile, path, PATH_MAX-1); -+} -+ -+void saveAgentState(char* state) -+{ -+ FILE* fptr; -+ if(strlen(stateFile)) -+ { -+ fptr=fopen(stateFile, "w"); -+ if(!fptr) -+ return; -+ fprintf(fptr,"%s", state); -+ fclose(fptr); -+ } -+} -+ -+ - int nxagentHandleConnectionStates(void) - { - #ifdef TEST -@@ -211,6 +238,7 @@ - fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); - - fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("SUSPENDING"); - } - - nxagentDisconnectSession(); -@@ -265,6 +293,7 @@ - fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString()); - #endif - } -+ saveAgentState("SUSPENDED"); - - nxagentResetDisplayHandlers(); - -@@ -622,6 +651,7 @@ - #else - fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString()); - #endif -+ saveAgentState("RUNNING"); - - nxagentRemoveSplashWindow(NULL); - -@@ -785,12 +815,14 @@ - if (nxagentSessionState == SESSION_GOING_DOWN) - { - fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("SUSPENDING"); - - nxagentDisconnectSession(); - } - else if (nxagentSessionState == SESSION_GOING_UP) - { - fprintf(stderr, "Session: Resuming session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("RESUMING"); - - if (nxagentReconnectSession()) - { -@@ -803,6 +835,7 @@ - fprintf(stderr, "Session: Display failure detected at '%s'.\n", GetTimeAsString()); - - fprintf(stderr, "Session: Suspending session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("SUSPENDING"); - - nxagentDisconnectSession(); - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h -@@ -34,6 +34,8 @@ - Bool nxagentReconnectSession(void); - int nxagentHandleConnectionStates(void); - void nxagentHandleConnectionChanges(void); -+void setStatePath(char*); -+void saveAgentState(char*); - - enum SESSION_STATE - { ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c -@@ -609,6 +609,7 @@ - #endif - - nxagentSessionState = SESSION_UP; -+ saveAgentState("RUNNING"); - } - - #ifdef BLOCKS -@@ -823,6 +824,7 @@ - */ - - fprintf(stderr, "Session: Terminating session at '%s'.\n", GetTimeAsString()); -+ saveAgentState("TERMINATING"); - - nxagentWaitDisplay(); - -@@ -833,6 +835,7 @@ - { - NXShadowDestroy(); - } -+ saveAgentState("TERMINATED"); - - KillAllClients(); - DEALLOCATE_LOCAL(clientReady); diff --git a/debian/patches/210_nxcomp_save_session_state.full+lite.patch b/debian/patches/210_nxcomp_save_session_state.full+lite.patch deleted file mode 100644 index 1ef4440d8..000000000 --- a/debian/patches/210_nxcomp_save_session_state.full+lite.patch +++ /dev/null @@ -1,15 +0,0 @@ -Description: Ignore state= option in nxproxy/nxcomp -Author: Oleksandr Shneyder - ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -8872,7 +8872,8 @@ - } - else if (strcasecmp(name, "defer") == 0 || - strcasecmp(name, "tile") == 0 || -- strcasecmp(name, "menu") == 0) -+ strcasecmp(name, "menu") == 0 || -+ strcasecmp(name, "state") == 0 ) - { - #ifdef DEBUG - *logofs << "Loop: Ignoring agent option '" << name diff --git a/debian/patches/211_nxcomp_set_default_options.full+lite.patch b/debian/patches/211_nxcomp_set_default_options.full+lite.patch deleted file mode 100644 index 7bd8a781d..000000000 --- a/debian/patches/211_nxcomp_set_default_options.full+lite.patch +++ /dev/null @@ -1,27 +0,0 @@ -Description: Set default pack and link options to avoid damage of session. -Author: Oleksandr Shneyder - ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -8328,8 +8328,8 @@ - - cerr << "Error" << ": Can't identify 'link' option in string '" - << value << "'.\n"; -- -- return -1; -+ if (ParseLinkOption("adsl") < 0) -+ return -1; - } - } - else if (strcasecmp(name, "limit") == 0) -@@ -8783,8 +8783,8 @@ - - cerr << "Error" << ": Can't identify pack method for string '" - << value << "'.\n"; -- -- return -1; -+ if (ParsePackOption("nopack")<0) -+ return -1; - } - } - else if (strcasecmp(name, "core") == 0) diff --git a/debian/patches/212_nxcomp_build-on-Android.full+lite.patch b/debian/patches/212_nxcomp_build-on-Android.full+lite.patch deleted file mode 100644 index 528d33b74..000000000 --- a/debian/patches/212_nxcomp_build-on-Android.full+lite.patch +++ /dev/null @@ -1,253 +0,0 @@ -Author: Nito Martinez -Description: Fix FTBFS of nxproxy/nxcomp on Android - ---- a/nxcomp/Jpeg.cpp -+++ b/nxcomp/Jpeg.cpp -@@ -17,6 +17,9 @@ - - #include - -+#ifdef ANDROID -+#include -+#endif - #include - #include - #include ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -4187,7 +4187,7 @@ - - #endif - -- char *separator = rindex(display, ':'); -+ char *separator = strrchr(display, ':'); - - if ((separator == NULL) || !isdigit(*(separator + 1))) - { -@@ -8240,7 +8240,7 @@ - char *name; - char *value; - -- value = rindex(nextOpts, ':'); -+ value = strrchr(nextOpts, ':'); - - if (value != NULL) - { -@@ -11010,7 +11010,7 @@ - packMethod == PACK_LOSSLESS || - packMethod == PACK_ADAPTIVE) - { -- const char *dash = rindex(opt, '-'); -+ const char *dash = strrchr(opt, '-'); - - if (dash != NULL && strlen(dash) == 2 && - *(dash + 1) >= '0' && *(dash + 1) <= '9') -@@ -12275,6 +12275,10 @@ - control -> ShmemServer = 0; - } - -+ // For android, no shared memory available -+ control -> ShmemServer = 0; -+ control -> ShmemClientSize = 0; -+ - return 1; - } - -@@ -13525,7 +13529,7 @@ - - int newPort = port; - -- const char *separator = rindex(opt, ':'); -+ const char *separator = strrchr(opt, ':'); - - if (separator != NULL) - { ---- a/nxcomp/Pgn.cpp -+++ b/nxcomp/Pgn.cpp -@@ -23,6 +23,9 @@ - - #include - -+#ifdef ANDROID -+#include -+#endif - #include - #include - #include ---- a/nxcomp/Proxy.cpp -+++ b/nxcomp/Proxy.cpp -@@ -20,6 +20,11 @@ - #include - #include - #include -+#ifdef ANDROID -+#include -+#include -+#include -+#endif - - #include "Misc.h" - -@@ -31,9 +36,11 @@ - #include - #endif - -+#ifndef ANDROID - #include - #include - #include -+#endif - - #if defined(__EMX__ ) || defined(__CYGWIN32__) - ---- a/nxcomp/ServerChannel.cpp -+++ b/nxcomp/ServerChannel.cpp -@@ -18,7 +18,9 @@ - #include - #include - #include -+#ifndef ANDROID - #include -+#endif - - #include - #include -@@ -1079,7 +1081,6 @@ - - priority_++; - } -- - // - // Account this data to the original opcode. - // -@@ -1500,7 +1501,6 @@ - continue; - } - } -- - // - // Check if user pressed the CTRL+ALT+SHIFT+ESC key - // sequence because was unable to kill the session -@@ -5475,7 +5475,7 @@ - *logofs << "handleColormap: Dumping colormap entries:\n" - << logofs_flush; - -- const unsigned char *p = unpackState_[resource] -> colormap -> data; -+ const unsigned char *p = (const unsigned char *) unpackState_[resource] -> colormap -> data; - - for (unsigned int i = 0; i < unpackState_[resource] -> - colormap -> entries; i++) -@@ -7100,7 +7100,12 @@ - { - encodeBuffer.encodeValue(stage, 2); - -+#ifndef ANDROID - shmemState_ -> present = *(buffer + 8); -+#else -+ shmemState_ -> present = 0; -+ cerr << "Info: handleShmemReply: In android no shared memory. Setting present to 0 hardcoded\n"; -+#endif - shmemState_ -> opcode = *(buffer + 9); - shmemState_ -> event = *(buffer + 10); - shmemState_ -> error = *(buffer + 11); -@@ -7128,7 +7133,12 @@ - cerr << "Info" << ": Using shared memory parameters 1/" - << (shmemState_ -> size / 1024) << "K.\n"; - -+#ifndef ANDROID - shmemState_ -> enabled = 1; -+#else -+ cerr << "Info: handleShmemReply: In android no shared memory. Setting enabled to -1. This should not be displayed\n"; -+ shmemState_ -> enabled = -1; -+#endif - - encodeBuffer.encodeBoolValue(1); - } -@@ -7241,7 +7251,7 @@ - // memory support is disabled by the - // user. - // -- -+#ifndef ANDROID - if (control -> ShmemServer == 1 && - control -> ShmemServerSize > 0 && - enableServer == 1) -@@ -7252,8 +7262,12 @@ - { - memcpy(buffer + 8, "NO-MIT-", 7); - } -+#else -+ cerr << "Info: handleShmemRequest: In android no shared memory. Returning NO-MIT- answer\n"; - -- sequenceQueue_.push(clientSequence_, opcode, -+ memcpy(buffer + 8, "NO-MIT-", 7); -+#endif -+ sequenceQueue_.push(clientSequence_, opcode, - opcodeStore_ -> getShmemParameters, stage); - - // -@@ -7289,9 +7303,13 @@ - - shmemState_ -> size = control -> ShmemServerSize; - -+#ifndef ANDROID - shmemState_ -> id = shmget(IPC_PRIVATE, shmemState_ -> size, - IPC_CREAT | permissions); -- -+#else -+ cerr << "Info: handleShmemReqyest: In android no shared memory (shmget). This message should not be displayed present should never be 1 in android\n"; -+ shmemState_ -> id = -1; -+#endif - if (shmemState_ -> id >= 0) - { - #if defined(TEST) || defined(INFO) -@@ -7302,8 +7320,12 @@ - #endif - - -+#ifndef ANDROID - shmemState_ -> address = shmat(shmemState_ -> id, 0, 0); -- -+#else -+ cerr << "Info: handleShmemReqyest: In android no shared memory (shmat). This message should not be displayed. present should never be 1 in android\n"; -+ shmemState_ -> address = NULL; -+#endif - if (shmemState_ -> address != NULL) - { - #ifdef TEST -@@ -7437,6 +7459,10 @@ - - return 0; - } -+#ifdef ANDROID -+ cerr << "Info: handleShmem: In android no shared memory. enabled should never be 1. This should not be displayed\n"; -+ return 0; -+#endif - - // - // Ignore null requests and requests that will not result -@@ -8054,14 +8080,22 @@ - { - if (shmemState_ != NULL) - { -- if (shmemState_ -> address != NULL) -+ if (shmemState_ -> address != NULL) - { -- shmdt((char *) shmemState_ -> address); -+#ifndef ANDROID -+ shmdt((char *) shmemState_ -> address); -+#else -+ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. address should always be NULL\n"; -+#endif - } - - if (shmemState_ -> id > 0) - { -+#ifndef ANDROID - shmctl(shmemState_ -> id, IPC_RMID, 0); -+#else -+ cerr << "Info: handleShmemStateRemove: In android no shared memory. This should not be displayed. id should always be 0\n"; -+#endif - } - - delete shmemState_; diff --git a/debian/patches/220_nxproxy_bind-loopback-only.full+lite.patch b/debian/patches/220_nxproxy_bind-loopback-only.full+lite.patch deleted file mode 100644 index c65b85501..000000000 --- a/debian/patches/220_nxproxy_bind-loopback-only.full+lite.patch +++ /dev/null @@ -1,130 +0,0 @@ -Description: Force NX proxy to bind to loopback devices only (loopback option) -Author: Mike Gabriel ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -952,6 +952,7 @@ - static char displayHost[DEFAULT_STRING_LENGTH] = { 0 }; - static char authCookie[DEFAULT_STRING_LENGTH] = { 0 }; - -+static int loopbackBind = DEFAULT_LOOPBACK_BIND; - static int proxyPort = DEFAULT_NX_PROXY_PORT; - static int xPort = DEFAULT_NX_X_PORT; - -@@ -3959,7 +3960,14 @@ - - tcpAddr.sin_family = AF_INET; - tcpAddr.sin_port = htons(proxyPortTCP); -- tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ if ( loopbackBind ) -+ { -+ tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); -+ } -+ else -+ { -+ tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ } - - if (bind(tcpFD, (sockaddr *) &tcpAddr, sizeof(tcpAddr)) == -1) - { -@@ -4550,7 +4558,14 @@ - - tcpAddr.sin_family = AF_INET; - tcpAddr.sin_port = htons(portTCP); -- tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ if ( loopbackBind ) -+ { -+ tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); -+ } -+ else -+ { -+ tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ } - - if (bind(newFD, (sockaddr *) &tcpAddr, sizeof(tcpAddr)) == -1) - { -@@ -6718,7 +6733,14 @@ - - #ifdef __APPLE__ - -- tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ if ( loopbackBind ) -+ { -+ tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); -+ } -+ else -+ { -+ tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ } - - #else - -@@ -8397,6 +8419,10 @@ - - listenPort = ValidateArg("local", name, value); - } -+ else if (strcasecmp(name, "loopback") == 0) -+ { -+ loopbackBind = ValidateArg("local", name, value); -+ } - else if (strcasecmp(name, "accept") == 0) - { - if (*connectHost != '\0') -@@ -13778,7 +13804,14 @@ - } - else - { -- address = htonl(INADDR_ANY); -+ if ( loopbackBind ) -+ { -+ address = htonl(INADDR_LOOPBACK); -+ } -+ else -+ { -+ address = htonl(INADDR_ANY); -+ } - } - } - else ---- a/nxcomp/Misc.cpp -+++ b/nxcomp/Misc.cpp -@@ -42,6 +42,14 @@ - #undef DEBUG - - // -+// By default nxproxy binds to all network interfaces, setting -+// DEFAULT_LOOPBACK_BIND to 1 enables binding to the loopback -+// device only. -+// -+ -+const int DEFAULT_LOOPBACK_BIND = 0; -+ -+// - // TCP port offset applied to any NX port specification. - // - -@@ -137,6 +145,8 @@ - \n\ - listen=n Local port used for accepting the proxy connection.\n\ - \n\ -+ loopback=b Bind to the loopback device only.\n\ -+\n\ - accept=s Name or IP of host that can connect to the proxy.\n\ - \n\ - connect=s Name or IP of host that the proxy will connect to.\n\ ---- a/nxcomp/Misc.h -+++ b/nxcomp/Misc.h -@@ -90,6 +90,14 @@ - extern const int DEFAULT_NX_SLAVE_PORT_SERVER_OFFSET; - - // -+// NX proxy binds to all network interfaces by default -+// With the -loopback parameter, you can switch -+// over to binding to the loopback device only. -+// -+ -+extern const int DEFAULT_LOOPBACK_BIND; -+ -+// - // Return strings containing various info. - // - diff --git a/debian/patches/300_nxagent_set-wm-class.full.patch b/debian/patches/300_nxagent_set-wm-class.full.patch deleted file mode 100644 index 70b1c9212..000000000 --- a/debian/patches/300_nxagent_set-wm-class.full.patch +++ /dev/null @@ -1,60 +0,0 @@ -Description: Set WM_CLASS to X2GoAgent/NXAgent - Depending on the binary name of the agent either NXAgent - or X2GoAgent is set as WM_Class. - . - This is needed for some window managers (like the one shipped with - Maemo) - . - The original WM_CLASS patch has been taken from the FreeNX patch - series, author unknown. - . - The nxagent/x2goagent has been done by the X2Go Project, author - see below. -Forwarded: not-needed -Author: Oleksandr Shneyder -Last-Update: 2012-01-11 ---- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c -@@ -1762,6 +1762,42 @@ - nxagentDefaultWindows[pScreen->myNum]); - #endif - -+ /* -+ * Setting WM_CLASS to "X2GoAgent" when running in X2Go Agent mode -+ * we need it to properly display all window parameters by some WMs -+ * (for example on Maemo) -+ */ -+ if(nxagentX2go) -+ { -+ #ifdef TEST -+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n", -+ nxagentDefaultWindows[pScreen->myNum]); -+ #endif -+ XClassHint hint; -+ hint.res_name=malloc(strlen("X2GoAgent")+1); -+ hint.res_class=malloc(strlen("X2GoAgent")+1); -+ strcpy(hint.res_name,"X2GoAgent"); -+ strcpy(hint.res_class,"X2GoAgent"); -+ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint); -+ free(hint.res_name); -+ free(hint.res_class); -+ } else { -+ #ifdef TEST -+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n", -+ nxagentDefaultWindows[pScreen->myNum]); -+ #endif -+ -+ XClassHint hint; -+ hint.res_name=malloc(strlen("NXAgent")+1); -+ hint.res_class=malloc(strlen("NXAgent")+1); -+ strcpy(hint.res_name,"NXAgent"); -+ strcpy(hint.res_class,"NXAgent"); -+ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint); -+ free(hint.res_name); -+ free(hint.res_class); -+ } -+ -+ - if (nxagentOption(Fullscreen)) - { - nxagentFullscreenWindow = nxagentDefaultWindows[pScreen->myNum]; diff --git a/debian/patches/301_nx-X11_use-shared-libs.full.patch b/debian/patches/301_nx-X11_use-shared-libs.full.patch deleted file mode 100644 index 200147449..000000000 --- a/debian/patches/301_nx-X11_use-shared-libs.full.patch +++ /dev/null @@ -1,106 +0,0 @@ -Description: Use shared libraries - Many distributions have a policy to reduce code duplications. - One means to avoid such duplications is to use shared libraries - instead of using libs that are ofter shipped for convenience. - . - Fedora: - http://fedoraproject.org/wiki/Packaging:Guidelines#Shared_Libraries - . - Debian (Section 10.7.4 of Debian policy): - http://www.debian.org/doc/debian-policy/ch-files.html -Forwarded: pending... -Author: Jan Engelhardt -Last-Update: 2012-02-14 ---- - nx-X11/config/cf/host.def | 11 ++++++----- - nx-X11/programs/Xserver/Imakefile | 6 +++--- - nx-X11/programs/nxauth/Imakefile | 2 +- - 3 files changed, 10 insertions(+), 9 deletions(-) - -Index: nx-X11/config/cf/host.def -=================================================================== ---- a/nx-X11/config/cf/host.def -+++ b/nx-X11/config/cf/host.def -@@ -138,7 +138,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de - #define BuildRenderLibrary YES - #define SharedLibFreetype2 YES - #define NormalLibFreetype2 YES --#define FontLibSharedFreeType NO -+#define FontLibSharedFreeType YES - #endif - - /* -@@ -649,6 +649,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de - * - #define XserverStaticFontLib NO - */ -+#define XserverStaticFontLib YES - - /* - * To enable binary compatibility with previous versions of the font -@@ -733,7 +734,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de - #define BuildXKB YES - #define BuildXKBlib YES - --#define SharedLibXau NO -+#define SharedLibXau YES - - /* - * If you are running NetBSD 0.9C or later, and have the aperture driver -@@ -956,9 +957,9 @@ XCOMM $XFree86: xc/config/cf/xf86site.de - #define BuildXterm YES - */ - --#define SharedLibXau NO -+#define SharedLibXau YES - --#define SharedLibXdmcp NO -+#define SharedLibXdmcp YES - - #define BuildXaw7 YES - -@@ -976,7 +977,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.de - #define BuildFontServer NO - #define BuildFreeType NO - #define BuildXTrueType NO --#define FontLibSharedFreeType NO -+#define FontLibSharedFreeType YES - #endif - - #if !defined(NXZaurusXServer) && defined(NXiPAQXServer) -Index: nx-X11/programs/Xserver/Imakefile -=================================================================== ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -1013,15 +1013,15 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTS - #if defined(SunArchitecture) - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -+ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp - #elif defined(cygwinArchitecture) - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ - -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ -- -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -+ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp - #else - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -+ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp - #endif - - #endif -Index: nx-X11/programs/nxauth/Imakefile -=================================================================== ---- a/nx-X11/programs/nxauth/Imakefile -+++ b/nx-X11/programs/nxauth/Imakefile -@@ -26,7 +26,7 @@ XCOMM $XFree86: xc/programs/xauth/Imakef - - INCLUDES=-I../../lib - DEPLIBS = $(DEPXAUTHLIB) -- LOCAL_LIBRARIES = ../../exports/lib/libXau.a -+ LOCAL_LIBRARIES = $(XAUTHLIB) - SRCS = xauth.c gethost.c process.c parsedpy.c - OBJS = xauth.o gethost.o process.o parsedpy.o - CONN_DEFINES = $(CONNECTION_FLAGS) diff --git a/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch b/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch deleted file mode 100644 index dac3d8a08..000000000 --- a/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch +++ /dev/null @@ -1,84 +0,0 @@ -Description: Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir -Author: Mike Gabriel -Abstract: - In recent (as of 2014/06) X.org release, the keymap.dir file - has become obsolete. Let's test for the xkb/rules/base file - instead. ---- a/nx-X11/programs/Xserver/xkb/ddxLoad.c -+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c -@@ -180,7 +180,7 @@ - - #define NX_XKB_BASE_DIRECTORY "/usr/lib/X11/xkb" - #define NX_XKB_ALTERNATE_BASE_DIRECTORY "/usr/share/X11/xkb" --#define NX_KEYMAP_DIR_FILE "keymap.dir" -+#define NX_XKB_RULES_BASE_FILE "rules/base" - #define NX_ALT_XKBCOMP_PATH "/usr/bin" - - static char _NXXkbBasePath[PATH_MAX]; -@@ -189,43 +189,43 @@ - static int NXVerifyXkbBaseDirectory(const char *dirPath) - { - int size; -- char *keymapDirFilePath; -- struct stat keymapDirFileStat; -+ char *rulesBaseFilePath; -+ struct stat rulesBaseFileStat; - - /* -- * If keymap.dir file -- * is not present into -- * Xkb Base Directory, -+ * If rules/base file -+ * is not present inside -+ * the Xkb Base Directory, - * we suppose that the - * path is not valid. - */ - - size = strlen(dirPath) + strlen("/") + -- strlen(NX_KEYMAP_DIR_FILE) + 1; -+ strlen(NX_XKB_RULES_BASE_FILE) + 1; - -- if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL) -+ if ((rulesBaseFilePath = malloc((size + 1) * sizeof(char))) == NULL) - { - FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n"); - } - -- strcpy(keymapDirFilePath, dirPath); -- strcat(keymapDirFilePath, "/"); -- strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE); -+ strcpy(rulesBaseFilePath, dirPath); -+ strcat(rulesBaseFilePath, "/"); -+ strcat(rulesBaseFilePath, NX_XKB_RULES_BASE_FILE); - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n", -- keymapDirFilePath); -+ rulesBaseFilePath); - #endif - -- if (stat(keymapDirFilePath, &keymapDirFileStat) != 0) -+ if (stat(rulesBaseFilePath, &rulesBaseFileStat) != 0) - { - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n", -- keymapDirFilePath); -+ rulesBaseFilePath); - #endif - -- free(keymapDirFilePath); -+ free(rulesBaseFilePath); - - return 0; - } -@@ -235,7 +235,7 @@ - dirPath); - #endif - -- free(keymapDirFilePath); -+ free(rulesBaseFilePath); - - return 1; - } diff --git a/debian/patches/320_nxagent_configurable-keystrokes.full.patch b/debian/patches/320_nxagent_configurable-keystrokes.full.patch deleted file mode 100644 index c799c8b93..000000000 --- a/debian/patches/320_nxagent_configurable-keystrokes.full.patch +++ /dev/null @@ -1,1031 +0,0 @@ -Author: Alexander Wuerstlein -Description: Make nxagent-specific keyboard bindings configurable - Replaces the hardcoded nxagent keybindings by a configurable - table of keybindings. The default configuration is the same as the - original one, to maintain compatibility. A user/administrator can either - specify a command line parameter, environment variable or place a file - in ~/.nx/config/keystrokes.cfg or /etc/nxagent/keystrokes.cfg to reconfigure - these keybindings. - . - The configuration file format is XML, a dependency on libxml2 is added - to allow parsing the configuration. ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -1013,15 +1013,18 @@ - #if defined(SunArchitecture) - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp -+ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp \ -+`pkg-config --libs libxml-2.0` - #elif defined(cygwinArchitecture) - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ - -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ -- -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp -+ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp \ -+`pkg-config --libs libxml-2.0` - #else - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp -+ -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp \ -+`pkg-config --libs libxml-2.0` - #endif - - #endif ---- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile -+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile -@@ -142,7 +142,8 @@ - -I../../miext/damage -I../../miext/cw \ - -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) \ -- $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) -+ $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ -+ `pkg-config --cflags-only-I libxml-2.0` - #ifdef SunArchitecture - INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ - -I../../../../extras/Mesa/include \ -@@ -152,7 +153,8 @@ - -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ - -I../../miext/damage -I../../miext/cw \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) \ -- $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) -+ $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ -+ `pkg-config --cflags-only-I libxml-2.0` - #else - #ifdef cygwinArchitecture - INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ -@@ -162,7 +164,8 @@ - -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ - -I../../../../extras/Mesa/include \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) \ -- $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) -+ $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ -+ `pkg-config --cflags-only-I libxml-2.0` - #endif - #endif - ---- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c -@@ -28,8 +28,15 @@ - #include "Keystroke.h" - #include "Drawable.h" - -+#include -+ -+#include -+#include -+ - extern Bool nxagentWMIsRunning; - extern Bool nxagentIpaq; -+extern char *nxagentKeystrokeFile; -+Bool nxagentKeystrokeFileParsed = False; - - #ifdef NX_DEBUG_INPUT - int nxagentDebugInputDevices = 0; -@@ -47,297 +54,528 @@ - #undef DEBUG - #undef DUMP - --int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) --{ -- KeySym sym; -- int index = 0; - -- *result = doNothing; -+/* this table is used to parse actions given on the command line or in the -+ * config file, therefore indices have to match the enum in Keystroke.h */ -+char * nxagentSpecialKeystrokeNames[] = { -+ "end_marker", -+ "close_session", -+ "switch_all_screens", -+ "minimize", -+ "left", -+ "up", -+ "right", -+ "down", -+ "resize", -+ "defer", -+ "ignore", -+ "force_synchronization", -+ -+ "debug_tree", -+ "regions_on_screen", -+ "test_input", -+ "deactivate_input_devices_grab", -+ -+ "fullscreen", -+ "viewport_move_left", -+ "viewport_move_up", -+ "viewport_move_right", -+ "viewport_move_down", -+ NULL, -+}; -+ -+struct nxagentSpecialKeystrokeMap default_map[] = { -+ /* stroke, modifierMask, modifierAltMeta, keysym */ -+ {KEYSTROKE_DEBUG_TREE, ControlMask, 1, XK_q}, -+ {KEYSTROKE_DEBUG_TREE, ControlMask, 1, XK_Q}, -+ {KEYSTROKE_CLOSE_SESSION, ControlMask, 1, XK_t}, -+ {KEYSTROKE_CLOSE_SESSION, ControlMask, 1, XK_T}, -+ {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, 1, XK_f}, -+ {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, 1, XK_F}, -+ {KEYSTROKE_MINIMIZE, ControlMask, 1, XK_m}, -+ {KEYSTROKE_MINIMIZE, ControlMask, 1, XK_M}, -+ {KEYSTROKE_LEFT, ControlMask, 1, XK_Left}, -+ {KEYSTROKE_LEFT, ControlMask, 1, XK_KP_Left}, -+ {KEYSTROKE_UP, ControlMask, 1, XK_Up}, -+ {KEYSTROKE_UP, ControlMask, 1, XK_KP_Up}, -+ {KEYSTROKE_RIGHT, ControlMask, 1, XK_Right}, -+ {KEYSTROKE_RIGHT, ControlMask, 1, XK_KP_Right}, -+ {KEYSTROKE_DOWN, ControlMask, 1, XK_Down}, -+ {KEYSTROKE_DOWN, ControlMask, 1, XK_KP_Down}, -+ {KEYSTROKE_RESIZE, ControlMask, 1, XK_r}, -+ {KEYSTROKE_RESIZE, ControlMask, 1, XK_R}, -+ {KEYSTROKE_DEFER, ControlMask, 1, XK_e}, -+ {KEYSTROKE_DEFER, ControlMask, 1, XK_E}, -+ {KEYSTROKE_IGNORE, ControlMask, 1, XK_BackSpace}, -+ {KEYSTROKE_IGNORE, 0, 0, XK_Terminate_Server}, -+ {KEYSTROKE_FORCE_SYNCHRONIZATION, ControlMask, 1, XK_j}, -+ {KEYSTROKE_FORCE_SYNCHRONIZATION, ControlMask, 1, XK_J}, -+ {KEYSTROKE_REGIONS_ON_SCREEN, ControlMask, 1, XK_a}, -+ {KEYSTROKE_REGIONS_ON_SCREEN, ControlMask, 1, XK_A}, -+ {KEYSTROKE_TEST_INPUT, ControlMask, 1, XK_x}, -+ {KEYSTROKE_TEST_INPUT, ControlMask, 1, XK_X}, -+ {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, 1, XK_y}, -+ {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, 1, XK_Y}, -+ {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, 1, XK_f}, -+ {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, 1, XK_F}, -+ {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, 1, XK_Left}, -+ {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, 1, XK_KP_Left}, -+ {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, 1, XK_Up}, -+ {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, 1, XK_KP_Up}, -+ {KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, 1, XK_Right}, -+ {KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, 1, XK_KP_Right}, -+ {KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, 1, XK_Down}, -+ {KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, 1, XK_KP_Down}, -+ {KEYSTROKE_END_MARKER, 0, 0, 0}, -+}; -+struct nxagentSpecialKeystrokeMap *map = default_map; - -- /* -- * I don't know how much hard work is doing this operation. -- * Do we need a cache ? -+static int modifier_matches(unsigned int mask, int compare_alt_meta, unsigned int state) -+{ -+ /* nxagentAltMetaMask needs special handling -+ * it seems to me its an and-ed mask of all possible meta and alt keys -+ * somehow... -+ * -+ * otherwise this function would be just a simple bitop - */ -+ int ret = 1; - -- sym = XKeycodeToKeysym(nxagentDisplay, X -> keycode, index); -+ if (compare_alt_meta) { -+ if (! (state & nxagentAltMetaMask)) { -+ ret = 0; -+ } - -- if (sym == XK_VoidSymbol || sym == NoSymbol) -- { -- return 0; -+ mask &= ~nxagentAltMetaMask; - } - -- #ifdef TEST -- fprintf(stderr, "nxagentCheckSpecialKeystroke: got code %x - state %x - sym %lx\n", -- X -> keycode, X -> state, sym); -- #endif -- -- /* -- * Check special keys. -- */ -- -- /* -- * FIXME: We should use the keysym instead that the keycode -- * here. -- */ -+ /* all modifiers except meta/alt have to match exactly, extra bits are evil */ -+ if ((mask & state) != mask) { -+ ret = 0; -+ } - -- if (X -> keycode == 130 && nxagentIpaq) -- { -- *result = doStartKbd; -+ return ret; -+} - -- return 1; -- } -+static int read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystrokeMap *ret) -+{ -+ int successful = 0; -+ struct nxagentSpecialKeystrokeMap new = {0, 0, 0, 0}; -+ xmlAttr *attr; - -- if ((X -> state & nxagentAltMetaMask) && -- ((X -> state & (ControlMask | ShiftMask)) == ControlMask)) -+ for (attr = node->properties; attr; attr = attr->next) - { -- switch (sym) -+ /* ignore attributes without data (which should never happen anyways) */ -+ if (attr->children->content == NULL) - { -- #ifdef DEBUG_TREE -- -- case XK_q: -- case XK_Q: -- { -- *result = doDebugTree; -- -- break; -- } -- -- #endif /* DEBUG_TREE */ -- -- case XK_t: -- case XK_T: -- { -- *result = doCloseSession; -- -- break; -- } -- case XK_f: -- case XK_F: -+ char *aname = (attr->name)?(attr->name):"unknown"; -+ fprintf(stderr, "attribute %s with NULL value", aname); -+ continue; -+ } -+ if (strcmp((char *)attr->name, "action") == 0) -+ { -+ int i; -+ for (i = 0; nxagentSpecialKeystrokeNames[i] != NULL; i++) - { -- if (nxagentOption(Rootless) == False) -+ if (strcmp(nxagentSpecialKeystrokeNames[i],(char *)attr->children->content) == 0) - { -- *result = doSwitchAllScreens; -+ /* this relies on the values of enum nxagentSpecialKeystroke and the -+ * indices of nxagentSpecialKeystrokeNames being in sync */ -+ new.stroke = i; -+ break; - } -- -- break; - } -- case XK_m: -- case XK_M: -+ continue; -+ } -+ else if (strcmp((char *)attr->name, "key") == 0) -+ { -+ new.keysym = XStringToKeysym((char *)attr->children->content); -+ /* NoSymbol is usually 0, but could there be weird implementations? */ -+ if (new.keysym == NoSymbol) - { -- if (nxagentOption(Rootless) == False) -- { -- *result = doMinimize; -- } -- -- break; -+ new.keysym = 0; - } -- case XK_Left: -- case XK_KP_Left: -- { -- if (nxagentOption(Rootless) == False && -- nxagentOption(DesktopResize) == False) -- { -- *result = doViewportLeft; -- } -+ continue; -+ } - -- break; -- } -- case XK_Up: -- case XK_KP_Up: -- { -- if (nxagentOption(Rootless) == False && -- nxagentOption(DesktopResize) == False) -- { -- *result = doViewportUp; -- } -+ /* ignore attributes with value="0" or "false", everything else is interpreted as true */ -+ if (strcmp((char *)attr->children->content, "0") == 0 || strcmp((char *)attr->children->content, "false") == 0) -+ continue; - -- break; -- } -- case XK_Right: -- case XK_KP_Right: -- { -- if (nxagentOption(Rootless) == False && -- nxagentOption(DesktopResize) == False) -- { -- *result = doViewportRight; -- } -+ if (strcmp((char *)attr->name, "Mod1") == 0) -+ { -+ new.modifierMask |= Mod1Mask; -+ } -+ else if (strcmp((char *)attr->name, "Mod2") == 0) -+ { -+ new.modifierMask |= Mod2Mask; -+ } -+ else if (strcmp((char *)attr->name, "Mod3") == 0) -+ { -+ new.modifierMask |= Mod3Mask; -+ } -+ else if (strcmp((char *)attr->name, "Mod4") == 0) -+ { -+ new.modifierMask |= Mod4Mask; -+ } -+ else if (strcmp((char *)attr->name, "Control") == 0) -+ { -+ new.modifierMask |= ControlMask; -+ } -+ else if (strcmp((char *)attr->name, "Shift") == 0) -+ { -+ new.modifierMask |= ShiftMask; -+ } -+ else if (strcmp((char *)attr->name, "Lock") == 0) -+ { -+ new.modifierMask |= LockMask; -+ } -+ else if (strcmp((char *)attr->name, "AltMeta") == 0) -+ { -+ new.modifierAltMeta = 1; -+ } -+ } - -- break; -- } -- case XK_Down: -- case XK_KP_Down: -- { -- if (nxagentOption(Rootless) == 0 && -- nxagentOption(DesktopResize) == 0) -- { -- *result = doViewportDown; -- } -+ if (new.stroke != 0 && new.keysym != 0) -+ { -+ /* keysym and stroke are required, everything else is optional */ -+ successful = 1; -+ memcpy(ret, &new, sizeof(struct nxagentSpecialKeystrokeMap)); -+ } -+ return successful; -+} - -- break; -- } -- case XK_R: -- case XK_r: -- { -- if (nxagentOption(Rootless) == 0) -- { -- *result = doSwitchResizeMode; -- } -+/* -+ * searches a keystroke xml file -+ * -+ * search order: -+ * - '-keystrokefile' commandline parameter -+ * - $NXAGENT_KEYSTROKEFILE environment variable -+ * - $HOME/.nx/config/keystrokes.cfg -+ * - /etc/nxagent/keystrokes.cfg -+ * - hardcoded traditional NX default settings -+ */ -+static void parse_keystroke_file(void) -+{ -+ char *filename = NULL; - -- break; -- } -- case XK_E: -- case XK_e: -- { -- *result = doSwitchDeferMode; -+ char *homefile = "/.nx/config/keystrokes.cfg"; -+ char *etcfile = "/etc/nxagent/keystrokes.cfg"; - -- break; -+ if (nxagentKeystrokeFile != NULL && access(nxagentKeystrokeFile, R_OK) == 0) -+ { -+ filename = strdup(nxagentKeystrokeFile); -+ if (filename == NULL) -+ { -+ fprintf(stderr, "malloc failed"); -+ exit(EXIT_FAILURE); -+ } -+ } -+ else if ((filename = getenv("NXAGENT_KEYSTROKEFILE")) != NULL && access(filename, R_OK) == 0) -+ { -+ filename = strdup(filename); -+ if (filename == NULL) -+ { -+ fprintf(stderr, "malloc failed"); -+ exit(EXIT_FAILURE); -+ } -+ } -+ else -+ { -+ char *homedir = getenv("HOME"); -+ filename = NULL; -+ if (homedir != NULL) -+ { -+ homedir = strdup(homedir); -+ if (homedir == NULL) -+ { -+ fprintf(stderr, "malloc failed"); -+exit(EXIT_FAILURE); - } -- case XK_BackSpace: -- case XK_Terminate_Server: -+ filename = calloc(1, strlen(homefile) + strlen(homedir) + 1); -+ if (filename == NULL) - { -- /* -- * Discard Ctrl-Alt-BackSpace key. -- */ -- -- return 1; -- -- break; -+ fprintf(stderr, "malloc failed"); -+ exit(EXIT_FAILURE); - } -- -- case XK_J: -- case XK_j: -+ strcpy(filename, homedir); -+ strcpy(filename + strlen(homedir), homefile); -+ if (homedir) - { -- nxagentForceSynchronization = 1; -- -- return 1; -+ free(homedir); - } -+ } - -- #ifdef DUMP -- -- case XK_A: -- case XK_a: -+ if (access(filename, R_OK) == 0) -+ { -+ /* empty */ -+ } -+ else if (access(etcfile, R_OK) == 0) -+ { -+ if (filename) -+ free(filename); -+ filename = strdup(etcfile); -+ if (filename == NULL) - { -- /* -- * Used to test the lazy encoding. -- */ -- -- nxagentRegionsOnScreen(); -- -- return 1; -+ fprintf(stderr, "malloc failed"); -+ exit(EXIT_FAILURE); - } -+ } -+ else -+ { -+ if (filename) -+free(filename); -+ filename = NULL; -+ } -+ } - -- #endif -- -- #ifdef NX_DEBUG_INPUT -+ /* now we know which file to read, if any */ -+ if (filename) -+ { -+ xmlDoc *doc = NULL; -+ xmlNode *root = NULL; -+ LIBXML_TEST_VERSION -+ doc = xmlReadFile(filename, NULL, 0); -+ if (doc != NULL) -+ { -+ xmlNode *cur = NULL; -+ root = xmlDocGetRootElement(doc); - -- case XK_X: -- case XK_x: -+ for (cur = root; cur; cur = cur->next) - { -- /* -- * Used to test the input devices state. -- */ -+ if (cur->type == XML_ELEMENT_NODE && strcmp((char *)cur->name, "keystrokes") == 0) -+{ -+ xmlNode *bindings = NULL; -+ int num = 0; -+ int idx = 0; - -- if (X -> type == KeyPress) -- { -- if (nxagentDebugInputDevices == 0) -+ for (bindings = cur->children; bindings; bindings = bindings->next) - { -- fprintf(stderr, "Info: Turning input devices debug ON.\n"); -- -- nxagentDebugInputDevices = 1; -+ if (bindings->type == XML_ELEMENT_NODE && strcmp((char *)bindings->name, "keystroke") == 0) -+ { -+ num++; -+ } - } -- else -+ map = calloc((num + 1), sizeof(struct nxagentSpecialKeystrokeMap)); -+ if (map == NULL) - { -- fprintf(stderr, "Info: Turning input devices debug OFF.\n"); -- -- nxagentDebugInputDevices = 0; -- -- nxagentLastInputDevicesDumpTime = 0; -+ fprintf(stderr, "malloc failed"); -+ exit(EXIT_FAILURE); - } -- } -- -- return 1; -- } - -- case XK_Y: -- case XK_y: -- { -- /* -- * Used to deactivate input devices grab. -- */ -+ for (bindings = cur->children; bindings; bindings = bindings->next) -+ { -+ if (bindings->type == XML_ELEMENT_NODE && strcmp((char *)bindings->name, "keystroke") == 0) -+ { -+ int res = 0; -+ res = read_binding_from_xmlnode(bindings, &(map[idx])); -+ if (res) -+ idx++; -+ } -+ } - -- if (X -> type == KeyPress) -- { -- nxagentDeactivateInputDevicesGrabs(); -+ map[idx].stroke = KEYSTROKE_END_MARKER; - } -- -- return 1; - } - -+ xmlFreeDoc(doc); -+ xmlCleanupParser(); -+ } -+ else -+ { -+ #ifdef DEBUG -+ fprintf("XML parsing for %s failed\n", filename); - #endif - } -+ free(filename); - } -- else if ((X -> state & nxagentAltMetaMask) && -- ((X -> state & (ControlMask | ShiftMask)) == (ControlMask | -- ShiftMask))) -+} -+ -+static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) -+{ -+ KeySym keysym = XKeycodeToKeysym(nxagentDisplay, X->keycode, 0); -+ struct nxagentSpecialKeystrokeMap *cur = map; -+ -+ if (! nxagentKeystrokeFileParsed) - { -- switch (sym) -- { -- case XK_f: -- case XK_F: -- { -- if (nxagentOption(Rootless) == 0) -- { -- *result = doSwitchFullscreen; -- } -+ parse_keystroke_file(); -+ nxagentKeystrokeFileParsed = True; -+ } - -- break; -- } -- case XK_Left: -- case XK_KP_Left: -- { -- if (nxagentOption(Rootless) == 0 && -- nxagentOption(DesktopResize) == 0) -- { -- *result = doViewportMoveLeft; -- } -+ enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING; - -- break; -- } -- case XK_Up: -- case XK_KP_Up: -- { -- if (nxagentOption(Rootless) == 0 && -- nxagentOption(DesktopResize) == 0) -- { -- *result = doViewportMoveUp; -- } -+ while (cur->stroke != KEYSTROKE_END_MARKER) { -+ if (cur->keysym == keysym && modifier_matches(cur->modifierMask, cur->modifierAltMeta, X->state)) { -+ return cur->stroke; -+ } -+ cur++; -+ } - -- break; -- } -- case XK_Right: -- case XK_KP_Right: -- { -- if (nxagentOption(Rootless) == 0 && -- nxagentOption(DesktopResize) == 0) -- { -- *result = doViewportMoveRight; -- } -+ return ret; -+} - -- break; -- } -- case XK_Down: -- case XK_KP_Down: -- { -- if (nxagentOption(Rootless) == 0 && -- nxagentOption(DesktopResize) == 0) -- { -- *result = doViewportMoveDown; -- } -+int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) -+{ -+ KeySym sym; -+ int index = 0; -+ enum nxagentSpecialKeystroke stroke = find_keystroke(X); - -- break; -- } -- } -+ *result = doNothing; -+ -+ /* -+ * I don't know how much hard work is doing this operation. -+ * Do we need a cache ? -+ */ -+ -+ sym = XKeycodeToKeysym(nxagentDisplay, X -> keycode, index); -+ -+ if (sym == XK_VoidSymbol || sym == NoSymbol) -+ { -+ return 0; - } - -+ #ifdef TEST -+ fprintf(stderr, "nxagentCheckSpecialKeystroke: got code %x - state %x - sym %lx\n", -+ X -> keycode, X -> state, sym); -+ #endif -+ -+ /* -+ * Check special keys. -+ */ -+ -+ /* -+ * FIXME: We should use the keysym instead that the keycode -+ * here. -+ */ -+ -+ if (X -> keycode == 130 && nxagentIpaq) -+ { -+ *result = doStartKbd; -+ -+ return 1; -+ } -+ -+ switch (stroke) { -+ case KEYSTROKE_DEBUG_TREE: -+ #ifdef DEBUG_TREE -+ *result = doDebugTree; -+ #endif -+ break; -+ case KEYSTROKE_CLOSE_SESSION: -+ *result = doCloseSession; -+ break; -+ case KEYSTROKE_SWITCH_ALL_SCREENS: -+ if (nxagentOption(Rootless) == False) { -+ *result = doSwitchAllScreens; -+ } -+ break; -+ case KEYSTROKE_MINIMIZE: -+ if (nxagentOption(Rootless) == False) { -+ *result = doMinimize; -+ } -+ break; -+ case KEYSTROKE_LEFT: -+ if (nxagentOption(Rootless) == False && -+ nxagentOption(DesktopResize) == False) { -+ *result = doViewportLeft; -+ } -+ break; -+ case KEYSTROKE_UP: -+ if (nxagentOption(Rootless) == False && -+ nxagentOption(DesktopResize) == False) { -+ *result = doViewportUp; -+ } -+ break; -+ case KEYSTROKE_RIGHT: -+ if (nxagentOption(Rootless) == False && -+ nxagentOption(DesktopResize) == False) { -+ *result = doViewportRight; -+ } -+ break; -+ case KEYSTROKE_DOWN: -+ if (nxagentOption(Rootless) == False && -+ nxagentOption(DesktopResize) == False) { -+ *result = doViewportDown; -+ } -+ break; -+ case KEYSTROKE_RESIZE: -+ if (nxagentOption(Rootless) == False) { -+ *result = doSwitchResizeMode; -+ } -+ break; -+ case KEYSTROKE_DEFER: -+ *result = doSwitchDeferMode; -+ break; -+ case KEYSTROKE_IGNORE: -+ /* this is used e.g. to ignore C-A-Backspace aka XK_Terminate_Server */ -+ return 1; -+ break; -+ case KEYSTROKE_FORCE_SYNCHRONIZATION: -+ nxagentForceSynchronization = 1; -+ break; -+ case KEYSTROKE_REGIONS_ON_SCREEN: -+ #ifdef DUMP -+ nxagentRegionsOnScreen(); -+ #endif -+ break; -+ case KEYSTROKE_TEST_INPUT: -+ /* -+ * Used to test the input devices state. -+ */ -+ #ifdef NX_DEBUG_INPUT -+ if (X -> type == KeyPress) { -+ if (nxagentDebugInputDevices == 0) { -+ fprintf(stderr, "Info: Turning input devices debug ON.\n"); -+ nxagentDebugInputDevices = 1; -+ } else { -+ fprintf(stderr, "Info: Turning input devices debug OFF.\n"); -+ nxagentDebugInputDevices = 0; -+ nxagentLastInputDevicesDumpTime = 0; -+ } -+ } -+ return 1; -+ #endif -+ break; -+ case KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB: -+ #ifdef NX_DEBUG_INPUT -+ if (X->type == KeyPress) { -+ nxagentDeactivateInputDevicesGrab(); -+ } -+ return 1; -+ #endif -+ break; -+ case KEYSTROKE_FULLSCREEN: -+ if (nxagentOption(Rootless) == 0) { -+ *result = doSwitchFullscreen; -+ } -+ break; -+ case KEYSTROKE_VIEWPORT_MOVE_LEFT: -+ if (nxagentOption(Rootless) == 0 && -+ nxagentOption(DesktopResize) == 0) { -+ *result = doViewportMoveLeft; -+ } -+ break; -+ case KEYSTROKE_VIEWPORT_MOVE_UP: -+ if (nxagentOption(Rootless) == 0 && -+ nxagentOption(DesktopResize) == 0) { -+ *result = doViewportMoveUp; -+ } -+ break; -+ case KEYSTROKE_VIEWPORT_MOVE_RIGHT: -+ if (nxagentOption(Rootless) == 0 && -+ nxagentOption(DesktopResize) == 0) { -+ *result = doViewportMoveRight; -+ } -+ break; -+ case KEYSTROKE_VIEWPORT_MOVE_DOWN: -+ if (nxagentOption(Rootless) == 0 && -+ nxagentOption(DesktopResize) == 0) { -+ *result = doViewportMoveDown; -+ } -+ break; -+ case KEYSTROKE_NOTHING: /* do nothing. difference to KEYSTROKE_IGNORE is the return value */ -+ case KEYSTROKE_END_MARKER: /* just to make gcc STFU */ -+ case KEYSTROKE_MAX: -+ break; -+ } - return (*result == doNothing) ? 0 : 1; - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h -@@ -24,4 +24,51 @@ - - unsigned int nxagentAltMetaMask; - -+/* keep this sorted, do not rely on any numerical value in this enum, and be aware -+ * that KEYSTROKE_MAX may be used in a malloc */ -+ -+/* also be aware that if changing any numerical values, you also need to change values -+ * Keystroke.c nxagentSpecialKeystrokeNames */ -+enum nxagentSpecialKeystroke { -+ /* 0 is used as end marker */ -+ KEYSTROKE_END_MARKER = 0, -+ KEYSTROKE_CLOSE_SESSION = 1, -+ KEYSTROKE_SWITCH_ALL_SCREENS = 2, -+ KEYSTROKE_MINIMIZE = 3, -+ KEYSTROKE_LEFT = 4, -+ KEYSTROKE_UP = 5, -+ KEYSTROKE_RIGHT = 6, -+ KEYSTROKE_DOWN = 7, -+ KEYSTROKE_RESIZE = 8, -+ KEYSTROKE_DEFER = 9, -+ KEYSTROKE_IGNORE = 10, -+ KEYSTROKE_FORCE_SYNCHRONIZATION = 11, -+ -+ /* stuff used for debugging, probably not useful for most people */ -+ KEYSTROKE_DEBUG_TREE = 12, -+ KEYSTROKE_REGIONS_ON_SCREEN = 13, -+ KEYSTROKE_TEST_INPUT = 14, -+ KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB = 15, -+ -+ KEYSTROKE_FULLSCREEN = 16, -+ KEYSTROKE_VIEWPORT_MOVE_LEFT = 17, -+ KEYSTROKE_VIEWPORT_MOVE_UP = 18, -+ KEYSTROKE_VIEWPORT_MOVE_RIGHT = 19, -+ KEYSTROKE_VIEWPORT_MOVE_DOWN = 20, -+ -+ KEYSTROKE_NOTHING = 21, -+ -+ /* insert more here, increment KEYSTROKE_MAX accordingly. -+ * then update string translation below */ -+ -+ KEYSTROKE_MAX=22, -+}; -+ -+struct nxagentSpecialKeystrokeMap { -+ enum nxagentSpecialKeystroke stroke; -+ unsigned int modifierMask; /* everything except alt/meta */ -+ int modifierAltMeta; /* modifier combination should include alt/meta */ -+ KeySym keysym; -+}; -+ - #endif /* __Keystroke_H__ */ ---- /dev/null -+++ b/README.keystrokes -@@ -0,0 +1,83 @@ -+Configurable keybindings in nxagent -+ -+Keybindings in the redistributed x2go version of nxagent can now be configured -+by the user. This is done via a configuration file. -+ -+File location -+------------- -+ -+nxagent searches for the configuration file in the following order: -+- in the location given by the '-keystrokefile' command line parameter -+- in the location given by the NXAGENT_KEYSTROKEFILE environment variable -+- in ~/.nx/config/keystrokes.cfg -+- in /etc/nxagent/keystrokes.cfg -+ -+If none of those files is accessible, the default configuration is used which -+is the same as the old, traditional nxagent keybindings. -+ -+File format -+----------- -+ -+The configuration file is XML with the following format: -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+Each 'action' defines an action to be executed when receiving that keystroke. A -+list of possible actions is given below. Some of those actions are only -+available with debug builds of nxagent. -+ -+Keys are given as a combination of 'key' and (optionally) a number of -+modifiers. The key attribute is evaluated into a X11 key via the usual -+XStringToKeysym function. A list of possible keys can be found in -+/usr/include/X11/keysymdef.h, the names are specified without the leading -+'XK_'. Evaluation is case-sensitive, so, 'space' and 'Escape' will work while -+'Space' and 'escape' won't. -+ -+Modifiers are given as boolean attributes, possible modifiers are Mod1, Mod2, -+Mod3, Mod4, Control, Shift, Lock. Sensible combinations strongly depend on your -+keyboard configuration, but usually you will need Mod1 and Control. Boolean in -+this context means '0', 'false' and an unspecified attribute are false, anything -+else is considered true. -+ -+Everything in this file is case-sensitive. Unknown lines are ignored. -+Keybindings are evaluated from top to bottom, so if a keybinding matches, other -+keybindings further down will be ignored. The contents of the file replaces the -+default keybindings, and only one file is read, no merging between different -+configuration files is done. This also means that an empty or invalid configuration -+file deactivates all keybindings. -+ -+List of possible 'action' attributes: -+------------------------------------- -+ -+close_session -+switch_all_screens -+minimize -+left -+up -+right -+down -+resize -+defer -+ignore -+fullscreen -+viewport_move_left -+viewport_move_up -+viewport_move_right -+viewport_move_down -+ -+Only in builds with certain debugging options enabled, ignored otherwise: -+force_synchronization -+debug_tree -+regions_on_screen -+test_input -+deactivate_input_devices_grab ---- a/nx-X11/programs/Xserver/hw/nxagent/Args.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c -@@ -149,6 +149,8 @@ - - char nxagentVerbose = 0; - -+char *nxagentKeystrokeFile = NULL; -+ - int ddxProcessArgument(int argc, char *argv[], int i) - { - /* -@@ -1022,6 +1024,20 @@ - return 1; - } - -+ if (!strcmp(argv[i], "-keystrokefile")) -+ { -+ if (i + 1 < argc) -+ { -+ if (NULL != (nxagentKeystrokeFile = strdup(argv[i + 1]))) -+ { -+ return 2; -+ } else { -+ FatalError("malloc failed"); -+ } -+ } -+ return 0; -+ } -+ - return 0; - } - ---- a/nx-X11/programs/Xserver/hw/nxagent/Args.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h -@@ -83,4 +83,6 @@ - - extern int nxagentRemoteMajor; - -+extern char *nxagentKeystrokeFile; -+ - #endif /* __Args_H__ */ diff --git a/debian/patches/321_nxagent_x2go-specific-keystroke-config.full.patch b/debian/patches/321_nxagent_x2go-specific-keystroke-config.full.patch deleted file mode 100644 index 795f10b76..000000000 --- a/debian/patches/321_nxagent_x2go-specific-keystroke-config.full.patch +++ /dev/null @@ -1,25 +0,0 @@ -Description: Adapt paths of keystrokes.cfg if nxagent runs as x2goagent -Author: Horst Schirmeier - ---- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c -@@ -27,6 +27,7 @@ - #include "Options.h" - #include "Keystroke.h" - #include "Drawable.h" -+#include "Init.h" /* extern int nxagentX2go */ - - #include - -@@ -261,6 +262,11 @@ static void parse_keystroke_file(void) - char *homefile = "/.nx/config/keystrokes.cfg"; - char *etcfile = "/etc/nxagent/keystrokes.cfg"; - -+ if (nxagentX2go) { -+ homefile = "/.x2go/config/keystrokes.cfg"; -+ etcfile = "/etc/x2go/keystrokes.cfg"; -+ } -+ - if (nxagentKeystrokeFile != NULL && access(nxagentKeystrokeFile, R_OK) == 0) - { - filename = strdup(nxagentKeystrokeFile); diff --git a/debian/patches/400_nxcomp-version.full+lite.patch b/debian/patches/400_nxcomp-version.full+lite.patch deleted file mode 100644 index 703cec823..000000000 --- a/debian/patches/400_nxcomp-version.full+lite.patch +++ /dev/null @@ -1,240 +0,0 @@ -Description: Allow version 4-digit version comparison/handshake -Author: Nito Martinez ---- a/nxcomp/Control.cpp -+++ b/nxcomp/Control.cpp -@@ -15,6 +15,7 @@ - /* */ - /**************************************************************************/ - -+#include "NX.h" - #include "NXpack.h" - - #include "Control.h" -@@ -594,44 +595,17 @@ - RemoteVersionMajor = -1; - RemoteVersionMinor = -1; - RemoteVersionPatch = -1; -+ RemoteVersionMaintenancePatch = -1; - - CompatVersionMajor = -1; - CompatVersionMinor = -1; - CompatVersionPatch = -1; -+ CompatVersionMaintenancePatch = -1; - -- char version[32]; -- -- strcpy(version, VERSION); -- -- char *value; -- -- value = strtok(version, "."); -- -- for (int i = 0; value != NULL && i < 3; i++) -- { -- switch (i) -- { -- case 0: -- -- LocalVersionMajor = atoi(value); -- -- break; -- -- case 1: -- -- LocalVersionMinor = atoi(value); -- -- break; -- -- case 2: -- -- LocalVersionPatch = atoi(value); -- -- break; -- } -- -- value = strtok(NULL, "."); -- } -+ LocalVersionMajor = NXMajorVersion(); -+ LocalVersionMinor = NXMinorVersion(); -+ LocalVersionPatch = NXPatchVersion(); -+ LocalVersionMaintenancePatch = NXMaintenancePatchVersion(); - - #ifdef TEST - *logofs << "Control: Major version is " << LocalVersionMajor ---- a/nxcomp/Control.h -+++ b/nxcomp/Control.h -@@ -299,17 +299,26 @@ - // Version number of local and remote proxy. - // - -+ /* -+ * LocalVersionMaintenancePatch, RemoteVersionMaintenancePatch -+ * CompatVersionMaintenancePatch -+ * -+ * currently not used, for future compatibility checks -+ */ - int LocalVersionMajor; - int LocalVersionMinor; - int LocalVersionPatch; -+ int LocalVersionMaintenancePatch; - - int RemoteVersionMajor; - int RemoteVersionMinor; - int RemoteVersionPatch; -+ int RemoteVersionMaintenancePatch; - - int CompatVersionMajor; - int CompatVersionMinor; - int CompatVersionPatch; -+ int CompatVersionMaintenancePatch; - - // - // Which unpack methods are implemented in proxy? ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -14250,7 +14250,8 @@ - cerr << "NXPROXY - " << "Version " - << control -> LocalVersionMajor << "." - << control -> LocalVersionMinor << "." -- << control -> LocalVersionPatch; -+ << control -> LocalVersionPatch << "." -+ << control -> LocalVersionMaintenancePatch; - - cerr << endl; - } ---- a/nxcomp/Makefile.in -+++ b/nxcomp/Makefile.in -@@ -105,7 +105,8 @@ - - CSRC = MD5.c \ - Pack.c \ -- Vars.c -+ Vars.c \ -+ Version.c - - CXXSRC = Loop.cpp \ - Children.cpp \ ---- a/nxcomp/NX.h -+++ b/nxcomp/NX.h -@@ -442,6 +442,12 @@ - - extern void NXTransCleanup(void) __attribute__((noreturn)); - -+extern const char* NXVersion(); -+extern int NXMajorVersion(); -+extern int NXMinorVersion(); -+extern int NXPatchVersion(); -+extern int NXMaintenancePatchVersion(); -+ - #ifdef __cplusplus - } - #endif ---- /dev/null -+++ b/nxcomp/Version.c -@@ -0,0 +1,106 @@ -+/**************************************************************************/ -+/* */ -+/* Copyright (C) 2014 Qindel http://qindel.com and QVD http://theqvd.com */ -+/* */ -+/* 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 3 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, see . */ -+/* */ -+/* Additional permission under GNU GPL version 3 section 7 */ -+/* */ -+/* If you modify this Program, or any covered work, by linking or */ -+/* combining it with [name of library] (or a modified version of that */ -+/* library), containing parts covered by the terms of [name of library's */ -+/* license], the licensors of this Program grant you additional */ -+/* permission to convey the resulting work. {Corresponding Source for a */ -+/* non-source form of such a combination shall include the source code */ -+/* for the parts of [name of library] used as well as that of the covered */ -+/* work.} */ -+/* */ -+/* */ -+/**************************************************************************/ -+ -+#include -+#include -+#include -+#include "NX.h" -+ -+ -+static int _NXVersionMajor = -1; -+static int _NXVersionMinor = -1; -+static int _NXVersionPatch = -1; -+static int _NXVersionMaintenancePatch = -1; -+ -+ -+const char* NXVersion() { -+ const char *version = VERSION; -+ return version; -+} -+ -+void _parseNXVersion() { -+ char version[32]; -+ int i; -+ strcpy(version, VERSION); -+ -+ char *value; -+ /* Reset values to 0 if undefined */ -+ _NXVersionMajor = _NXVersionMinor = _NXVersionPatch = _NXVersionMaintenancePatch = 0; -+ -+ -+#define NXVERSIONSEPARATOR "." -+ value = strtok(version, NXVERSIONSEPARATOR); -+ -+ for (i = 0; value != NULL && i < 4; i++) -+ { -+ switch (i) -+ { -+ case 0: -+ _NXVersionMajor = atoi(value); -+ break; -+ -+ case 1: -+ _NXVersionMinor = atoi(value); -+ break; -+ -+ case 2: -+ _NXVersionPatch = atoi(value); -+ break; -+ -+ case 3: -+ _NXVersionMaintenancePatch = atoi(value); -+ break; -+ } -+ -+ value = strtok(NULL, NXVERSIONSEPARATOR); -+ } -+} -+ -+int NXMajorVersion() { -+ if (_NXVersionMajor == -1) -+ _parseNXVersion(); -+ return _NXVersionMajor; -+} -+int NXMinorVersion() { -+ if (_NXVersionMinor == -1) -+ _parseNXVersion(); -+ return _NXVersionMinor; -+} -+int NXPatchVersion() { -+ if (_NXVersionPatch == -1) -+ _parseNXVersion(); -+ return _NXVersionPatch; -+} -+int NXMaintenancePatchVersion() { -+ if (_NXVersionMaintenancePatch == -1) -+ _parseNXVersion(); -+ return _NXVersionMaintenancePatch; -+} diff --git a/debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch b/debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch deleted file mode 100644 index ab16864df..000000000 --- a/debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch +++ /dev/null @@ -1,1870 +0,0 @@ ---- a/nxcomp/ClientChannel.cpp -+++ b/nxcomp/ClientChannel.cpp -@@ -447,6 +447,26 @@ - } - } - -+ // Get other bits of the header, so will not need to refer to them again -+ unsigned char inputDataByte = inputMessage[1]; -+ unsigned int buffer2 = GetUINT(inputMessage + 2, bigEndian_); -+ unsigned int inputDataSize = buffer2 - 1; -+ if (buffer2 == 0) -+ { -+ // BIG-REQUESTS -+ inputMessage += 4; -+ inputLength -= 4; -+ inputDataSize = GetULONG(inputMessage, bigEndian_) - 2; -+ } -+ if (inputLength != (4 * (inputDataSize + 1))) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead: inputLength=" << inputLength -+ << " mismatch inputDataSize=" << inputDataSize -+ << ".\n" << logofs_flush; -+ #endif -+ } -+ - // - // Go to the message's specific encoding. - // -@@ -455,6 +475,11 @@ - { - case X_AllocColor: - { -+ #ifdef WARNING -+ if (inputLength < 14) -+ *logofs << "handleRead: X_AllocColor inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> colormapCache); - const unsigned char *nextSrc = inputMessage + 8; -@@ -476,6 +501,11 @@ - break; - case X_ReparentWindow: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ReparentWindow inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), -@@ -486,6 +516,11 @@ - break; - case X_ChangeProperty: - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_ChangeProperty inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_ChangeProperty); - -@@ -501,8 +536,36 @@ - encodeBuffer.encodeCachedValue(format, 8, - clientCache_ -> changePropertyFormatCache); - unsigned int dataLength = GetULONG(inputMessage + 20, bigEndian_); -+ -+ // Self-preserving sanity check (otherwise we crash and dump core): -+ // some clients do this when not getting their beloved BIG-REQUESTS. -+ unsigned int maxLength = 0; -+ if (format == 8) -+ { -+ maxLength = inputLength - 24; -+ } -+ else if (format == 32) -+ { -+ maxLength = (inputLength - 24) >> 2; -+ } -+ else if (format == 16) -+ { -+ maxLength = (inputLength - 24) >> 1; -+ } -+ if (dataLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_ChangeProperty bogus dataLength=" << dataLength -+ << " set to " << maxLength -+ << " when format=" << (int)format -+ << " inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ dataLength = maxLength; -+ } -+ - encodeBuffer.encodeValue(dataLength, 32, 6); -- encodeBuffer.encodeValue(inputMessage[1], 2); -+ encodeBuffer.encodeValue(inputDataByte, 2); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 8, bigEndian_), 29, -@@ -533,7 +596,7 @@ - nextSrc += 4; - } - } -- else -+ else if (format == 16) - { - for (unsigned int i = 0; i < dataLength; i++) - { -@@ -541,6 +604,13 @@ - nextSrc += 2; - } - } -+ else -+ { -+ #ifdef WARNING -+ *logofs << "ChangeProperty bogus format=" << (int)format -+ << ".\n" << logofs_flush; -+ #endif -+ } - } - break; - case X_SendEvent: -@@ -551,6 +621,11 @@ - // ratio. - // - -+ #ifdef WARNING -+ if (inputLength < 44) -+ *logofs << "handleRead: X_SendEvent inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_SendEvent); - -@@ -562,7 +637,7 @@ - break; - } - -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - unsigned int window = GetULONG(inputMessage + 4, bigEndian_); - - if (window == 0 || window == 1) -@@ -599,7 +674,12 @@ - break; - case X_ChangeWindowAttributes: - { -- encodeBuffer.encodeValue((inputLength - 12) >> 2, 4); -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ChangeWindowAttributes inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeValue(inputDataSize - 2, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - unsigned int bitmask = GetULONG(inputMessage + 8, bigEndian_); -@@ -621,6 +701,11 @@ - break; - case X_ClearArea: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ClearArea inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -654,7 +739,7 @@ - break; - } - -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - const unsigned char *nextSrc = inputMessage + 8; -@@ -668,6 +753,11 @@ - break; - case X_CloseFont: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_CloseFont inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int font = GetULONG(inputMessage + 4, bigEndian_); - encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); - clientCache_ -> lastFont = font; -@@ -675,6 +765,11 @@ - break; - case X_ConfigureWindow: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_ConfigureWindow inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_ConfigureWindow); - -@@ -708,6 +803,11 @@ - break; - case X_ConvertSelection: - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_ConvertSelection inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> convertSelectionRequestorCache, 9); - const unsigned char* nextSrc = inputMessage + 8; -@@ -725,6 +825,11 @@ - break; - case X_CopyArea: - { -+ #ifdef WARNING -+ if (inputLength < 28) -+ *logofs << "handleRead: X_CopyArea inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -793,6 +898,11 @@ - break; - case X_CopyGC: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_CopyGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int s_g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -814,6 +924,11 @@ - break; - case X_CopyPlane: - { -+ #ifdef WARNING -+ if (inputLength < 32) -+ *logofs << "handleRead: X_CopyPlane inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -833,6 +948,11 @@ - break; - case X_CreateGC: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_CreateGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -917,6 +1037,11 @@ - break; - case X_ChangeGC: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ChangeGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -998,14 +1123,19 @@ - break; - case X_CreatePixmap: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_CreatePixmap inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - -- *logofs << "handleRead: X_CreatePixmap depth " << (unsigned) inputMessage[1] -+ *logofs << "handleRead: X_CreatePixmap depth " << (unsigned) inputDataByte - << ", pixmap id " << GetULONG(inputMessage + 4, bigEndian_) - << ", drawable " << GetULONG(inputMessage + 8, bigEndian_) - << ", width " << GetUINT(inputMessage + 12, bigEndian_) - << ", height " << GetUINT(inputMessage + 14, bigEndian_) -- << ", size " << GetUINT(inputMessage + 2, bigEndian_) << 2 -+ << ", length " << inputLength - << ".\n" << logofs_flush; - - unsigned int p_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1042,6 +1172,11 @@ - break; - case X_CreateWindow: - { -+ #ifdef WARNING -+ if (inputLength < 32) -+ *logofs << "handleRead: X_CreateWindow inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int w_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1054,7 +1189,7 @@ - #endif - - unsigned bitmask = GetULONG(inputMessage + 28, bigEndian_); -- encodeBuffer.encodeCachedValue((unsigned int) inputMessage[1], 8, -+ encodeBuffer.encodeCachedValue((unsigned int) inputDataByte, 8, - clientCache_ -> depthCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), - clientCache_ -> windowCache); -@@ -1098,6 +1233,11 @@ - break; - case X_DeleteProperty: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_DeleteProperty inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeValue(GetULONG(inputMessage + 8, bigEndian_), 29, 9); -@@ -1105,6 +1245,11 @@ - break; - case X_FillPoly: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_FillPoly inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1138,7 +1283,7 @@ - break; - } - -- unsigned int numPoints = ((inputLength - 16) >> 2); -+ unsigned int numPoints = (inputDataSize - 3); - - if (control -> isProtoStep10() == 1) - { -@@ -1209,7 +1354,12 @@ - break; - case X_FreeColors: - { -- unsigned int numPixels = GetUINT(inputMessage + 2, bigEndian_) - 3; -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_FreeColors inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ unsigned int numPixels = inputDataSize - 2; - encodeBuffer.encodeValue(numPixels, 16, 4); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> colormapCache); -@@ -1225,12 +1375,22 @@ - break; - case X_FreeCursor: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_FreeCursor inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), - 29, clientCache_ -> cursorCache, 9); - } - break; - case X_FreeGC: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_FreeGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1284,6 +1444,11 @@ - break; - case X_FreePixmap: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_FreePixmap inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int p_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1318,6 +1483,11 @@ - break; - case X_GetAtomName: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetAtomName inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeValue(GetULONG(inputMessage + 4, bigEndian_), 29, 9); - - sequenceQueue_.push(clientSequence_, inputOpcode); -@@ -1327,6 +1497,11 @@ - break; - case X_GetGeometry: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetGeometry inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> drawableCache); - -@@ -1351,6 +1526,11 @@ - break; - case X_GetKeyboardMapping: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetKeyboardMapping inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeValue((unsigned int) inputMessage[4], 8); - encodeBuffer.encodeValue((unsigned int) inputMessage[5], 8); - -@@ -1361,6 +1541,11 @@ - break; - case X_GetProperty: - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_GetProperty inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_GetProperty); - -@@ -1378,7 +1563,7 @@ - break; - } - -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - unsigned int property = GetULONG(inputMessage + 8, bigEndian_); -@@ -1394,6 +1579,11 @@ - break; - case X_GetSelectionOwner: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetSelectionOwner inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> getSelectionOwnerSelectionCache, 9); - -@@ -1404,7 +1594,12 @@ - break; - case X_GrabButton: - { -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_GrabButton inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, -@@ -1423,7 +1618,12 @@ - break; - case X_GrabPointer: - { -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_GrabPointer inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, -@@ -1448,7 +1648,12 @@ - break; - case X_GrabKeyboard: - { -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_GrabKeyboard inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - unsigned int timestamp = GetULONG(inputMessage + 8, bigEndian_); -@@ -1471,6 +1676,11 @@ - break; - case X_PolyText8: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_PolyText8 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1555,6 +1765,11 @@ - break; - case X_PolyText16: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_PolyText16 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1639,6 +1854,11 @@ - break; - case X_ImageText8: - { -+ #ifdef WARNING -+ if (inputLength < 16 + (unsigned int)inputDataByte) -+ *logofs << "handleRead: X_ImageText8 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1673,7 +1893,7 @@ - break; - } - -- unsigned int textLength = (unsigned int) inputMessage[1]; -+ unsigned int textLength = (unsigned int) inputDataByte; - encodeBuffer.encodeCachedValue(textLength, 8, - clientCache_ -> imageTextLengthCache, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, -@@ -1706,6 +1926,11 @@ - break; - case X_ImageText16: - { -+ #ifdef WARNING -+ if (inputLength < 16 + (unsigned int)inputDataByte) -+ *logofs << "handleRead: X_ImageText16 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1740,7 +1965,7 @@ - break; - } - -- unsigned int textLength = (unsigned int) inputMessage[1]; -+ unsigned int textLength = (unsigned int) inputDataByte; - encodeBuffer.encodeCachedValue(textLength, 8, - clientCache_ -> imageTextLengthCache, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, -@@ -1773,6 +1998,11 @@ - break; - case X_InternAtom: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_InternAtom inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_InternAtom); - -@@ -1796,8 +2026,18 @@ - } - - unsigned int nameLength = GetUINT(inputMessage + 4, bigEndian_); -+ unsigned int maxLength = inputLength - 8; -+ if (nameLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_InternAtom bogus nameLength=" << nameLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ nameLength = maxLength; -+ } - encodeBuffer.encodeValue(nameLength, 16, 6); -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - const unsigned char *nextSrc = inputMessage + 8; - - if (control -> isProtoStep7() == 1) -@@ -1827,7 +2067,22 @@ - break; - case X_ListFonts: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_ListFonts inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int textLength = GetUINT(inputMessage + 6, bigEndian_); -+ unsigned int maxLength = inputLength - 8; -+ if (textLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_ListFonts bogus textLength=" << textLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ textLength = maxLength; -+ } - encodeBuffer.encodeValue(textLength, 16, 6); - encodeBuffer.encodeValue(GetUINT(inputMessage + 4, bigEndian_), 16, 6); - const unsigned char* nextSrc = inputMessage + 8; -@@ -1853,7 +2108,22 @@ - case X_LookupColor: - case X_AllocNamedColor: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_AllocNamedColor inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int textLength = GetUINT(inputMessage + 8, bigEndian_); -+ unsigned int maxLength = inputLength - 12; -+ if (textLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_AllocNamedColor bogus textLength=" << textLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ textLength = maxLength; -+ } - encodeBuffer.encodeValue(textLength, 16, 6); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), - 29, clientCache_ -> colormapCache); -@@ -1886,6 +2156,11 @@ - case X_QueryPointer: - case X_QueryTree: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_MapWindow...X_QueryTree inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - if (inputOpcode == X_DestroyWindow) -@@ -1923,7 +2198,22 @@ - break; - case X_OpenFont: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_OpenFont inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int nameLength = GetUINT(inputMessage + 8, bigEndian_); -+ unsigned int maxLength = inputLength - 12; -+ if (nameLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_InternAtom bogus nameLength=" << nameLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ nameLength = maxLength; -+ } - encodeBuffer.encodeValue(nameLength, 16, 7); - unsigned int font = GetULONG(inputMessage + 4, bigEndian_); - encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); -@@ -1947,6 +2237,11 @@ - break; - case X_PolyFillRectangle: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyFillRectangle inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2034,6 +2329,11 @@ - break; - case X_PolyFillArc: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyFillArc inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2135,6 +2435,11 @@ - break; - case X_PolyArc: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyArc inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2236,6 +2541,11 @@ - break; - case X_PolyPoint: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyPoint inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2269,8 +2579,8 @@ - break; - } - -- encodeBuffer.encodeValue(GetUINT(inputMessage + 2, bigEndian_) - 3, 16, 4); -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeValue(inputDataSize - 2, 32, 4); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), -@@ -2303,6 +2613,11 @@ - break; - case X_PolyLine: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyLine inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2336,8 +2651,8 @@ - break; - } - -- encodeBuffer.encodeValue(GetUINT(inputMessage + 2, bigEndian_) - 3, 16, 4); -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeValue(inputDataSize - 2, 32, 4); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -2370,8 +2685,12 @@ - break; - case X_PolyRectangle: - { -- encodeBuffer.encodeValue((GetUINT(inputMessage + 2, -- bigEndian_) - 3) >> 1, 16, 3); -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyRectangle inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeValue((inputDataSize - 2) >> 1, 32, 3); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -2391,6 +2710,11 @@ - break; - case X_PolySegment: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolySegment inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2424,8 +2748,7 @@ - break; - } - -- encodeBuffer.encodeValue((GetUINT(inputMessage + 2, -- bigEndian_) - 3) >> 1, 16, 4); -+ encodeBuffer.encodeValue((inputDataSize - 2) >> 1, 32, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -2491,6 +2814,11 @@ - break; - case X_PutImage: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_PutImage inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2522,7 +2850,12 @@ - break; - case X_QueryBestSize: - { -- encodeBuffer.encodeValue((unsigned int)inputMessage[1], 2); -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_QueryBestSize inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeValue((unsigned int)inputDataByte, 2); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeValue(GetUINT(inputMessage + 8, bigEndian_), 16, 8); -@@ -2535,10 +2868,15 @@ - break; - case X_QueryColors: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_QueryColors inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - // Differential encoding. - encodeBuffer.encodeBoolValue(1); - -- unsigned int numColors = ((inputLength - 8) >> 2); -+ unsigned int numColors = (inputDataSize - 1); - encodeBuffer.encodeValue(numColors, 16, 5); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> colormapCache); -@@ -2567,15 +2905,20 @@ - break; - case X_QueryExtension: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_QueryExtension inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TEST - - char data[256]; - - int length = GetUINT(inputMessage + 4, bigEndian_); - -- if (length > 256) -+ if (length > 255) - { -- length = 256; -+ length = 255; - } - - strncpy(data, (char *) inputMessage + 8, length); -@@ -2588,6 +2931,16 @@ - #endif - - unsigned int nameLength = GetUINT(inputMessage + 4, bigEndian_); -+ unsigned int maxLength = inputLength - 8; -+ if (nameLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_QueryExtension bogus nameLength=" << nameLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ nameLength = maxLength; -+ } - encodeBuffer.encodeValue(nameLength, 16, 6); - const unsigned char *nextSrc = inputMessage + 8; - -@@ -2614,6 +2967,11 @@ - break; - case X_QueryFont: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_QueryFont inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int font = GetULONG(inputMessage + 4, bigEndian_); - encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); - clientCache_ -> lastFont = font; -@@ -2625,6 +2983,11 @@ - break; - case X_SetClipRectangles: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_SetClipRectangles inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_SetClipRectangles); - -@@ -2636,7 +2999,7 @@ - break; - } - -- unsigned int numRectangles = ((inputLength - 12) >> 3); -+ unsigned int numRectangles = ((inputDataSize - 2) >> 1); - - if (control -> isProtoStep9() == 1) - { -@@ -2647,7 +3010,7 @@ - encodeBuffer.encodeValue(numRectangles, 13, 4); - } - -- encodeBuffer.encodeValue((unsigned int) inputMessage[1], 2); -+ encodeBuffer.encodeValue((unsigned int) inputDataByte, 2); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> gcCache); - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, -@@ -2668,7 +3031,22 @@ - break; - case X_SetDashes: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_SetDashes inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int numDashes = GetUINT(inputMessage + 10, bigEndian_); -+ unsigned int maxLength = inputLength - 12; -+ if (numDashes > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_SetDashes bogus numDashes=" << numDashes -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ numDashes = maxLength; -+ } - encodeBuffer.encodeCachedValue(numDashes, 16, - clientCache_ -> setDashesLengthCache, 5); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), -@@ -2683,6 +3061,11 @@ - break; - case X_SetSelectionOwner: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_SetSelectionOwner inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> setSelectionOwnerCache, 9); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 8, bigEndian_), 29, -@@ -2693,6 +3076,11 @@ - break; - case X_TranslateCoords: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_TranslateCoords inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2764,6 +3152,11 @@ - break; - case X_GetImage: - { -+ #ifdef WARNING -+ if (inputLength < 20) -+ *logofs << "handleRead: X_GetImage inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2802,7 +3195,7 @@ - } - - // Format. -- encodeBuffer.encodeValue((unsigned int) inputMessage[1], 2); -+ encodeBuffer.encodeValue((unsigned int) inputDataByte, 2); - // Drawable. - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); -@@ -2869,6 +3262,11 @@ - } - else if (inputOpcode == opcodeStore_ -> putPackedImage) - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: putPackedImage inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -3004,7 +3402,7 @@ - << ".\n" << logofs_flush; - #endif - -- encodeBuffer.encodeCachedValue(*(inputMessage + 1), 8, -+ encodeBuffer.encodeCachedValue(inputDataByte, 8, - clientCache_ -> resourceCache); - } - else if (inputOpcode == opcodeStore_ -> freeUnpack) -@@ -3015,7 +3413,7 @@ - << ".\n" << logofs_flush; - #endif - -- encodeBuffer.encodeCachedValue(*(inputMessage + 1), 8, -+ encodeBuffer.encodeCachedValue(inputDataByte, 8, - clientCache_ -> resourceCache); - } - else if (inputOpcode == opcodeStore_ -> getControlParameters) -@@ -3130,6 +3528,11 @@ - // Enable or disable expose events - // coming from the real server. - // -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: setExposeParameters inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - - encodeBuffer.encodeBoolValue(*(inputMessage + 4)); - encodeBuffer.encodeBoolValue(*(inputMessage + 5)); -@@ -3198,10 +3601,10 @@ - { - if (hit) - { -- statistics -> addRenderCachedRequest(*(inputMessage + 1)); -+ statistics -> addRenderCachedRequest(inputDataByte); - } - -- statistics -> addRenderRequestBits(*(inputMessage + 1), inputLength << 3, bits); -+ statistics -> addRenderRequestBits(inputDataByte, inputLength << 3, bits); - } - - } // End if (firstRequest_)... else ... -@@ -4548,10 +4951,10 @@ - // - - /* --FIXME: Recover the sequence number if the proxy -+Fixed as below? - FIXME: Recover the sequence number if the proxy - is not connected to an agent. - */ -- if (serverSequence_ > lastSequence_ || -+ if (SequenceNumber_x_gt_y(serverSequence_, lastSequence_) || - control -> SessionMode != session_proxy) - { - #ifdef DEBUG -@@ -4564,7 +4967,7 @@ - lastSequence_ = serverSequence_; - } - #ifdef DEBUG -- else if (serverSequence_ < lastSequence_) -+ else if (SequenceNumber_x_gt_y(lastSequence_, serverSequence_)) - { - // - // Use our last auto-generated sequence. -@@ -5003,6 +5406,12 @@ - break; - default: - { -+ // BEWARE: not only inputOpcode == GenericEvent but also -+ // others not handled above, at least: -+ // GraphicsExpose 13 -+ // MapRequest 20 -+ // ConfigureRequest 23 -+ // and any beyond LASTEvent. - #ifdef TEST - *logofs << "handleWrite: Using generic event compression " - << "for OPCODE#" << (unsigned int) outputOpcode -@@ -5014,11 +5423,51 @@ - - for (unsigned int i = 0; i < 14; i++) - { -- decodeBuffer.decodeCachedValue(value, 16, -- *serverCache_ -> genericEventIntCache[i]); -+ //decodeBuffer.decodeCachedValue(value, 16, -+ // *serverCache_ -> genericEventIntCache[i]); -+ if ( ! (decodeBuffer.decodeCachedValue(value, 16, -+ *serverCache_ -> genericEventIntCache[i])) ) -+ { -+ #ifdef WARNING -+ *logofs << "decodeCachedValue failed for GenEvt:" -+ << " buffer length=" << length -+ << " i=" << i -+ << "\n" << logofs_flush; -+ #endif -+ break; -+ } - - PutUINT(value, outputMessage + i * 2 + 4, bigEndian_); - } -+ // Handle "X Generic Event Extension" -+ // Extra data is not cached... -+ if (outputOpcode == GenericEvent && *(outputMessage+1) != 0 && outputLength == 32) -+ { -+ unsigned int extraOutputLength = (GetULONG(outputMessage + 4, bigEndian_) << 2); -+ if (extraOutputLength > 0 && extraOutputLength < 100*1024*1024) -+ { -+ // Extend buffer for the extra data -+ outputMessage = writeBuffer_.addMessage(extraOutputLength); -+ // Decode data and write into buffer at new position -+ for (unsigned int i = 0; i < (extraOutputLength>>1); i++) -+ { -+ //decodeBuffer.decodeValue(value, 16); -+ if ( ! (decodeBuffer.decodeValue(value, 16)) ) -+ { -+ #ifdef WARNING -+ *logofs << "decodeValue failed for GenEvt:" -+ << " extraOutputLength=" << extraOutputLength -+ << " buffer length=" << length -+ << " i=" << i -+ << "\n" << logofs_flush; -+ #endif -+ break; -+ } -+ PutUINT(value, outputMessage + i * 2, bigEndian_); -+ } -+ } -+ } -+ - } - } // End of switch (outputOpcode)... - -@@ -6892,7 +7341,7 @@ - } - else - { -- if (serverSequence_ > lastSequence_) -+ if (SequenceNumber_x_gt_y(serverSequence_, lastSequence_)) - { - #ifdef DEBUG - *logofs << "handleNotify: Updating last event's sequence " -@@ -6904,7 +7353,7 @@ - lastSequence_ = serverSequence_; - } - #ifdef DEBUG -- else if (serverSequence_ < lastSequence_) -+ else if (SequenceNumber_x_gt_y(lastSequence_, serverSequence_)) - { - // - // Use our last auto-generated sequence. ---- a/nxcomp/ClientReadBuffer.cpp -+++ b/nxcomp/ClientReadBuffer.cpp -@@ -119,15 +119,34 @@ - - dataLength = (GetUINT(start + 2, bigEndian_) << 2); - -- if (dataLength < 4) -+ if (dataLength == 0) // or equivalently (dataLength < 4) - { -- #ifdef TEST -- *logofs << "ClientReadBuffer: WARNING! Assuming length 4 " -- << "for suspicious message of length " << dataLength -- << ".\n" << logofs_flush; -- #endif -+ // BIG-REQUESTS extension -+ if (size < 8) -+ { -+ remaining_ = 8 - size; -+ return 0; -+ } - -- dataLength = 4; -+ dataLength = (GetULONG(start + 4, bigEndian_) << 2); -+ -+// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere -+// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. -+ if (dataLength < 8 || dataLength > 100*1024*1024) -+ { -+ #ifdef WARNING -+ *logofs << "BIG-REQUESTS with unacceptable dataLength=" -+ << dataLength << ", now set to 8.\n" << logofs_flush; -+ #endif -+ dataLength = 8; -+ } -+ else if (dataLength < 4*64*1024) -+ { -+ #ifdef WARNING -+ *logofs << "BIG-REQUESTS with silly dataLength=" -+ << dataLength << ".\n" << logofs_flush; -+ #endif -+ } - } - } - ---- a/nxcomp/DecodeBuffer.cpp -+++ b/nxcomp/DecodeBuffer.cpp -@@ -78,34 +78,45 @@ - { - if (!endOkay) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [A] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [A] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- // -- // Label "context" is just used to identify -- // the routine which detected the problem in -- // present source file. -- // -- -- cerr << "Error" << ": Failure decoding data in context [A].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [A] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //// -+ //// Label "context" is just used to identify -+ //// the routine which detected the problem in -+ //// present source file. -+ //// -+ //cerr << "Error" << ": Failure decoding data in context [A].\n"; -+ //HandleAbort(); - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [B] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [B] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [B].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [B] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [B].\n"; -+ //HandleAbort(); - } - - lastBit = (nextSrcChar & srcMask_); -@@ -134,28 +145,40 @@ - { - if (!endOkay) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [C] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [C] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [C].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [C] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [C].\n"; -+ //HandleAbort(); - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [D] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [D] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [D].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [D] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [D].\n"; -+ //HandleAbort(); - } - - unsigned char moreData = (nextSrcChar & srcMask_); -@@ -212,16 +235,24 @@ - - if (nextSrc_ >= end_) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [E] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [E] in decodeCachedValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [E].\n"; -- -- HandleAbort(); -+ // Failed: return value 0 -+ value = 0; -+ // Failed: return 0, though our callers do not check that... -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [E] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [E].\n"; -+ //HandleAbort(); - } - - unsigned int index = 0; -@@ -237,30 +268,33 @@ - nextSrc_++; - if (nextSrc_ >= end_) - { -- if (!endOkay) -- { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [F] " -- << "in decodeCachedValue() nextSrc_ = " -- << (nextSrc_ - buffer_) << " end_ = " -- << (end_ - buffer_) << ".\n" << logofs_flush; -- #endif -- -- cerr << "Error" << ": Failure decoding data in context [F].\n"; -- -- HandleAbort(); -- } -- -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [G] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [G] in decodeCachedValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [G].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //if (!endOkay) -+ //{ -+ // #ifdef PANIC -+ // *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [F] " -+ // << "in decodeCachedValue() nextSrc_ = " -+ // << (nextSrc_ - buffer_) << " end_ = " -+ // << (end_ - buffer_) << ".\n" << logofs_flush; -+ // #endif -+ // cerr << "Error" << ": Failure decoding data in context [F].\n"; -+ // HandleAbort(); -+ //} -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [G] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [G].\n"; -+ //HandleAbort(); - } - - nextSrcChar = *nextSrc_; -@@ -288,15 +322,20 @@ - return 1; - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -- << "in decodeCacheValue() with no value found.\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [H] in decodeCachedValue(), returning 0:" -+ << " no value found" -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [H].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -+ // << "in decodeCacheValue() with no value found.\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [H].\n"; -+ //HandleAbort(); - } - else - { -@@ -323,15 +362,20 @@ - return 1; - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -- << "in decodeCacheValue() with no value found.\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [F] in decodeCachedValue(), returning 0:" -+ << " no value found" -+ << " .\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [H].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -+ // << "in decodeCacheValue() with no value found.\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [H].\n"; -+ //HandleAbort(); - } - } - } -@@ -344,16 +388,22 @@ - - if (index > cache.getSize()) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [I] " -- << "in decodeCachedValue() index = " << index -- << " cache size = " << cache.getSize() << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [I] in decodeCachedValue(), returning 0:" -+ << " index = " << index -+ << " cache size = " << cache.getSize() -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [I].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [I] " -+ // << "in decodeCachedValue() index = " << index -+ // << " cache size = " << cache.getSize() << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [I].\n"; -+ //HandleAbort(); - } - - value = cache.get(index); -@@ -401,16 +451,22 @@ - { - if (!endOkay) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [K] " -- << "in decodeCachedValue() nextSrc_ " -- << (nextSrc_ - buffer_) << " end_ " << (end_ - buffer_) -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [K] in decodeCachedValue(), returning 0:" -+ << " nextSrc_ " << (nextSrc_ - buffer_) -+ << " end_ " << (end_ - buffer_) - << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [K].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [K] " -+ // << "in decodeCachedValue() nextSrc_ " -+ // << (nextSrc_ - buffer_) << " end_ " << (end_ - buffer_) -+ // << ".\n" << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [K].\n"; -+ //HandleAbort(); - } - - #ifdef TEST -@@ -446,15 +502,20 @@ - } - else - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [M] " -- << "in decodeValue() with index = 2.\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [M] in decodeCachedValue(), returning 0:" -+ << "with index = 2" -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [M].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [M] " -+ // << "in decodeValue() with index = 2.\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [M].\n"; -+ //HandleAbort(); - } - } - else -@@ -466,16 +527,22 @@ - - if (index > cache.getSize()) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [N] " -- << "in decodeCachedValue() " << "index = " << index -- << " cache size = " << cache.getSize() << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [N] in decodeCachedValue(), returning 0:" -+ << " index = " << index -+ << " cache size = " << cache.getSize() -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [N].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [N] " -+ // << "in decodeCachedValue() " << "index = " << index -+ // << " cache size = " << cache.getSize() << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [N].\n"; -+ //HandleAbort(); - } - - value = cache.get(index); -@@ -538,16 +605,22 @@ - } - else if (end_ - nextSrc_ < (int) numBytes) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [P] " -- << "in decodeMemory() " << "with length " << numBytes -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [P] in decodeMemory(), returning NULL:" -+ << " with length " << numBytes - << " and " << (end_ - nextSrc_) -- << " bytes remaining.\n" << logofs_flush; -+ << " bytes remaining" -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [P].\n"; -- -- HandleAbort(); -+ return NULL; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [P] " -+ // << "in decodeMemory() " << "with length " << numBytes -+ // << " and " << (end_ - nextSrc_) -+ // << " bytes remaining.\n" << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [P].\n"; -+ //HandleAbort(); - } - - nextSrc_ += numBytes; ---- a/nxcomp/DecodeBuffer.h -+++ b/nxcomp/DecodeBuffer.h -@@ -30,7 +30,8 @@ - #include "ActionCacheCompat.h" - #include "PositionCacheCompat.h" - --#define DECODE_BUFFER_OVERFLOW_SIZE 4194304 -+// See WriteBuffer.h and EncodeBuffer.h -+#define DECODE_BUFFER_OVERFLOW_SIZE 104857600 - - #define DECODE_BUFFER_POSTFIX_SIZE 1 - ---- a/nxcomp/EncodeBuffer.h -+++ b/nxcomp/EncodeBuffer.h -@@ -33,10 +33,10 @@ - // - // This should match the maximum size of - // a single message added to write buffer --// (see WriteBuffer.h). -+// (see WriteBuffer.h and DecodeBuffer.h). - // - --#define ENCODE_BUFFER_OVERFLOW_SIZE 4194304 -+#define ENCODE_BUFFER_OVERFLOW_SIZE 104857600 - - // - // Adjust for the control messages and the ---- a/nxcomp/SequenceQueue.h -+++ b/nxcomp/SequenceQueue.h -@@ -18,6 +18,22 @@ - #ifndef SequenceQueue_H - #define SequenceQueue_H - -+inline int SequenceNumber_x_gt_y(unsigned int x, unsigned int y) -+{ -+ // For two sequence numbers x and y, determine whether (x > y). -+ // Sequence numbers are the trailing 16 bits of a bigger number: -+ // need to handle wraparound, e.g. 0 is 65536, just after 65535. -+ if (x != (x & 0x00ffff)) return 0; -+ if (y != (y & 0x00ffff)) return 0; -+ // Closeness when comparison makes sense: arbitrarily set at 16*1024 -+ if ((x > y) && ((x-y) < 16*1024)) return 1; -+ // Wrapped value -+ unsigned int w = x + 64*1024; -+ // We know that w>y but test left for symmetry -+ if ((w > y) && ((w-y) < 16*1024)) return 1; -+ return 0; -+} -+ - // - // List of outstanding request messages which - // are waiting for a reply. This class is used ---- a/nxcomp/ServerChannel.cpp -+++ b/nxcomp/ServerChannel.cpp -@@ -104,7 +104,8 @@ - // - - #define HIDE_MIT_SHM_EXTENSION --#define HIDE_BIG_REQUESTS_EXTENSION -+// HIDE_BIG_REQUESTS_EXTENSION : No good to hide, some clients may send crap instead... -+#undef HIDE_BIG_REQUESTS_EXTENSION - #define HIDE_XFree86_Bigfont_EXTENSION - #undef HIDE_SHAPE_EXTENSION - #undef HIDE_XKEYBOARD_EXTENSION -@@ -1412,6 +1413,9 @@ - - unsigned int inputSequence = GetUINT(inputMessage + 2, bigEndian_); - -+ // Sometimes we get inputSequence=0 or =256 when inputOpcode=11=X_UnmapSubwindows -+ // Seems weird... but is "normal" and is to be accepted. -+ - // - // Check if this is an event which we can discard. - // -@@ -1905,6 +1909,12 @@ - break; - default: - { -+ // BEWARE: not only inputOpcode == GenericEvent but also -+ // others not handled above, at least: -+ // GraphicsExpose 13 -+ // MapRequest 20 -+ // ConfigureRequest 23 -+ // and any beyond LASTEvent. - #ifdef TEST - *logofs << "handleRead: Using generic event compression " - << "for OPCODE#" << (unsigned int) inputOpcode -@@ -1919,6 +1929,16 @@ - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + i * 2 + 4, bigEndian_), - 16, *serverCache_ -> genericEventIntCache[i]); - } -+ // Handle "X Generic Event Extension" -+ // Cannot cache extra data... -+// FIXME: BUG ALERT: is it OK to have the first 32 bytes cached, but not the rest? -+ if (inputOpcode == GenericEvent && inputLength > 32) -+ { -+ for (unsigned int i = 14; i < ((inputLength-4)>>1); i++) -+ { -+ encodeBuffer.encodeValue(GetUINT(inputMessage + i * 2 + 4, bigEndian_), 16); -+ } -+ } - } - - } // switch (inputOpcode)... -@@ -3756,7 +3776,7 @@ - } - - unsigned int numPoints; -- decodeBuffer.decodeValue(numPoints, 16, 4); -+ decodeBuffer.decodeValue(numPoints, 32, 4); - outputLength = (numPoints << 2) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - unsigned int relativeCoordMode; -@@ -3802,7 +3822,7 @@ - } - - unsigned int numPoints; -- decodeBuffer.decodeValue(numPoints, 16, 4); -+ decodeBuffer.decodeValue(numPoints, 32, 4); - outputLength = (numPoints << 2) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - unsigned int relativeCoordMode; -@@ -3839,7 +3859,7 @@ - case X_PolyRectangle: - { - unsigned int numRectangles; -- decodeBuffer.decodeValue(numRectangles, 16, 3); -+ decodeBuffer.decodeValue(numRectangles, 32, 3); - outputLength = (numRectangles << 3) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - decodeBuffer.decodeXidValue(value, clientCache_ -> drawableCache); -@@ -3869,7 +3889,7 @@ - } - - unsigned int numSegments; -- decodeBuffer.decodeValue(numSegments, 16, 4); -+ decodeBuffer.decodeValue(numSegments, 32, 4); - outputLength = (numSegments << 3) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - decodeBuffer.decodeXidValue(value, clientCache_ -> drawableCache); -@@ -4590,7 +4610,29 @@ - - *outputMessage = (unsigned char) outputOpcode; - -- PutUINT(outputLength >> 2, outputMessage + 2, bigEndian_); -+ if (outputLength < 4*64*1024) -+ PutUINT(outputLength >> 2, outputMessage + 2, bigEndian_); -+ else -+ { -+ // Handle BIG-REQUESTS -+ PutUINT(0, outputMessage + 2, bigEndian_); -+// FIXME: BUG ALERT: following write may not work well, -+// particularly with un-flushed messages. -+if (outputMessage != writeBuffer_.getData()) -+{ -+*logofs << "PSz BUG handleWrite BIG-REQUESTS:" -+ << " have " << (unsigned int)(outputMessage - writeBuffer_.getData()) -+ << " bytes in buffer" -+ << ", write immediate of 4-byte header will not work well" -+ << "\n" << logofs_flush; -+} -+// But, it works well enough in my testing... -+ // Write first four bytes -+ if (transport_ -> write(write_immediate, outputMessage, 4) < 0) -+ return -1; -+ // Replace with new 4-byte length -+ PutULONG(1 + (outputLength >> 2), outputMessage, bigEndian_); -+ } - - #if defined(TEST) || defined(OPCODES) - *logofs << "handleWrite: Handled request OPCODE#" -@@ -5912,7 +5954,7 @@ - unsigned char opcode = *lastMotion_; - unsigned int size = 32; - -- if (GetUINT(buffer + 2, bigEndian_) < serverSequence_) -+ if (SequenceNumber_x_gt_y(serverSequence_, GetUINT(buffer + 2, bigEndian_))) - { - PutUINT(serverSequence_, (unsigned char *) buffer + 2, bigEndian_); - } ---- a/nxcomp/ServerReadBuffer.cpp -+++ b/nxcomp/ServerReadBuffer.cpp -@@ -108,14 +108,21 @@ - { - dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); - } -+ else if (*start == GenericEvent && *(start+1) != 0) -+ { -+ // X Generic Event Extension -+ dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); -+ } - else - { - dataLength = 32; - } - -- if (dataLength < 32) -+// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere -+// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. -+ if (dataLength < 32 || dataLength > 100*1024*1024) - { -- #ifdef TEST -+ #ifdef WARNING - *logofs << "ServerReadBuffer: WARNING! Assuming length 32 " - << "for suspicious message of length " << dataLength - << ".\n" << logofs_flush; ---- a/nxcomp/WriteBuffer.h -+++ b/nxcomp/WriteBuffer.h -@@ -32,8 +32,14 @@ - // This is likely to be a reply to a X_ListFonts where - // user has a large amount of installed fonts. - // -+// Used also for messages sent, and should accommodate any BIG-REQUESTS. -+// Value was 4MB = 4194304, changed to 100MB = 104857600. -+// See also sanity check limits (set same, to 100*1024*1024) in -+// ClientReadBuffer.cpp ServerReadBuffer.cpp and ClientChannel.cpp, and -+// ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE elsewhere. -+// - --#define WRITE_BUFFER_OVERFLOW_SIZE 4194304 -+#define WRITE_BUFFER_OVERFLOW_SIZE 104857600 - - class WriteBuffer - { diff --git a/debian/patches/600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch b/debian/patches/600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch deleted file mode 100644 index 7c21c6fe5..000000000 --- a/debian/patches/600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch +++ /dev/null @@ -1,1183 +0,0 @@ -Description: Unique Library Names Patch - Patch from the RPM folks... - . - We really want to make use of rpm's automatic dependency finding. - Binaries are scanned for DT_NEEDED entries, the latter of which are - then used for populating the "Requires"-type deps. The "nxagent" - binary for example would require libX11.so.6. That incurs problems: - . - 1. A package manager told to install nxagent could select xorg-x11 - rather than nx-libs, even though nxagent depends on the NX version. - . - 2. A package manager told to install $some_program could select nx-libs - rather than xorg-x11 (since both provide libX11.so.6), but, since - the NX library is in an obscure directory, running $some_program - would fail as libX11.so.6 is not found. - . - To solve this, give the NX libraries unique names different from the - Xorg ones. -Forward: pending -Author: Jan Engelhardt -Last-Update: 2012-02-15 ---- - nx-X11/config/cf/Imake.rules | 12 - - nx-X11/config/cf/X11.tmpl | 240 ++++++++++---------- - nx-X11/config/cf/lnxLib.rules | 16 - - nx-X11/config/cf/lnxLib.tmpl | 4 - nx-X11/lib/X11/Imakefile | 2 - nx-X11/lib/XRes/Imakefile | 2 - nx-X11/lib/Xau/Imakefile | 2 - nx-X11/lib/Xcomposite/Imakefile | 2 - nx-X11/lib/Xcomposite/xcomposite.pc.in | 2 - nx-X11/lib/Xcursor/Imakefile | 2 - nx-X11/lib/Xcursor/xcursor.pc.in | 2 - nx-X11/lib/Xdamage/Imakefile | 2 - nx-X11/lib/Xdamage/xdamage.pc.in | 2 - nx-X11/lib/Xdmcp/Imakefile | 2 - nx-X11/lib/Xext/Imakefile | 2 - nx-X11/lib/Xfixes/Imakefile | 2 - nx-X11/lib/Xfixes/xfixes.pc.in | 2 - nx-X11/lib/Xinerama/Imakefile | 2 - nx-X11/lib/Xpm/Imakefile | 2 - nx-X11/lib/Xrandr/Imakefile | 2 - nx-X11/lib/Xrender/Imakefile | 2 - nx-X11/lib/Xrender/xrender.pc.in | 2 - nx-X11/lib/Xtst/Imakefile | 2 - nx-X11/lib/font/Imakefile | 2 - nx-X11/lib/oldX/Imakefile | 2 - nx-X11/lib/xkbfile/Imakefile | 2 - nx-X11/lib/xkbui/Imakefile | 2 - nx-X11/programs/Xserver/Imakefile | 18 - - nxcompext/Makefile.in | 4 - nxcompshad/Makefile.in | 4 - 103 files changed, 294 insertions(+), 294 deletions(-) - ---- a/nx-X11/config/cf/Imake.rules -+++ b/nx-X11/config/cf/Imake.rules -@@ -2124,9 +2124,9 @@ - */ - #ifndef ProjectUnsharedFontLibReferences - #define ProjectUnsharedFontLibReferences() @@\ --DEPFONTLIB = _UseCat($(USRLIBDIR)/,XBuildLibDir/,LibraryTargetName(Xfont)) @@\ --FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lXfont @@\ --LintLibReferences(XFONT,Xfont,$(FONTLIBSRC)) -+DEPFONTLIB = _UseCat($(USRLIBDIR)/,XBuildLibDir/,LibraryTargetName(NX_Xfont)) @@\ -+FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lNX_Xfont @@\ -+LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) - #endif - - /* -@@ -2142,9 +2142,9 @@ - #ifndef SharedFontLibReferences - #define SharedFontLibReferences() @@\ - SOFONTREV = SharedFontRev @@\ --DEPFONTLIB = SharedLibDependencies(Xfont,$(FONTLIBSRC),SOFONTREV) @@\ --FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lXfont @@\ --LintLibReferences(XFONT,Xfont,$(FONTLIBSRC)) -+DEPFONTLIB = SharedLibDependencies(NX_Xfont,$(FONTLIBSRC),SOFONTREV) @@\ -+FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lNX_Xfont @@\ -+LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) - #endif - - /* ---- a/nx-X11/config/cf/X11.tmpl -+++ b/nx-X11/config/cf/X11.tmpl -@@ -1835,9 +1835,9 @@ - #ifndef SharedX11Rev - #define SharedX11Rev 6.2 - #endif --SharedLibReferences(XONLY,X11,$(XLIBSRC),SOXLIBREV,SharedX11Rev) -+SharedLibReferences(XONLY,NX_X11,$(XLIBSRC),SOXLIBREV,SharedX11Rev) - #else --ProjectUnsharedLibReferences(XONLY,X11,$(XLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XONLY,NX_X11,$(XLIBSRC),XBuildLibDir) - #endif - /* Common alternate spellings */ - DEPXLIBONLY = $(DEPXONLYLIB) -@@ -2466,9 +2466,9 @@ - #ifndef SharedXextRev - #define SharedXextRev 6.4 - #endif --SharedLibReferences(EXTENSION,Xext,$(XEXTLIBSRC),SOXEXTREV,SharedXextRev) -+SharedLibReferences(EXTENSION,NX_Xext,$(XEXTLIBSRC),SOXEXTREV,SharedXextRev) - #else --ProjectUnsharedLibReferences(EXTENSION,Xext,$(XEXTLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(EXTENSION,NX_Xext,$(XEXTLIBSRC),XBuildLibDir) - #endif - LINTEXTENSIONLIB = $(LINTEXTENSION) - DEPXLIB = $(DEPEXTENSIONLIB) $(DEPXONLYLIB) -@@ -2480,9 +2480,9 @@ - #ifndef SharedXssRev - #define SharedXssRev 1.0 - #endif --SharedLibReferences(XSS,Xss,$(XSSLIBSRC),SOXSSREV,SharedXssRev) -+SharedLibReferences(XSS,NX_Xss,$(XSSLIBSRC),SOXSSREV,SharedXssRev) - #else --ProjectUnsharedLibReferences(XSS,Xss,$(XSSLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XSS,NX_Xss,$(XSSLIBSRC),XBuildLibDir) - #endif - - XXF86MISCLIBSRC = $(LIBSRC)/Xxf86misc -@@ -2490,9 +2490,9 @@ - #ifndef SharedXxf86miscRev - #define SharedXxf86miscRev 1.1 - #endif --SharedLibReferences(XXF86MISC,Xxf86misc,$(XXF86MISCLIBSRC),SOXXF86MISCREV,SharedXxf86miscRev) -+SharedLibReferences(XXF86MISC,NX_Xxf86misc,$(XXF86MISCLIBSRC),SOXXF86MISCREV,SharedXxf86miscRev) - #else --ProjectUnsharedLibReferences(XXF86MISC,Xxf86misc,$(XXF86MISCLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XXF86MISC,NX_Xxf86misc,$(XXF86MISCLIBSRC),XBuildLibDir) - #endif - - XXF86VMLIBSRC = $(LIBSRC)/Xxf86vm -@@ -2500,9 +2500,9 @@ - #ifndef SharedXxf86vmRev - #define SharedXxf86vmRev 1.0 - #endif --SharedLibReferences(XXF86VM,Xxf86vm,$(XXF86VMLIBSRC),SOXXF86VMREV,SharedXxf86vmRev) -+SharedLibReferences(XXF86VM,NX_Xxf86vm,$(XXF86VMLIBSRC),SOXXF86VMREV,SharedXxf86vmRev) - #else --ProjectUnsharedLibReferences(XXF86VM,Xxf86vm,$(XXF86VMLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XXF86VM,NX_Xxf86vm,$(XXF86VMLIBSRC),XBuildLibDir) - #endif - - XXF86DGALIBSRC = $(LIBSRC)/Xxf86dga -@@ -2510,9 +2510,9 @@ - #ifndef SharedXxf86dgaRev - #define SharedXxf86dgaRev 1.0 - #endif --SharedLibReferences(XXF86DGA,Xxf86dga,$(XXF86DGALIBSRC),SOXXF86DGAREV,SharedXxf86dgaRev) -+SharedLibReferences(XXF86DGA,NX_Xxf86dga,$(XXF86DGALIBSRC),SOXXF86DGAREV,SharedXxf86dgaRev) - #else --ProjectUnsharedLibReferences(XXF86DGA,Xxf86dga,$(XXF86DGALIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XXF86DGA,NX_Xxf86dga,$(XXF86DGALIBSRC),XBuildLibDir) - #endif - - #if BuildDmxLibrary -@@ -2544,9 +2544,9 @@ - #ifndef SharedXxf86rushRev - #define SharedXxf86rushRev 1.0 - #endif --SharedLibReferences(XXF86RUSH,Xxf86rush,$(XXF86RUSHLIBSRC),SOXXF86RUSHREV,SharedXxf86rushRev) -+SharedLibReferences(XXF86RUSH,NX_Xxf86rush,$(XXF86RUSHLIBSRC),SOXXF86RUSHREV,SharedXxf86rushRev) - #else --ProjectUnsharedLibReferences(XXF86RUSH,Xxf86rush,$(XXF86RUSHLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XXF86RUSH,NX_Xxf86rush,$(XXF86RUSHLIBSRC),XBuildLibDir) - #endif - - -@@ -2555,9 +2555,9 @@ - #ifndef SharedXvRev - #define SharedXvRev 1.0 - #endif --SharedLibReferences(XV,Xv,$(XVLIBSRC),SOXVREV,SharedXvRev) -+SharedLibReferences(XV,NX_Xv,$(XVLIBSRC),SOXVREV,SharedXvRev) - #else --ProjectUnsharedLibReferences(XV,Xv,$(XVLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XV,NX_Xv,$(XVLIBSRC),XBuildLibDir) - #endif - - -@@ -2566,9 +2566,9 @@ - #ifndef SharedXvMCRev - #define SharedXvMCRev 1.0 - #endif --SharedLibReferences(XVMC,XvMC,$(XVMCLIBSRC),SOXVMCREV,SharedXvMCRev) -+SharedLibReferences(XVMC,NX_XvMC,$(XVMCLIBSRC),SOXVMCREV,SharedXvMCRev) - #else --ProjectUnsharedLibReferences(XVMC,XvMC,$(XVMCLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XVMC,NX_XvMC,$(XVMCLIBSRC),XBuildLibDir) - #endif - - XINERAMALIBSRC = $(LIBSRC)/Xinerama -@@ -2576,9 +2576,9 @@ - #ifndef SharedXineramaRev - #define SharedXineramaRev 1.0 - #endif --SharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),SOXINERAMAREV,SharedXineramaRev) -+SharedLibReferences(XINERAMA,NX_Xinerama,$(XINERAMALIBSRC),SOXINERAMAREV,SharedXineramaRev) - #else --ProjectUnsharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XINERAMA,NX_Xinerama,$(XINERAMALIBSRC),XBuildLibDir) - #endif - - XRESLIBSRC = $(LIBSRC)/XRes -@@ -2586,9 +2586,9 @@ - #ifndef SharedXResRev - #define SharedXResRev 1.0 - #endif --SharedLibReferences(XRES,XRes,$(XRESLIBSRC),SOXRESREV,SharedXResRev) -+SharedLibReferences(XRES,NX_XRes,$(XRESLIBSRC),SOXRESREV,SharedXResRev) - #else --ProjectUnsharedLibReferences(XRES,XRes,$(XRESLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XRES,NX_XRes,$(XRESLIBSRC),XBuildLibDir) - #endif - - DMXLIBSRC = $(LIBSRC)/dmx -@@ -2596,9 +2596,9 @@ - #ifndef SharedDmxRev - #define SharedDmxRev 1.0 - #endif --SharedLibReferences(DMX,dmx,$(DMXLIBSRC),SODMXREV,SharedDmxRev) -+SharedLibReferences(DMX,NX_dmx,$(DMXLIBSRC),SODMXREV,SharedDmxRev) - #else --ProjectUnsharedLibReferences(DMX,dmx,$(DMXLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(DMX,NX_dmx,$(DMXLIBSRC),XBuildLibDir) - #endif - - DPSLIBSRC = $(LIBSRC)/dps -@@ -2606,9 +2606,9 @@ - #ifndef SharedDpsRev - #define SharedDpsRev 1.0 - #endif --SharedLibReferences(DPS,dps,$(DPSLIBSRC),SODPSREV,SharedDpsRev) -+SharedLibReferences(DPS,NX_dps,$(DPSLIBSRC),SODPSREV,SharedDpsRev) - #else --ProjectUnsharedLibReferences(DPS,dps,$(DPSLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(DPS,NX_dps,$(DPSLIBSRC),XBuildLibDir) - #endif - - DPSTKLIBSRC = $(LIBSRC)/dpstk -@@ -2616,9 +2616,9 @@ - #ifndef SharedDpsTkRev - #define SharedDpsTkRev 1.0 - #endif --SharedLibReferences(DPSTK,dpstk,$(DPSTKLIBSRC),SODPSTKREV,SharedDpsTkRev) -+SharedLibReferences(DPSTK,NX_dpstk,$(DPSTKLIBSRC),SODPSTKREV,SharedDpsTkRev) - #else --ProjectUnsharedLibReferences(DPSTK,dpstk,$(DPSTKLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(DPSTK,NX_dpstk,$(DPSTKLIBSRC),XBuildLibDir) - #endif - - PSRESLIBSRC = $(LIBSRC)/psres -@@ -2626,9 +2626,9 @@ - #ifndef SharedPSResRev - #define SharedPSResRev 1.0 - #endif --SharedLibReferences(PSRES,psres,$(PSRESLIBSRC),SOPSRESREV,SharedPSResRev) -+SharedLibReferences(PSRES,NX_psres,$(PSRESLIBSRC),SOPSRESREV,SharedPSResRev) - #else --ProjectUnsharedLibReferences(PSRES,psres,$(PSRESLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(PSRES,NX_psres,$(PSRESLIBSRC),XBuildLibDir) - #endif - - GLULIBSRC = $(LIBSRC)/GLU -@@ -2636,9 +2636,9 @@ - #ifndef SharedGluRev - #define SharedGluRev 1.3 - #endif --SharedLibReferences(GLU,GLU,$(GLULIBSRC),SOGLUREV,SharedGluRev) -+SharedLibReferences(GLU,NX_GLU,$(GLULIBSRC),SOGLUREV,SharedGluRev) - #else --ProjectUnsharedLibReferences(GLU,GLU,$(GLULIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(GLU,NX_GLU,$(GLULIBSRC),XBuildLibDir) - #endif - - GLXLIBSRC = $(LIBSRC)/GL -@@ -2646,18 +2646,18 @@ - #ifndef SharedGlxRev - #define SharedGlxRev 1.2 - #endif --SharedLibReferences(GLX,GL,$(GLXLIBSRC),SOGLREV,SharedGlxRev) -+SharedLibReferences(GLX,NX_GL,$(GLXLIBSRC),SOGLREV,SharedGlxRev) - #else --ProjectUnsharedLibReferences(GLX,GL,$(GLXLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(GLX,NX_GL,$(GLXLIBSRC),XBuildLibDir) - #endif - GLWIDGETSRC = $(LIBSRC)/GLw - #if SharedLibGLw - #ifndef SharedGLwRev - #define SharedGLwRev 1.0 /* used to name the shared library */ - #endif --SharedDSLibReferences(GLW,GLw,$(GLWIDGETSRC),SOGLWREV,SharedGLwRev) -+SharedDSLibReferences(GLW,NX_GLw,$(GLWIDGETSRC),SOGLWREV,SharedGLwRev) - #else --ProjectUnsharedLibReferences(GLW,GLw,$(GLWIDGETSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(GLW,NX_GLw,$(GLWIDGETSRC),XBuildLibDir) - #endif - - XRENDERLIBSRC = $(LIBSRC)/Xrender -@@ -2665,9 +2665,9 @@ - #ifndef SharedXrenderRev - #define SharedXrenderRev 1.2.2 - #endif --SharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),SOXRENDERREV,SharedXrenderRev) -+SharedLibReferences(XRENDER,NX_Xrender,$(XRENDERLIBSRC),SOXRENDERREV,SharedXrenderRev) - #else --ProjectUnsharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XRENDER,NX_Xrender,$(XRENDERLIBSRC),XBuildLibDir) - #endif - - XRANDRLIBSRC = $(LIBSRC)/Xrandr -@@ -2675,9 +2675,9 @@ - #ifndef SharedXrandrRev - #define SharedXrandrRev 2.0 - #endif --SharedLibReferences(XRANDR,Xrandr,$(XRANDRLIBSRC),SOXRANDRREV,SharedXrandrRev) -+SharedLibReferences(XRANDR,NX_Xrandr,$(XRANDRLIBSRC),SOXRANDRREV,SharedXrandrRev) - #else --ProjectUnsharedLibReferences(XRANDR,Xrandr,$(XRANDRLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XRANDR,NX_Xrandr,$(XRANDRLIBSRC),XBuildLibDir) - #endif - - XFIXESLIBSRC = $(LIBSRC)/Xfixes -@@ -2685,9 +2685,9 @@ - #ifndef SharedXfixesRev - #define SharedXfixesRev 3.0 - #endif --SharedLibReferences(XFIXES,Xfixes,$(XFIXESLIBSRC),SOXFIXESREV,SharedXfixesRev) -+SharedLibReferences(XFIXES,NX_Xfixes,$(XFIXESLIBSRC),SOXFIXESREV,SharedXfixesRev) - #else --ProjectUnsharedLibReferences(XFIXES,Xfixes,$(XFIXESLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XFIXES,NX_Xfixes,$(XFIXESLIBSRC),XBuildLibDir) - #endif - - XDAMAGELIBSRC = $(LIBSRC)/Xdamage -@@ -2695,9 +2695,9 @@ - #ifndef SharedXdamageRev - #define SharedXdamageRev 1.0 - #endif --SharedLibReferences(XDAMAGE,Xdamage,$(XDAMAGELIBSRC),SOXDAMAGEREV,SharedXdamageRev) -+SharedLibReferences(XDAMAGE,NX_Xdamage,$(XDAMAGELIBSRC),SOXDAMAGEREV,SharedXdamageRev) - #else --ProjectUnsharedLibReferences(XDAMAGE,Xdamage,$(XDAMAGELIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XDAMAGE,NX_Xdamage,$(XDAMAGELIBSRC),XBuildLibDir) - #endif - - XCOMPOSITELIBSRC = $(LIBSRC)/Xcomposite -@@ -2705,9 +2705,9 @@ - #ifndef SharedXcompositeRev - #define SharedXcompositeRev 1.0 - #endif --SharedLibReferences(XCOMPOSITE,Xcomposite,$(XCOMPOSITELIBSRC),SOXCOMPOSITEREV,SharedXcompositeRev) -+SharedLibReferences(XCOMPOSITE,NX_Xcomposite,$(XCOMPOSITELIBSRC),SOXCOMPOSITEREV,SharedXcompositeRev) - #else --ProjectUnsharedLibReferences(XCOMPOSITE,Xcomposite,$(XCOMPOSITELIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XCOMPOSITE,NX_Xcomposite,$(XCOMPOSITELIBSRC),XBuildLibDir) - #endif - - XEVIELIBSRC = $(LIBSRC)/Xevie -@@ -2715,9 +2715,9 @@ - #ifndef SharedXevieRev - #define SharedXevieRev 1.0 - #endif --SharedLibReferences(XEVIE,Xevie,$(XEVIELIBSRC),SOXEVIEREV,SharedXevieRev) -+SharedLibReferences(XEVIE,NX_Xevie,$(XEVIELIBSRC),SOXEVIEREV,SharedXevieRev) - #else --ProjectUnsharedLibReferences(XEVIE,Xevie,$(XEVIELIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XEVIE,NX_Xevie,$(XEVIELIBSRC),XBuildLibDir) - #endif - - XCURSORLIBSRC = $(LIBSRC)/Xcursor -@@ -2725,9 +2725,9 @@ - #ifndef SharedXcursorRev - #define SharedXcursorRev 1.0.2 - #endif --SharedLibReferences(XCURSOR,Xcursor,$(XCURSORLIBSRC),SOXCURSORREV,SharedXcursorRev) -+SharedLibReferences(XCURSOR,NX_Xcursor,$(XCURSORLIBSRC),SOXCURSORREV,SharedXcursorRev) - #else --ProjectUnsharedLibReferences(XCURSOR,Xcursor,$(XCURSORLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XCURSOR,NX_Xcursor,$(XCURSORLIBSRC),XBuildLibDir) - #endif - - APPLEWMLIBSRC = $(LIBSRC)/apple -@@ -2735,9 +2735,9 @@ - #ifndef SharedAppleWMRev - #define SharedAppleWMRev 1.0 - #endif --SharedLibReferences(APPLEWM,AppleWM,$(APPLEWMLIBSRC),SOAPPLEWMREV,SharedAppleWMRev) -+SharedLibReferences(APPLEWM,NX_AppleWM,$(APPLEWMLIBSRC),SOAPPLEWMREV,SharedAppleWMRev) - #else --ProjectUnsharedLibReferences(APPLEWM,AppleWM,$(APPLEWMLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(APPLEWM,NX_AppleWM,$(APPLEWMLIBSRC),XBuildLibDir) - #endif - - WINDOWSWMLIBSRC = $(LIBSRC)/windows -@@ -2745,9 +2745,9 @@ - #ifndef SharedWindowsWMRev - #define SharedWindowsWMRev 1.0 - #endif --SharedLibReferences(WINDOWSWM,WindowsWM,$(WINDOWSWMLIBSRC),SOWINDOWSWMREV,SharedWindowsWMRev) -+SharedLibReferences(WINDOWSWM,NX_WindowsWM,$(WINDOWSWMLIBSRC),SOWINDOWSWMREV,SharedWindowsWMRev) - #else --ProjectUnsharedLibReferences(WINDOWSWM,WindowsWM,$(WINDOWSWMLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(WINDOWSWM,NX_WindowsWM,$(WINDOWSWMLIBSRC),XBuildLibDir) - #endif - - # ifndef SharedLibXfontcache -@@ -2768,9 +2768,9 @@ - #ifndef SharedXfontcacheRev - #define SharedXfontcacheRev 1.2 - #endif --SharedLibReferences(XFONTCACHE,Xfontcache,$(XFONTCACHELIBSRC),SOXFONTCACHEREV,SharedXfontcacheRev) -+SharedLibReferences(XFONTCACHE,NX_Xfontcache,$(XFONTCACHELIBSRC),SOXFONTCACHEREV,SharedXfontcacheRev) - #else --ProjectUnsharedLibReferences(XFONTCACHE,Xfontcache,$(XFONTCACHELIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XFONTCACHE,NX_Xfontcache,$(XFONTCACHELIBSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXau -@@ -2790,12 +2790,12 @@ - #ifndef SharedXauRev - #define SharedXauRev 6.0 - #endif --SharedLibReferences(XAUTH,Xau,$(XAUTHSRC),SOXAUTHREV,SharedXauRev) -+SharedLibReferences(XAUTH,NX_Xau,$(XAUTHSRC),SOXAUTHREV,SharedXauRev) - #else - #if !UseInstalledXauLib --ProjectUnsharedLibReferences(XAUTH,Xau,$(XAUTHSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XAUTH,NX_Xau,$(XAUTHSRC),XBuildLibDir) - #else --ProjectUnsharedLibReferences(XAUTH,Xau,$(XAUTHSRC),$(USRLIBDIR)) -+ProjectUnsharedLibReferences(XAUTH,NX_Xau,$(XAUTHSRC),$(USRLIBDIR)) - #endif - #endif - -@@ -2816,12 +2816,12 @@ - #ifndef SharedXdmcpRev - #define SharedXdmcpRev 6.0 - #endif --SharedLibReferences(XDMCP,Xdmcp,$(XDMCPLIBSRC),SOXDMCPREV,SharedXdmcpRev) -+SharedLibReferences(XDMCP,NX_Xdmcp,$(XDMCPLIBSRC),SOXDMCPREV,SharedXdmcpRev) - #else - #if !UseInstalledXdmcpLib --ProjectUnsharedLibReferences(XDMCP,Xdmcp,$(XDMCPLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XDMCP,NX_Xdmcp,$(XDMCPLIBSRC),XBuildLibDir) - #else --ProjectUnsharedLibReferences(XDMCP,Xdmcp,$(XDMCPLIBSRC),$(USRLIBDIR)) -+ProjectUnsharedLibReferences(XDMCP,NX_Xdmcp,$(XDMCPLIBSRC),$(USRLIBDIR)) - #endif - #endif - -@@ -2842,9 +2842,9 @@ - #ifndef SharedXmuRev - #define SharedXmuRev 6.2 - #endif --SharedDSLibReferences(XMU,Xmu,$(XMUSRC),SOXMUREV,SharedXmuRev) -+SharedDSLibReferences(XMU,NX_Xmu,$(XMUSRC),SOXMUREV,SharedXmuRev) - #else --ProjectUnsharedLibReferences(XMU,Xmu,$(XMUSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XMU,NX_Xmu,$(XMUSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXmuu -@@ -2864,9 +2864,9 @@ - #ifndef SharedXmuuRev - #define SharedXmuuRev 1.0 - #endif --SharedLibReferences(XMUU,Xmuu,$(XMUUSRC),SOXMUUREV,SharedXmuuRev) -+SharedLibReferences(XMUU,NX_Xmuu,$(XMUUSRC),SOXMUUREV,SharedXmuuRev) - #else --ProjectUnsharedLibReferences(XMUU,Xmuu,$(XMUUSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XMUU,NX_Xmuu,$(XMUUSRC),XBuildLibDir) - #endif - - #ifndef SharedOldX -@@ -2886,9 +2886,9 @@ - #ifndef SharedOldXRev - #define SharedOldXRev 6.0 - #endif --SharedLibReferences(OLDX,oldX,$(OLDXLIBSRC),SOOLDXREV,SharedOldXRev) -+SharedLibReferences(OLDX,NX_oldX,$(OLDXLIBSRC),SOOLDXREV,SharedOldXRev) - #else --ProjectUnsharedLibReferences(OLDX,oldX,$(OLDXLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(OLDX,NX_oldX,$(OLDXLIBSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXp -@@ -2908,9 +2908,9 @@ - #ifndef SharedXpRev - #define SharedXpRev 6.2 - #endif --SharedLibReferences(XP,Xp,$(XPLIBSRC),SOXPREV,SharedXpRev) -+SharedLibReferences(XP,NX_Xp,$(XPLIBSRC),SOXPREV,SharedXpRev) - #else --ProjectUnsharedLibReferences(XP,Xp,$(XPLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XP,NX_Xp,$(XPLIBSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXt -@@ -2930,9 +2930,9 @@ - #ifndef SharedXtRev - #define SharedXtRev 6.0 - #endif --SharedDSLibReferences(XTOOLONLY,Xt,$(TOOLKITSRC),SOXTREV,SharedXtRev) -+SharedDSLibReferences(XTOOLONLY,NX_Xt,$(TOOLKITSRC),SOXTREV,SharedXtRev) - #else --ProjectUnsharedLibReferences(XTOOLONLY,Xt,$(TOOLKITSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XTOOLONLY,NX_Xt,$(TOOLKITSRC),XBuildLibDir) - #endif - DEPXTOOLLIB = $(DEPXTOOLONLYLIB) $(DEPSMLIB) $(DEPICELIB) - XTOOLLIB = $(XTOOLONLYLIB) $(SMLIB) $(ICELIB) -@@ -2956,9 +2956,9 @@ - #ifndef SharedXaRev - #define SharedXaRev 1.0 - #endif --SharedLibReferences(XA,Xa,$(XALIBSRC),SOXAREV,SharedXaRev) -+SharedLibReferences(XA,NX_Xa,$(XALIBSRC),SOXAREV,SharedXaRev) - #else --UnsharedLibReferences(XA,Xa,$(XALIBSRC)) -+UnsharedLibReferences(XA,NX_Xa,$(XALIBSRC)) - #endif - - #ifndef BuildXaw -@@ -2985,9 +2985,9 @@ - #ifndef SharedXawRev - #define SharedXawRev 8.0 - #endif --SharedDSLibReferences(XAW,Xaw,$(AWIDGETSRC),SOXAWREV,SharedXawRev) -+SharedDSLibReferences(XAW,NX_Xaw,$(AWIDGETSRC),SOXAWREV,SharedXawRev) - #else --ProjectUnsharedLibReferences(XAW,Xaw,$(AWIDGETSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XAW,NX_Xaw,$(AWIDGETSRC),XBuildLibDir) - #endif - #endif - -@@ -3013,14 +3013,14 @@ - #ifndef SharedXaw7Rev - #define SharedXaw7Rev 7.0 - #endif --SharedDSLibReferences(XAW7,Xaw,$(AWIDGET7SRC),SOXAW7REV,SharedXaw7Rev) -+SharedDSLibReferences(XAW7,NX_Xaw,$(AWIDGET7SRC),SOXAW7REV,SharedXaw7Rev) - #if !BuildXaw --SharedDSLibReferences(XAW,Xaw,$(AWIDGET7SRC),SOXAWREV,SharedXawRev) -+SharedDSLibReferences(XAW,NX_Xaw,$(AWIDGET7SRC),SOXAWREV,SharedXawRev) - #endif - #else --ProjectUnsharedLibReferences(XAW7,Xaw,$(AWIDGET7SRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XAW7,NX_Xaw,$(AWIDGET7SRC),XBuildLibDir) - #if !BuildXaw --ProjectUnsharedLibReferences(XAW,Xaw,$(AWIDGET7SRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XAW,NX_Xaw,$(AWIDGET7SRC),XBuildLibDir) - #endif - #endif - #endif -@@ -3048,14 +3048,14 @@ - #ifndef SharedXaw6Rev - #define SharedXaw6Rev 6.1 - #endif --SharedDSLibReferences(XAW6,Xaw,$(AWIDGET6SRC),SOXAW6REV,SharedXaw6Rev) -+SharedDSLibReferences(XAW6,NX_Xaw,$(AWIDGET6SRC),SOXAW6REV,SharedXaw6Rev) - #if !BuildXaw && !BuildXaw7 --SharedDSLibReferences(XAW,Xaw,$(AWIDGET6SRC),SOXAWREV,SharedXawRev) -+SharedDSLibReferences(XAW,NX_Xaw,$(AWIDGET6SRC),SOXAWREV,SharedXawRev) - #endif - #else --ProjectUnsharedLibReferences(XAW6,Xaw,$(AWIDGET6SRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XAW6,NX_Xaw,$(AWIDGET6SRC),XBuildLibDir) - #if !BuildXaw && !BuildXaw7 --ProjectUnsharedLibReferences(XAW,Xaw,$(AWIDGET6SRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XAW,NX_Xaw,$(AWIDGET6SRC),XBuildLibDir) - #endif - #endif - #endif -@@ -3077,9 +3077,9 @@ - #ifndef SharedXiRev - #define SharedXiRev 6.0 - #endif --SharedLibReferences(XI,Xi,$(XILIBSRC),SOXINPUTREV,SharedXiRev) -+SharedLibReferences(XI,NX_Xi,$(XILIBSRC),SOXINPUTREV,SharedXiRev) - #else --ProjectUnsharedLibReferences(XI,Xi,$(XILIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XI,NX_Xi,$(XILIBSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXtst -@@ -3099,12 +3099,12 @@ - #ifndef SharedXtstRev - #define SharedXtstRev 6.1 - #endif --SharedLibReferences(XTEST,Xtst,$(XTESTLIBSRC),SOXTESTREV,SharedXtstRev) -+SharedLibReferences(XTEST,NX_Xtst,$(XTESTLIBSRC),SOXTESTREV,SharedXtstRev) - #else --ProjectUnsharedLibReferences(XTEST,Xtst,$(XTESTLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XTEST,NX_Xtst,$(XTESTLIBSRC),XBuildLibDir) - #endif - --ProjectUnsharedLibReferences(XBSD,Xbsd,$(LIBSRC)/Xbsd,XBuildLibDir) -+ProjectUnsharedLibReferences(XBSD,NX_Xbsd,$(LIBSRC)/Xbsd,XBuildLibDir) - - #ifndef SharedLibICE - #define SharedLibICE HasSharedLibraries -@@ -3123,9 +3123,9 @@ - #ifndef SharedICERev - #define SharedICERev 6.4 - #endif --SharedLibReferences(ICE,ICE,$(ICESRC),SOICEREV,SharedICERev) -+SharedLibReferences(ICE,NX_ICE,$(ICESRC),SOICEREV,SharedICERev) - #else --ProjectUnsharedLibReferences(ICE,ICE,$(ICESRC),XBuildLibDir) -+ProjectUnsharedLibReferences(ICE,NX_ICE,$(ICESRC),XBuildLibDir) - #endif - - #ifndef SharedLibSM -@@ -3145,9 +3145,9 @@ - #ifndef SharedSMRev - #define SharedSMRev 6.0 - #endif --SharedLibReferences(SM,SM,$(SMSRC),SOSMREV,SharedSMRev) -+SharedLibReferences(SM,NX_SM,$(SMSRC),SOSMREV,SharedSMRev) - #else --ProjectUnsharedLibReferences(SM,SM,$(SMSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(SM,NX_SM,$(SMSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXkey -@@ -3167,9 +3167,9 @@ - #ifndef SharedXkeyRev - #define SharedXkeyRev 6.0 - #endif --SharedLibReferences(XKEY,Xkey,$(XKEYSRC),SOXKEYREV,SharedXkeyRev) -+SharedLibReferences(XKEY,NX_Xkey,$(XKEYSRC),SOXKEYREV,SharedXkeyRev) - #else --ProjectUnsharedLibReferences(XKEY,Xkey,$(XKEYSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XKEY,NX_Xkey,$(XKEYSRC),XBuildLibDir) - #endif - - #ifndef SharedLibFS -@@ -3189,9 +3189,9 @@ - #ifndef SharedFSRev - #define SharedFSRev 6.0 - #endif --SharedLibReferences(FS,FS,$(FSLIBSRC),SOFSREV,SharedFSRev) -+SharedLibReferences(FS,NX_FS,$(FSLIBSRC),SOFSREV,SharedFSRev) - #else --ProjectUnsharedLibReferences(FS,FS,$(FSLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(FS,NX_FS,$(FSLIBSRC),XBuildLibDir) - #endif - - #ifndef SharedLibFont -@@ -3212,14 +3212,14 @@ - #define SharedFontRev 1.5 - #endif - SharedFontLibReferences() --XCOMM SharedLibReferences(XFONT,Xfont,$(FONTLIBSRC),SOFONTREV,SharedFontRev) -+XCOMM SharedLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC),SOFONTREV,SharedFontRev) - #else - ProjectUnsharedFontLibReferences() --XCOMM ProjectUnsharedLibReferences(XFONT,Xfont,$(FONTLIBSRC),XBuildLibDir) -+XCOMM ProjectUnsharedLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC),XBuildLibDir) - #endif - - FONTSTUBLIBSRC = $(FONTLIBSRC)/stubs --ProjectUnsharedLibReferences(FONTSTUB,fntstubs,$(FONTSUBLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(FONTSTUB,NX_fntstubs,$(FONTSUBLIBSRC),XBuildLibDir) - DEPFONTLIB = $(DEPXFONTLIB) $(DEPFONTSTUBLIB) - FONTLIB = $(XFONTLIB) $(FONTSTUBLIB) $(FREETYPE2LIB) - -@@ -3241,9 +3241,9 @@ - #ifndef SharedFontEncRev - #define SharedFontEncRev 1.0 - #endif --SharedLibReferences(XFONTENC,fontenc,$(FONTENCLIBSRC),SOFONTENCREV,SharedFontEncRev) -+SharedLibReferences(XFONTENC,NX_fontenc,$(FONTENCLIBSRC),SOFONTENCREV,SharedFontEncRev) - #else --ProjectUnsharedLibReferences(XFONTENC,fontenc,$(FONTENCLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XFONTENC,NX_fontenc,$(FONTENCLIBSRC),XBuildLibDir) - #endif - - #ifndef SharedLibXpm -@@ -3263,9 +3263,9 @@ - #ifndef SharedXpmRev - #define SharedXpmRev 4.11 - #endif --SharedLibReferences(XPM,Xpm,$(XPMLIBSRC),SOXPMREV,SharedXpmRev) -+SharedLibReferences(XPM,NX_Xpm,$(XPMLIBSRC),SOXPMREV,SharedXpmRev) - #else --ProjectUnsharedLibReferences(XPM,Xpm,$(XPMLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XPM,NX_Xpm,$(XPMLIBSRC),XBuildLibDir) - #endif - - #if UseFreetype2 -@@ -3313,9 +3313,9 @@ - #define SharedFreetype2Rev 9.0 - #endif - #endif --SharedLibReferences(FREETYPE2,freetype,$(FREETYPE2LIBSRC),SOFREETYPE2REV,SharedFreetype2Rev) -+SharedLibReferences(FREETYPE2,NX_freetype,$(FREETYPE2LIBSRC),SOFREETYPE2REV,SharedFreetype2Rev) - #else --ProjectUnsharedLibReferences(FREETYPE2,freetype,$(FREETYPE2LIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(FREETYPE2,NX_freetype,$(FREETYPE2LIBSRC),XBuildLibDir) - #endif - - #ifdef UseInstalled -@@ -3470,9 +3470,9 @@ - #define SharedExpatRev 4.0 - #endif - #endif --SharedLibReferences(EXPAT,expat,$(EXPATLIBSRC),SOEXPATREV,SharedExpatRev) -+SharedLibReferences(EXPAT,NX_expat,$(EXPATLIBSRC),SOEXPATREV,SharedExpatRev) - #else --ProjectUnsharedLibReferences(EXPAT,expat,$(EXPATLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(EXPAT,NX_expat,$(EXPATLIBSRC),XBuildLibDir) - #endif - - #if UseExpat -@@ -3552,9 +3552,9 @@ - #ifndef SharedXft1Rev - #define SharedXft1Rev 1.1 - #endif --SharedLibReferences(XFT1,Xft,$(XFT1LIBSRC),SOXFT1REV,SharedXft1Rev) -+SharedLibReferences(XFT1,NX_Xft,$(XFT1LIBSRC),SOXFT1REV,SharedXft1Rev) - #else --ProjectUnsharedLibReferences(XFT1,Xft,$(XFT1LIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XFT1,NX_Xft,$(XFT1LIBSRC),XBuildLibDir) - #endif - - #ifndef Xft1ClientDepLibs -@@ -3589,9 +3589,9 @@ - #ifndef SharedXftRev - #define SharedXftRev 2.1.2 - #endif --SharedLibReferences(XFT,Xft,$(XFTLIBSRC),SOXFTREV,SharedXftRev) -+SharedLibReferences(XFT,NX_Xft,$(XFTLIBSRC),SOXFTREV,SharedXftRev) - #else --ProjectUnsharedLibReferences(XFT,Xft,$(XFTLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XFT,NX_Xft,$(XFTLIBSRC),XBuildLibDir) - #endif - - #ifndef XftClientDepLibs -@@ -3622,9 +3622,9 @@ - #ifndef SharedFontconfigRev - #define SharedFontconfigRev 1.0.4 - #endif --SharedLibReferences(FONTCONFIG,fontconfig,$(FONTCONFIGLIBSRC),SOFONTCONFIGREV,SharedFontconfigRev) -+SharedLibReferences(FONTCONFIG,NX_fontconfig,$(FONTCONFIGLIBSRC),SOFONTCONFIGREV,SharedFontconfigRev) - #else --ProjectUnsharedLibReferences(FONTCONFIG,fontconfig,$(FONTCONFIGLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(FONTCONFIG,NX_fontconfig,$(FONTCONFIGLIBSRC),XBuildLibDir) - #endif - - #ifdef UseInstalled -@@ -3827,9 +3827,9 @@ - # ifndef SharedxkbfileRev - # define SharedxkbfileRev 1.0 - # endif --SharedLibReferences(XKBFILE,xkbfile,$(XKBFILESRC),SOXKBFILEREV, SharedxkbfileRev) -+SharedLibReferences(XKBFILE,NX_xkbfile,$(XKBFILESRC),SOXKBFILEREV, SharedxkbfileRev) - #else --ProjectUnsharedLibReferences(XKBFILE,xkbfile,$(XKBFILELIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XKBFILE,NX_xkbfile,$(XKBFILELIBSRC),XBuildLibDir) - #endif - - #if BuildXKBlib -@@ -3899,9 +3899,9 @@ - # ifndef SharedxkbuiRev - # define SharedxkbuiRev 1.0 - # endif --SharedLibReferences(XKBUI,xkbui,$(XKBUISRC),SOXKBUIREV, SharedxkbuiRev) -+SharedLibReferences(XKBUI,NX_xkbui,$(XKBUISRC),SOXKBUIREV, SharedxkbuiRev) - #else --ProjectUnsharedLibReferences(XKBUI,xkbui,$(XKBUILIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XKBUI,NX_xkbui,$(XKBUILIBSRC),XBuildLibDir) - #endif - - #ifndef XkbuiLibs -@@ -3974,9 +3974,9 @@ - #ifndef SharedXTrapRev - #define SharedXTrapRev 6.4 - #endif --SharedLibReferences(XTRAP,XTrap,$(XTRAPLIBSRC),SOXTRAPREV,SharedXTrapRev) -+SharedLibReferences(XTRAP,NX_XTrap,$(XTRAPLIBSRC),SOXTRAPREV,SharedXTrapRev) - #else --ProjectUnsharedLibReferences(XTRAP,XTrap,$(XTRAPLIBSRC),XBuildLibDir) -+ProjectUnsharedLibReferences(XTRAP,NX_XTrap,$(XTRAPLIBSRC),XBuildLibDir) - #endif - - #ifndef NeedDefaultDepLibs ---- a/nx-X11/config/cf/lnxLib.rules -+++ b/nx-X11/config/cf/lnxLib.rules -@@ -389,7 +389,7 @@ - XCOMM libX11.so (X11, SM, ICE) - JUMP_ROOT_X11 = $(XLIBSRC) - JUMP_IS_HOST_X11 = YES --JUMP_STUBLIBS_X11 = libX11.sa libSM.sa libICE.sa -+JUMP_STUBLIBS_X11 = libNX_X11.sa libNX_SM.sa libNX_ICE.sa - JUMP_SIBDIRS_X11 = $(JUMP_ROOT_SM) $(JUMP_ROOT_ICE) - JUMP_DIR_X11 = $(JUMP_ROOT_X11)/shared - JUMP_DEFS_X11 = $(XDMAUTHDEFS) $(XKB_DEFINES) -@@ -400,9 +400,9 @@ - JUMP_ADDRESS_X11 = 0x60200000 - JUMP_JUMPTABLESIZE_X11 = 0x4000 - JUMP_GOTSIZE_X11 = 4096 --JUMP_STUBNAMES_X11 = libX11 libSM libICE -+JUMP_STUBNAMES_X11 = libNX_X11 libNX_SM libNX_ICE - JUMP_STUBS_IMPORT_X11 = $(LIBC_SA) --JUMP_SIBARS_X11 = jump/libSM.a~ jump/libICE.a~ -+JUMP_SIBARS_X11 = jump/libNX_SM.a~ jump/libNX_ICE.a~ - JUMP_LDLIBS_X11 = $(JUMP_SIBARS_X11) $(JUMP_LDLIBS_libc) - - XCOMM libSM (part of libX11.so) -@@ -435,9 +435,9 @@ - JUMP_GOTSIZE_Xt = 4096 - JUMP_STUBNAMES_Xt = libXt libXmu libXext libXi libXtst libXp - JUMP_STUBS_IMPORT_Xt = $(JUMP_STUBS_IMPORT_X11) --JUMP_SIBARS_Xt = jump/libXmu.a~ jump/libXext.a~ jump/libXi.a~ jump/libXtst.a~ jump/libXp.a~ --JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_ICE)/libICE.sa \ -- $(JUMP_ROOT_SM)/libSM.sa $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_libc) -+JUMP_SIBARS_Xt = jump/libNX_Xmu.a~ jump/libNX_Xext.a~ jump/libNX_Xi.a~ jump/libNX_Xtst.a~ jump/libNX_Xp.a~ -+JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_ICE)/libNX_ICE.sa \ -+ $(JUMP_ROOT_SM)/libNX_SM.sa $(JUMP_ROOT_X11)/libNX_X11.sa $(JUMP_LDLIBS_libc) - - XCOMM libXmu (part of libXt.so) - JUMP_ROOT_Xmu = $(XMUSRC) -@@ -485,8 +485,8 @@ - JUMP_GOTSIZE_Xaw = 4096 - JUMP_STUBNAMES_Xaw = libXaw - JUMP_STUBS_IMPORT_Xaw = $(JUMP_STUBS_IMPORT_X11) --JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \ -- $(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \ -+JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libNX_Xt.sa $(JUMP_ROOT_Xt)/libNX_Xmu.sa \ -+ $(JUMP_ROOT_Xt)/libNX_Xext.sa $(JUMP_ROOT_X11)/libNX_X11.sa \ - $(JUMP_LDLIBS_libc) - - # endif /* !UseInstalled */ ---- a/nx-X11/config/cf/lnxLib.tmpl -+++ b/nx-X11/config/cf/lnxLib.tmpl -@@ -9,7 +9,7 @@ - - #ifndef FixupLibReferences - #define FixupLibReferences() @@\ --XMULIBONLY = -lXmu @@\ -+XMULIBONLY = -lNX_Xmu @@\ - XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB) - #endif - -@@ -66,7 +66,7 @@ - - #ifndef FixupLibReferences - #define FixupLibReferences() @@\ --XMULIB = -lXmu $(XLIB) -+XMULIB = -lNX_Xmu $(XLIB) - #endif - - #endif /* UseElfFormat */ ---- a/nx-X11/lib/X11/Imakefile -+++ b/nx-X11/lib/X11/Imakefile -@@ -82,7 +82,7 @@ - #define DoExtraLib SharedLibX11 - #define DoDebugLib DebugLibX11 - #define DoProfileLib ProfileLibX11 --#define LibName X11 -+#define LibName NX_X11 - #define SoRev SOXLIBREV - #define HugeLibrary YES - #define IncSubdir X11 ---- a/nx-X11/lib/XRes/Imakefile -+++ b/nx-X11/lib/XRes/Imakefile -@@ -4,7 +4,7 @@ - #define DoSharedLib SharedLibXRes - #define DoDebugLib DebugLibXRes - #define DoProfileLib ProfileLibXRes --#define LibName XRes -+#define LibName NX_XRes - #define SoRev SOXRESREV - #define LibHeaders NO - ---- a/nx-X11/lib/Xau/Imakefile -+++ b/nx-X11/lib/Xau/Imakefile -@@ -10,7 +10,7 @@ - #define DoExtraLib SharedLibXau - #define DoDebugLib DebugLibXau - #define DoProfileLib ProfileLibXau --#define LibName Xau -+#define LibName NX_Xau - #define SoRev SOXAUTHREV - #define IncSubdir X11 - ---- a/nx-X11/lib/Xcomposite/Imakefile -+++ b/nx-X11/lib/Xcomposite/Imakefile -@@ -14,7 +14,7 @@ - #define DoDebugLib DebugLibXcomposite - #define DoProfileLib ProfileLibXcomposite - --#define LibName Xcomposite -+#define LibName NX_Xcomposite - #define SoRev SOXCOMPOSITEREV - #define IncSubdir X11 - #define IncSubSubdir extensions ---- a/nx-X11/lib/Xcomposite/xcomposite.pc.in -+++ b/nx-X11/lib/Xcomposite/xcomposite.pc.in -@@ -7,4 +7,4 @@ - Description: X Composite Library - Version: @VERSION@ - Cflags: -I${includedir} @XCOMPOSITE_CFLAGS@ @X_CFLAGS@ --Libs: -L${libdir} -lXcomposite @XCOMPOSITE_LIBS@ @X_LIBS@ -+Libs: -L${libdir} -lNX_Xcomposite @XCOMPOSITE_LIBS@ @X_LIBS@ ---- a/nx-X11/lib/Xcursor/Imakefile -+++ b/nx-X11/lib/Xcursor/Imakefile -@@ -15,7 +15,7 @@ - #define DoDebugLib DebugLibXcursor - #define DoProfileLib ProfileLibXcursor - --#define LibName Xcursor -+#define LibName NX_Xcursor - #define SoRev SOXCURSORREV - #define IncSubdir X11 - #define IncSubSubdir Xcursor ---- a/nx-X11/lib/Xcursor/xcursor.pc.in -+++ b/nx-X11/lib/Xcursor/xcursor.pc.in -@@ -12,4 +12,4 @@ - Version: @VERSION@ - Requires: xrender - Cflags: -I${includedir} ${xrendercflags} ${xcflags} --Libs: -L${libdir} -lXcursor ${xrenderlibs} ${xlibs} -+Libs: -L${libdir} -lNX_Xcursor ${xrenderlibs} ${xlibs} ---- a/nx-X11/lib/Xdamage/Imakefile -+++ b/nx-X11/lib/Xdamage/Imakefile -@@ -14,7 +14,7 @@ - #define DoDebugLib DebugLibXdamage - #define DoProfileLib ProfileLibXdamage - --#define LibName Xdamage -+#define LibName NX_Xdamage - #define SoRev SOXDAMAGEREV - #define IncSubdir X11 - #define IncSubSubdir extensions ---- a/nx-X11/lib/Xdamage/xdamage.pc.in -+++ b/nx-X11/lib/Xdamage/xdamage.pc.in -@@ -7,4 +7,4 @@ - Description: X Damage Library - Version: @VERSION@ - Cflags: -I${includedir} @XDAMAGE_CFLAGS@ @X_CFLAGS@ --Libs: -L${libdir} -lXdamage @XDAMAGE_LIBS@ @X_LIBS@ -+Libs: -L${libdir} -lNX_Xdamage @XDAMAGE_LIBS@ @X_LIBS@ ---- a/nx-X11/lib/Xdmcp/Imakefile -+++ b/nx-X11/lib/Xdmcp/Imakefile -@@ -10,7 +10,7 @@ - #define DoExtraLib SharedLibXdmcp - #define DoDebugLib DebugLibXdmcp - #define DoProfileLib ProfileLibXdmcp --#define LibName Xdmcp -+#define LibName NX_Xdmcp - #define SoRev SOXDMCPREV - #define IncSubdir X11 - ---- a/nx-X11/lib/Xext/Imakefile -+++ b/nx-X11/lib/Xext/Imakefile -@@ -10,7 +10,7 @@ - #define DoExtraLib SharedLibXext - #define DoDebugLib DebugLibXext - #define DoProfileLib ProfileLibXext --#define LibName Xext -+#define LibName NX_Xext - #define SoRev SOXEXTREV - #define LibHeaders NO - ---- a/nx-X11/lib/Xfixes/Imakefile -+++ b/nx-X11/lib/Xfixes/Imakefile -@@ -14,7 +14,7 @@ - #define DoDebugLib DebugLibXfixes - #define DoProfileLib ProfileLibXfixes - --#define LibName Xfixes -+#define LibName NX_Xfixes - #define SoRev SOXFIXESREV - #define IncSubdir X11 - #define IncSubSubdir extensions ---- a/nx-X11/lib/Xfixes/xfixes.pc.in -+++ b/nx-X11/lib/Xfixes/xfixes.pc.in -@@ -7,4 +7,4 @@ - Description: X Fixes Library - Version: @VERSION@ - Cflags: -I${includedir} @X_CFLAGS@ --Libs: -L${libdir} -lXfixes @X_LIBS@ -+Libs: -L${libdir} -lNX_Xfixes @X_LIBS@ ---- a/nx-X11/lib/Xinerama/Imakefile -+++ b/nx-X11/lib/Xinerama/Imakefile -@@ -4,7 +4,7 @@ - #define DoSharedLib SharedLibXinerama - #define DoDebugLib DebugLibXinerama - #define DoProfileLib ProfileLibXinerama --#define LibName Xinerama -+#define LibName NX_Xinerama - #define SoRev SOXINERAMAREV - #define LibHeaders NO - ---- a/nx-X11/lib/Xpm/Imakefile -+++ b/nx-X11/lib/Xpm/Imakefile -@@ -12,7 +12,7 @@ - #define DoDebugLib DebugLibXpm - #define DoProfileLib ProfileLibXpm - #define HasSharedData NO --#define LibName Xpm -+#define LibName NX_Xpm - #define SoRev SOXPMREV - #define IncSubdir X11 - ---- a/nx-X11/lib/Xrandr/Imakefile -+++ b/nx-X11/lib/Xrandr/Imakefile -@@ -5,7 +5,7 @@ - #define DoSharedLib SharedLibXrandr - #define DoDebugLib DebugLibXrandr - #define DoProfileLib ProfileLibXrandr --#define LibName Xrandr -+#define LibName NX_Xrandr - #define SoRev SOXRANDRREV - #define IncSubdir X11 - #define IncSubSubdir extensions ---- a/nx-X11/lib/Xrender/Imakefile -+++ b/nx-X11/lib/Xrender/Imakefile -@@ -74,7 +74,7 @@ - #define DoSharedLib SharedLibXrender - #define DoDebugLib DebugLibXrender - #define DoProfileLib ProfileLibXrender --#define LibName Xrender -+#define LibName NX_Xrender - #define SoRev SOXRENDERREV - - #ifdef XBuildIncDir ---- a/nx-X11/lib/Xrender/xrender.pc.in -+++ b/nx-X11/lib/Xrender/xrender.pc.in -@@ -8,4 +8,4 @@ - Version: @VERSION@ - Requires: @X_REQUIRES@ - Cflags: -I${includedir} @RENDER_CFLAGS@ @X_NON_PKG_CFLAGS@ --Libs: -L${libdir} -lXrender @X_NON_PKG_LIBS@ -+Libs: -L${libdir} -lNX_Xrender @X_NON_PKG_LIBS@ ---- a/nx-X11/lib/Xtst/Imakefile -+++ b/nx-X11/lib/Xtst/Imakefile -@@ -10,7 +10,7 @@ - #define DoExtraLib SharedLibXtst - #define DoDebugLib DebugLibXtst - #define DoProfileLib ProfileLibXtst --#define LibName Xtst -+#define LibName NX_Xtst - #define SoRev SOXTESTREV - #define LibHeaders NO - ---- a/nx-X11/lib/font/Imakefile -+++ b/nx-X11/lib/font/Imakefile -@@ -31,7 +31,7 @@ - STUBDIRS = stubs - #endif - --LIBNAME = Xfont -+LIBNAME = NX_Xfont - SOREV = $(SOFONTREV) - - #ifndef SeparateSharedCompile ---- a/nx-X11/lib/oldX/Imakefile -+++ b/nx-X11/lib/oldX/Imakefile -@@ -10,7 +10,7 @@ - #define DoExtraLib SharedOldX - #define DoDebugLib DebugOldX - #define DoProfileLib ProfileOldX --#define LibName oldX -+#define LibName NX_oldX - #define SoRev SOOLDXREV - #define IncSubdir X11 - ---- a/nx-X11/lib/xkbfile/Imakefile -+++ b/nx-X11/lib/xkbfile/Imakefile -@@ -11,7 +11,7 @@ - #define DoDebugLib DebugLibxkbfile - #define DoProfileLib ProfileLibxkbfile - #define HasSharedData NO --#define LibName xkbfile -+#define LibName NX_xkbfile - #define SoRev SOXKBFILEREV - #define IncSubdir X11 - #define IncSubSubdir extensions ---- a/nx-X11/lib/xkbui/Imakefile -+++ b/nx-X11/lib/xkbui/Imakefile -@@ -6,7 +6,7 @@ - #define DoDebugLib DebugLibxkbui - #define DoProfileLib ProfileLibxkbui - #define HasSharedData NO --#define LibName xkbui -+#define LibName NX_xkbui - #define SoRev SOXKBUIREV - #define IncSubdir X11 - #define IncSubSubdir extensions ---- a/nx-X11/programs/Xserver/Imakefile -+++ b/nx-X11/programs/Xserver/Imakefile -@@ -313,7 +313,7 @@ - FONTBASE = $(FONTLIBSRC)/fontbase.o \ - $(FONTLIBSRC)/LibraryTargetName(fontbase) - #if XserverStaticFontLib -- FONT = $(FONTLIBSRC)/LibraryTargetName(Xfont) $(FREETYPE2LIB) -+ FONT = $(FONTLIBSRC)/LibraryTargetName(NX_Xfont) $(FREETYPE2LIB) - #else - FONT = $(LDPRELIB) $(XFONTLIB) $(FREETYPE2LIB) - #endif -@@ -994,7 +994,7 @@ - dix/main.o - #endif - --XPMLIB = -lXpm -+XPMLIB = -lNX_Xpm - NXAGENT = hw/nxagent/LibraryTargetName(nxagent) - NXAGENTLIBS = PreFbLibs $(NXAGENT) FbPostFbLibs $(NXAGENT) $(MI) - NXAGENTSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) -@@ -1012,18 +1012,18 @@ - - #if defined(SunArchitecture) - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ -- -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXdmcp \ -+ -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lNX_Xrender -lNX_Xfixes \ -+ -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xdmcp \ - `pkg-config --libs libxml-2.0` - #elif defined(cygwinArchitecture) - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ -- -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ -- -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp \ -+ -lXcomp -lXcompext -lNX_Xrender -lX11 -lNX_Xext -lNX_Xcomposite -lNX_Xfixes \ -+ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdmcp \ - `pkg-config --libs libxml-2.0` - #else - NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ -- -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ -- -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -lXinerama -lXdmcp \ -+ -lXcomp -lXcompext -lXcompshad -lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xfixes \ -+ -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xinerama -lNX_Xdmcp \ - `pkg-config --libs libxml-2.0` - #endif - -@@ -1078,7 +1078,7 @@ - else exit 0; fi - $(CCLINK) -o nxagent_static_nolibs -Wl,-Bstatic $(LDOPTIONS) $(NXAGENTOBJS) \ - $(NXAGENTLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER) $(LDLIBS) $(FONTLIBS) \ -- $(LDPRELIBS) $(SYSLIBS) -Wl,-Bdynamic -lXext -lX11 $(EXTRA_LOAD_FLAGS) -+ $(LDPRELIBS) $(SYSLIBS) -Wl,-Bdynamic -lNX_Xext -lNX_X11 $(EXTRA_LOAD_FLAGS) - #endif /* NXAgentServer */ - - #if defined(XnonServer) && XnonServer ---- a/nxcompext/Makefile.in -+++ b/nxcompext/Makefile.in -@@ -42,12 +42,12 @@ - CCDEFINES = - - LDFLAGS = @LDFLAGS@ -L../nxcomp --LIBS = @LIBS@ -lz -lX11 -lXcomp -+LIBS = @LIBS@ -lz -lNX_X11 -lXcomp - - # - # Only if THREADS is defined - # --# LIBS = @LIBS@ -lz -ljpeg -lpthread -lX11 -lXcomp -+# LIBS = @LIBS@ -lz -ljpeg -lpthread -lNX_X11 -lXcomp - # - - srcdir = @srcdir@ ---- a/nxcompshad/Makefile.in -+++ b/nxcompshad/Makefile.in -@@ -48,7 +48,7 @@ - CCDEFINES = - - LDFLAGS = @LDFLAGS@ --LIBS = @LIBS@ -lX11 -+LIBS = @LIBS@ -lNX_X11 - - # - # Only if THREADS is defined. -@@ -139,7 +139,7 @@ - - else - --EXTRALIBS = -lXtst -lXrandr -lXdamage -+EXTRALIBS = -lNX_Xtst -lNX_Xrandr -lNX_Xdamage - - all: depend $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) - diff --git a/debian/patches/601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch b/debian/patches/601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch deleted file mode 100644 index dbb2e85b0..000000000 --- a/debian/patches/601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch +++ /dev/null @@ -1,99 +0,0 @@ -Description: Do not build bundled libraries. -Author: Orion Poplawski -Abstract: - This commit has been submitted by Orion in two - portions. One was submitted to X2Go BTS and created - on Wed, 10 Jul 2013. - . - The other portion has been taken from the Fedora - package by Mike Gabriel and worked into this - patch on Fri, 06 Dec 2013. ---- - nx-X11/config/cf/host.def | 10 +++++++--- - nx-X11/lib/font/include/Imakefile | 2 +- - 2 files changed, 8 insertions(+), 4 deletions(-) - ---- a/nx-X11/config/cf/host.def -+++ b/nx-X11/config/cf/host.def -@@ -311,6 +311,7 @@ - * - #define BuildFreeType NO - */ -+#define BuildFreeType NO - - /* - * To set non-default build options for the underlying FreeType libraries, -@@ -892,7 +893,7 @@ - * - #define HasFreetype2 NO - */ --#define HasFreetype2 NO -+#define HasFreetype2 YES - - /* - * To use a FreeType library already installed outside the default search -@@ -909,7 +910,7 @@ - * - #define HasFontconfig NO - */ --#define HasFontconfig NO -+#define HasFontconfig YES - - /* - * To use a Fontconfig library already installed outside the default search -@@ -925,7 +926,7 @@ - * - #define HasExpat NO - */ --#define HasExpat NO -+#define HasExpat YES - - /* - * To use a Expat library already installed outside the default search -@@ -961,7 +962,7 @@ - - #define SharedLibXdmcp YES - --#define BuildXaw7 YES -+#define BuildXaw7 NO - - #else /* #if !defined(NXZaurusXServer) && !defined(NXiPAQXServer) && !defined(DarwinArchitecture) */ - -@@ -1019,3 +1020,11 @@ - #endif - - #endif /* #if !defined(NXZaurusXServer) && !defined(NXiPAQXServer) && !defined(DarwinArchitecture) */ -+ -+#define BuildRman NO -+#define BuildFontEncLib NO -+#define BuildXcursorLibrary NO -+#define BuildXftLibrary NO -+#define BuildXft1Library NO -+#define SharedLibFont NO -+#define BuildLoadableXlibI18n NO ---- a/nx-X11/lib/font/include/Imakefile -+++ b/nx-X11/lib/font/include/Imakefile -@@ -1,5 +1,5 @@ - XCOMM $Xorg$ -- HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h fontenc.h \ -+ HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h \ - fontencc.h fontmisc.h fontmod.h fontshow.h fontutil.h \ - fontxlfd.h - all:: ---- a/nx-X11/lib/Imakefile -+++ b/nx-X11/lib/Imakefile -@@ -213,14 +213,8 @@ - - #if BuildLibraries - OLDXLIBDIR = oldX --ICELIBDIR = ICE --SMLIBDIR = SM --XTLIBDIR = Xt --XMULIBDIR = Xmu --XMUULIBDIR = Xmuu - XPMLIBDIR = Xpm - XTSTLIBDIR = Xtst --FSLIBDIR = FS - #endif - - diff --git a/debian/patches/602_nx-X11_initgroups.full.patch b/debian/patches/602_nx-X11_initgroups.full.patch deleted file mode 100644 index 182b378dc..000000000 --- a/debian/patches/602_nx-X11_initgroups.full.patch +++ /dev/null @@ -1,67 +0,0 @@ -Description: Be compliant with POS36-C: Observe correct revocation order while relinquishing privileges -Author: Orion Poplawski -Abstract: - The Fedora review of NX (redistributed) caught the following rpmlint issue: - . - This executable is calling setuid and setgid without setgroups or initgroups. - There is a high probability this mean it didn't relinquish all groups, and this - would be a potential security issue to be fixed. Seek POS36-C on the web for - details about the problem. - . - Ref POS36-C: - https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges - . - This patch adds initgroups() calls to the code to initialize the supplemental group list. -diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c -index 7e62654..9b2431a 100644 ---- a/nx-X11/programs/Xserver/os/utils.c -+++ b/nx-X11/programs/Xserver/os/utils.c -@@ -112,6 +112,9 @@ OR PERFORMANCE OF THIS SOFTWARE. - #include - #include /* for isspace */ - #include -+#include -+#include -+#include - - #if defined(DGUX) - #include -@@ -1770,6 +1773,7 @@ System(char *command) - void (*csig)(int); - #endif - int status; -+ struct passwd *pwent; - - if (!command) - return(1); -@@ -1791,6 +1795,9 @@ System(char *command) - case -1: /* error */ - p = -1; - case 0: /* child */ -+ pwent = getpwuid(getuid()); -+ if (initgroups(pwent->pw_name,getgid()) == -1) -+ _exit(127); - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) -diff --git a/nxcomp/Pipe.cpp b/nxcomp/Pipe.cpp -index 7238d0c..aacbbae 100644 ---- a/nxcomp/Pipe.cpp -+++ b/nxcomp/Pipe.cpp -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include "Pipe.h" - #include "Misc.h" -@@ -234,6 +235,8 @@ FILE *Popen(char * const parameters[], const char *type) - // Child. - // - -+ struct passwd *pwent = getpwuid(getuid()); -+ if (pwent) initgroups(pwent->pw_name,getgid()); - setgid(getgid()); - setuid(getuid()); - diff --git a/debian/patches/603_nx-X11_compilation_warnings.full.patch b/debian/patches/603_nx-X11_compilation_warnings.full.patch deleted file mode 100644 index 3656461b6..000000000 --- a/debian/patches/603_nx-X11_compilation_warnings.full.patch +++ /dev/null @@ -1,38 +0,0 @@ -Description: Handle some serious compilation warnings -Author: Mirraz Mirraz ---- a/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c 2013-08-30 20:18:40.000000000 +0600 -+++ b/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c 2013-09-30 18:39:42.357560169 +0600 -@@ -3259,7 +3259,6 @@ - vp->SrcReg[0].Swizzle = SWIZZLE_NOOP; - vp->SrcReg[1].Swizzle = SWIZZLE_NOOP; - vp->SrcReg[2].Swizzle = SWIZZLE_NOOP; -- vp->SrcReg[3].Swizzle = SWIZZLE_NOOP; - vp->DstReg.WriteMask = 0xf; - - switch (type) { ---- a/nx-X11/lib/X11/imLcPrs.c 2013-08-30 20:18:40.000000000 +0600 -+++ b/nx-X11/lib/X11/imLcPrs.c 2013-09-30 19:02:56.925125678 +0600 -@@ -589,7 +589,7 @@ - - l = _Xmbstoutf8(local_utf8_buf, rhs_string_mb, LOCAL_UTF8_BUFSIZE - 1); - if (l == LOCAL_UTF8_BUFSIZE - 1) { -- local_wc_buf[l] = '\0'; -+ local_utf8_buf[l] = '\0'; - } - if( (rhs_string_utf8 = (char *)Xmalloc(l + 1)) == NULL ) { - Xfree( rhs_string_wc ); ---- a/nx-X11/programs/Xserver/xkb/ddxLoad.c 2013-08-30 20:18:40.000000000 +0600 -+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c 2013-09-30 18:56:27.358995920 +0600 -@@ -37,6 +37,12 @@ - #include - #include - #include -+ -+/* stat() */ -+#include -+#include -+#include -+ - #define NEED_EVENTS 1 - #include - #include diff --git a/debian/patches/605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch b/debian/patches/605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch deleted file mode 100644 index 60f33ce3f..000000000 --- a/debian/patches/605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch +++ /dev/null @@ -1,52 +0,0 @@ -Description: In Types.h, don't use STL internals on libc++. -Author: Clemens Lang -Abstract: - The nx-libs-lite package does not compile on OS X Mavericks because - Apple's clang compilers now default to compiling against the libc++ STL - rather than (their outdated copy of) libstdc++. - . - While the compiler still allows changing that, we should not rely on - this being possible forever. - . - The compiler chokes in Types.h, specifically the clear() methods in - subclasses of vectors that use implementation details of the GNU STL. - The attached patch fixes these compilation issues by not overriding the - clear() method when compiling against libc++, since the libc++ headers - seem to do essentially the same as the overriden method. ---- a/nxcomp/Types.h 2013-11-05 01:35:22.000000000 +0100 -+++ b/nxcomp/Types.h 2013-11-05 01:37:30.000000000 +0100 -@@ -55,6 +55,9 @@ - return &*(vector < unsigned char >::begin()); - } - -+ // Avoid overriding clear() when using libc++. Fiddling with STL internals -+ // doesn't really seem like a good idea to me anyway. -+ #ifndef _LIBCPP_VECTOR - void clear() - { - #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) -@@ -95,12 +98,16 @@ - - #endif /* #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) */ - } -+ #endif /* #ifdef _LIBCPP_VECTOR */ - }; - - class T_messages : public vector < Message * > - { - public: - -+ // Avoid overriding clear() when using libc++. Fiddling with STL internals -+ // doesn't really seem like a good idea to me anyway. -+ #ifndef _LIBCPP_VECTOR - void clear() - { - #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) -@@ -141,6 +148,7 @@ - - #endif /* #if defined(__STL_USE_STD_ALLOCATORS) || defined(__GLIBCPP_INTERNAL_VECTOR_H) */ - } -+ #endif /* #ifndef _LIBCPP_VECTOR */ - }; - - typedef md5_byte_t * T_checksum; diff --git a/debian/patches/606_nx-X11_build-on-aarch64.full.patch b/debian/patches/606_nx-X11_build-on-aarch64.full.patch deleted file mode 100644 index bda43399a..000000000 --- a/debian/patches/606_nx-X11_build-on-aarch64.full.patch +++ /dev/null @@ -1,77 +0,0 @@ -Description: Provide build support for aarch64 architecture -Author: Orion Poplawski ---- a/nx-X11/config/cf/Imake.cf -+++ b/nx-X11/config/cf/Imake.cf -@@ -908,6 +908,9 @@ - # endif - # undef __ARMEB__ - # endif -+# ifdef __aarch64__ -+# define Arm64Architecture -+# endif - # ifdef mc68000 - # define Mc68020Architecture - # undef mc68000 ---- a/nx-X11/config/cf/linux.cf -+++ b/nx-X11/config/cf/linux.cf -@@ -844,6 +844,16 @@ - # define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines - #endif /* Arm32Achitecture */ - -+#ifdef Arm64Architecture -+# define DefaultCCOptions -+# ifndef OptimizedCDebugFlags -+# define OptimizedCDebugFlags -O3 -+# endif -+# define LinuxMachineDefines -D__aarch64__ -U__arm -Uarm -+# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -+# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -+#endif /* Arm64Achitecture */ -+ - #ifdef HPArchitecture - # define OptimizedCDebugFlags -O2 GccAliasingArgs - # define LinuxMachineDefines -D__hppa__ ---- a/nx-X11/config/cf/Imake.tmpl -+++ b/nx-X11/config/cf/Imake.tmpl -@@ -526,6 +526,10 @@ - #define ByteOrder X_BIG_ENDIAN - #elif defined(Arm32Architecture) - #define ByteOrder X_LITTLE_ENDIAN -+#elif defined(Arm64ebArchitecture) -+#define ByteOrder X_BIG_ENDIAN -+#elif defined(Arm64Architecture) -+#define ByteOrder X_LITTLE_ENDIAN - #elif defined(RsArchitecture) - #define ByteOrder X_BIG_ENDIAN - #elif defined(PpcArchitecture) || defined(Ppc64Architecture) ---- a/nx-X11/programs/Xserver/include/servermd.h -+++ b/nx-X11/programs/Xserver/include/servermd.h -@@ -154,6 +154,28 @@ - - #endif /* __arm32__ */ - -+#ifdef __aarch64__ -+ -+#ifdef __AARCH64EL__ -+#define IMAGE_BYTE_ORDER LSBFirst -+#define BITMAP_BIT_ORDER LSBFirst -+#endif -+#ifdef __AARCH64EB__ -+#define IMAGE_BYTE_ORDER MSBFirst -+#define BITMAP_BIT_ORDER MSBFirst -+#endif -+ -+# if defined(XF86MONOVGA) || defined(XF86VGA16) -+# define BITMAP_SCANLINE_UNIT 8 -+# endif -+ -+#define GLYPHPADBYTES 4 -+#define GETLEFTBITS_ALIGNMENT 1 -+#define LARGE_INSTRUCTION_CACHE -+#define AVOID_MEMORY_READ -+ -+#endif /* __aarch64__ */ -+ - #if defined (hpux) || defined __hppa__ - - #define IMAGE_BYTE_ORDER MSBFirst diff --git a/debian/patches/607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch b/debian/patches/607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch deleted file mode 100644 index 535671fef..000000000 --- a/debian/patches/607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch +++ /dev/null @@ -1,14 +0,0 @@ -Description: Detection for Mac OS X's launchd service on Mac OS X 10.10 and beyond -Author: Mike Gabriel - ---- a/nxcomp/Loop.cpp -+++ b/nxcomp/Loop.cpp -@@ -4183,7 +4183,7 @@ - - #ifdef __APPLE__ - -- if (strncasecmp(display, "/tmp/launch", 11) == 0) -+ if ((strncasecmp(display, "/tmp/launch", 11) == 0) || (strncasecmp(display, "/private/tmp/com.apple.launchd", 30) == 0)) - { - #ifdef TEST - *logofs << "Loop: Using launchd service on socket '" diff --git a/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch b/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch deleted file mode 100644 index 23c8508a2..000000000 --- a/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch +++ /dev/null @@ -1,69 +0,0 @@ -Author: Mihai Moldovan -Description: Several fixes for building debug versions of NX -Abstract: - (1) In nx-X11/programs/Xserver/dix: - . - Fix several compile errors when specifying -DDEBUG globally. Previous GCC - versions were more liberal and the code thus compiled. - . - Also initialize/reset a count variable correctly. - . - . - (2) In nx-X11/programs/Xserver/hw/nxagent/Render.c: - . - Check for pSrc->pDrawable to exist instead of having nxagent segfault when - it does not. - . - This enables the possibility of compiling all nxagent modules in TEST mode. - ---- a/nx-X11/programs/Xserver/dix/dixfonts.c -+++ b/nx-X11/programs/Xserver/dix/dixfonts.c -@@ -2203,7 +2203,7 @@ - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { -- if (maskTab[l & 7] & row[l >> 3]) -+ if (maskTab[l & 7] & (((int*)row)[l >> 3])) - putchar('X'); - else - putchar('.'); ---- a/nx-X11/programs/Xserver/hw/nxagent/Render.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c -@@ -1678,10 +1678,11 @@ - - #ifdef TEST - -- fprintf(stderr, "nxagentTrapezoids: Source is a [%s] of geometry [%d,%d].\n", -- (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), -- pSrc -> pDrawable -> width, pSrc -> pDrawable -> height); -- -+ if (pSrc->pDrawable) { -+ fprintf(stderr, "nxagentTrapezoids: Source is a [%s] of geometry [%d,%d].\n", -+ (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), -+ pSrc -> pDrawable -> width, pSrc -> pDrawable -> height); -+ } - if (pSrc ->pDrawable != pDst -> pDrawable) - { - fprintf(stderr, "nxagentTrapezoids: Destination is a [%s] of geometry [%d,%d].\n", ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c -@@ -735,7 +735,7 @@ - - client->sequence++; - #ifdef DEBUG -- if (client->requestLogIndex == MAX_REQUEST_LOG) -+ if ((client->requestLogIndex >= MAX_REQUEST_LOG) || (client->requestLogIndex <= 0)) - client->requestLogIndex = 0; - client->requestLog[client->requestLogIndex] = MAJOROP; - client->requestLogIndex++; ---- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c -@@ -2351,7 +2351,7 @@ - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { -- if (maskTab[l & 7] & row[l >> 3]) -+ if (maskTab[l & 7] & (((int *)row)[l >> 3])) - putchar('X'); - else - putchar('.'); diff --git a/debian/patches/991_fix-hr-typos.full+lite.patch b/debian/patches/991_fix-hr-typos.full+lite.patch deleted file mode 100644 index 4ff18462e..000000000 --- a/debian/patches/991_fix-hr-typos.full+lite.patch +++ /dev/null @@ -1,97 +0,0 @@ -Description: Fix several typos in nxcomp -Author: Mike Gabriel - ---- a/nxcomp/CHANGELOG -+++ b/nxcomp/CHANGELOG -@@ -668,7 +668,7 @@ - - nxcomp-2.0.0-69 - --- Changed the format of the persistent cache to accomodate the new -+- Changed the format of the persistent cache to accommodate the new - encoding of the render opcodes. Caches from the 1.4.0 and 1.5.0 - should be still loaded and saved correctly when connected to and - old version of the library. ---- a/nxcomp/ClientReadBuffer.cpp -+++ b/nxcomp/ClientReadBuffer.cpp -@@ -29,7 +29,7 @@ - // - // Even if the pending data is not - // enough to make a complete message, -- // resize the buffer to accomodate -+ // resize the buffer to accommodate - // it all. - // - ---- a/nxcomp/EncodeBuffer.cpp -+++ b/nxcomp/EncodeBuffer.cpp -@@ -505,12 +505,12 @@ - { - #ifdef PANIC - *logofs << "EncodeBuffer: PANIC! Error in context [C] " -- << "growing buffer to accomodate " << numBytes -+ << "growing buffer to accommodate " << numBytes - << " bytes .\n" << logofs_flush; - #endif - - cerr << "Error" << ": Error in context [C] " -- << "growing encode buffer to accomodate " -+ << "growing encode buffer to accommodate " - << numBytes << " bytes.\n"; - - HandleAbort(); ---- a/nxcomp/GenericChannel.cpp -+++ b/nxcomp/GenericChannel.cpp -@@ -210,7 +210,7 @@ - // All data has been read from the read buffer. - // We still need to mark the end of the encode - // buffer just before sending the frame. This -- // allows us to accomodate multiple reads in -+ // allows us to accommodate multiple reads in - // a single frame. - // - ---- a/nxcomp/ProxyReadBuffer.cpp -+++ b/nxcomp/ProxyReadBuffer.cpp -@@ -50,7 +50,7 @@ - // - // Even if the readable data is not - // enough to make a complete message, -- // resize the buffer to accomodate -+ // resize the buffer to accommodate - // it all. - // - ---- a/nxcomp/ServerReadBuffer.cpp -+++ b/nxcomp/ServerReadBuffer.cpp -@@ -46,7 +46,7 @@ - // - // Even if the readable data is not - // enough to make a complete message, -- // resize the buffer to accomodate -+ // resize the buffer to accommodate - // it all. - // - ---- a/nxcomp/Transport.h -+++ b/nxcomp/Transport.h -@@ -226,7 +226,7 @@ - protected: - - // -- // Make room in the buffer to accomodate -+ // Make room in the buffer to accommodate - // at least size bytes. - // - ---- a/nxcomp/Types.h -+++ b/nxcomp/Types.h -@@ -179,7 +179,7 @@ - typedef list < int > T_list; - - // --// Used to accomodate data to be read and -+// Used to accommodate data to be read and - // written to a socket. - // - diff --git a/debian/patches/991_fix-hr-typos.full.patch b/debian/patches/991_fix-hr-typos.full.patch deleted file mode 100644 index 3836adf55..000000000 --- a/debian/patches/991_fix-hr-typos.full.patch +++ /dev/null @@ -1,36 +0,0 @@ -Description: Fix several typos in nx-X11 -Author: Mike Gabriel - ---- a/nx-X11/extras/Mesa/src/mesa/main/debug.c -+++ b/nx-X11/extras/Mesa/src/mesa/main/debug.c -@@ -43,7 +43,7 @@ - "GL_QUAD_STRIP", - "GL_POLYGON", - "outside begin/end", -- "inside unkown primitive", -+ "inside unknown primitive", - "unknown state" - }; - ---- a/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c -+++ b/nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c -@@ -4106,7 +4106,7 @@ - if (*inst++ != REVISION) { - _mesa_set_program_error (ctx, 0, "Grammar version mismatch"); - _mesa_error(ctx, GL_INVALID_OPERATION, -- "glProgramStringARB(Grammar verison mismatch)"); -+ "glProgramStringARB(Grammar version mismatch)"); - err = GL_TRUE; - } - else { ---- a/nx-X11/ChangeLog.X.org -+++ b/nx-X11/ChangeLog.X.org -@@ -12733,7 +12733,7 @@ - * programs/xkill/xkill.c: (get_window_id): - Changed cursor for the 'kill' action from XC_draped_box to - XC_Pirate. If you don't like it we can change it back -- (original author unkown). -+ (original author unknown). - - * programs/xman/vendor.h: - Added 'pic' to the man page rendering command pipeline diff --git a/debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch b/debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch deleted file mode 100644 index 62c85cfb2..000000000 --- a/debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch +++ /dev/null @@ -1,367 +0,0 @@ -Description: Unbrand NX Agent Startup Screen / Brand X2Go Agent Startup Screen - When launched with NX Agent flavour, the startup screen gets unbranded by - this patch (the !M logo does not get shown). - . - When launched with X2Go Agent flavour, the startup screen gets branded - with the X2GO logo. -Forwarded: not-needed -Author: Oleksandr Shneyder -Last-Update: 2012-01-11 ---- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c -@@ -35,6 +35,7 @@ - #include "Windows.h" - #include "Atoms.h" - #include "Trap.h" -+#include "Init.h" - - /* - * Set here the required log level. -@@ -53,6 +54,7 @@ - int nxagentLogoWhite; - int nxagentLogoRed; - int nxagentLogoBlack; -+int nxagentLogoGray; - - void nxagentPaintLogo(Window win, GC gc, int scale, int width, int height); - -@@ -166,6 +168,15 @@ - XPoint m[12]; - int w, h, c, w2, h2; - -+ /* -+ * Show only X2GO Logo when running as X2Go Agent -+ */ -+ if(! nxagentX2go) -+ { -+ nxagentPixmapLogo = 0L; -+ return; -+ } -+ - #ifdef DEBUG - fprintf(stderr, "nxagenShowtLogo: Got called.\n"); - #endif -@@ -218,75 +229,146 @@ - XSetForeground(nxagentDisplay, gc, nxagentLogoRed); - XSetBackground(nxagentDisplay, gc, nxagentLogoWhite); - -- rect[0].x = w2-10*c; rect[0].y = h2-8*c; -- rect[1].x = w2-10*c; rect[1].y = h2+8*c; -- rect[2].x = w2+10*c; rect[2].y = h2+8*c; -- rect[3].x = w2+10*c; rect[3].y = h2-8*c; -+ /* -+ * Draw X2GO Logo -+ */ - -+ /* -+ * Begin 'X'. -+ */ -+ -+ XSetForeground(nxagentDisplay, gc, nxagentLogoGray); -+ XSetBackground(nxagentDisplay, gc, nxagentLogoWhite); -+ rect[0].x = w2-7*c; rect[0].y = h2-5*c; -+ rect[1].x = w2-8*c; rect[1].y = h2-5*c; -+ rect[2].x = w2-4*c; rect[2].y = h2+3*c; -+ rect[3].x = w2-3*c; rect[3].y = h2+3*c; - XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -- #ifdef NXAGENT_LOGO_DEBUG -- fprintf(stderr, "filled red rect\n"); -- #endif -+ rect[0].x = w2-4*c; rect[0].y = h2-5*c; -+ rect[1].x = w2-3*c; rect[1].y = h2-5*c; -+ rect[2].x = w2-7*c; rect[2].y = h2+3*c; -+ rect[3].x = w2-8*c; rect[3].y = h2+3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -- rect[0].x = w2-9*c; rect[0].y = h2-7*c; -- rect[1].x = w2-9*c; rect[1].y = h2+7*c; -- rect[2].x = w2+9*c; rect[2].y = h2+7*c; -- rect[3].x = w2+9*c; rect[3].y = h2-7*c; -+ /* -+ * End 'X'. -+ */ - -- XSetForeground(nxagentDisplay, gc, nxagentLogoWhite); -- XSetBackground(nxagentDisplay, gc, nxagentLogoRed); -+ /* -+ * Start '2'. -+ */ -+ -+ rect[0].x = w2-2*c; rect[0].y = h2-5*c; -+ rect[1].x = w2-1*c; rect[1].y = h2-5*c; -+ rect[2].x = w2-1*c; rect[2].y = h2-3*c; -+ rect[3].x = w2-2*c; rect[3].y = h2-3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); -+ -+ rect[0].x = w2-2*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+2*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+2*c; rect[2].y = h2-4*c; -+ rect[3].x = w2-2*c; rect[3].y = h2-4*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -+ rect[0].x = w2+1*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+2*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+2*c; rect[2].y = h2-2*c; -+ rect[3].x = w2+1*c; rect[3].y = h2-2*c; - XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -+ rect[0].x = w2+2*c; rect[0].y = h2-2*c; -+ rect[1].x = w2+1*c; rect[1].y = h2-2*c; -+ rect[2].x = w2-2*c; rect[2].y = h2+2*c; -+ rect[3].x = w2-1*c; rect[3].y = h2+2*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); -+ -+ -+ rect[0].x = w2-2*c; rect[0].y = h2+2*c; -+ rect[1].x = w2+2*c; rect[1].y = h2+2*c; -+ rect[2].x = w2+2*c; rect[2].y = h2+3*c; -+ rect[3].x = w2-2*c; rect[3].y = h2+3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - /* -- * Begin 'M'. -+ * End '2'. - */ - -- m[0].x = w2-3*c; m[0].y = h2-5*c; -- m[1].x = w2+7*c; m[1].y = h2-5*c; -- m[2].x = w2+7*c; m[2].y = h2+5*c; -- m[3].x = w2+5*c; m[3].y = h2+5*c; -- m[4].x = w2+5*c; m[4].y = h2-3*c; -- m[5].x = w2+3*c; m[5].y = h2-3*c; -- m[6].x = w2+3*c; m[6].y = h2+5*c; -- m[7].x = w2+1*c; m[7].y = h2+5*c; -- m[8].x = w2+1*c; m[8].y = h2-3*c; -- m[9].x = w2-1*c; m[9].y = h2-3*c; -- m[10].x = w2-1*c; m[10].y = h2+5*c; -- m[11].x = w2-3*c; m[11].y = h2+5*c; -+ /* -+ * Start 'G'. -+ */ - -- XSetForeground(nxagentDisplay, gc, nxagentLogoRed); -- XSetBackground(nxagentDisplay, gc, nxagentLogoWhite); -+ rect[0].x = w2+3*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+7*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+7*c; rect[2].y = h2-4*c; -+ rect[3].x = w2+3*c; rect[3].y = h2-4*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -- XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, m, 12, Nonconvex, CoordModeOrigin); -+ rect[0].x = w2+3*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+4*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+4*c; rect[2].y = h2+3*c; -+ rect[3].x = w2+3*c; rect[3].y = h2+3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -+ rect[0].x = w2+3*c; rect[0].y = h2+2*c; -+ rect[1].x = w2+7*c; rect[1].y = h2+2*c; -+ rect[2].x = w2+7*c; rect[2].y = h2+3*c; -+ rect[3].x = w2+3*c; rect[3].y = h2+3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); -+ -+ rect[0].x = w2+6*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+7*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+7*c; rect[2].y = h2-3*c; -+ rect[3].x = w2+6*c; rect[3].y = h2-3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); -+ -+ rect[0].x = w2+6*c; rect[0].y = h2-0*c; -+ rect[1].x = w2+7*c; rect[1].y = h2-0*c; -+ rect[2].x = w2+7*c; rect[2].y = h2+3*c; -+ rect[3].x = w2+6*c; rect[3].y = h2+3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); -+ -+ rect[0].x = w2+5*c; rect[0].y = h2-1*c; -+ rect[1].x = w2+7*c; rect[1].y = h2-1*c; -+ rect[2].x = w2+7*c; rect[2].y = h2+0*c; -+ rect[3].x = w2+5*c; rect[3].y = h2+0*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - /* -- * End 'M'. -+ * End 'G'. - */ - - /* -- * Begin '!'. -+ * Start 'O'. - */ - -- rect[0].x = w2-7*c; rect[0].y = h2-5*c; -- rect[1].x = w2-5*c; rect[1].y = h2-5*c; -- rect[2].x = w2-5*c; rect[2].y = h2+2*c; -- rect[3].x = w2-7*c; rect[3].y = h2+2*c; -+ rect[0].x = w2+8*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+12*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+12*c; rect[2].y = h2-4*c; -+ rect[3].x = w2+8*c; rect[3].y = h2-4*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -+ rect[0].x = w2+8*c; rect[0].y = h2+3*c; -+ rect[1].x = w2+12*c; rect[1].y = h2+3*c; -+ rect[2].x = w2+12*c; rect[2].y = h2+2*c; -+ rect[3].x = w2+8*c; rect[3].y = h2+2*c; - XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -- rect[0].x = w2-7*c; rect[0].y = h2+3*c; -- rect[1].x = w2-5*c; rect[1].y = h2+3*c; -- rect[2].x = w2-5*c; rect[2].y = h2+5*c; -- rect[3].x = w2-7*c; rect[3].y = h2+5*c; -+ rect[0].x = w2+8*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+9*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+9*c; rect[2].y = h2+3*c; -+ rect[3].x = w2+8*c; rect[3].y = h2+3*c; -+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - -+ rect[0].x = w2+11*c; rect[0].y = h2-5*c; -+ rect[1].x = w2+12*c; rect[1].y = h2-5*c; -+ rect[2].x = w2+12*c; rect[2].y = h2+3*c; -+ rect[3].x = w2+11*c; rect[3].y = h2+3*c; - XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin); - - /* -- * End 'M'. -+ * End 'O'. - */ - -+ - XSetWindowBackgroundPixmap(nxagentDisplay, win, nxagentPixmapLogo); - - #ifdef NXAGENT_LOGO_DEBUG ---- a/nx-X11/programs/Xserver/hw/nxagent/Display.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c -@@ -1430,22 +1430,10 @@ - g = pV.green_mask; - b = pV.blue_mask; - -- if (!pV.red_mask || !pV.green_mask || !pV.blue_mask) -- { -- nxagentLogoBlack = 0x000000; -- nxagentLogoRed = 0xff0000; -- nxagentLogoWhite = 0xffffff; -- } -- else -- { -- for (or=0, off=0x800000; (r&(off>>or)) == 0; or++); -- for (og=0, off=0x800000; (g&(off>>og)) == 0; og++); -- for (ob=0, off=0x800000; (b&(off>>ob)) == 0; ob++); -- -- nxagentLogoRed = nxagentLogoColor(0xff0000); -- nxagentLogoBlack = nxagentLogoColor(0x000000); -- nxagentLogoWhite = 0xffffff; -- } -+ nxagentLogoBlack = 0x000000; -+ nxagentLogoRed = 0xff0000; -+ nxagentLogoWhite = 0xffffff; -+ nxagentLogoGray = 0x222222; - - #ifdef WATCH - -@@ -2696,22 +2684,10 @@ - g = pV.green_mask; - b = pV.blue_mask; - -- if (!pV.red_mask || !pV.green_mask || !pV.blue_mask) -- { -- nxagentLogoBlack = 0x000000; -- nxagentLogoRed = 0xff0000; -- nxagentLogoWhite = 0xffffff; -- } -- else -- { -- for (or=0, off=0x800000; (r&(off>>or)) == 0; or++); -- for (og=0, off=0x800000; (g&(off>>og)) == 0; og++); -- for (ob=0, off=0x800000; (b&(off>>ob)) == 0; ob++); -- -- nxagentLogoRed = nxagentLogoColor(0xff0000); -- nxagentLogoBlack = nxagentLogoColor(0x000000); -- nxagentLogoWhite = 0xffffff; -- } -+ nxagentLogoBlack = 0x000000; -+ nxagentLogoRed = 0xff0000; -+ nxagentLogoWhite = 0xffffff; -+ nxagentLogoGray = 0x222222; - - useXpmIcon = nxagentMakeIcon(nxagentDisplay, &nxagentIconPixmap, &nxagentIconShape); - ---- a/nx-X11/programs/Xserver/hw/nxagent/Splash.h -+++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.h -@@ -33,6 +33,7 @@ - extern int nxagentLogoWhite; - extern int nxagentLogoRed; - extern int nxagentLogoBlack; -+extern int nxagentLogoGray; - - extern Window nxagentSplashWindow; - ---- a/nx-X11/programs/Xserver/os/oscolor.c -+++ b/nx-X11/programs/Xserver/os/oscolor.c -@@ -53,7 +53,19 @@ - #include - #include - --static char* nxAltRgbPaths[] = {"/etc/nxagent/rgb", "/usr/share/nx/rgb", "/usr/local/share/nx/rgb", "/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; -+/* FIXME: we need more intelligent code (like provided by the nxagentX2go -+ * var in hw/nxagent/Init.h) to detect our current runtime mode (running -+ * as x2goagent, running as nxagent) -+ */ -+static char* nxAltRgbPaths[] = {"/etc/x2go/rgb", \ -+ "/usr/share/x2go/rgb", \ -+ "/usr/local/share/x2go/rgb", \ -+ "/etc/nxagent/rgb", \ -+ "/usr/share/nx/rgb", \ -+ "/usr/local/share/nx/rgb", \ -+ "/usr/NX/share/rgb", \ -+ "/usr/share/X11/rgb", \ -+ "/etc/X11/rgb"}; - static char _NXRgbPath[1024]; - - #endif ---- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c -@@ -62,6 +62,7 @@ - - #include "globals.h" - #include "property.h" -+#include "Init.h" - - #include - -@@ -138,8 +139,11 @@ - #ifndef XKB_ALTERNATE_BASE_DIRECTORY - #define XKB_ALTERNATE_BASE_DIRECTORY "/usr/X11R6/lib/X11/xkb" - #endif --#ifndef XKB_CONFIG_FILE --#define XKB_CONFIG_FILE "/etc/nxagent/nxagent.keyboard" -+#ifndef XKB_CONFIG_FILE_NX -+#define XKB_CONFIG_FILE_NX "/etc/nxagent/nxagent.keyboard" -+#endif -+#ifndef XKB_CONFIG_FILE_X2GO -+#define XKB_CONFIG_FILE_X2GO "/etc/x2go/x2goagent.keyboard" - #endif - #ifndef XKB_DFLT_RULES_FILE - #define XKB_DFLT_RULES_FILE "xfree86" -@@ -988,7 +992,10 @@ - - XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); - -- nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE); -+ if (nxagentX2go) -+ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); -+ else -+ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); - - nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char)); - -@@ -997,7 +1004,10 @@ - FatalError("nxagentKeyboardProc: malloc failed."); - } - -- strcpy(nxagentXkbConfigFilePath, XKB_CONFIG_FILE); -+ if (nxagentX2go) -+ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); -+ else -+ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); - - #ifdef TEST - fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n", diff --git a/debian/patches/series b/debian/patches/series index e6398bc19..efd6f2988 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,76 +1,76 @@ -000_add-NX-redistribution-README.full+lite.patch -002_nxcompshad_build-against-nx-x11-only.full.patch -003_nxcompshad_gcc43.full.patch -004_nx-X11_fix-nxcompshad-build.full.patch -005_nxcomp_gcc43.full+lite.patch -006_nxcomp_libpng15.full+lite.patch -007_nxcompshad_clean-gch-files.full.patch -008_nxcomp_sa-restorer.full+lite.patch -009_nxproxy_add-man-page.full+lite.patch -009_nxagent_add-man-page.full.patch -010_nxauth_fix-binary-name-in-man-page.full.patch -012_nxcomp_makefile-uninstall+autoconf.full+lite.patch -013_nxcompext_makefile-uninstall+autoconf.full.patch -014_nxcompshad_makefile-uninstall+autoconf.full.patch -015_nxproxy_makefile-uninstall.full+lite.patch -016_nx-X11_install-location.full.patch -024_fix-make-clean.full.patch -024_fix-make-clean.full+lite.patch -025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch -026_nxcompext_honour-optflags.full.patch -026_nxcomp_honour-optflags.full+lite.patch -026_nxcompshad_honour-optflags.full.patch -027_nxcomp_abstract-X11-socket.full+lite.patch -028_nx-X11_abstract-kernel-sockets.full.patch -029_nxcomp_ppc64.full+lite.patch -030_nx-X11_configure-args.full.patch -031_nx-X11_parallel-make.full.patch -051_nxcomp_macos105-fdisset.full+lite.patch -052_nxcomp_macos10-nxauth-location.full+lite.patch -053_nx-X11_no-xcomp1-install-target.full.patch -054_nx-X11_ppc64-ftbfs.full.patch -055_nx-X11_imake-Werror-format-security.full.patch -056_nx-X11_Werror-format-security.full.patch -057_nx-X11_sanitize-eventmasks.full.patch -101_nxagent_set-rgb-path.full.patch -102_xserver-xext_set-securitypolicy-path.full.patch -103_nxagent_set-X0-config-path.full.patch -105_nxagent_export-remote-keyboard-config.full.patch -106_nxagent_utf8-copy-clipboard.full.patch -107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch -108_nxagent_wine-close-delay.full.patch -110_nxagent_createpixmap-bounds-check.full.patch -200_nxagent_check-binary-x2go-flavour.full.patch -201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch -202_nx-X11_enable-xinerama.full.patch -203_nxagent_disable-rootless-exit.full.patch -204_nxagent_repaint-solidpict.full.patch -205_nxagent_refresh-adsl.full.patch -206_nxagent_clipboard-as-nxoption.full.patch -207_nxagent_fix-xfixes-selection.full.patch -209_x2goagent_add-man-page.full.patch -210_nxagent_save_session_state.full.patch -210_nxcomp_save_session_state.full+lite.patch -211_nxcomp_set_default_options.full+lite.patch -212_nxcomp_build-on-Android.full+lite.patch -220_nxproxy_bind-loopback-only.full+lite.patch -300_nxagent_set-wm-class.full.patch -301_nx-X11_use-shared-libs.full.patch -302_nx-X11_xkbbasedir-detection.full.patch -320_nxagent_configurable-keystrokes.full.patch -321_nxagent_x2go-specific-keystroke-config.full.patch -400_nxcomp-version.full+lite.patch -#401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch -600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch -601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch -602_nx-X11_initgroups.full.patch -603_nx-X11_compilation_warnings.full.patch -605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch -606_nx-X11_build-on-aarch64.full.patch -607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch -990_fix-DEBUG-and-TEST-builds.full.patch -991_fix-hr-typos.full+lite.patch -991_fix-hr-typos.full.patch -999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch -016_nx-X11_install-location.debian.patch -102_xserver-xext_set-securitypolicy-path.debian.patch +0000_add-NX-redistribution-README.full+lite.patch +0002_nxcompshad_build-against-nx-x11-only.full.patch +0003_nxcompshad_gcc43.full.patch +0004_nx-X11_fix-nxcompshad-build.full.patch +0005_nxcomp_gcc43.full+lite.patch +0006_nxcomp_libpng15.full+lite.patch +0007_nxcompshad_clean-gch-files.full.patch +0008_nxcomp_sa-restorer.full+lite.patch +0009_nxproxy_add-man-page.full+lite.patch +0009_nxagent_add-man-page.full.patch +0010_nxauth_fix-binary-name-in-man-page.full.patch +0012_nxcomp_makefile-uninstall+autoconf.full+lite.patch +0013_nxcompext_makefile-uninstall+autoconf.full.patch +0014_nxcompshad_makefile-uninstall+autoconf.full.patch +0015_nxproxy_makefile-uninstall.full+lite.patch +0016_nx-X11_install-location.full.patch +0024_fix-make-clean.full.patch +0024_fix-make-clean.full+lite.patch +0025_nxcomp-fix-ftbfs-against-jpeg9a.full+lite.patch +0026_nxcompext_honour-optflags.full.patch +0026_nxcomp_honour-optflags.full+lite.patch +0026_nxcompshad_honour-optflags.full.patch +0027_nxcomp_abstract-X11-socket.full+lite.patch +0028_nx-X11_abstract-kernel-sockets.full.patch +0029_nxcomp_ppc64.full+lite.patch +0030_nx-X11_configure-args.full.patch +0031_nx-X11_parallel-make.full.patch +0051_nxcomp_macos105-fdisset.full+lite.patch +0052_nxcomp_macos10-nxauth-location.full+lite.patch +0053_nx-X11_no-xcomp1-install-target.full.patch +0054_nx-X11_ppc64-ftbfs.full.patch +0055_nx-X11_imake-Werror-format-security.full.patch +0056_nx-X11_Werror-format-security.full.patch +0057_nx-X11_sanitize-eventmasks.full.patch +0101_nxagent_set-rgb-path.full.patch +0102_xserver-xext_set-securitypolicy-path.full.patch +0103_nxagent_set-X0-config-path.full.patch +0105_nxagent_export-remote-keyboard-config.full.patch +0106_nxagent_utf8-copy-clipboard.full.patch +0107_nxagent_clipboard-compound-text+small-bed-sheets.full.patch +0108_nxagent_wine-close-delay.full.patch +0110_nxagent_createpixmap-bounds-check.full.patch +0200_nxagent_check-binary-x2go-flavour.full.patch +0201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch +0202_nx-X11_enable-xinerama.full.patch +0203_nxagent_disable-rootless-exit.full.patch +0204_nxagent_repaint-solidpict.full.patch +0205_nxagent_refresh-adsl.full.patch +0206_nxagent_clipboard-as-nxoption.full.patch +0207_nxagent_fix-xfixes-selection.full.patch +0209_x2goagent_add-man-page.full.patch +0210_nxagent_save_session_state.full.patch +0210_nxcomp_save_session_state.full+lite.patch +0211_nxcomp_set_default_options.full+lite.patch +0212_nxcomp_build-on-Android.full+lite.patch +0220_nxproxy_bind-loopback-only.full+lite.patch +0300_nxagent_set-wm-class.full.patch +0301_nx-X11_use-shared-libs.full.patch +0302_nx-X11_xkbbasedir-detection.full.patch +0320_nxagent_configurable-keystrokes.full.patch +0321_nxagent_x2go-specific-keystroke-config.full.patch +0400_nxcomp-version.full+lite.patch +#0401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch +0600_nx-X11+nxcompext+nxcompshad_unique-libnames.full.patch +0601_nx-X11_build-option-changes-to-not-use-bundled-libraries.full.patch +0602_nx-X11_initgroups.full.patch +0603_nx-X11_compilation_warnings.full.patch +0605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full+lite.patch +0606_nx-X11_build-on-aarch64.full.patch +0607_nxcomp_macosx-X11-launcher-in-private-tmp.full+lite.patch +0990_fix-DEBUG-and-TEST-builds.full.patch +0991_fix-hr-typos.full+lite.patch +0991_fix-hr-typos.full.patch +0999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch +0016_nx-X11_install-location.debian.patch +0102_xserver-xext_set-securitypolicy-path.debian.patch -- cgit v1.2.3