aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2013-09-26 08:20:08 -0400
committerAnthony G. Basile <blueness@gentoo.org>2013-11-07 09:48:06 -0500
commit8846793632c93d7fc4f7175312a025a2f194f161 (patch)
tree7a6fd31a1547daa006d21d509fe2fb8e34273ac9
parentPrepare release 0.8.3 (diff)
downloadelfix-8846793632c93d7fc4f7175312a025a2f194f161.tar.gz
elfix-8846793632c93d7fc4f7175312a025a2f194f161.tar.bz2
elfix-8846793632c93d7fc4f7175312a025a2f194f161.zip
Return EXIT_SUCCESS if user.pax.flags is done after paxctl-ng -d
If the user.pax.flags field exists and we have permissions to remove it, the first invocation of paxctl-ng -d returns 0. But subsequently it returns 1 because it fails to remove an xattr field that is not there. We make sure we return 0 if the field is gone for whatever reason. We only fail upon not having permissions to change the xattr filed, or the filesystem not supporting xattrs (ENOTSUP). Reported-by: Maxim Kammerer <mk@dee.su> X-Gentoo-Bug: 485908 X-Gentoo-Bug-URL: https://bugs.gentoo.org/485908
-rw-r--r--src/paxctl-ng.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/paxctl-ng.c b/src/paxctl-ng.c
index 4d69ab4..8071d50 100644
--- a/src/paxctl-ng.c
+++ b/src/paxctl-ng.c
@@ -26,6 +26,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <errno.h>
#ifdef PTPAX
#include <gelf.h>
@@ -744,7 +745,15 @@ delete_xt_flags(int fd)
if( !fremovexattr(fd, PAX_NAMESPACE) )
return EXIT_SUCCESS;
else
- return EXIT_FAILURE;
+ {
+ // If this fails because there was no such named xattr
+ // in the first place, then in a sense, we succeeded.
+ // See: https://bugs.gentoo.org/show_bug.cgi?id=485908
+ if( errno == ENOATTR )
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
+ }
}
#endif