public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/elfix:elfix-0.8.x commit in: src/
@ 2013-11-07 14:53 Anthony G. Basile
  0 siblings, 0 replies; only message in thread
From: Anthony G. Basile @ 2013-11-07 14:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8846793632c93d7fc4f7175312a025a2f194f161
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 26 12:20:08 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Nov  7 14:48:06 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=88467936

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 <AT> dee.su>

X-Gentoo-Bug: 485908
X-Gentoo-Bug-URL: https://bugs.gentoo.org/485908

---
 src/paxctl-ng.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

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
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-07 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 14:53 [gentoo-commits] proj/elfix:elfix-0.8.x commit in: src/ Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox