public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:master commit in: scripts/, misc/
Date: Sun, 23 Dec 2012 01:19:57 +0000 (UTC)	[thread overview]
Message-ID: <1356225586.6e6e8b0b77c8b97a8e0c5b48e94be22367f627c9.blueness@gentoo> (raw)

commit:     6e6e8b0b77c8b97a8e0c5b48e94be22367f627c9
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 23 01:19:46 2012 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Dec 23 01:19:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=6e6e8b0b

scripts/paxmodule.c: fix logic of finding either PT_PAX or XATTR_PAX

---
 misc/alt-revdep-pax |    2 +-
 scripts/paxmodule.c |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/misc/alt-revdep-pax b/misc/alt-revdep-pax
index 6c0c7ba..58fba3c 100755
--- a/misc/alt-revdep-pax
+++ b/misc/alt-revdep-pax
@@ -195,7 +195,7 @@ def print_object_linkings( object_linkings, soname2library, verbose ):
 			sv = '%s ( %s )\n' % ( elf, elf_str_flags )
 			s = sv
 		except pax.PaxError:
-			elf_without_flags.append(elf)
+			elfs_without_flags.append(elf)
 			continue
 
 		count = 0

diff --git a/scripts/paxmodule.c b/scripts/paxmodule.c
index f77dabb..f329df8 100644
--- a/scripts/paxmodule.c
+++ b/scripts/paxmodule.c
@@ -281,7 +281,7 @@ static PyObject *
 pax_getflags(PyObject *self, PyObject *args)
 {
 	const char *f_name;
-	int fd;
+	int fd, flags_found;
 	uint16_t flags;
 	char buf[FLAGS_SIZE];
 
@@ -308,10 +308,13 @@ pax_getflags(PyObject *self, PyObject *args)
 	 * other but not both.
 	 */
 
+	flags_found = 0;
+
 #ifdef PTPAX
 	flags = get_pt_flags(fd);
 	if( flags != UINT16_MAX )
 	{
+		flags_found = 1;
 		memset(buf, 0, FLAGS_SIZE);
 		bin2string4print(flags, buf);
 	}
@@ -321,6 +324,7 @@ pax_getflags(PyObject *self, PyObject *args)
 	flags = get_xt_flags(fd);
 	if( flags != UINT16_MAX )
 	{
+		flags_found = 1;
 		memset(buf, 0, FLAGS_SIZE);
 		bin2string4print(flags, buf);
 	}
@@ -328,7 +332,7 @@ pax_getflags(PyObject *self, PyObject *args)
 
 	close(fd);
 
-	if( flags == UINT16_MAX )
+	if( !flags_found )
 	{
 		PyErr_SetString(PaxError, "pax_getflags: no PAX flags found");
 		return NULL;


             reply	other threads:[~2012-12-23  1:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-23  1:19 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-12-23  1:29 [gentoo-commits] proj/elfix:master commit in: scripts/, misc/ Anthony G. Basile
2012-12-23  1:32 Anthony G. Basile
2012-12-23  2:36 Anthony G. Basile
2012-12-23  2:36 Anthony G. Basile
2012-12-23  3:49 Anthony G. Basile
2012-12-23  3:49 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356225586.6e6e8b0b77c8b97a8e0c5b48e94be22367f627c9.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox