This commit is contained in:
Brian Cox 2016-07-03 14:30:53 -07:00
commit b410bdf87f
16 changed files with 185 additions and 42 deletions

View File

@ -87,6 +87,9 @@
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H

31
configure vendored
View File

@ -5694,7 +5694,7 @@ fi
done
for ac_header in unistd.h syslog.h langinfo.h sys/statfs.h
for ac_header in unistd.h syslog.h langinfo.h sys/statfs.h sys/select.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@ -7139,7 +7139,16 @@ else
# Basic test to check for compatible library and
# correct linking
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
if test "$cross_compiling" = yes; then
found_crypto=1
else
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
@ -7152,22 +7161,18 @@ int main(void)
return(RAND_status() <= 0);
}
int
main ()
{
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
found_crypto=1
break;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
if test ! -z "$found_crypto" ; then
break;

View File

@ -68,7 +68,7 @@ AC_CHECK_HEADERS(sys/mount.h,,,
#endif
]])
AC_CHECK_HEADERS(sys/ustat.h sys/sysmacros.h sys/syslog.h sys/socket.h)
AC_CHECK_HEADERS(unistd.h syslog.h langinfo.h sys/statfs.h)
AC_CHECK_HEADERS(unistd.h syslog.h langinfo.h sys/statfs.h sys/select.h)
AC_CHECK_HEADERS(signum.h bits/signum.h, break )
AC_CHECK_HEADERS(stdarg.h varargs.h, break )
@ -371,7 +371,10 @@ then
# Basic test to check for compatible library and
# correct linking
AC_TRY_COMPILE(
if test "$cross_compiling" = yes; then
found_crypto=1
else
AC_TRY_RUN(
[
#include <string.h>
#include <openssl/rand.h>
@ -388,6 +391,7 @@ int main(void)
break;
], []
)
fi
if test ! -z "$found_crypto" ; then
break;

56
contrib/twpolmake.pl Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/perl
# Tripwire Policy File customize tool
# ----------------------------------------------------------------
# Copyright (C) 2003 Hiroaki Izumi
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ----------------------------------------------------------------
# Usage:
# perl twpolmake.pl {Pol file}
# ----------------------------------------------------------------
#
$POLFILE=$ARGV[0];
open(POL,"$POLFILE") or die "open error: $POLFILE" ;
my($myhost,$thost) ;
my($sharp,$tpath,$cond) ;
my($INRULE) = 0 ;
while (<POL>) {
chomp;
if (($thost) = /^HOSTNAME\s*=\s*(.*)\s*;/) {
$myhost = `hostname` ; chomp($myhost) ;
if ($thost ne $myhost) {
$_="HOSTNAME=\"$myhost\";" ;
}
}
elsif ( /^{/ ) {
$INRULE=1 ;
}
elsif ( /^}/ ) {
$INRULE=0 ;
}
elsif ($INRULE == 1 and ($sharp,$tpath,$cond) = /^(\s*\#?\s*)(\/\S+)\b(\s+->\s+.+)$/) {
$ret = ($sharp =~ s/\#//g) ;
if ($tpath eq '/sbin/e2fsadm' ) {
$cond =~ s/;\s+(tune2fs.*)$/; \#$1/ ;
}
if (! -s $tpath) {
$_ = "$sharp#$tpath$cond" if ($ret == 0) ;
}
else {
$_ = "$sharp$tpath$cond" ;
}
}
print "$_\n" ;
}
close(POL) ;

View File

@ -143,8 +143,8 @@ public:
};
#if IS_AROS
class cArosPath
#if USES_DEVICE_PATH
class cDevicePath
{
public:
static TSTRING AsPosix(const TSTRING& in);

View File

@ -128,13 +128,13 @@ cFile::~cFile()
// Open
///////////////////////////////////////////////////////////////////////////////
#ifndef __AROS
#if !USES_DEVICE_PATH
void cFile::Open( const TSTRING& sFileName, uint32 flags )
{
#else
void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
{
TSTRING sFileName = cArosPath::AsNative(sFileNameC);
TSTRING sFileName = cDevicePath::AsNative(sFileNameC);
#endif
mode_t openmode = 0664;
if (mpData->mpCurrStream != NULL)
@ -451,30 +451,51 @@ void cFile::Truncate( File_t offset ) // throw(eFile)
}
#if IS_AROS
TSTRING cArosPath::AsPosix( const TSTRING& in )
#if USES_DEVICE_PATH
// For paths of type DH0:/dir/file
TSTRING cDevicePath::AsPosix( const TSTRING& in )
{
if (in[0] == '/')
return in;
#if IS_DOS_DJGPP
TSTRING out = "/dev/" + in;
std::replace(out.begin(), out.end(), '\\', '/');
#else
TSTRING out = '/' + in;
#endif
std::replace(out.begin(), out.end(), ':', '/');
return out;
}
TSTRING cArosPath::AsNative( const TSTRING& in )
TSTRING cDevicePath::AsNative( const TSTRING& in )
{
if (in[0] != '/')
return in;
int x;
for (x=1; in[x] == '/' && x<in.length(); x++);
#if IS_DOS_DJGPP
if (in.find("/dev") != 0 || in.length() < 6)
return in;
TSTRING out = "?:/";
out[0] = in[5];
if (in.length() >= 8)
out.append(in.substr(7));
return out;
#elif IS_AROS
int x = 1;
for ( x; in[x] == '/' && x<in.length(); x++);
TSTRING out = in.substr(x);
TSTRING::size_type t = out.find_first_of('/');
out[t] = ':';
return out;
#endif
}
#endif

View File

@ -299,6 +299,7 @@
#define SUPPORTS_SYSLOG (HAVE_SYSLOG_H && !IS_SKYOS)
#define NEEDS_SWAB_IMPL (IS_SYLLABLE || IS_ANDROID || IS_SORTIX)
#define USES_MBLEN (!IS_ANDROID && !IS_AROS)
#define USES_DEVICE_PATH (IS_AROS || IS_DOS_DJGPP)
#define ICONV_CONST_SOURCE (IS_MINIX)

View File

@ -78,8 +78,14 @@ void util_SignalHandler( int sig )
#if IS_UNIX
/* For the morbidly curious, here's a thread where a POSIX standards committee
wrings its hands about how to define NSIG: http://austingroupbugs.net/view.php?id=741#c1834 */
#ifndef NSIG
#define NSIG 32
# ifdef SIGMAX
# define NSIG (SIGMAX+1)
# else
# define NSIG 32
# endif
#endif
void tw_psignal(int sig, const TCHAR *str)

View File

@ -178,13 +178,13 @@ TCHAR cUnixFSServices::GetPathSeparator() const
return '/';
}
#if !IS_AROS
#if !USES_DEVICE_PATH
void cUnixFSServices::ReadDir(const TSTRING& strFilename, std::vector<TSTRING> &v, bool bFullPaths) const throw(eFSServices)
{
#else
void cUnixFSServices::ReadDir(const TSTRING& strFilenameC, std::vector<TSTRING>& v, bool bFullPaths) const throw(eFSServices)
{
TSTRING strFilename = cArosPath::AsNative(strFilenameC);
TSTRING strFilename = cDevicePath::AsNative(strFilenameC);
#endif
//Get all the filenames
@ -326,13 +326,13 @@ void cUnixFSServices::SetTempDirName(TSTRING& tmpPath) {
}
#if !IS_AROS
#if !USES_DEVICE_PATH
void cUnixFSServices::Stat( const TSTRING& strName, cFSStatArgs &stat ) const throw(eFSServices)
{
#else
void cUnixFSServices::Stat( const TSTRING& strNameC, cFSStatArgs& stat) const throw(eFSServices)
{
TSTRING strName = cArosPath::AsNative(strNameC);
TSTRING strName = cDevicePath::AsNative(strNameC);
#endif
//local variable for obtaining info on file.
struct stat statbuf;

View File

@ -6,11 +6,11 @@ noinst_LIBRARIES = libdb.a
libdb_adir=.
libdb_a_SOURCES = \
blockfile.cpp blockrecordarray.cpp blockrecordfile.cpp \
db.cpp hierdatabase.cpp hierdbpath.cpp stddb.cpp
db.cpp dberrors.cpp hierdatabase.cpp hierdbpath.cpp stddb.cpp
libdb_a_HEADERS = \
block.h blockfile.h blockrecordarray.h blockrecordfile.h \
db.h hierdatabase.h hierdbnode.h hierdbpath.h stddb.h
db.h dberrors.h hierdatabase.h hierdbnode.h hierdbpath.h stddb.h
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit

View File

@ -111,8 +111,8 @@ am__v_AR_1 =
libdb_a_AR = $(AR) $(ARFLAGS)
libdb_a_LIBADD =
am_libdb_a_OBJECTS = blockfile.$(OBJEXT) blockrecordarray.$(OBJEXT) \
blockrecordfile.$(OBJEXT) db.$(OBJEXT) hierdatabase.$(OBJEXT) \
hierdbpath.$(OBJEXT) stddb.$(OBJEXT)
blockrecordfile.$(OBJEXT) db.$(OBJEXT) dberrors.$(OBJEXT) \
hierdatabase.$(OBJEXT) hierdbpath.$(OBJEXT) stddb.$(OBJEXT)
libdb_a_OBJECTS = $(am_libdb_a_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@ -318,11 +318,11 @@ noinst_LIBRARIES = libdb.a
libdb_adir = .
libdb_a_SOURCES = \
blockfile.cpp blockrecordarray.cpp blockrecordfile.cpp \
db.cpp hierdatabase.cpp hierdbpath.cpp stddb.cpp
db.cpp dberrors.cpp hierdatabase.cpp hierdbpath.cpp stddb.cpp
libdb_a_HEADERS = \
block.h blockfile.h blockrecordarray.h blockrecordfile.h \
db.h hierdatabase.h hierdbnode.h hierdbpath.h stddb.h
db.h dberrors.h hierdatabase.h hierdbnode.h hierdbpath.h stddb.h
all: all-am

View File

@ -36,8 +36,7 @@
//
#include "stddb.h"
#include "core/errortable.h"
#include "dberrors.h"
#include "hierdatabase.h"
TSS_BEGIN_ERROR_REGISTRATION( db )

48
src/db/dberrors.h Normal file
View File

@ -0,0 +1,48 @@
//
// The developer of the original code and/or files is Tripwire, Inc.
// Portions created by Tripwire, Inc. are copyright (C) 2000 Tripwire,
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
// reserved.
//
// This program is free software. The contents of this file are subject
// to the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your
// option) any later version. You may redistribute it and/or modify it
// only in compliance with the GNU General Public License.
//
// This program is distributed in the hope that it will be useful.
// However, this program is distributed AS-IS WITHOUT ANY
// WARRANTY; INCLUDING THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
// FOR A PARTICULAR PURPOSE. Please see the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
//
// Nothing in the GNU General Public License or any other license to use
// the code or files shall permit you to use Tripwire's trademarks,
// service marks, or other intellectual property without Tripwire's
// prior written consent.
//
// If you have any questions, please contact Tripwire, Inc. at either
// info@tripwire.org or www.tripwire.org.
//
//
// Name....: dberrors.h
// Date....: 5/17/99
// Creator.: Matthew Brinkley (brinkley)
//
//
#ifndef __DBERRORS_H
#define __DBERRORS_H
#include "core/errortable.h"
TSS_DECLARE_ERROR_REGISTRATION( db )
#endif//__DBERRORS_H

View File

@ -137,8 +137,8 @@ void cFSParserUtil::InterpretFCOName( const std::list<TSTRING>& l, cFCOName& nam
for( std::list<TSTRING>::const_iterator i = l.begin(); i != l.end(); i++ )
strT += *i;
#if IS_AROS
strT = cArosPath::AsPosix(strT);
#if USES_DEVICE_PATH
strT = cDevicePath::AsPosix(strT);
#endif
// let cFCOName handle interpretation

View File

@ -56,7 +56,7 @@
#include <sys/time.h>
#include <sys/utsname.h>
#if !IS_SORTIX
#if HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

View File

@ -311,8 +311,8 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
// make sure it exists...
//
#if IS_AROS
temp_directory = cArosPath::AsNative(temp_directory);
#if USES_DEVICE_PATH
temp_directory = cDevicePath::AsNative(temp_directory);
#endif
if (access(temp_directory.c_str(), F_OK) != 0) {