]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/commitdiff
mc: Proper harden consaver binary
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 11 Mar 2023 11:41:16 +0000 (11:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 13 Mar 2023 14:43:57 +0000 (14:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
mc/mc.nm

index 4830ff4d0424ac97e57d97d5466a1a9c2cec3a85..1fe8161a69b884c7c672e46cf17a927a4d300ede 100644 (file)
--- a/mc/mc.nm
+++ b/mc/mc.nm
@@ -5,7 +5,7 @@
 
 name       = mc
 version    = 4.8.29
-release    = 2
+release    = 3
 
 groups     = Applications/System
 url        = https://midnight-commander.org
@@ -40,6 +40,13 @@ build
                --enable-charset \
                --disable-rpath
 
+       configure_cmds
+               # Add some additional CFLAGS to the consaver Makefile to proper
+               # harden the binary.
+               sed -i '/^CFLAGS =/ s/$/ -fno-builtin-exit -D__noreturn__=/' \
+                       src/consaver/Makefile
+       end
+
        install_cmds
                # Fix permissions
                chmod 1755 %{BUILDROOT}/usr/lib/mc/cons.saver