From f1097c9e8fc1624799f7a08c7e510e24903f1f7d Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Mon, 17 Oct 2011 15:28:22 -0400 Subject: scripts/{paxmodule.c,revdep-pax}: add code to set pax flags --- scripts/paxmodule.c | 183 +++++++++++----------------------------------------- scripts/revdep-pax | 100 +++++++++++++++++----------- 2 files changed, 101 insertions(+), 182 deletions(-) diff --git a/scripts/paxmodule.c b/scripts/paxmodule.c index eac774a..32c8768 100644 --- a/scripts/paxmodule.c +++ b/scripts/paxmodule.c @@ -1,6 +1,5 @@ #include -#include //remove when you remove printf #include #include @@ -53,14 +52,13 @@ static PyObject * pax_getflags(PyObject *self, PyObject *args) { const char *f_name; - int fd, sts; + int fd; Elf *elf; char pax_buf[BUF_SIZE]; + uint16_t pax_flags; GElf_Ehdr ehdr; - uint16_t ei_flags; - GElf_Phdr phdr; char found_pt_pax; size_t i, phnum; @@ -102,6 +100,8 @@ pax_getflags(PyObject *self, PyObject *args) found_pt_pax = 0; + pax_flags = 0; + elf_getphdrnum(elf, &phnum); for(i=0; i> 8) ; @@ -283,6 +277,7 @@ pax_setflags(PyObject *self, PyObject *args) return NULL; } + elf_getphdrnum(elf, &phnum); for(i=0; i