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 2AF4B1381F3 for ; Sun, 23 Dec 2012 01:04:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF8B421C00A; Sun, 23 Dec 2012 01:04:17 +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 5912C21C00A for ; Sun, 23 Dec 2012 01:04:17 +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 7526833D966 for ; Sun, 23 Dec 2012 01:04:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id CA928E543C for ; Sun, 23 Dec 2012 01:04:13 +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: <1356224644.20d4eca613ae2f51a35138bcbe4127746fdc4d32.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: 20d4eca613ae2f51a35138bcbe4127746fdc4d32 X-VCS-Branch: master Date: Sun, 23 Dec 2012 01:04:13 +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: d0873c42-e220-4698-851c-8ccbae40aca6 X-Archives-Hash: dc348796a4f3367e88d33903a928af19 commit: 20d4eca613ae2f51a35138bcbe4127746fdc4d32 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 01:04:04 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=20d4eca6 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