diff --git a/fvwm-0001-Change-html-viewer-to-xdg-open.patch b/fvwm-0001-Change-html-viewer-to-xdg-open.patch
index 54f4d55..827b095 100644
--- a/fvwm-0001-Change-html-viewer-to-xdg-open.patch
+++ b/fvwm-0001-Change-html-viewer-to-xdg-open.patch
@@ -1,11 +1,7 @@
-From e01a29e327d0ec4de33628914f88573e348710da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?=
Date: Thu, 19 Apr 2012 23:29:16 +0400
-Subject: [PATCH 1/5] Change html viewer to xdg-open
+Subject: [PATCH] Change html viewer to xdg-open
----
- bin/fvwm-menu-headlines.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/fvwm-menu-headlines.in b/bin/fvwm-menu-headlines.in
index 2a27953..4209b38 100644
@@ -20,6 +16,3 @@ index 2a27953..4209b38 100644
my $commf = undef;
my $icont = '';
my $iconi = '';
---
-1.8.0
-
diff --git a/fvwm-0002-Use-mimeopen-instead-of-EDITOR.patch b/fvwm-0002-Use-mimeopen-instead-of-EDITOR.patch
index 4b2efe3..a59f9c5 100644
--- a/fvwm-0002-Use-mimeopen-instead-of-EDITOR.patch
+++ b/fvwm-0002-Use-mimeopen-instead-of-EDITOR.patch
@@ -1,11 +1,7 @@
-From 5ea8db5a592fa84881fc4f2f9e644915ee93af0f Mon Sep 17 00:00:00 2001
From: Adam Goode
Date: Thu, 19 Apr 2012 23:31:41 +0400
-Subject: [PATCH 2/5] Use mimeopen instead of EDITOR
+Subject: [PATCH] Use mimeopen instead of EDITOR
----
- bin/fvwm-menu-directory.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/fvwm-menu-directory.in b/bin/fvwm-menu-directory.in
index 8e1ff42..038f6b6 100644
@@ -20,6 +16,3 @@ index 8e1ff42..038f6b6 100644
my $execa = undef;
my $commt = undef;
my $commf = undef;
---
-1.8.0
-
diff --git a/fvwm-0003-Enable-auto-generate-menus-in-the-Setup-Form-config-.patch b/fvwm-0003-Enable-auto-generate-menus-in-the-Setup-Form-config-.patch
index 924a328..74b1e7f 100644
--- a/fvwm-0003-Enable-auto-generate-menus-in-the-Setup-Form-config-.patch
+++ b/fvwm-0003-Enable-auto-generate-menus-in-the-Setup-Form-config-.patch
@@ -1,12 +1,7 @@
-From 0d46f79e61d4acdea271a4879b46a46de62c6971 Mon Sep 17 00:00:00 2001
From: Adam Goode
Date: Thu, 19 Apr 2012 23:34:36 +0400
-Subject: [PATCH 3/5] Enable auto-generate menus in the Setup Form config
- generator
+Subject: [PATCH] Enable auto-generate menus in the Setup Form config generator
----
- fvwm/ConfigFvwmSetup | 15 +--------------
- 1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/fvwm/ConfigFvwmSetup b/fvwm/ConfigFvwmSetup
index 30d6326..e8226f7 100644
@@ -41,6 +36,3 @@ index 30d6326..e8226f7 100644
DestroyMenu MenuFvwmConfig
AddToMenu MenuFvwmConfig "$[gt.Fvwm Config Ops]" Title
---
-1.8.0
-
diff --git a/fvwm-0004-Increase-number-of-mouse-buttons-supported.patch b/fvwm-0004-Increase-number-of-mouse-buttons-supported.patch
index 2440953..cba8085 100644
--- a/fvwm-0004-Increase-number-of-mouse-buttons-supported.patch
+++ b/fvwm-0004-Increase-number-of-mouse-buttons-supported.patch
@@ -1,11 +1,7 @@
-From acf766b3a9d695a107f929b3be185015028e7ddb Mon Sep 17 00:00:00 2001
From: Bill Pemberton
Date: Thu, 19 Apr 2012 23:37:44 +0400
-Subject: [PATCH 4/5] Increase number of mouse buttons supported
+Subject: [PATCH] Increase number of mouse buttons supported
----
- libs/defaults.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/defaults.h b/libs/defaults.h
index ad39f8b..ad15994 100644
@@ -20,6 +16,3 @@ index ad39f8b..ad15994 100644
#if NUMBER_OF_EXTENDED_MOUSE_BUTTONS > 31
#error No more than 31 mouse buttons can be supported on 32 bit platforms
#endif
---
-1.8.0
-
diff --git a/fvwm-0005-FvwmPager-be-more-careful-with-window-labels.patch b/fvwm-0005-FvwmPager-be-more-careful-with-window-labels.patch
index 79b7b31..387ed04 100644
--- a/fvwm-0005-FvwmPager-be-more-careful-with-window-labels.patch
+++ b/fvwm-0005-FvwmPager-be-more-careful-with-window-labels.patch
@@ -1,12 +1,8 @@
-From a2b4ed53679cfccc307a98f34cdbf8a279cd6dae Mon Sep 17 00:00:00 2001
From: Anton Khirnov
Date: Fri, 16 Nov 2012 18:01:13 +0100
-Subject: [PATCH 5/5] FvwmPager: be more careful with window labels.
+Subject: [PATCH] FvwmPager: be more careful with window labels.
Do not assume they contain properly encoded strings.
----
- modules/FvwmPager/x_pager.c | 5 +++++
- 1 file changed, 5 insertions(+)
diff --git a/modules/FvwmPager/x_pager.c b/modules/FvwmPager/x_pager.c
index a0c3a6f..e56095c 100644
@@ -24,6 +20,3 @@ index a0c3a6f..e56095c 100644
if (width > t->pager_view_width - cur_width - 2*label_border && cur != next)
break;
---
-1.8.0
-
diff --git a/fvwm-0006-Comply-with-Debian-s-hardening-rules.patch b/fvwm-0006-Comply-with-Debian-s-hardening-rules.patch
new file mode 100644
index 0000000..f534064
--- /dev/null
+++ b/fvwm-0006-Comply-with-Debian-s-hardening-rules.patch
@@ -0,0 +1,169 @@
+From: tadam
+Date: Tue, 22 Jan 2013 08:32:34 +0000
+Subject: [PATCH] Comply with Debian's hardening rules.
+
+Debian's policy of what's considered "fit for purpos" for inclusion in
+its repositoy of packages says that all compiled programs must pass the
+following:
+
+CFLAGS="-I/usr/local/include -g -O2 -fstack-protector \
+ --param=ssp-buffer-size=4 -Wformat -Werror=format-security" \
+LDFLAGS="-L/usr/local/lib"
+
+http://wiki.debian.org/HardeningWalkthrough
+
+Conflicts:
+ ChangeLog
+ modules/ChangeLog
+
+diff --git a/fvwm/builtins.c b/fvwm/builtins.c
+index 8cb39e5..301c6e9 100644
+--- a/fvwm/builtins.c
++++ b/fvwm/builtins.c
+@@ -2682,7 +2682,7 @@ void CMD_Echo(F_CMD_ARGS)
+ action[len-1]='\0';
+ }
+ }
+- fvwm_msg(ECHO,"Echo",action);
++ fvwm_msg(ECHO, "", "Echo %s", action);
+
+ return;
+ }
+diff --git a/fvwm/misc.c b/fvwm/misc.c
+index f303453..3c57cc0 100644
+--- a/fvwm/misc.c
++++ b/fvwm/misc.c
+@@ -346,6 +346,7 @@ static char *fvwm_msg_strings[] =
+ void fvwm_msg(fvwm_msg_t type, char *id, char *msg, ...)
+ {
+ va_list args;
++ char *mfmt;
+ char fvwm_id[20];
+ char time_str[40] = "\0";
+ #ifdef FVWM_DEBUG_TIME
+@@ -378,21 +379,22 @@ void fvwm_msg(fvwm_msg_t type, char *id, char *msg, ...)
+ sprintf(&fvwm_id[strlen(fvwm_id)], ".%d", (int)Scr.screen);
+ }
+
+- fprintf(stderr, "%s[%s][%s]: %s",
++ fprintf(stderr, "%s[%s][%s]: %s\n",
+ time_str, fvwm_id, id, fvwm_msg_strings[(int)type]);
+
+ if (type == ECHO)
+ {
+ /* user echos must be printed as a literal string */
+- fprintf(stderr, "%s", msg);
++ fprintf(stderr, "%s\n", msg);
+ }
+ else
+ {
+ va_start(args, msg);
+- vfprintf(stderr, msg, args);
++ asprintf(&mfmt, "%s\n", msg);
++ vfprintf(stderr, mfmt, args);
+ va_end(args);
++ free(mfmt);
+ }
+- fprintf(stderr, "\n");
+
+ if (type == ERR)
+ {
+@@ -411,6 +413,7 @@ void fvwm_msg(fvwm_msg_t type, char *id, char *msg, ...)
+ }
+ BroadcastName(M_ERROR, 0, 0, 0, tmp);
+ }
++ fprintf(stderr, "\n");
+
+ } /* fvwm_msg */
+ #endif
+diff --git a/fvwm/move_resize.c b/fvwm/move_resize.c
+index 22d16d0..941356d 100644
+--- a/fvwm/move_resize.c
++++ b/fvwm/move_resize.c
+@@ -3037,8 +3037,7 @@ void CMD_SnapAttraction(F_CMD_ARGS)
+ fvwm_msg(
+ OLD, "CMD_SnapAttraction",
+ "The command SnapAttraction is obsolete. Please use the"
+- " following command instead:");
+- fvwm_msg(OLD, "", cmd);
++ " following command instead:\n\n%s", cmd);
+ execute_function(
+ cond_rc, exc, cmd,
+ FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND);
+@@ -3059,8 +3058,7 @@ void CMD_SnapGrid(F_CMD_ARGS)
+ fvwm_msg(
+ OLD, "CMD_SnapGrid",
+ "The command SnapGrid is obsolete. Please use the following"
+- " command instead:");
+- fvwm_msg(OLD, "", cmd);
++ " command instead:\n\n%s", cmd);
+ execute_function(
+ cond_rc, exc, cmd,
+ FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND);
+diff --git a/fvwm/virtual.c b/fvwm/virtual.c
+index 7f7cadf..80abe93 100644
+--- a/fvwm/virtual.c
++++ b/fvwm/virtual.c
+@@ -2019,10 +2019,7 @@ void CMD_EdgeResistance(F_CMD_ARGS)
+ OLD, "CMD_EdgeResistance",
+ "The command EdgeResistance with three arguments is"
+ " obsolete. Please use the following commands"
+- " instead:");
+- fvwm_msg(OLD, "", cmd);
+- fvwm_msg(OLD, "", stylecmd);
+- fvwm_msg(OLD, "", stylecmd2);
++ " instead:\n%s\n%s\n%s\n", cmd, stylecmd, stylecmd2);
+ execute_function(
+ cond_rc, exc, cmd,
+ FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND);
+diff --git a/libs/FRenderInit.c b/libs/FRenderInit.c
+index fcdb259..6dc8f36 100644
+--- a/libs/FRenderInit.c
++++ b/libs/FRenderInit.c
+@@ -129,7 +129,7 @@ Bool FRenderGetErrorText(int code, char *msg)
+ code <= FRenderErrorBase +
+ (sizeof(error_names) / sizeof(char *)) -1)
+ {
+- sprintf(msg, error_names[code - FRenderErrorBase]);
++ sprintf(msg, "%s\n", error_names[code - FRenderErrorBase]);
+ return 1;
+ }
+ }
+diff --git a/modules/FvwmIconMan/debug.c b/modules/FvwmIconMan/debug.c
+index 9b5c194..3aef888 100644
+--- a/modules/FvwmIconMan/debug.c
++++ b/modules/FvwmIconMan/debug.c
+@@ -37,6 +37,7 @@ int WINLIST = 0;
+ void
+ ConsoleMessage(const char *fmt, ...)
+ {
++ char *mfmt;
+ va_list args;
+
+ assert(console != NULL);
+@@ -44,8 +45,10 @@ ConsoleMessage(const char *fmt, ...)
+ fputs("FvwmIconMan: ", console);
+
+ va_start(args, fmt);
+- vfprintf(console, fmt, args);
++ asprintf(&mfmt, "%s\n", fmt);
++ vfprintf(console, mfmt, args);
+ va_end(args);
++ free(mfmt);
+ }
+
+ int
+diff --git a/modules/FvwmIconMan/functions.c b/modules/FvwmIconMan/functions.c
+index 77f3910..f841de9 100644
+--- a/modules/FvwmIconMan/functions.c
++++ b/modules/FvwmIconMan/functions.c
+@@ -534,8 +534,7 @@ int builtin_print(int numargs, BuiltinArg *args)
+ }
+ else
+ {
+- sprintf(buf, "%s\n", s);
+- ConsoleMessage(buf);
++ ConsoleMessage("%s\n", s);
+ }
+
+ return 0;
diff --git a/fvwm.spec b/fvwm.spec
index 30d0179..279dedc 100644
--- a/fvwm.spec
+++ b/fvwm.spec
@@ -1,6 +1,6 @@
Name: fvwm
Version: 2.6.5
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: Highly configurable multiple virtual desktop window manager
Group: User Interface/X
@@ -24,6 +24,8 @@ Patch3: fvwm-0003-Enable-auto-generate-menus-in-the-Setup-Form-config-.patch
Patch4: fvwm-0004-Increase-number-of-mouse-buttons-supported.patch
# https://github.com/ThomasAdam/fvwm/issues/5
Patch5: fvwm-0005-FvwmPager-be-more-careful-with-window-labels.patch
+# backported from upstream's CVS
+Patch6: fvwm-0006-Comply-with-Debian-s-hardening-rules.patch
BuildRequires: autoconf
BuildRequires: automake
@@ -59,6 +61,7 @@ and implement a virtual desktop.
%patch3 -p1 -b .menu-generate
%patch4 -p1 -b .more-mouse-buttons
%patch5 -p1 -b .fix_pager
+%patch6 -p1 -b .fix_printf_fmt
# Filter out false Perl provides
cat << \EOF > %{name}-prov
@@ -119,6 +122,9 @@ install -D -m0755 -p %{SOURCE2} \
%changelog
+* Sun Nov 16 2014 Peter Lemenkov - 2.6.5-9
+- Fix FTBFS in Rawhide (rhbz #1106311)
+
* Sat Aug 16 2014 Fedora Release Engineering - 2.6.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild