aboutsummaryrefslogtreecommitdiff
path: root/src
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-09-26 08:20:08 -0400
commit2f98962eccca32b60f93ef358eb7dc638067f9da (patch)
treeaa5db81c5eaa9dba8822830aec5e1c38603d9387 /src
parentmisc/change-interp: add utility to change ld.so pathname (diff)
downloadelfix-2f98962eccca32b60f93ef358eb7dc638067f9da.tar.gz
elfix-2f98962eccca32b60f93ef358eb7dc638067f9da.tar.bz2
elfix-2f98962eccca32b60f93ef358eb7dc638067f9da.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
Diffstat (limited to 'src')
-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