[mingetty] Harden comiler and linker flags

Petr Pisar ppisar at fedoraproject.org
Mon Sep 26 15:15:32 UTC 2011


commit 2a8df29bc733806b45be55807a577e2a46193cc1
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Sep 26 17:14:36 2011 +0200

    Harden comiler and linker flags

 mingetty-1.00-opt.patch => mingetty-1.08-opt.patch |    5 ++---
 mingetty.spec                                      |   11 +++++++----
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/mingetty-1.00-opt.patch b/mingetty-1.08-opt.patch
similarity index 73%
rename from mingetty-1.00-opt.patch
rename to mingetty-1.08-opt.patch
index 25fb27b..f02aa71 100644
--- a/mingetty-1.00-opt.patch
+++ b/mingetty-1.08-opt.patch
@@ -1,11 +1,10 @@
 --- mingetty-1.00/Makefile.rpm	Mon Mar  4 15:27:11 2002
 +++ mingetty-1.00/Makefile	Mon Mar  4 15:27:34 2002
-@@ -1,6 +1,7 @@
+@@ -1,6 +1,6 @@
  DESTDIR=
  CC=gcc
 -CFLAGS=-O2 -Wall -W -pipe -D_GNU_SOURCE
-+CFLAGS=$(RPM_OPTS) -Wall -D_GNU_SOURCE
-+LDFLAGS=$(RPM_OPTS)
++CFLAGS+=$(CFLAGS) -Wall -D_GNU_SOURCE
  MANDIR=/usr/share/man/man8
  SBINDIR=/sbin
  
diff --git a/mingetty.spec b/mingetty.spec
index a10ffb2..a840d4c 100644
--- a/mingetty.spec
+++ b/mingetty.spec
@@ -2,12 +2,11 @@ Summary: A compact getty program for virtual consoles only
 Name: mingetty
 Version: 1.08
 License: GPLv2+
-Release: 8%{?dist}
+Release: 9%{?dist}
 Group: System Environment/Base
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://sourceforge.net/projects/mingetty/
 Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
-Patch0: mingetty-1.00-opt.patch
 # Bug #635412
 Patch1: mingetty-1.08-check_chroot_chdir_nice.patch
 Patch2: mingetty-1.08-openlog_authpriv.patch
@@ -25,7 +24,6 @@ lines (you should use the mgetty program in that case).
 
 %prep
 %setup -q
-%patch0 -p1 -b .opt
 %patch1 -p1 -b .chroot
 %patch2 -p1 -b .openlog
 %patch3 -p1 -b .tty_length
@@ -33,7 +31,8 @@ lines (you should use the mgetty program in that case).
 %patch5 -p1 -b .clear_buffer
 
 %build
-make "RPM_OPTS=$RPM_OPT_FLAGS"
+%global _hardened_build 1
+make "CFLAGS=-Wall -D_GNU_SOURCE %{__global_cflags}" "LDFLAGS=%{__global_ldflags}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -52,6 +51,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/mingetty.*
 
 %changelog
+* Mon Sep 26 2011 Petr Pisar <ppisar at redhat.com> - 1.08-9
+- Harden compiler and linker flags per
+  <https://fedoraproject.org/wiki/Hardened_Packages#list>
+
 * Fri Jun 10 2011 Petr Pisar <ppisar at redhat.com> - 1.08-8
 - Clear scroll-back buffer (bug #691406)
 


More information about the scm-commits mailing list