Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
aports
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
652
Issues
652
List
Boards
Labels
Service Desk
Milestones
Merge Requests
186
Merge Requests
186
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
aports
Commits
2e13d49d
Commit
2e13d49d
authored
May 29, 2015
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main/fortify-headers: upgrade to 0.5
parent
14ac979c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
65 deletions
+5
-65
main/fortify-headers/0001-fix-realpath-when-stdlib.h-is-included-before-limits.patch
...ix-realpath-when-stdlib.h-is-included-before-limits.patch
+0
-56
main/fortify-headers/APKBUILD
main/fortify-headers/APKBUILD
+5
-9
No files found.
main/fortify-headers/0001-fix-realpath-when-stdlib.h-is-included-before-limits.patch
deleted
100644 → 0
View file @
14ac979c
From 31d62b60c5b4f1baa795537da898a83e39be9dd1 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 7 May 2015 14:41:36 +0200
Subject: [PATCH fortify-headers] fix realpath when stdlib.h is included before
limits.h
To: sin@2f30.org
If program includes stdlib.h before limits.h without _XOPEN_SOURCE,
_GNU_SOURCE or _BSD_SOURCE explicitly set, then will it always trigger
the trap with musl libc.
This is becase stdlib.h will pull in features.h which will set
_GNU_SOURCE. This means that the fortify stdlib.h will not include
limits.h but it will still trigger the fortified realpath(), but without
PATH_MAX set.
We fix this by including system stdlib.h before testing if limits.h
should be included.
Since PATH_MAX is known at compile time we can also error at compile
time, instead of compiling a broken realpath().
---
include/stdlib.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/stdlib.h b/include/stdlib.h
index 22f1f2b..6629652 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,12 +1,12 @@
#ifndef _FORTIFY_STDLIB_H
#define _FORTIFY_STDLIB_H
+#include_next <stdlib.h>
+
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#include_next <limits.h>
#endif
-#include_next <stdlib.h>
-
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
#ifdef __cplusplus
@@ -23,7 +23,7 @@
char *realpath(const char *path, char *resolved)
if (resolved) {
#ifndef PATH_MAX
- __builtin_trap();
+# error PATH_MAX unset. A fortified realpath will not work.
#else
bos = __builtin_object_size(resolved, 0);
if (PATH_MAX > bos)
--
2.4.0
main/fortify-headers/APKBUILD
View file @
2e13d49d
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname
=
fortify-headers
pkgver
=
0.
4
pkgrel
=
1
pkgver
=
0.
5
pkgrel
=
0
pkgdesc
=
"standalone fortify source implementation"
url
=
"http://git.2f30.org/fortify-headers/"
arch
=
"noarch"
...
...
@@ -13,7 +13,6 @@ makedepends="$depends_dev"
install
=
""
subpackages
=
""
source
=
"http://dl.2f30.org/releases/
$pkgname
-
$pkgver
.tar.gz
0001-fix-realpath-when-stdlib.h-is-included-before-limits.patch
"
_builddir
=
"
$srcdir
"
/
$pkgname
-
$pkgver
...
...
@@ -37,9 +36,6 @@ package() {
rm
-f
"
$pkgdir
"
/usr/lib/
*
.la
}
md5sums
=
"99b34bbd925cbfe383252fe107cafece fortify-headers-0.4.tar.gz
47e6831fc0fa84075f5750b47b13d888 0001-fix-realpath-when-stdlib.h-is-included-before-limits.patch"
sha256sums
=
"fedfbd951bf4d4bd30d32bef20710d6124c004037df52059a274c090c1f11a0a fortify-headers-0.4.tar.gz
1216858e96afa30b093ec420d0b6d8943036d8816f54a59e3fa6ef5b5b0ee32e 0001-fix-realpath-when-stdlib.h-is-included-before-limits.patch"
sha512sums
=
"669bf35df5278d4557caa2c8f28e33fe3e4a03c4267eed2cc8638dcb8e705d8797e487fbb524d9ff919e2752f1dc817cef9d41f14ceb46d520661e3d2301c5f2 fortify-headers-0.4.tar.gz
5364518842709e2c25baaf9a8b7651db422f2d37c64fac690f671daa157214192933ac1821a29d31d8ddfd49dd8e2625e3dfbe6fdba3b2b899c533f0f73e4699 0001-fix-realpath-when-stdlib.h-is-included-before-limits.patch"
md5sums
=
"56487ae93e3f45ffc0736afd3ebce549 fortify-headers-0.5.tar.gz"
sha256sums
=
"4564f0ee9cb7c789b5a827d21a0d3b6da9df61fcb7ba31b711999f638e9e913a fortify-headers-0.5.tar.gz"
sha512sums
=
"951e3a5771c3cf9b2fe248e62badfc6699f0a05b8967f3982d279de8473501c66a6d1c17d7b42c90ef8bd303c06a642d7bdfea334caef892c90a15c45d4bb1c4 fortify-headers-0.5.tar.gz"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment