diff options
author | 2015-03-02 04:32:07 -0500 | |
---|---|---|
committer | 2015-03-02 04:32:07 -0500 | |
commit | 10c47816af92c613d67bb717286f3f8397d96c43 (patch) | |
tree | 19a6903252b18b3844731981eb3a203bdf508c85 | |
parent | scanelf: add more range checks to deal with corrupt elfs (diff) | |
download | pax-utils-10c47816af92c613d67bb717286f3f8397d96c43.tar.gz pax-utils-10c47816af92c613d67bb717286f3f8397d96c43.tar.bz2 pax-utils-10c47816af92c613d67bb717286f3f8397d96c43.zip |
migrate to gitv1.0
-rw-r--r-- | .cvsignore | 43 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 35 | ||||
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | dumpelf.c | 6 | ||||
-rwxr-xr-x | lddtree.py | 4 | ||||
-rwxr-xr-x | lddtree.sh | 5 | ||||
-rw-r--r-- | macho.h | 1 | ||||
-rwxr-xr-x | make-tarball.sh | 75 | ||||
-rw-r--r-- | man/fragment/version | 2 | ||||
-rw-r--r-- | paxelf.c | 1 | ||||
-rw-r--r-- | paxelf.h | 1 | ||||
-rw-r--r-- | paxinc.c | 1 | ||||
-rw-r--r-- | paxinc.h | 6 | ||||
-rw-r--r-- | paxmacho.c | 1 | ||||
-rw-r--r-- | paxmacho.h | 1 | ||||
-rw-r--r-- | porting.h | 1 | ||||
-rw-r--r-- | pspax.c | 5 | ||||
-rw-r--r-- | scanelf.c | 6 | ||||
-rw-r--r-- | scanmacho.c | 6 | ||||
-rwxr-xr-x | tests/source/dotest | 4 | ||||
-rw-r--r-- | xfuncs.c | 1 | ||||
-rw-r--r-- | xfuncs.h | 1 |
24 files changed, 104 insertions, 122 deletions
diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index a121e02..0000000 --- a/.cvsignore +++ /dev/null @@ -1,43 +0,0 @@ -*bz2 -*~ -*.[adio] -*.l[ao] -*.gdb -*.pyc -*.deps -*.libs - -*.patch -*.orig -*.rej -*.diff -pax-utils-* -contrib - -a.out* -lib*.so* -core -.gdb_history -.gdbinit - -aclocal.m4 -autom4te.cache -build -config.cache -config.h -config.h.in -config.log -config.status -configure -autotools -libtool -Makefile.in -stamp-h1 - -dumpelf -pspax -scanelf -scanmacho - -.git -*.x @@ -40,5 +40,3 @@ stamp-h1 /scanmacho /man/*.1 - -CVS @@ -1,6 +1,5 @@ # Copyright 2003-2006 Ned Ludd <solar@linbsd.net> # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-projects/pax-utils/Makefile,v 1.88 2015/02/28 22:49:13 vapier Exp $ #################################################################### check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ @@ -48,7 +47,10 @@ endif ifdef PV override CPPFLAGS += -DVERSION=\"$(PV)\" +else +VCSID := $(shell git describe --tags HEAD) endif +override CPPFLAGS += -DVCSID='"$(VCSID)"' #################################################################### ELF_TARGETS = scanelf dumpelf $(shell echo | $(CC) -dM -E - | grep -q __svr4__ || echo pspax) @@ -131,32 +133,13 @@ endif PN = pax-utils P = $(PN)-$(PV) dist: - @if [ "$(PV)" = "" ] ; then \ - echo "Please run 'make dist PV=<ver>'" ; \ - exit 1 ; \ - fi + ./make-tarball.sh $(PV) +distcheck: dist rm -rf $(P) - mkdir $(P) - cp -a CVS $(P)/ - cd $(P) && cvs up - echo "<releaseinfo>$(PV)</releaseinfo>" > $(P)/man/fragment/version - $(MAKE) -C $(P)/man - sed -i '/AC_INIT/s:git:$(PV):' $(P)/configure.ac - $(MAKE) -C $(P) autotools - tar cf - $(P) --exclude=CVS --exclude=.cvsignore | xz > $(P).tar.xz - @printf "\n ..... Making sure clean cvs build works ..... \n\n" - set -e; \ - unset CFLAGS; \ - for t in all check clean debug check clean; do \ - $(MAKE) -C $(P) $$t; \ - done; \ - cd $(P); \ - ./configure -C; \ - for t in all check; do \ - $(MAKE) $$t; \ - done + tar xf $(P).tar.xz + $(MAKE) -C $(P) + $(MAKE) -C $(P) check rm -rf $(P) - du -b $(P).tar.xz -include .depend @@ -171,7 +154,7 @@ check test: GEN_MARK_START = \# @@@ GEN START @@@ \# GEN_MARK_END = \# @@@ GEN START @@@ \# EXTRA_DIST = \ - $(shell find '(' -name CVS -prune ')' -o '(' -type f -print ')') + $(shell find -type f) MAKE_MULTI_LINES = $(patsubst %,\\\\\n\t%,$(sort $(1))) # 2nd level of indirection here is so the $(find) doesn't pick up # files in EXTRA_DIST that get cleaned up ... diff --git a/Makefile.am b/Makefile.am index bcb7462..9f51139 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,28 +44,16 @@ EXTRA_DIST = autotools/m4/gnulib-cache.m4 # @@@ GEN START @@@ # dist_man_MANS += EXTRA_DIST += \ - tests/CVS/Entries \ - tests/CVS/Repository \ - tests/CVS/Root \ tests/Makefile \ - tests/lddtree/CVS/Entries \ - tests/lddtree/CVS/Repository \ - tests/lddtree/CVS/Root \ tests/lddtree/Makefile \ tests/lddtree/dotest.cmp \ tests/lddtree/dotest.py \ tests/lddtree/dotest.sfx \ tests/lddtree/dotest.sh \ tests/lib.sh \ - tests/scanelf/CVS/Entries \ - tests/scanelf/CVS/Repository \ - tests/scanelf/CVS/Root \ tests/scanelf/Makefile \ tests/scanelf/dotest \ tests/scanelf/scanelf.simple.good \ - tests/source/CVS/Entries \ - tests/source/CVS/Repository \ - tests/source/CVS/Root \ tests/source/Makefile \ tests/source/dotest \ tests/source/space @@ -1,6 +1,6 @@ HOMEPAGE: http://hardened.gentoo.org/pax-utils.xml -CVS: cvs -d :pserver:anonymous@anoncvs.gentoo.org:/var/cvsroot co gentoo-projects/pax-utils -VIEWVCS: http://sources.gentoo.org/gentoo-projects/pax-utils/ +GIT: git clone git://git.overlays.gentoo.org/proj/pax-utils.git +VIEWVCS: http://git.overlays.gentoo.org/gitweb/?p=proj/pax-utils.git pax-utils is a small set of various PaX aware and related utilities for ELF binaries. It was written for ELF Q/A on Gentoo systems but can be @@ -23,7 +23,7 @@ see the homepage at http://pax.grsecurity.net/ (Gentoo) http://www.gentoo.org/proj/en/hardened/pax-utils.xml -http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/ +http://git.overlays.gentoo.org/gitweb/?p=proj/pax-utils.git Maintainer: solar@gentoo.org,vapier@gentoo.org (openSUSE) @@ -1,13 +1,11 @@ /* * Copyright 2005-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/dumpelf.c,v 1.33 2015/02/22 00:54:34 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> */ -static const char rcsid[] = "$Id: dumpelf.c,v 1.33 2015/02/22 00:54:34 vapier Exp $"; const char argv0[] = "dumpelf"; #include "paxinc.h" @@ -355,9 +353,9 @@ static void parseargs(int argc, char *argv[]) switch (flag) { case 'V': /* version info */ - printf("pax-utils-%s: %s\n%s\n" + printf("pax-utils-%s: %s\n" "%s written for Gentoo by <solar and vapier @ gentoo.org>\n", - VERSION, __FILE__, rcsid, argv0); + VERSION, VCSID, argv0); exit(EXIT_SUCCESS); break; case 'h': usage(EXIT_SUCCESS); break; @@ -4,7 +4,6 @@ # Copyright 2012-2014 The Chromium OS Authors # Use of this source code is governed by a BSD-style license (BSD-3) # pylint: disable=C0301 -# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.56 2014/11/20 01:22:36 vapier Exp $ """Read the ELF dependency tree and show it @@ -447,8 +446,7 @@ def _NormalizePath(option, _opt, value, parser): def _ShowVersion(_option, _opt, _value, _parser): - d = '$Id: lddtree.py,v 1.56 2014/11/20 01:22:36 vapier Exp $'.split() - print('%s-%s %s %s' % (d[1].split('.')[0], d[2], d[3], d[4])) + print('lddtree by Mike Frysinger <vapier@gentoo.org>') sys.exit(0) @@ -2,7 +2,6 @@ # Copyright 2007-2013 Gentoo Foundation # Copyright 2007-2013 Mike Frysinger <vapier@gentoo.org> # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.sh,v 1.22 2013/04/07 19:20:09 vapier Exp $ argv0=${0##*/} @@ -29,9 +28,7 @@ usage() { } version() { - local id='$Id: lddtree.sh,v 1.22 2013/04/07 19:20:09 vapier Exp $' - id=${id##*,v } - exec echo "lddtree-${id% * Exp*}" + exec echo "lddtree by Mike Frysinger <vapier@gentoo.org>" } error() { @@ -1,7 +1,6 @@ /* * Copyright 2008-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/macho.h,v 1.10 2013/12/16 20:30:38 grobian Exp $ */ #ifndef _MACHO_H diff --git a/make-tarball.sh b/make-tarball.sh new file mode 100755 index 0000000..83caa75 --- /dev/null +++ b/make-tarball.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +set -e + +if ! . /etc/init.d/functions.sh 2>/dev/null ; then + einfo() { printf ' * %b\n' "$*"; } + eerror() { einfo "$@" 1>&2; } +fi +die() { eerror "$@"; exit 1; } + +v() { printf '\t%s\n' "$*"; "$@"; } + +: ${MAKE:=make} + +if [[ $# -ne 1 ]] ; then + die "Usage: $0 <ver>" +fi + +case $1 in +snap) ver=$(date -u +%Y%m%d) ;; +git) ver="HEAD" ;; +*) + ver="v$1" + if ! git describe --tags "${ver}" >&/dev/null ; then + die "Please create the tag first: git tag ${ver}" + fi + ;; +esac +p="pax-utils-${ver#v}" + +rm -rf "${p}" +mkdir "${p}" + +einfo "Checking out clean git sources ..." +git archive "${ver}" | tar xf - -C "${p}" +cd "${p}" + +einfo "Building autotools ..." +sed -i "/^AC_INIT/s:git:${ver}:" configure.ac +sed -i "1iPV := ${ver}" Makefile +LC_ALL=C ${MAKE} -s autotools >/dev/null +rm -rf autom4te.cache + +einfo "Building docs ..." +echo "<releaseinfo>${ver#v}</releaseinfo>" > man/fragment/version +make -C man +cd .. + +einfo "Generating tarball ..." +tar cf - "${p}" | xz > "${p}".tar.xz +rm -r "${p}" +du -b "${p}".tar.* + +einfo "Checking tarball (simple) ..." +tar xf "${p}".tar.* +pushd "${p}" >/dev/null +v ${MAKE} -s +v ${MAKE} -s check +popd >/dev/null +rm -rf "${p}" + +einfo "Checking tarball (autotools) ..." +tar xf "${p}".tar.* +pushd "${p}" >/dev/null +v ./configure -q +v ${MAKE} -s +v ${MAKE} -s check +popd >/dev/null +rm -rf "${p}" + +echo +einfo "All ready for distribution!" +du -b "${p}".tar.* + +exit 0 diff --git a/man/fragment/version b/man/fragment/version index 6ea022b..69ba922 100644 --- a/man/fragment/version +++ b/man/fragment/version @@ -1 +1 @@ -<releaseinfo>cvs</releaseinfo> +<releaseinfo>git</releaseinfo> @@ -1,7 +1,6 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.c,v 1.81 2014/06/18 03:16:52 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -1,7 +1,6 @@ /* * Copyright 2005-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.61 2015/02/28 22:57:40 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -1,7 +1,6 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxinc.c,v 1.16 2013/04/10 22:16:45 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -1,7 +1,6 @@ /* * Copyright 2005-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxinc.h,v 1.17 2012/11/04 07:26:24 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -16,7 +15,10 @@ #include "xfuncs.h" #ifndef VERSION -# define VERSION "cvs" +# define VERSION "git" +#endif +#ifndef VCSID +# define VCSID "<unknown>" #endif /* ELF love */ @@ -1,7 +1,6 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxmacho.c,v 1.21 2013/04/16 16:26:28 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -1,7 +1,6 @@ /* * Copyright 2005-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxmacho.h,v 1.8 2013/04/16 16:26:28 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -1,7 +1,6 @@ /* * Copyright 2005-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/porting.h,v 1.46 2014/10/19 08:20:55 vapier Exp $ * * Copyright 2005-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org> @@ -12,7 +12,6 @@ * cc -o pspax pspax.c -DWANT_SYSCAP -lcap */ -static const char rcsid[] = "$Id: pspax.c,v 1.53 2015/02/22 00:54:34 vapier Exp $"; const char argv0[] = "pspax"; #include "paxinc.h" @@ -483,9 +482,9 @@ static void parseargs(int argc, char *argv[]) switch (flag) { case 'V': /* version info */ - printf("pax-utils-%s: %s\n%s\n" + printf("pax-utils-%s: %s\n" "%s written for Gentoo by <solar and vapier @ gentoo.org>\n", - VERSION, __FILE__, rcsid, argv0); + VERSION, VCSID, argv0); exit(EXIT_SUCCESS); break; case 'h': usage(EXIT_SUCCESS); break; @@ -1,13 +1,11 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.277 2015/02/28 22:59:34 vapier Exp $ * * Copyright 2003-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org> */ -static const char rcsid[] = "$Id: scanelf.c,v 1.277 2015/02/28 22:59:34 vapier Exp $"; const char argv0[] = "scanelf"; #include "paxinc.h" @@ -2218,9 +2216,9 @@ static int parseargs(int argc, char *argv[]) switch (i) { case 'V': - printf("pax-utils-%s: %s\n%s\n" + printf("pax-utils-%s: %s\n" "%s written for Gentoo by <solar and vapier @ gentoo.org>\n", - VERSION, __FILE__, rcsid, argv0); + VERSION, VCSID, argv0); exit(EXIT_SUCCESS); break; case 'h': usage(EXIT_SUCCESS); break; diff --git a/scanmacho.c b/scanmacho.c index 71e971c..a36aed4 100644 --- a/scanmacho.c +++ b/scanmacho.c @@ -1,7 +1,6 @@ /* * Copyright 2008-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.25 2015/02/22 00:54:34 vapier Exp $ * * based on scanelf by: * Copyright 2003-2012 Ned Ludd - <solar@gentoo.org> @@ -10,7 +9,6 @@ * 2008-2013 Fabian Groffen - <grobian@gentoo.org> */ -static const char rcsid[] = "$Id: scanmacho.c,v 1.25 2015/02/22 00:54:34 vapier Exp $"; const char argv0[] = "scanmacho"; #include "paxinc.h" @@ -630,9 +628,9 @@ static int parseargs(int argc, char *argv[]) switch (i) { case 'V': - printf("pax-utils-%s: %s\n%s\n" + printf("pax-utils-%s: %s\n" "%s written for Gentoo by <solar, vapier and grobian @ gentoo.org>\n", - VERSION, __FILE__, rcsid, argv0); + VERSION, VCSID, argv0); exit(EXIT_SUCCESS); break; case 'h': usage(EXIT_SUCCESS); break; diff --git a/tests/source/dotest b/tests/source/dotest index b7b3567..16297e2 100755 --- a/tests/source/dotest +++ b/tests/source/dotest @@ -4,7 +4,7 @@ findfiles() { find "${top_srcdir}" \ - '(' -type d -a '(' -name CVS -o -name .git -o -name autotools ')' -prune ')' \ + '(' -type d -a '(' -name .git -o -name autotools ')' -prune ')' \ -o '(' '(' -name '*.[ch]' -a ! -name 'config.h' ')' -print0 ')' } @@ -12,7 +12,7 @@ findfiles() { # check for misc common typos # find "${top_srcdir}" \ - '(' -type d -a '(' -name CVS -o -name .git -o -name tests ')' -prune ')' \ + '(' -type d -a '(' -name .git -o -name tests ')' -prune ')' \ -o '(' -type f -a -print0 ')' | xargs -0 \ grep -n -I \ -e '\<compatability\>' \ @@ -1,7 +1,6 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/xfuncs.c,v 1.12 2014/03/20 07:52:07 vapier Exp $ * * Copyright 2003-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org> @@ -1,7 +1,6 @@ /* * Copyright 2003-2012 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/xfuncs.h,v 1.8 2014/03/20 07:59:27 vapier Exp $ * * Copyright 2003-2012 Ned Ludd - <solar@gentoo.org> * Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org> |