*BSD News Article 35766


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!happy!wkt
From: wkt@happy.cs.adfa.oz.au (Warren Toomey)
Subject: [patches] Tripwire 1.1 under FreeBSD 1.0/1.1
Message-ID: <1994Sep14.005855.22123@sserve.cc.adfa.oz.au>
Followup-To: wkt@cs.adfa.oz.au
Keywords: tripwire patch freebsd ntohl
Sender: wkt@happy (Warren Toomey)
Organization: Australian Defence Force Academy
Date: Wed, 14 Sep 1994 00:58:55 GMT

Here are the patches to get tripwire v1.1 running under FreeBSD 1.0 and 1.1.
The problem: utils.c was getting the definition of ntohl and htonl from param.h
and not from byteorder.h.

The patch: reoders the include files, and undef's the two if they are already
defined (e.g from param.h).

**** You also need to compile WITHOUT the -O flag. ****

	Warren Toomey	wkt@cs.adfa.oz.au

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	conf-freebsd.h
#	ntohl.h.diff
#	utils.c.diff
#
echo x - conf-freebsd.h
sed 's/^X//' >conf-freebsd.h << 'END-of-conf-freebsd.h'
X/*
X * conf-freebsd.h
X *
X *	Tripwire configuration file for FreeBSD 1.0/1.1
X *
X * Warren Toomey
X * wkt@cs.adfa.oz.au
X */
X
X/***
X *** Operating System specifics
X ***	
X ***	If the answer to a question in the comment is "Yes", then
X ***	change the corresponding "#undef" to a "#define"
X ***/
X
X/*
X * is your OS a System V derivitive?  if so, what version?
X *			(e.g., define SYSV 4)
X */
X
X#undef SYSV
X
X/* 
X * does your system have a <malloc.h> like System V? 
X */
X
X#undef MALLOCH 	
X
X/* 
X * does your system have a <stdlib.h> like POSIX says you should? 
X */
X
X#define STDLIBH
X
X/*
X * does your system use readdir(3) that returns (struct dirent *)?
X */
X
X#define DIRENT
X
X/*
X * is #include <string.h> ok?  (as opposed to <strings.h>)
X */
X
X#define STRINGH
X 
X/* 
X * does your system have gethostname(2) (instead of uname(2))?
X */
X
X#define GETHOSTNAME
END-of-conf-freebsd.h
echo x - ntohl.h.diff
sed 's/^X//' >ntohl.h.diff << 'END-of-ntohl.h.diff'
X*** old_ntohl.h	Wed Sep 14 09:09:26 1994
X--- ntohl.h	Wed Sep 14 09:10:02 1994
X***************
X*** 1,3 ****
X--- 1,10 ----
X+ #ifdef ntohl
X+ # undef ntohl
X+ #endif
X+ #ifdef htonl
X+ # undef htonl
X+ #endif
X+ 
X  #if BYTEORDER == 0x4321
X  
X  #define ntohl(x)
END-of-ntohl.h.diff
echo x - utils.c.diff
sed 's/^X//' >utils.c.diff << 'END-of-utils.c.diff'
X*** old_utils.c	Wed Sep 14 09:13:13 1994
X--- utils.c	Wed Sep 14 09:13:35 1994
X***************
X*** 11,18 ****
X   * Purdue University
X   */
X  
X- #include "../include/config.h"
X- #include "../include/byteorder.h"
X  #include <stdio.h>
X  #include <assert.h>
X  #ifdef STDLIBH
X--- 11,16 ----
X***************
X*** 51,56 ****
X--- 49,56 ----
X  #if (defined(SYSV) && (SYSV < 3))
X  # include <limits.h>
X  #endif	/* SVR2 */
X+ #include "../include/config.h"
X+ #include "../include/byteorder.h"
X  #include "../include/list.h"
X  #include "../include/tripwire.h"
X  
END-of-utils.c.diff
exit


-- 

`` ... nor do I regularly post multi-kilobyte screeds about driver software I
can't release because aliens haven't used the radio receivers in my head to
give me permission yet.'' -- John F. Woods