Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132952076
D21104.id60254.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1020 B
Referenced Files
None
Subscribers
None
D21104.id60254.diff
View Options
Index: contrib/elftoolchain/addr2line/addr2line.c
===================================================================
--- contrib/elftoolchain/addr2line/addr2line.c
+++ contrib/elftoolchain/addr2line/addr2line.c
@@ -25,6 +25,8 @@
*/
#include <sys/param.h>
+
+#include <capsicum_helpers.h>
#include <dwarf.h>
#include <err.h>
#include <fcntl.h>
@@ -649,6 +651,7 @@
int
main(int argc, char **argv)
{
+ cap_rights_t rights;
Elf *e;
Dwarf_Debug dbg;
Dwarf_Error de;
@@ -706,6 +709,16 @@
if ((fd = open(exe, O_RDONLY)) < 0)
err(EXIT_FAILURE, "%s", exe);
+ if (caph_rights_limit(fd, cap_rights_init(&rights, CAP_FSTAT,
+ CAP_MMAP_R)) < 0)
+ errx(EXIT_FAILURE, "caph_rights_limit");
+
+ caph_cache_catpages();
+ if (caph_limit_stdio() < 0)
+ errx(EXIT_FAILURE, "failed to limit stdio rights");
+ if (caph_enter() < 0)
+ errx(EXIT_FAILURE, "failed to enter capability mode");
+
if (dwarf_init(fd, DW_DLC_READ, NULL, NULL, &dbg, &de))
errx(EXIT_FAILURE, "dwarf_init: %s", dwarf_errmsg(de));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 22, 11:34 AM (9 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24055321
Default Alt Text
D21104.id60254.diff (1020 B)
Attached To
Mode
D21104: Capsicumize addr2line(1).
Attached
Detach File
Event Timeline
Log In to Comment