From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 70B7B1381F3 for ; Sun, 23 Dec 2012 02:36:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E1A921C075; Sun, 23 Dec 2012 02:36:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CFC5D21C055 for ; Sun, 23 Dec 2012 02:36:10 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E839B33D883 for ; Sun, 23 Dec 2012 02:36:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 8CDF6E5442 for ; Sun, 23 Dec 2012 02:36:08 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1356230154.69e05d04bd4796d67f6d9d89cbe2110e0679da58.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:master commit in: scripts/ X-VCS-Repository: proj/elfix X-VCS-Files: scripts/paxmodule.c X-VCS-Directories: scripts/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 69e05d04bd4796d67f6d9d89cbe2110e0679da58 X-VCS-Branch: master Date: Sun, 23 Dec 2012 02:36:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2d3b353c-274c-4aca-b6fd-4cef035dda4b X-Archives-Hash: 34cd682d2be86f0c7e1fede02038c527 commit: 69e05d04bd4796d67f6d9d89cbe2110e0679da58 Author: Anthony G. Basile gentoo org> AuthorDate: Sun Dec 23 01:04:04 2012 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sun Dec 23 02:35:54 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=69e05d04 scripts/paxmodule.c: throw a PaxError when pax_getflags or set_xt_flags --- 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