diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-12-22 20:04:04 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-12-22 22:48:39 -0500 |
commit | 38d458a4ca02f218dbb4d292007368209c635625 (patch) | |
tree | efade4c3257630f3c4475097e0e5f5fd11292529 /scripts | |
parent | misc/alt-revdep-pax: add old revdep-pax, add print all forward linkings (-f) (diff) | |
download | elfix-38d458a4ca02f218dbb4d292007368209c635625.tar.gz elfix-38d458a4ca02f218dbb4d292007368209c635625.tar.bz2 elfix-38d458a4ca02f218dbb4d292007368209c635625.zip |
scripts/paxmodule.c: throw a PaxError when pax_getflags or set_xt_flags
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/paxmodule.c | 17 |
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 |