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.60) (envelope-from ) id 1RLwTn-0001dG-QH for garchives@archives.gentoo.org; Thu, 03 Nov 2011 12:33:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 93480E054D; Thu, 3 Nov 2011 12:33:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4A779E054D for ; Thu, 3 Nov 2011 12:33:01 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C33011B4019 for ; Thu, 3 Nov 2011 12:33:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 34CD780042 for ; Thu, 3 Nov 2011 12:33:00 +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: 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: d632f1a385d1295c5bdb25cdc0a3e6a31d01e7a9 Date: Thu, 3 Nov 2011 12:33:00 +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: a6d7935f-db1c-4d65-b60d-74c5accf03fa X-Archives-Hash: 49122a2768b3ee575181b3a78f1ce104 commit: d632f1a385d1295c5bdb25cdc0a3e6a31d01e7a9 Author: Anthony G. Basile gentoo org> AuthorDate: Thu Nov 3 12:32:54 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Thu Nov 3 12:32:54 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3Dd632f1a3 src/paxctl-ng.c: #defined values for cp_flags --- src/paxctl-ng.c | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/paxctl-ng.c b/src/paxctl-ng.c index d3ddb2f..94dea09 100644 --- a/src/paxctl-ng.c +++ b/src/paxctl-ng.c @@ -37,6 +37,11 @@ #define PAX_NAMESPACE "user.pax" #define BUF_SIZE 7 =20 +#define CREATE_XT_FLAGS_SECURE 1 +#define CREATE_XT_FLAGS_DEFAULT 2 +#define COPY_PT_TO_XT_FLAGS 3 +#define COPY_XT_TO_PT_FLAGS 4 + void print_help(char *v) { @@ -85,6 +90,7 @@ parse_cmd_args(int c, char *v[], uint16_t *pax_flags, i= nt *view_flags, int *cp_f *view_flags =3D 0; *cp_flags =3D 0;=20 while((oc =3D getopt(c, v,":PpEeMmRrXxSsZzCcFfvh")) !=3D -1) + { switch(oc) { case 'P': @@ -148,19 +154,19 @@ parse_cmd_args(int c, char *v[], uint16_t *pax_flag= s, int *view_flags, int *cp_f break; case 'C': solitaire +=3D 1; - *cp_flags =3D 1; + *cp_flags =3D CREATE_XT_FLAGS_SECURE; break; case 'c': solitaire +=3D 1; - *cp_flags =3D 2; + *cp_flags =3D CREATE_XT_FLAGS_DEFAULT; break; case 'F': solitaire +=3D 1; - *cp_flags =3D 3; + *cp_flags =3D COPY_PT_TO_XT_FLAGS; break; case 'f': solitaire +=3D 1; - *cp_flags =3D 4; + *cp_flags =3D COPY_XT_TO_PT_FLAGS; break; case 'v': *view_flags =3D 1; @@ -172,6 +178,7 @@ parse_cmd_args(int c, char *v[], uint16_t *pax_flags,= int *view_flags, int *cp_f default: error(EXIT_FAILURE, 0, "option -%c is invalid: ignored.", optopt ) ; } + } =20 if ( @@ -509,11 +516,11 @@ main( int argc, char *argv[]) { const char *f_name; int fd; - uint16_t flags; + uint16_t pax_flags; int view_flags, cp_flags; int rdwr_pt_pax =3D 1; =20 - f_name =3D parse_cmd_args(argc, argv, &flags, &view_flags, &cp_flags); + f_name =3D parse_cmd_args(argc, argv, &pax_flags, &view_flags, &cp_flag= s); =20 if((fd =3D open(f_name, O_RDWR)) < 0) { @@ -523,14 +530,14 @@ main( int argc, char *argv[]) error(EXIT_FAILURE, 0, "open() failed"); } =20 - if(cp_flags =3D=3D 1 || cp_flags =3D=3D 2) + if(cp_flags =3D=3D CREATE_XT_FLAGS_SECURE || cp_flags =3D=3D CREATE_XT_= FLAGS_DEFAULT) create_xt_flags(fd, cp_flags); =20 - if(cp_flags =3D=3D 3 || (cp_flags =3D=3D 4 && rdwr_pt_pax)) + if(cp_flags =3D=3D COPY_PT_TO_XT_FLAGS || (cp_flags =3D=3D COPY_XT_TO_P= T_FLAGS && rdwr_pt_pax)) copy_xt_flags(fd, cp_flags); =20 - if(flags !=3D 1) - set_flags(fd, &flags, rdwr_pt_pax); + if(pax_flags !=3D 1) + set_flags(fd, &pax_flags, rdwr_pt_pax); =20 if(view_flags =3D=3D 1) print_flags(fd);