diff --git a/config.h.in b/config.h.in index 191cef8..46e179d 100644 --- a/config.h.in +++ b/config.h.in @@ -87,6 +87,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H diff --git a/configure b/configure index 136b3ad..b52f923 100755 --- a/configure +++ b/configure @@ -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 @@ -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; diff --git a/configure.ac b/configure.ac index 18944a8..074a52d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 #include @@ -388,6 +391,7 @@ int main(void) break; ], [] ) + fi if test ! -z "$found_crypto" ; then break; diff --git a/contrib/twpolmake.pl b/contrib/twpolmake.pl new file mode 100755 index 0000000..d397d9c --- /dev/null +++ b/contrib/twpolmake.pl @@ -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 () { + 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) ; diff --git a/src/core/file.h b/src/core/file.h index a98f099..1964e31 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -143,8 +143,8 @@ public: }; -#if IS_AROS -class cArosPath +#if USES_DEVICE_PATH +class cDevicePath { public: static TSTRING AsPosix(const TSTRING& in); diff --git a/src/core/file_unix.cpp b/src/core/file_unix.cpp index c5f6b3c..af38c84 100644 --- a/src/core/file_unix.cpp +++ b/src/core/file_unix.cpp @@ -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= 8) + out.append(in.substr(7)); + + return out; + +#elif IS_AROS + int x = 1; + for ( x; in[x] == '/' && x &v, bool bFullPaths) const throw(eFSServices) { #else void cUnixFSServices::ReadDir(const TSTRING& strFilenameC, std::vector& 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; diff --git a/src/db/Makefile.am b/src/db/Makefile.am index 242c1ac..3488413 100644 --- a/src/db/Makefile.am +++ b/src/db/Makefile.am @@ -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 diff --git a/src/db/Makefile.in b/src/db/Makefile.in index 6034fa3..4458f4a 100644 --- a/src/db/Makefile.in +++ b/src/db/Makefile.in @@ -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 diff --git a/src/db/dberrors.cpp b/src/db/dberrors.cpp index 822159e..4b2d2ed 100644 --- a/src/db/dberrors.cpp +++ b/src/db/dberrors.cpp @@ -36,8 +36,7 @@ // #include "stddb.h" -#include "core/errortable.h" - +#include "dberrors.h" #include "hierdatabase.h" TSS_BEGIN_ERROR_REGISTRATION( db ) diff --git a/src/db/dberrors.h b/src/db/dberrors.h new file mode 100644 index 0000000..b4c876d --- /dev/null +++ b/src/db/dberrors.h @@ -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 + diff --git a/src/fs/fsparserutil.cpp b/src/fs/fsparserutil.cpp index 5ca28ea..c20ed44 100644 --- a/src/fs/fsparserutil.cpp +++ b/src/fs/fsparserutil.cpp @@ -137,8 +137,8 @@ void cFSParserUtil::InterpretFCOName( const std::list& l, cFCOName& nam for( std::list::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 diff --git a/src/tripwire/smtpmailmessage.cpp b/src/tripwire/smtpmailmessage.cpp index 472b098..046735c 100644 --- a/src/tripwire/smtpmailmessage.cpp +++ b/src/tripwire/smtpmailmessage.cpp @@ -56,7 +56,7 @@ #include #include -#if !IS_SORTIX +#if HAVE_SYS_SELECT_H # include #endif diff --git a/src/tripwire/twcmdline.cpp b/src/tripwire/twcmdline.cpp index a5d048b..68f6308 100644 --- a/src/tripwire/twcmdline.cpp +++ b/src/tripwire/twcmdline.cpp @@ -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) {