Skip to content

Commit

Permalink
Fix build on NetBSD > 3. Add patch comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dholland committed Mar 19, 2015
1 parent 356a0f0 commit a1e1c6b
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 62 deletions.
3 changes: 1 addition & 2 deletions security/tct/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.30 2015/01/04 04:03:42 dholland Exp $
# $NetBSD: Makefile,v 1.31 2015/03/19 08:34:53 dholland Exp $
#

DISTNAME= tct-1.09
Expand All @@ -10,7 +10,6 @@ MAINTAINER= frazee.23@osu.edu
HOMEPAGE= http://www.porcupine.org/forensics/tct.html
COMMENT= Programs to aid post-mortem after a break-in

BROKEN_ON_PLATFORM= NetBSD-[4-9]*-* # see PR 42039
MAKE_JOBS_SAFE= no

DEPENDS+= p5-Date-Manip-[0-9]*:../../devel/p5-Date-Manip
Expand Down
32 changes: 16 additions & 16 deletions security/tct/distinfo
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
$NetBSD: distinfo,v 1.7 2010/03/08 01:21:24 dholland Exp $
$NetBSD: distinfo,v 1.8 2015/03/19 08:34:53 dholland Exp $

SHA1 (tct-1.09.tar.gz) = fffb6ae1f389cfdfad95a9a81f6eaba115c9dfc0
RMD160 (tct-1.09.tar.gz) = ee4ddc286a2564f9b1daaa41f35e3d0fe8d6ea71
Size (tct-1.09.tar.gz) = 314134 bytes
SHA1 (patch-aa) = 6b91f920a42fc33dfd535bcf910407b612bb9c4e
SHA1 (patch-ab) = 5db53f9015c1362e20a1591859652fc121cd639b
SHA1 (patch-ac) = 18cf7490310cbf1831f4fcc77fb9c414191542dc
SHA1 (patch-ad) = 747a0eb789933bd3f7e840a3dc28bd2dd6929819
SHA1 (patch-ae) = 6403b5788edabd7e9146450282aad2460e83bc7e
SHA1 (patch-af) = bbf402d8d4c5c6118e158d70f4e1814f0e179c8d
SHA1 (patch-ag) = 9767ae8b3ed7f940c8350f944c363ac10694f7f4
SHA1 (patch-ah) = 6a4b473141ffbced2f5491b215b30cbf4fc9bfd1
SHA1 (patch-ai) = 8bc7f949bed634b1c5e0ee78295e80a0b8ce6e0a
SHA1 (patch-aj) = fc67eefa3f92ceb8f4703b6a00ad7fe3777c3357
SHA1 (patch-ak) = 040fcaf2151c06b655e56305941b1dec3c8ae17d
SHA1 (patch-al) = 4d01407b6566d16d7f5c0fb718644e90aa2b9094
SHA1 (patch-am) = 2a45fcdfb88c0340e46419bcd76eef7c7202a9f9
SHA1 (patch-an) = ee3ed219467a4e3212a8ff7345e4d6a6c2163b17
SHA1 (patch-ao) = 243091eb5dc20955f82b4707947ee7f09a5a3c20
SHA1 (patch-aa) = a35aa034a081ff37ce56192f1f25d2cd2f15d46a
SHA1 (patch-ab) = c58443c20afd70e00f61e76fc3f2a453b5508f7f
SHA1 (patch-ac) = db01162b2394a086c6e878dc5587320448ccbe45
SHA1 (patch-ad) = 12bad749062032c88b9ddcbb5c30aed0f4409e3b
SHA1 (patch-ae) = bfecf9be7cdcc078f8c9ff5bd2141e43f46ede90
SHA1 (patch-af) = d5629a143ee190b64df298f22dfd2e8ba8928d52
SHA1 (patch-ag) = 4f03bdc2ae7f1bf36a705a3543f9925fcc037c11
SHA1 (patch-ah) = dedb464b3050b5c7dafe620d75743ef9525e7696
SHA1 (patch-ai) = a706e9265552d4864b765c7700ee80cd61a19edf
SHA1 (patch-aj) = 736eb7f1cb1c1a3eb7f7ce69019e8f4a61753b40
SHA1 (patch-ak) = 03cb4b36878386c3200b37a0f9092f80f6813bcd
SHA1 (patch-al) = e29ba1b2846f63c2847072f6e0c37b58a94a76e9
SHA1 (patch-am) = 57531cca621df787c4aa59e4a2ddd2d538f3933a
SHA1 (patch-an) = 27c7d503841bcb58ae141f594decc8aff3b72e7d
SHA1 (patch-ao) = ba87c403613154a091cdbe91c8fa43335d2bfe50
SHA1 (patch-ap) = 1587d7b4e4da1226a2943a4f98b9fa20bd83c79d
6 changes: 4 additions & 2 deletions security/tct/patches/patch-aa
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-aa,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-aa,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- src/aux/makedefs.orig 2001-10-04 12:34:08.000000000 -0700
+++ src/aux/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-aa,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
6 changes: 4 additions & 2 deletions security/tct/patches/patch-ab
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-ab,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-ab,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- extras/entropy/makedefs.orig 2001-10-04 12:59:35.000000000 -0700
+++ extras/entropy/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-ab,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
6 changes: 4 additions & 2 deletions security/tct/patches/patch-ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-ac,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-ac,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- extras/findkey/makedefs.orig 2001-10-04 12:32:54.000000000 -0700
+++ extras/findkey/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-ac,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
12 changes: 10 additions & 2 deletions security/tct/patches/patch-ad
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
$NetBSD: patch-ad,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-ad,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- lib/ostype.pl.orig 2000-07-30 16:39:20.000000000 -0700
+++ lib/ostype.pl
@@ -9,6 +9,9 @@ print "Determining OS (in determine_os()
@@ -9,6 +9,15 @@ print "Determining OS (in determine_os()

