From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1SsYwT-0004mp-Vs for garchives@archives.gentoo.org; Sat, 21 Jul 2012 12:37:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D751CE062C; Sat, 21 Jul 2012 12:37:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AC0FFE062C for ; Sat, 21 Jul 2012 12:37:30 +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 1AD0F1B40BF for ; Sat, 21 Jul 2012 12:37:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D64CFE5436 for ; Sat, 21 Jul 2012 12:37:28 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1342874240.0e5fa67947a5eb01d036a27e697735fb94d5c37e.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:master commit in: src/ X-VCS-Repository: proj/elfix X-VCS-Files: src/paxctl-ng.c X-VCS-Directories: src/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 0e5fa67947a5eb01d036a27e697735fb94d5c37e X-VCS-Branch: master Date: Sat, 21 Jul 2012 12:37:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 0ee9e116-7b95-4569-80a2-a7c8360a67db X-Archives-Hash: 4a989807deea2d96238d33ad9c52c18f commit: 0e5fa67947a5eb01d036a27e697735fb94d5c37e Author: Anthony G. Basile gentoo org> AuthorDate: Sat Jul 21 12:37:20 2012 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Jul 21 12:37:20 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D0e5fa679 src/paxctl-ng.c: sanity check on copy XT_PAX <-> PT_PAX --- src/paxctl-ng.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/paxctl-ng.c b/src/paxctl-ng.c index 431d285..30584db 100644 --- a/src/paxctl-ng.c +++ b/src/paxctl-ng.c @@ -58,7 +58,7 @@ print_help_exit(char *v) "Description : Get or set pax flags on an ELF object\n\n" "Usage : %s -PpSsMmEeRrv ELF | -Zv ELF | -zv ELF\n" #ifdef XATTR - " : %s -Cv ELF | -cv ELF | Fv ELF | -fv ELF\n" + " : %s -Cv ELF | -cv ELF | -Fv ELF | -fv ELF\n" #endif " : %s -v ELF | -h\n\n" "Options : -P enable PAGEEXEC\t-p disable PAGEEXEC\n" @@ -513,8 +513,7 @@ set_xt_flags(int fd, uint16_t xt_flags) =20 memset(buf, 0, FLAGS_SIZE); bin2string(xt_flags, buf); - printf("DEBUG buf =3D %s\n", buf); - //fsetxattr(fd, PAX_NAMESPACE, buf, FLAGS_SIZE, XATTR_REPLACE); + fsetxattr(fd, PAX_NAMESPACE, buf, strlen(buf), XATTR_REPLACE); } #endif =20 @@ -558,8 +557,7 @@ create_xt_flags(int fd, int cp_flags) =20 memset(buf, 0, FLAGS_SIZE); bin2string(xt_flags, buf); - printf("DEBUG buf =3D %s\n", buf); - //fsetxattr(fd, PAX_NAMESPACE, buf, FLAGS_SIZE, XATTR_REPLACE); + fsetxattr(fd, PAX_NAMESPACE, buf, strlen(buf), XATTR_CREATE); } =20 =20 @@ -570,12 +568,14 @@ copy_xt_flags(int fd, int cp_flags, int verbose) if(cp_flags =3D=3D 3) { flags =3D get_pt_flags(fd, verbose); - set_xt_flags(fd, flags); + if( flags !=3D UINT16_MAX ) + set_xt_flags(fd, flags); } else if(cp_flags =3D=3D 4) { flags =3D get_xt_flags(fd); - set_pt_flags(fd, flags, verbose); + if( flags !=3D UINT16_MAX ) + set_pt_flags(fd, flags, verbose); } } #endif