From b4855e232588c4798209b29596bffa0b6319e7ab01d24edc5c6627ffb2d4495d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 24 Apr 2019 07:27:52 +0000 Subject: [PATCH 1/2] - Reenable Xresources / remove -DNOT_X_WINDOWS [boo#1133181] OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/putty?expand=0&rev=59 --- putty.changes | 6 ++++++ putty.spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/putty.changes b/putty.changes index 031e52f..23cf191 100644 --- a/putty.changes +++ b/putty.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 24 07:24:56 UTC 2019 - Jan Engelhardt + +- Reenable Xresources / remove -DNOT_X_WINDOWS [boo#1133181], + the crash under Wayland appears gone. + ------------------------------------------------------------------- Mon Mar 18 17:57:39 UTC 2019 - Jan Engelhardt diff --git a/putty.spec b/putty.spec index 618b5a7..5506d97 100644 --- a/putty.spec +++ b/putty.spec @@ -57,7 +57,7 @@ openssh, and "putty" is the program that combines both in one. %patch -P 1 -P 2 -p1 %build -export CFLAGS="%optflags -Wno-error -DNOT_X_WINDOWS" +export CFLAGS="%optflags -Wno-error" %configure make %{?_smp_mflags} make %{?_smp_mflags} -C icons cicons pngs From 584e925e18fca5256244332756697ecaff01f7b74b245dd09232ea67dd37c59e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 24 Apr 2019 08:21:30 +0000 Subject: [PATCH 2/2] - Add 0001-Revert-settings.c-allow-load_open_settings-NULL.patch [boo#1133181] OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/putty?expand=0&rev=60 --- ...ings.c-allow-load_open_settings-NULL.patch | 78 +++++++++++++++++++ putty.changes | 2 + putty.spec | 4 +- 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 0001-Revert-settings.c-allow-load_open_settings-NULL.patch diff --git a/0001-Revert-settings.c-allow-load_open_settings-NULL.patch b/0001-Revert-settings.c-allow-load_open_settings-NULL.patch new file mode 100644 index 0000000..30f93d8 --- /dev/null +++ b/0001-Revert-settings.c-allow-load_open_settings-NULL.patch @@ -0,0 +1,78 @@ +From 39c20d4819794417e4e84429d1eb5430e3865b25 Mon Sep 17 00:00:00 2001 +From: Simon Tatham +Date: Sat, 13 Apr 2019 18:52:28 +0100 +Subject: [PATCH] Revert "settings.c: allow load_open_settings(NULL)." + +This reverts commit 1b2f39c24bb6591a4192377d9393f5c3e45cb5bd. + +The intention of that commit was to support the development of Uppity, +by arranging that I could get a Conf populated with completely default +values by calling load_open_settings(NULL,conf), with no risk of +interference from the normal PuTTY saved sessions full of client-side +configuration (which would have been confusing to apply unexpectedly +in a server). + +So I arranged that a NULL session handle was never passed to the +low-level read_setting_[type] functions, in case it caused a segfault. +But I overlooked two things. + +Firstly, on Unix, read_setting_* is where we check the tree234 of data +derived from X resources and/or -xrm command-line options. So if you +don't call those functions at all (e.g. if you have no on-disk PuTTY +saved configuration at all, not even Default Settings), you also don't +get your X defaults honoured. + +Secondly, those functions themselves already all checked their +argument for NULL before doing anything dangerous with it. So the +thing I wanted to make possible was already possible _anyway_, without +me having to do anything! + +So I'm exactly reverting that commit, because the _only_ thing it did +was to introduce a bug in X resource handling. +--- + settings.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/settings.c b/settings.c +index 54424f49..2c767a7a 100644 +--- a/settings.c ++++ b/settings.c +@@ -107,7 +107,7 @@ char *get_remote_username(Conf *conf) + + static char *gpps_raw(settings_r *sesskey, const char *name, const char *def) + { +- char *ret = sesskey ? read_setting_s(sesskey, name) : NULL; ++ char *ret = read_setting_s(sesskey, name); + if (!ret) + ret = platform_default_s(name); + if (!ret) +@@ -131,7 +131,7 @@ static void gpps(settings_r *sesskey, const char *name, const char *def, + static void gppfont(settings_r *sesskey, char *name, + Conf *conf, int primary) + { +- FontSpec *result = sesskey ? read_setting_fontspec(sesskey, name) : NULL; ++ FontSpec *result = read_setting_fontspec(sesskey, name); + if (!result) + result = platform_default_fontspec(name); + conf_set_fontspec(conf, primary, result); +@@ -140,7 +140,7 @@ static void gppfont(settings_r *sesskey, char *name, + static void gppfile(settings_r *sesskey, const char *name, + Conf *conf, int primary) + { +- Filename *result = sesskey ? read_setting_filename(sesskey, name) : NULL; ++ Filename *result = read_setting_filename(sesskey, name); + if (!result) + result = platform_default_filename(name); + conf_set_filename(conf, primary, result); +@@ -162,7 +162,7 @@ static void gppb(settings_r *sesskey, const char *name, bool def, + static int gppi_raw(settings_r *sesskey, const char *name, int def) + { + def = platform_default_i(name, def); +- return sesskey ? read_setting_i(sesskey, name, def) : def; ++ return read_setting_i(sesskey, name, def); + } + + static void gppi(settings_r *sesskey, const char *name, int def, +-- +2.21.0 + diff --git a/putty.changes b/putty.changes index 23cf191..fa14d78 100644 --- a/putty.changes +++ b/putty.changes @@ -3,6 +3,8 @@ Wed Apr 24 07:24:56 UTC 2019 - Jan Engelhardt - Reenable Xresources / remove -DNOT_X_WINDOWS [boo#1133181], the crash under Wayland appears gone. +- Add 0001-Revert-settings.c-allow-load_open_settings-NULL.patch + [boo#1133181] ------------------------------------------------------------------- Mon Mar 18 17:57:39 UTC 2019 - Jan Engelhardt diff --git a/putty.spec b/putty.spec index 5506d97..825d439 100644 --- a/putty.spec +++ b/putty.spec @@ -31,6 +31,7 @@ Source2: http://the.earth.li/~sgtatham/putty/latest/%name-%version.tar.gz Source4: %name.keyring Patch1: putty-03-config.diff Patch2: reproducible.patch +Patch3: 0001-Revert-settings.c-allow-load_open_settings-NULL.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: ImageMagick BuildRequires: gtk3-devel @@ -53,8 +54,7 @@ to xterm, "plink" is just the (console-based) SSH client similar to openssh, and "putty" is the program that combines both in one. %prep -%setup -q -%patch -P 1 -P 2 -p1 +%autosetup -p1 %build export CFLAGS="%optflags -Wno-error"