File: pass-flags-properly-for-hardening.patch

package info (click to toggle)
filter 2.6.3%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 1,024 kB
  • ctags: 896
  • sloc: ansic: 4,023; sh: 3,833; makefile: 158
file content (80 lines) | stat: -rw-r--r-- 2,187 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Description: Pass CFLAGS, LDFLAGS and friends properly to the C compiler
 This way, hardening flags can be passed properly.
Author: Axel Beckert <abe@debian.org>

Index: filter/Makefile
===================================================================
--- filter.orig/Makefile	2016-02-20 04:25:53.921232360 +0100
+++ filter/Makefile	2016-02-20 04:25:53.917232369 +0100
@@ -1,13 +1,13 @@
 # Variables
 #	Variables established by Configure
 CC		=	cc
-CCFLAGS		=	 
+CCFLAGS		?=	 
 CHGRP		=	/bin/chgrp
 CHMOD		=	/bin/chmod
 CP		=	/bin/cp
 DEST		=	$(DESTDIR)/usr/bin
 ECHO		=	/bin/echo
-LFLAGS		=	 
+LDFLAGS		?=	 
 LIB		=	
 LIB2		= 	
 LIBS		=	-lcurses 
@@ -27,7 +27,7 @@
 #DEBUG		=	-DDEBUG
 
 #	Other variables
-CFLAGS		=	$(CCFLAGS) $(OPTIMIZE) $(DEBUG) $(DACSNET) 
+CFLAGS		?=	$(CCFLAGS) $(OPTIMIZE) $(DEBUG) $(DACSNET) 
 
 # Definitions of variables
 FILTER_SRC	=	actions.c	\
@@ -94,7 +94,7 @@
 
 #	Dependencies and rules for compiling programs
 filter:	$& $(FILTER_OBJ)
-	$(CC) $(LFLAGS) -o $@ $(FILTER_OBJ)
+	$(CC) $(LDFLAGS) -o $@ $(FILTER_OBJ)
 
 #	Dependencies and rules for installing programs from bin directory
 $(DEST)/filter:		filter
Index: filter/Makefile.SH
===================================================================
--- filter.orig/Makefile.SH	2016-02-20 04:25:53.921232360 +0100
+++ filter/Makefile.SH	2016-02-20 04:26:40.913115592 +0100
@@ -23,13 +23,13 @@
 # Variables
 #	Variables established by Configure
 CC		=	$cc
-CCFLAGS		=	$ccflags $xencf
+CCFLAGS		?=	$ccflags $xencf
 CHGRP		=	$chgrp
 CHMOD		=	$chmod
 CP		=	$cp
 DEST		=	\$(DESTDIR)$bin
 ECHO		=	$echo
-LFLAGS		=	$ldflags $xenlf
+LDFLAGS		?=	$ldflags $xenlf
 LIB		=	$lib
 LIB2		= 	$libs
 LIBS		=	$termlib $dbm
@@ -53,7 +53,7 @@
 #DEBUG		=	-DDEBUG
 
 #	Other variables
-CFLAGS		=	$(CCFLAGS) $(OPTIMIZE) $(DEBUG) $(DACSNET) 
+CFLAGS		?=	$(CCFLAGS) $(OPTIMIZE) $(DEBUG) $(DACSNET) 
 
 # Definitions of variables
 FILTER_SRC	=	actions.c	\
@@ -120,7 +120,7 @@
 
 #	Dependencies and rules for compiling programs
 filter:	$& $(FILTER_OBJ)
-	$(CC) $(LFLAGS) -o $@ $(FILTER_OBJ)
+	$(CC) $(LDFLAGS) -o $@ $(FILTER_OBJ)
 
 #	Dependencies and rules for installing programs from bin directory
 $(DEST)/filter:		filter