summary refs log tree commit diff
path: root/pkgs/tools/filesystems/jfsutils
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-01-29 05:08:57 +0000
committerRobin Gloster <mail@glob.in>2016-01-30 16:36:57 +0000
commite721382448fdbf8002e9b0121c3ae11f5701261e (patch)
tree9277ca87f8fac1f0fc22c57e3cf822b5a356700b /pkgs/tools/filesystems/jfsutils
parent78a1ae85ed70454d5697d73ba8d1c1eebc66c173 (diff)
downloadnixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.tar
nixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.tar.gz
nixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.tar.bz2
nixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.tar.lz
nixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.tar.xz
nixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.tar.zst
nixpkgs-e721382448fdbf8002e9b0121c3ae11f5701261e.zip
jfsutils: add patch to build with format hardening
Diffstat (limited to 'pkgs/tools/filesystems/jfsutils')
-rw-r--r--pkgs/tools/filesystems/jfsutils/default.nix2
-rw-r--r--pkgs/tools/filesystems/jfsutils/hardening-format.patch37
2 files changed, 38 insertions, 1 deletions
diff --git a/pkgs/tools/filesystems/jfsutils/default.nix b/pkgs/tools/filesystems/jfsutils/default.nix
index 46ded088c69..16d95bd1933 100644
--- a/pkgs/tools/filesystems/jfsutils/default.nix
+++ b/pkgs/tools/filesystems/jfsutils/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha1 = "291e8bd9d615cf3d27e4000117c81a3602484a50";
   };
 
-  patches = [ ./types.patch ];
+  patches = [ ./types.patch ./hardening-format.patch ];
 
   buildInputs = [ libuuid ];
 
diff --git a/pkgs/tools/filesystems/jfsutils/hardening-format.patch b/pkgs/tools/filesystems/jfsutils/hardening-format.patch
new file mode 100644
index 00000000000..dd2a93a81ec
--- /dev/null
+++ b/pkgs/tools/filesystems/jfsutils/hardening-format.patch
@@ -0,0 +1,37 @@
+--- a/fscklog/fscklog.c	2016-01-29 04:59:54.102223291 +0000
++++ b/fscklog/fscklog.c	2016-01-29 05:00:10.707552565 +0000
+@@ -252,8 +252,8 @@
+ 
+ 	sprintf(debug_detail, " [%s:%d]\n", basename(file_name), line_number);
+ 
+-	printf(msg_string);
+-	printf(debug_detail);
++	printf("%s", msg_string);
++	printf("%s", debug_detail);
+ 
+ 	return 0;
+ }
+--- a/fscklog/display.c	2016-01-29 05:05:42.582133444 +0000
++++ b/fscklog/display.c	2016-01-29 05:05:47.541231780 +0000
+@@ -182,7 +182,7 @@
+ 				} else {
+ 					/* the record looks ok */
+ 					msg_txt = &log_entry[log_entry_pos];
+-					printf(msg_txt);
++					printf("%s", msg_txt);
+ 					/*
+ 					 * set up for the next record
+ 					 */
+--- a/logdump/helpers.c	2016-01-29 05:06:26.081996021 +0000
++++ b/logdump/helpers.c	2016-01-29 05:06:43.097333425 +0000
+@@ -95,8 +95,8 @@
+ 
+ 	sprintf(debug_detail, " [%s:%d]\n", file_name, line_number);
+ 
+-	printf(msg_string);
+-	printf(debug_detail);
++	printf("%s", msg_string);
++	printf("%s", debug_detail);
+ 
+ 	return 0;
+ }