# Order does not matter, table is sorted.
%OS_INFO = (
+ "NETBSD1", "NetBSD.1",
+ "NETBSD2", "NetBSD.2",
+ "NETBSD3", "NetBSD.3",
+ "NETBSD4", "NetBSD.4",
+ "NETBSD5", "NetBSD.5",
+ "NETBSD6", "NetBSD.6",
+ "NETBSD7", "NetBSD.7",
+ "NETBSD8", "NetBSD.8",
+ "NETBSD9", "NetBSD.9",
"FREEBSD2", "FreeBSD.2",
"FREEBSD3", "FreeBSD.3",
"FREEBSD4", "FreeBSD.4",
6 changes: 4 additions & 2 deletions security/tct/patches/patch-ae
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-ae,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-ae,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- src/file/makedefs.orig 2001-10-04 12:42:22.000000000 -0700
+++ src/file/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-ae,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD3"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
37 changes: 22 additions & 15 deletions security/tct/patches/patch-af
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
$NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
$NetBSD: patch-af,v 1.3 2015/03/19 08:34:53 dholland Exp $

--- src/fstools/ffs.c.orig 2001-09-15 13:45:56.000000000 -0700
Add NetBSD support.

--- src/fstools/ffs.c.orig 2001-09-15 20:45:56.000000000 +0000
+++ src/fstools/ffs.c
@@ -28,6 +28,16 @@
@@ -28,6 +28,21 @@
#include "mymalloc.h"
#include "error.h"

+#if defined(NETBSD2)
+#if defined(NETBSD2) || defined(NETBSD7)
+#define MY_DINODE ufs1_dinode
+#define MY_SBOFF SBLOCK_UFS1
+#define MY_FS_MAGIC FS_UFS1_MAGIC
+#if defined(NETBSD7)
+#define ROOTINO UFS_ROOTINO
+#define NDADDR UFS_NDADDR
+#define NIADDR UFS_NIADDR
+#endif
+#else
+#define MY_DINODE dinode
+#define MY_SBOFF SBOFF
Expand All @@ -19,7 +26,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
/*
* Structure of a fast file system handle.
*/
@@ -36,7 +46,7 @@ typedef struct {
@@ -36,7 +51,7 @@ typedef struct {
struct fs *fs; /* super block buffer */
FS_BUF *cg_buf; /* cylinder block buffer */
FS_BUF *dino_buf; /* inode block buffer */
Expand All @@ -28,7 +35,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
} FFS_INFO;

/* ffs_cgroup_lookup - look up cached cylinder group info */
@@ -84,7 +94,7 @@ static void ffs_cgroup_free(FFS_INFO *ff
@@ -84,7 +99,7 @@ static void ffs_cgroup_free(FFS_INFO *ff

/* ffs_dinode_lookup - look up cached disk inode */

Expand All @@ -37,7 +44,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
{
DADDR_T addr;
int offs;
@@ -109,9 +119,9 @@ static struct dinode *ffs_dinode_lookup(
@@ -109,9 +124,9 @@ static struct dinode *ffs_dinode_lookup(
* Copy the inode, in order to avoid alignment problems when accessing
* structure members.
*/
Expand All @@ -49,7 +56,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
return (&ffs->dinode);
}

@@ -125,7 +135,7 @@ static void ffs_dinode_free(FFS_INFO *ff
@@ -125,7 +140,7 @@ static void ffs_dinode_free(FFS_INFO *ff

/* ffs_copy_inode - copy disk inode to generic inode */

Expand All @@ -58,7 +65,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
{
int i;

@@ -151,7 +161,7 @@ static FS_INODE *ffs_inode_lookup(FS_INF
@@ -151,7 +166,7 @@ static FS_INODE *ffs_inode_lookup(FS_INF
{
FFS_INFO *ffs = (FFS_INFO *) fs;
FS_INODE *fs_inode = fs_inode_alloc(NDADDR, NIADDR);
Expand All @@ -67,7 +74,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $

ffs_copy_inode(dino, fs_inode);
return (fs_inode);
@@ -168,7 +178,7 @@ void ffs_inode_walk(FS_INFO *fs, INUM
@@ -168,7 +183,7 @@ void ffs_inode_walk(FS_INFO *fs, INUM
struct cg *cg = 0;
INUM_T inum;
unsigned char *inosused;
Expand All @@ -76,11 +83,11 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
FS_INODE *fs_inode = fs_inode_alloc(NDADDR, NIADDR);
int myflags;
INUM_T ibase;
@@ -193,7 +203,12 @@ void ffs_inode_walk(FS_INFO *fs, INUM
@@ -193,7 +208,12 @@ void ffs_inode_walk(FS_INFO *fs, INUM
cg_num = INO_TO_CG(ffs->fs, inum);
if (cg == 0 || cg->cg_cgx != cg_num) {
cg = ffs_cgroup_lookup(ffs, cg_num);
+#if defined(NETBSD1) || defined(NETBSD2)
+#if defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD7)
+ /* BYTE_SWAPPED filesystems can come later */
+ inosused = (unsigned char *) cg_inosused(cg, 0);
+#else
Expand All @@ -89,11 +96,11 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
ibase = cg_num * ffs->fs->fs_ipg;
}

@@ -290,7 +305,12 @@ void ffs_block_walk(FS_INFO *fs, DADD
@@ -290,7 +310,12 @@ void ffs_block_walk(FS_INFO *fs, DADD
cg_num = dtog(ffs->fs, addr);
if (cg == 0 || cg->cg_cgx != cg_num) {
cg = ffs_cgroup_lookup(ffs, cg_num);
+#if defined(NETBSD1) || defined(NETBSD2)
+#if defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD7)
+ /* BYTE_SWAPPED filesystems can come later */
+ freeblocks = (unsigned char *) cg_blksfree(cg, 0);
+#else
Expand All @@ -102,7 +109,7 @@ $NetBSD: patch-af,v 1.2 2005/01/22 15:59:58 ben Exp $
dbase = cgbase(ffs->fs, cg_num);
dmin = cgdmin(ffs->fs, cg_num);
sblock = cgsblock(ffs->fs, cg_num);
@@ -390,11 +410,11 @@ FS_INFO *ffs_open(const char *name)
@@ -390,11 +415,11 @@ FS_INFO *ffs_open(const char *name)
*/
len = roundup(sizeof(struct fs), DEV_BSIZE);
ffs->fs = (struct fs *) mymalloc(len);
Expand Down
7 changes: 5 additions & 2 deletions security/tct/patches/patch-ag
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
$NetBSD: patch-ag,v 1.3 2010/03/08 01:21:25 dholland Exp $
$NetBSD: patch-ag,v 1.4 2015/03/19 08:34:53 dholland Exp $

Fix Linux off_t handling.
Add NetBSD support.

--- src/fstools/fs_tools.h.orig 2001-09-07 10:06:57.000000000 -0700
+++ src/fstools/fs_tools.h
Expand Down Expand Up @@ -28,7 +31,7 @@ $NetBSD: patch-ag,v 1.3 2010/03/08 01:21:25 dholland Exp $
#endif
#endif

+#if defined(NETBSD1) || defined(NETBSD2)
+#if defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD7)
+#define SUPPORTED
+#define HAVE_UFS_FFS
+#include <sys/vnode.h>
Expand Down
6 changes: 4 additions & 2 deletions security/tct/patches/patch-ah
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-ah,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-ah,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- src/lastcomm/makedefs.orig 2001-10-04 12:45:44.000000000 -0700
+++ src/lastcomm/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-ah,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
4 changes: 3 additions & 1 deletion security/tct/patches/patch-ai
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-ai,v 1.2 2005/01/22 15:59:58 ben Exp $
$NetBSD: patch-ai,v 1.3 2015/03/19 08:34:53 dholland Exp $

NetBSD support.

--- src/lastcomm/sys_defs.h.orig 2000-07-30 16:39:20.000000000 -0700
+++ src/lastcomm/sys_defs.h
Expand Down
6 changes: 4 additions & 2 deletions security/tct/patches/patch-aj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-aj,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-aj,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- src/major_minor/makedefs.orig 2001-10-04 12:46:24.000000000 -0700
+++ src/major_minor/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-aj,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
6 changes: 4 additions & 2 deletions security/tct/patches/patch-ak
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-ak,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-ak,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- src/misc/makedefs.orig 2001-10-04 12:47:05.000000000 -0700
+++ src/misc/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-ak,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
6 changes: 4 additions & 2 deletions security/tct/patches/patch-al
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$NetBSD: patch-al,v 1.3 2006/03/01 22:48:06 wiz Exp $
$NetBSD: patch-al,v 1.4 2015/03/19 08:34:53 dholland Exp $

Recognize NetBSD versions.

--- src/pcat/makedefs.orig 2001-10-04 12:31:47.000000000 -0700
+++ src/pcat/makedefs
Expand All @@ -10,7 +12,7 @@ $NetBSD: patch-al,v 1.3 2006/03/01 22:48:06 wiz Exp $
+ ;;
+ NetBSD.2*) DEFS="-DNETBSD2"
+ ;;
+ NetBSD.3*) DEFS="-DNETBSD2"
+ NetBSD.[3-9]*) DEFS="-DNETBSD2"
+ ;;
FreeBSD.2*) DEFS="-DFREEBSD2"
;;
Expand Down
Loading

0 comments on commit a1e1c6b

Please sign in to comment.