File: 10_hardening.patch

package info (click to toggle)
rungetty 1.2-17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 324 kB
  • sloc: ansic: 3,931; makefile: 33
file content (29 lines) | stat: -rw-r--r-- 845 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
Author: Andreas Tille <tille@debian.org>
Last-Update: 2025-09-23
Description: Use hardening flags and make sure the code will build with these

--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
-CC=gcc
-CFLAGS=$(RPM_OPTS) -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe
-LDFLAGS=-Wl,-warn-common -s
+CC?=gcc
+DEB_CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
+DEB_LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
+CFLAGS=$(RPM_OPTS) -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe $(DEB_CFLAGS)
+LDFLAGS=-Wl,-warn-common -s $(DEB_LDFLAGS)
 
 all:		rungetty
 		size rungetty
--- a/rungetty.c
+++ b/rungetty.c
@@ -138,7 +138,7 @@ error (const char *fmt,...)
 
 #ifdef	USE_SYSLOG
   openlog (progname, LOG_PID, LOG_AUTH);
-  syslog (LOG_ERR, buf);
+  syslog (LOG_ERR, "%s", buf);
   closelog ();
 #else /* !USE_SYSLOG */
   strcat (bp, "\r\n");