diff --git a/0001-nano-2.9.4-restrict-crash.patch b/0001-nano-2.9.4-restrict-crash.patch deleted file mode 100644 index 3e4e38f..0000000 --- a/0001-nano-2.9.4-restrict-crash.patch +++ /dev/null @@ -1,147 +0,0 @@ -From 4cdad8299f605e8b0527391a49311786e0bca35c Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Tue, 20 Mar 2018 16:49:34 +0100 -Subject: [PATCH 1/2] input: do not crash if sctofunc() returns NULL - -This fixes a regression introduced by commit 54103d8e: a crash that -can be triggered by running 'nano --restrict' and pressing . - -This addresses https://bugzilla.redhat.com/1558532. - -Upstream-commit: b830a7dd384495fb9b882f866b26948025abe136 -Signed-off-by: Kamil Dudka ---- - src/nano.c | 16 +++++++++++----- - 1 file changed, 11 insertions(+), 5 deletions(-) - -diff --git a/src/nano.c b/src/nano.c -index ad95925..e7b6d62 100644 ---- a/src/nano.c -+++ b/src/nano.c -@@ -1712,9 +1712,12 @@ int do_input(bool allow_funcs) - if (shortcut == NULL) - pletion_line = NULL; - else { -- if (ISSET(VIEW_MODE) && !sctofunc(shortcut)->viewok) { -- print_view_warning(); -- return ERR; -+ if (ISSET(VIEW_MODE)) { -+ const subnfunc *f = sctofunc(shortcut); -+ if (f && !f->viewok) { -+ print_view_warning(); -+ return ERR; -+ } - } - - /* If the function associated with this shortcut is -@@ -1787,8 +1790,11 @@ int do_input(bool allow_funcs) - wrap_reset(); - #endif - #ifdef ENABLE_COLOR -- if (!refresh_needed && !sctofunc(shortcut)->viewok) -- check_the_multis(openfile->current); -+ if (!refresh_needed) { -+ const subnfunc *f = sctofunc(shortcut); -+ if (f && !f->viewok) -+ check_the_multis(openfile->current); -+ } - #endif - if (!refresh_needed && (shortcut->func == do_delete || - shortcut->func == do_backspace)) --- -2.14.3 - - -From 25a02d16fc59bbe88cdc51922534436b20187a3d Mon Sep 17 00:00:00 2001 -From: Benno Schulenberg -Date: Tue, 20 Mar 2018 19:56:03 +0100 -Subject: [PATCH 2/2] tweaks: factor out the check for 'viewok' into its own - function - -And also prevent a theoretical crash for restricted prompt functions. - -Upstream-commit: 8b8c6bb818b21b9c7fcf7481df7154745b4aad41 -Signed-off-by: Kamil Dudka ---- - src/nano.c | 24 +++++++++++++----------- - src/prompt.c | 2 +- - src/proto.h | 1 + - 3 files changed, 15 insertions(+), 12 deletions(-) - -diff --git a/src/nano.c b/src/nano.c -index e7b6d62..c39622b 100644 ---- a/src/nano.c -+++ b/src/nano.c -@@ -1621,6 +1621,14 @@ int do_mouse(void) - } - #endif /* ENABLE_MOUSE */ - -+/* Return TRUE when the given shortcut is valid in view mode. */ -+bool okay_for_view(const sc *shortcut) -+{ -+ const subnfunc *func = sctofunc(shortcut); -+ -+ return (func && func->viewok); -+} -+ - /* Read in a keystroke. Act on the keystroke if it is a shortcut or a toggle; - * otherwise, insert it into the edit buffer. If allow_funcs is FALSE, don't - * do anything with the keystroke -- just return it. */ -@@ -1712,12 +1720,9 @@ int do_input(bool allow_funcs) - if (shortcut == NULL) - pletion_line = NULL; - else { -- if (ISSET(VIEW_MODE)) { -- const subnfunc *f = sctofunc(shortcut); -- if (f && !f->viewok) { -- print_view_warning(); -- return ERR; -- } -+ if (ISSET(VIEW_MODE) && !okay_for_view(shortcut)) { -+ print_view_warning(); -+ return ERR; - } - - /* If the function associated with this shortcut is -@@ -1790,11 +1795,8 @@ int do_input(bool allow_funcs) - wrap_reset(); - #endif - #ifdef ENABLE_COLOR -- if (!refresh_needed) { -- const subnfunc *f = sctofunc(shortcut); -- if (f && !f->viewok) -- check_the_multis(openfile->current); -- } -+ if (!refresh_needed && !okay_for_view(shortcut)) -+ check_the_multis(openfile->current); - #endif - if (!refresh_needed && (shortcut->func == do_delete || - shortcut->func == do_backspace)) -diff --git a/src/prompt.c b/src/prompt.c -index e8fbbc0..8ec74fd 100644 ---- a/src/prompt.c -+++ b/src/prompt.c -@@ -171,7 +171,7 @@ int do_statusbar_input(bool *finished) - /* Handle any other shortcut in the current menu, setting finished - * to TRUE to indicate that we're done after running or trying to - * run its associated function. */ -- if (!ISSET(VIEW_MODE) || sctofunc(shortcut)->viewok) -+ if (!ISSET(VIEW_MODE) || okay_for_view(shortcut)) - shortcut->func(); - *finished = TRUE; - } -diff --git a/src/proto.h b/src/proto.h -index 86f53d7..5530a90 100644 ---- a/src/proto.h -+++ b/src/proto.h -@@ -441,6 +441,7 @@ void disable_flow_control(void); - void enable_flow_control(void); - void terminal_init(void); - void unbound_key(int code); -+bool okay_for_view(const sc *shortcut); - int do_input(bool allow_funcs); - void do_output(char *output, size_t output_len, bool allow_cntrls); - --- -2.14.3 - diff --git a/nano-2.9.4.tar.gz.asc b/nano-2.9.4.tar.gz.asc deleted file mode 100644 index 9402d9f..0000000 --- a/nano-2.9.4.tar.gz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEEv9AJBh5TUFKtDfIVDSjU0qCs6IQFAlqhDVUACgkQDSjU0qCs -6IRLYA//SS3c/APFhvi0kvJFPDfI+xva0R0y05Jbfm9w3R/MfZr+ShfOiXy/D2UL -BgSf9zgeXM7O5khLjoX2lsK8hwPp8viXUqEW4FR3UqEI7gHtwdGX4D5KI1HF31ny -KdL6DOEkEVUJpLEuc/C9SQDtOHzhs3/Ln3UVrWyUwLZoKNrQ9l6/EMwbjFGW4v8n -JSm+SOPVxaXonZE2V8LBL+uFY0Il3wGyiB9rOEFVygOTa96hac5QxbuNr0pdQQOd -K9qHWpfJJpMgW0s/tJN9RCmGJVzTNpmeHMKGlRGS24qEsWWklZy79qSKdni+9O8I -uv5dU9bto4zfGISG7SakF7+279SFHjefYW31V2L07Chr+9wrea5qz26ywrF+7Nkt -mpsttzIBMZuvjdbWbZiVtseuJU2d9GH4DEWMhI732HhsOFaaLLnaBdgxZUMiKqcN -IkwUAqY/9XFzJSe+6jLe+T5UIejVPuMAXzMu+Pl723Hq5ThGToWwy6tqmIWINBLq -YnfhDps28H39I6dD8nSCNTDDF7S0p4kyLnLccudbcI6x0RQzYuLvREFbikebwht3 -cHWfckr4TjBo4D5pKQFcEg3d8LLWYiQkta/6xeKlMmFf/Tg1waP6le5qeb2DZph/ -wSGtv2gaf2NROoxopszDO9xr68Q4YOnUwkPo0N7e5W50mJuTlkk= -=2DzZ ------END PGP SIGNATURE----- diff --git a/nano-2.9.5.tar.gz.asc b/nano-2.9.5.tar.gz.asc new file mode 100644 index 0000000..5a14912 --- /dev/null +++ b/nano-2.9.5.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEv9AJBh5TUFKtDfIVDSjU0qCs6IQFAlq8oSQACgkQDSjU0qCs +6IRtDw/+N/dg4msyK/snJ6gBx2rRob4VdIcQSNdUwcZAJXJR1edmn4Wg8+lFQi73 +pZHVvCiS3DZkYo1S+Da3VHr3PgygkD8bX0dHgir31/Cip+Et/jF9uyu+OhpecIEs +RCaHMGn3UjvRKqhyX8j1NBdh+pkTRoJdjgswyhRLFtT0aFy55EePY7xE38yBb60B +2q1GC0pptaVtPBdL/Efk4IDLL9IVZI3Nh3eU+ZnVKjfw8iAVETEo2n/ZNW1iNTI9 +Svnoj/Fap4Jb+qMeTKKCb75dhVin0ZIBmmagQ0xrSVPIhTBceWwQRoDI88ZPrhVU +JjRsE5OiA+kq/rXSB1oxu3cWuRTxkOjXPmDzeW1V8wQFFbWy+z7U5RM1PciimN1p +qokPJ21lzyQJTkDOsK0rgSlipzhbOdLITpXF9cXxU8HDk0RrmZeQYC6c+yndX7bi +hzvEe3wj9LgEEsVzVZ4/qG/VYxENbFbhBOj2Zx2i5uJLfzQQQ3MDID6CcPm5L+0/ +UmkzUsqtNzEBGb/Hjz9AVHIYx2vm+Rfo+DTPNYQ5oj9H3wyN7WDnSJQIvGqM9h2c +17hN0QLIzMIHt87Bs/BNrrYmDCy1DBC3qpQKL6qcVaQ7Wl1BPGo8g7qCJ4vVqhON +IuVCLWVGQ9ALLJyMwyONVOgkvdQ97A7WKroxacrYvtTXQJUPkIE= +=aCxy +-----END PGP SIGNATURE----- diff --git a/nano.spec b/nano.spec index 46078c1..493a7b6 100644 --- a/nano.spec +++ b/nano.spec @@ -1,7 +1,7 @@ Summary: A small text editor Name: nano -Version: 2.9.4 -Release: 2%{?dist} +Version: 2.9.5 +Release: 1%{?dist} License: GPLv3+ URL: https://www.nano-editor.org Source: https://www.nano-editor.org/dist/v2.9/%{name}-%{version}.tar.gz @@ -19,9 +19,6 @@ Conflicts: filesystem < 3 Requires(post): /sbin/install-info Requires(preun): /sbin/install-info -# fix crash of 'nano --restrict' when is pressed (#1558532) -Patch1: 0001-nano-2.9.4-restrict-crash.patch - %description GNU nano is a small and friendly text editor. @@ -83,6 +80,9 @@ exit 0 %{_datadir}/nano %changelog +* Thu Mar 29 2018 Kamil Dudka - 2.9.5-1 +- new upstream release + * Wed Mar 21 2018 Kamil Dudka - 2.9.4-2 - fix crash of 'nano --restrict' when is pressed (#1558532) diff --git a/sources b/sources index 0470266..f848d49 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nano-2.9.4.tar.gz) = dec4259668716a49d6dc403aabf4e2c0c0148247f9161e6a88c29c573026fcec00a15147b2e6d2c8c1d52fac227ab4d7b3f3552389af97b485da0b875976f0fd +SHA512 (nano-2.9.5.tar.gz) = 623a1d142f5aff62186314d84ea8461e10ab7eb2e11c8a57497736bc5ad432e39d48086d17eb80bdbf9b33adc41e9d77db5416281138993dbea795afd96dbfc0