aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-12-22 20:04:04 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-12-24 05:57:57 -0500
commit6754ad01706641315d2319dc4349de7fb49eb109 (patch)
tree69beb24f5622bbf956cc44fa88b0998db7e53a20
parentmisc/alt-revdep-pax: add old revdep-pax, add print all forward linkings (-f) (diff)
downloadelfix-6754ad01706641315d2319dc4349de7fb49eb109.tar.gz
elfix-6754ad01706641315d2319dc4349de7fb49eb109.tar.bz2
elfix-6754ad01706641315d2319dc4349de7fb49eb109.zip
scripts/paxmodule.c: throw a PaxError when pax_getflags or set_xt_flags
-rw-r--r--scripts/paxmodule.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/paxmodule.c b/scripts/paxmodule.c
index 469e0cb..f77dabb 100644
--- a/scripts/paxmodule.c
+++ b/scripts/paxmodule.c
@@ -328,7 +328,13 @@ pax_getflags(PyObject *self, PyObject *args)
close(fd);
- return Py_BuildValue("si", buf, flags);
+ if( flags == UINT16_MAX )
+ {
+ PyErr_SetString(PaxError, "pax_getflags: no PAX flags found");
+ return NULL;
+ }
+ else
+ return Py_BuildValue("si", buf, flags);
}
@@ -488,7 +494,14 @@ set_xt_flags(int fd, uint16_t xt_flags)
memset(buf, 0, FLAGS_SIZE);
bin2string(xt_flags, buf);
- fsetxattr(fd, PAX_NAMESPACE, buf, strlen(buf), 0);
+
+ if( fsetxattr(fd, PAX_NAMESPACE, buf, strlen(buf), 0))
+ {
+ PyErr_SetString(PaxError, "pax_deletextpax: fremovexattr() failed");
+ return;
+ }
+ else
+ return;
}
#endif