maelstrom: Fix build with hardened security flags

poky uses them for a while

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2020-11-15 21:28:39 +01:00
parent fc2b7d08a1
commit ea6026a9ee
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
From 53b3b2081c38c882f5aefcd5e630bdd0591283e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Sun, 15 Nov 2020 21:18:59 +0100
Subject: [PATCH] scores.cpp: Fix build with hardened security flags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
| In function 'int open(const char*, int, ...)',
| inlined from 'void GetScoreFile()' at scores.cpp:44:10:
| <...>/recipe-sysroot/usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
| 50 | __open_missing_mode ();
| | ~~~~~~~~~~~~~~~~~~~~^~
| make[1]: *** [Makefile:561: scores.o] Error 1
Stolen from [1]
[1] https://src.fedoraproject.org/rpms/Maelstrom/blob/master/f/Maelstrom-open.patch
Upstream-Status: Pending
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
scores.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scores.cpp b/scores.cpp
index c8b53b5..f42c40f 100644
--- a/scores.cpp
+++ b/scores.cpp
@@ -41,7 +41,7 @@ void GetScoreFile(void)
#ifdef unix
omask=umask(SCORES_PERMMASK);
#endif
- f = open(MAELSTROM_SCORES,O_RDWR|O_CREAT);
+ f = open(MAELSTROM_SCORES,O_RDWR|O_CREAT,S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP);
if (f == -1)
f = open(MAELSTROM_SCORES,O_RDONLY);
if (f == -1)
--
2.26.2

View File

@@ -16,6 +16,7 @@ SRC_URI = " \
file://0003-Fix-install-dir.patch \
file://0004-Maelstrom-3.0.6-setgid.patch \
file://0005-SDL_FrameBuf.cpp-Fix-build-for-64Bit-targets.patch \
file://0006-scores.cpp-Fix-build-with-hardened-security-flags.patch \
file://maelstrom.png \
file://Maelstrom.desktop \
"