Merge branch 'dev/next' of https://github.com/Tripwire/tripwire-open-source into dev/next
This commit is contained in:
commit
159e735ebc
|
@ -3,7 +3,6 @@ config.h
|
|||
config.h.in~
|
||||
config.log
|
||||
config.status
|
||||
compile
|
||||
autom4te.cache/
|
||||
bin/
|
||||
lib/
|
||||
|
@ -21,6 +20,9 @@ src/test-harness/twtest
|
|||
**/*.dll
|
||||
**/*.exe
|
||||
**/*~
|
||||
**/*#
|
||||
**/*.bak
|
||||
**/.DS_Store
|
||||
**/*.gcno
|
||||
**/*.gcda
|
||||
releases/
|
||||
|
|
|
@ -17,3 +17,9 @@ check:
|
|||
rm -Rf $(top_srcdir)/bin/TWTestData
|
||||
cd $(top_srcdir)/src/test-harness && perl ./twtest.pl
|
||||
cd $(top_srcdir)/bin && ./twtest all
|
||||
|
||||
test: check
|
||||
|
||||
.PHONY: targets
|
||||
targets:
|
||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
||||
|
|
|
@ -813,6 +813,12 @@ check:
|
|||
cd $(top_srcdir)/src/test-harness && perl ./twtest.pl
|
||||
cd $(top_srcdir)/bin && ./twtest all
|
||||
|
||||
test: check
|
||||
|
||||
.PHONY: targets
|
||||
targets:
|
||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -0,0 +1,348 @@
|
|||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2016-01-11.22; # UTC
|
||||
|
||||
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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, 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
15
config.h.in
15
config.h.in
|
@ -6,6 +6,9 @@
|
|||
/* Compile with debug code */
|
||||
#undef DEBUG
|
||||
|
||||
/* Enable use of /dev/urandom */
|
||||
#undef ENABLE_DEV_URANDOM
|
||||
|
||||
/* this is the prefix for STL exception functions */
|
||||
#undef EXCEPTION_NAMESPACE
|
||||
|
||||
|
@ -24,6 +27,12 @@
|
|||
/* Has /dev/urandom */
|
||||
#undef HAVE_DEV_URANDOM
|
||||
|
||||
/* Define to 1 if you have the `door_create' function. */
|
||||
#undef HAVE_DOOR_CREATE
|
||||
|
||||
/* Define to 1 if you have the <door.h> header file. */
|
||||
#undef HAVE_DOOR_H
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
|
@ -63,6 +72,12 @@
|
|||
/* Define to 1 if you have the <openssl/sha.h> header file. */
|
||||
#undef HAVE_OPENSSL_SHA_H
|
||||
|
||||
/* Define to 1 if you have the `port_create' function. */
|
||||
#undef HAVE_PORT_CREATE
|
||||
|
||||
/* Define to 1 if you have the <port.h> header file. */
|
||||
#undef HAVE_PORT_H
|
||||
|
||||
/* Define to 1 if you have the `posix_fadvise' function. */
|
||||
#undef HAVE_POSIX_FADVISE
|
||||
|
||||
|
|
|
@ -750,6 +750,9 @@ enable_silent_rules
|
|||
enable_extrawarnings
|
||||
enable_static
|
||||
enable_debug
|
||||
enable_coverage
|
||||
enable_profiling
|
||||
enable_urandom
|
||||
enable_dependency_tracking
|
||||
enable_commoncrypto
|
||||
enable_iconv
|
||||
|
@ -1395,6 +1398,9 @@ Optional Features:
|
|||
—-disable-extrawarnings do not compile with -Wextra warnings enabled
|
||||
--enable-static compile static binaries
|
||||
--enable-debug compile with debuging enabled
|
||||
--enable-coverage enable code coverage
|
||||
--enable-profiling enable profiling
|
||||
--enable-urandom use /dev/urandom
|
||||
--enable-dependency-tracking
|
||||
do not reject slow dependency extractors
|
||||
--disable-dependency-tracking
|
||||
|
@ -3497,6 +3503,42 @@ $as_echo "#define NDEBUG 1" >>confdefs.h
|
|||
|
||||
fi
|
||||
|
||||
# Check whether --enable-coverage was given.
|
||||
if test "${enable_coverage+set}" = set; then :
|
||||
enableval=$enable_coverage;
|
||||
fi
|
||||
|
||||
if test "x$enable_coverage" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} --coverage"
|
||||
CXXFLAGS="${CXXFLAGS} --coverage"
|
||||
LDFLAGS="${LDFLAGS} --coverage"
|
||||
fi
|
||||
|
||||
# Check whether --enable-profiling was given.
|
||||
if test "${enable_profiling+set}" = set; then :
|
||||
enableval=$enable_profiling;
|
||||
fi
|
||||
|
||||
if test "x$enable_profiling" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} -pg"
|
||||
CXXFLAGS="${CXXFLAGS} -pg"
|
||||
LDFLAGS="${LDFLAGS} -pg"
|
||||
fi
|
||||
|
||||
# Check whether --enable-urandom was given.
|
||||
if test "${enable_urandom+set}" = set; then :
|
||||
enableval=$enable_urandom;
|
||||
fi
|
||||
|
||||
if test "x$enable_urandom" = xyes
|
||||
then
|
||||
|
||||
$as_echo "#define ENABLE_DEV_URANDOM 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
|
@ -6186,6 +6228,52 @@ done
|
|||
|
||||
fi
|
||||
|
||||
for ac_header in door.h
|
||||
do :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "door.h" "ac_cv_header_door_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_door_h" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_DOOR_H 1
|
||||
_ACEOF
|
||||
for ac_func in door_create
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "door_create" "ac_cv_func_door_create"
|
||||
if test "x$ac_cv_func_door_create" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_DOOR_CREATE 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
for ac_header in port.h
|
||||
do :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_port_h" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_PORT_H 1
|
||||
_ACEOF
|
||||
for ac_func in port_create
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "port_create" "ac_cv_func_port_create"
|
||||
if test "x$ac_cv_func_port_create" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_PORT_CREATE 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
|
||||
if test -c "/dev/random"; then
|
||||
|
||||
|
|
28
configure.ac
28
configure.ac
|
@ -44,6 +44,28 @@ else
|
|||
AC_DEFINE(NDEBUG, 1, [Compile without debug code])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage])
|
||||
if test "x$enable_coverage" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} --coverage"
|
||||
CXXFLAGS="${CXXFLAGS} --coverage"
|
||||
LDFLAGS="${LDFLAGS} --coverage"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling])
|
||||
if test "x$enable_profiling" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} -pg"
|
||||
CXXFLAGS="${CXXFLAGS} -pg"
|
||||
LDFLAGS="${LDFLAGS} -pg"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(urandom, [ --enable-urandom use /dev/urandom])
|
||||
if test "x$enable_urandom" = xyes
|
||||
then
|
||||
AC_DEFINE(ENABLE_DEV_URANDOM, 1, [Enable use of /dev/urandom])
|
||||
fi
|
||||
|
||||
dnl ###################
|
||||
dnl Checks for programs
|
||||
dnl ###################
|
||||
|
@ -134,6 +156,12 @@ then
|
|||
AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
|
||||
fi
|
||||
|
||||
dnl check for door support (Solaris)
|
||||
AC_CHECK_HEADERS(door.h, [AC_CHECK_FUNCS(door_create)])
|
||||
|
||||
dnl check for event port support (Solaris)
|
||||
AC_CHECK_HEADERS(port.h, [AC_CHECK_FUNCS(port_create)])
|
||||
|
||||
dnl ##############################################
|
||||
dnl check for various RNG/PRNG devices
|
||||
dnl ##############################################
|
||||
|
|
|
@ -28,7 +28,7 @@ fi
|
|||
## The usage message.
|
||||
##-------------------------------------------------------
|
||||
|
||||
USAGE="install.sh [<configfile>] [-n] [-f] [-s <sitepassphrase>] [-l <localpassphrase>]"
|
||||
USAGE="install.sh [<configfile>] [-n] [-f] [-s <sitepassphrase>] [-l <localpassphrase>] [-d <installdir>]"
|
||||
|
||||
##-------------------------------------------------------
|
||||
## Figure out how to do an echo without newline.
|
||||
|
@ -104,8 +104,10 @@ fi
|
|||
## Miscellaneous configuration parameters.
|
||||
##-------------------------------------------------------
|
||||
|
||||
# prefix
|
||||
prefix="${prefix:=/usr}"
|
||||
# set a few location variables if caller didn't pass them to us
|
||||
prefix="${prefix:=/usr/local}"
|
||||
sysconfdir="${sysconfdir:=/usr/local/etc}"
|
||||
path_to_vi="${path_to_vi:=/usr/bin/vi}"
|
||||
|
||||
# License File name
|
||||
TWLICENSEFILE="COPYING"
|
||||
|
@ -178,6 +180,13 @@ while [ "x$1" != "x" ] ; do
|
|||
exit 1 ;;
|
||||
*) TW_LOCAL_PASS="$2"; shift ;;
|
||||
esac ;;
|
||||
-d) case "$2" in
|
||||
"" | -*)
|
||||
echo "Error: missing install dir with -d option." 1>&2
|
||||
echo "$USAGE"
|
||||
exit 1 ;;
|
||||
*) prefix="$2"; sysconfdir="$2/bin"; shift ;;
|
||||
esac ;;
|
||||
-*) echo "Error: unknown argument $1" 1>&2
|
||||
echo "$USAGE"
|
||||
exit 1 ;;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -d ./lcov ]; then
|
||||
rm -Rf ./lcov
|
||||
fi
|
||||
|
||||
if [ -e ./lcov.dat ]; then
|
||||
rm ./lcov.dat
|
||||
fi
|
||||
|
||||
if [ -e ./lcov.tgz ]; then
|
||||
rm ./lcov.tgz
|
||||
fi
|
||||
|
||||
lcov --capture --directory src --output-file ./lcov.dat
|
||||
genhtml ./lcov.dat --output-directory lcov
|
||||
tar -zcvf lcov.tgz lcov
|
||||
|
|
@ -8,3 +8,7 @@ install:
|
|||
uninstall:
|
||||
true
|
||||
|
||||
clean-local: clean-local-check
|
||||
.PHONY: clean-local-check
|
||||
clean-local-check:
|
||||
-rm -rf test-harness/twtest
|
|
@ -519,7 +519,7 @@ maintainer-clean-generic:
|
|||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
clean-am: clean-generic clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f Makefile
|
||||
|
@ -586,16 +586,17 @@ uninstall-am:
|
|||
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
|
||||
check-am clean clean-generic cscopelist-am ctags ctags-am \
|
||||
distclean distclean-generic distclean-tags distdir dvi dvi-am \
|
||||
html html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am tags tags-am uninstall uninstall-am
|
||||
check-am clean clean-generic clean-local cscopelist-am ctags \
|
||||
ctags-am distclean distclean-generic distclean-tags distdir \
|
||||
dvi dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs installdirs-am \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
@ -606,6 +607,11 @@ install:
|
|||
uninstall:
|
||||
true
|
||||
|
||||
clean-local: clean-local-check
|
||||
.PHONY: clean-local-check
|
||||
clean-local-check:
|
||||
-rm -rf test-harness/twtest
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -35,6 +35,7 @@ libcore_a_LIBADD = @CORE_CRYPT_O@
|
|||
libcore_a_DEPENDENCIES = @CORE_CRYPT_O@
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libcore_a_OBJECTS) $(libcore_a_LIBADD)
|
||||
|
|
|
@ -358,6 +358,7 @@ libcore_a_HEADERS = archive.h charutil.h cmdlineparser.h codeconvert.h \
|
|||
|
||||
libcore_a_LIBADD = @CORE_CRYPT_O@
|
||||
libcore_a_DEPENDENCIES = @CORE_CRYPT_O@
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -544,6 +545,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -111,6 +111,12 @@ iCodeConverter* iCodeConverter::GetInstance()
|
|||
return m_pInst;
|
||||
}
|
||||
|
||||
void iCodeConverter::Finit()
|
||||
{
|
||||
delete m_pInst;
|
||||
m_pInst = 0;
|
||||
}
|
||||
|
||||
iCodeConverter* iCodeConverter::CreateConverter()
|
||||
{
|
||||
cDebug d("iCodeConverter::CreateConverter()");
|
||||
|
|
|
@ -93,6 +93,8 @@ class iCodeConverter
|
|||
public:
|
||||
|
||||
static iCodeConverter* GetInstance(); // Singleton
|
||||
static void Finit();
|
||||
|
||||
|
||||
|
||||
/// Subclass Responsibilities
|
||||
|
|
|
@ -60,5 +60,8 @@ cCore::cCore()
|
|||
iCodeConverter::GetInstance();
|
||||
}
|
||||
|
||||
|
||||
cCore::~cCore()
|
||||
{
|
||||
iCodeConverter::Finit();
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ TSS_BeginPackage( cCore )
|
|||
public:
|
||||
|
||||
cCore();
|
||||
~cCore();
|
||||
|
||||
TSS_EndPackage( cCore )
|
||||
|
||||
|
|
|
@ -254,10 +254,14 @@ inline void cHashTableIter<KEY_TYPE, VAL_TYPE, COMPARE_OP, CONVERTER>::SeekNextV
|
|||
{
|
||||
if(mpCurNode)
|
||||
mpCurNode = mpCurNode->next;
|
||||
//mCurIndex++;
|
||||
while((! mpCurNode) && (mCurIndex < mHashTable.mTableSize))
|
||||
|
||||
// if we're out of range, bail out w/o incrementing index
|
||||
if(mCurIndex >= mHashTable.mTableSize)
|
||||
return;
|
||||
|
||||
while((! mpCurNode) && (++mCurIndex < mHashTable.mTableSize))
|
||||
{
|
||||
mpCurNode = mHashTable.mTable[++mCurIndex];
|
||||
mpCurNode = mHashTable.mTable[mCurIndex];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#if defined(HAVE_MALLOC_H)
|
||||
#if HAVE_MALLOC_H && !IS_AROS
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
|
|
@ -320,6 +320,8 @@
|
|||
// which uses this syntax for UNC paths. So we'll allow leading double slashes there, but
|
||||
// continue removing them on all other platforms
|
||||
|
||||
#define USE_DEV_URANDOM (HAVE_DEV_URANDOM && ENABLE_DEV_URANDOM)
|
||||
|
||||
//=============================================================================
|
||||
// Miscellaneous
|
||||
//
|
||||
|
|
|
@ -365,10 +365,12 @@ void cUnixFSServices::Stat( const TSTRING& strNameC, cFSStatArgs& stat) const
|
|||
#ifdef S_ISSOCK
|
||||
else if(S_ISSOCK(statbuf.st_mode)) stat.mFileType = cFSStatArgs::TY_SOCK;
|
||||
#endif
|
||||
#ifdef S_IFDOOR
|
||||
|
||||
#if HAVE_DOOR_CREATE
|
||||
else if(S_ISDOOR(statbuf.st_mode)) stat.mFileType = cFSStatArgs::TY_DOOR;
|
||||
#endif
|
||||
#ifdef S_ISPORT
|
||||
|
||||
#if HAVE_PORT_CREATE
|
||||
else if(S_ISPORT(statbuf.st_mode)) stat.mFileType = cFSStatArgs::TY_PORT;
|
||||
#endif
|
||||
|
||||
|
@ -594,12 +596,14 @@ void cUnixFSServices::ConvertModeToString( uint64 perm, TSTRING& tstrPerm ) cons
|
|||
case S_IFLNK:
|
||||
szPerm[0] = _T('l');
|
||||
break;
|
||||
#ifdef S_IFDOOR
|
||||
|
||||
#if HAVE_DOOR_CREATE // Solaris doors
|
||||
case S_IFDOOR:
|
||||
szPerm[0] = _T('D');
|
||||
break;
|
||||
#endif
|
||||
#ifdef S_ISPORT
|
||||
|
||||
#if HAVE_PORT_CREATE // Solaris event ports
|
||||
case S_IFPORT:
|
||||
szPerm[0] = _T('P');
|
||||
break;
|
||||
|
|
|
@ -20,7 +20,7 @@ libcryptlib_a_HEADERS = \
|
|||
ztrees.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = ../../lib/libcryptlib.a
|
||||
CLEANFILES = ../../lib/libcryptlib.a *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(LN) -f $(noinst_LIBRARIES) ../../lib/libcryptlib.a
|
||||
|
|
|
@ -333,7 +333,7 @@ libcryptlib_a_HEADERS = \
|
|||
queue.h rng.h sha.h smartptr.h words.h zbits.h zdeflate.h zinflate.h \
|
||||
ztrees.h
|
||||
|
||||
CLEANFILES = ../../lib/libcryptlib.a
|
||||
CLEANFILES = ../../lib/libcryptlib.a *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
|
@ -13,6 +13,7 @@ libdb_a_HEADERS = \
|
|||
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
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libdb_a_OBJECTS)
|
||||
|
|
|
@ -324,6 +324,7 @@ libdb_a_HEADERS = \
|
|||
block.h blockfile.h blockrecordarray.h blockrecordfile.h \
|
||||
db.h dberrors.h hierdatabase.h hierdbnode.h hierdbpath.h stddb.h
|
||||
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -510,6 +511,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -27,6 +27,7 @@ libfco_a_HEADERS = \
|
|||
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libfco_a_OBJECTS)
|
||||
|
|
|
@ -345,6 +345,7 @@ libfco_a_HEADERS = \
|
|||
iterproxy.h parsergenreutil.h propset.h signature.h \
|
||||
stdfco.h twfactory.h
|
||||
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -531,6 +532,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -92,4 +92,10 @@ void cFCOSpecAttr::TraceContents(int dl) const
|
|||
}
|
||||
}
|
||||
|
||||
bool cFCOSpecAttr::operator==(const cFCOSpecAttr& rhs) const
|
||||
{
|
||||
return ( (mEmailAddrs == rhs.mEmailAddrs)
|
||||
&& (mName == rhs.mName)
|
||||
&& (mSeverity == rhs.mSeverity));
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ public:
|
|||
|
||||
void TraceContents(int dl = -1) const;
|
||||
|
||||
bool operator==(const cFCOSpecAttr& rhs) const;
|
||||
|
||||
DECLARE_SERREFCOUNT()
|
||||
private:
|
||||
cFCOSpecAttr (const cFCOSpecAttr& rhs); // not impl
|
||||
|
|
|
@ -17,6 +17,7 @@ libfs_a_HEADERS = \
|
|||
fsvisitor.h stdfs.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libfs_a_OBJECTS)
|
||||
|
|
|
@ -331,6 +331,7 @@ libfs_a_HEADERS = \
|
|||
fspropcalc.h fspropdisplayer.h fspropset.h fsstrings.h \
|
||||
fsvisitor.h stdfs.h
|
||||
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -517,6 +518,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -76,7 +76,12 @@ iFCOSpec* cFSFactory::CreateSpec(const TSTRING& name, iFCOSpecHelper* pHelper) c
|
|||
|
||||
iFCOPropDisplayer* cFSFactory::CreatePropDisplayer() const
|
||||
{
|
||||
return new cFSPropDisplayer();
|
||||
static iFCOPropDisplayer* gPropDisplayer = 0;
|
||||
|
||||
if (!gPropDisplayer)
|
||||
gPropDisplayer = new cFSPropDisplayer();
|
||||
|
||||
return gPropDisplayer;
|
||||
}
|
||||
|
||||
iSerRefCountObj::CreateFunc cFSFactory::GetCreateFunc() const
|
||||
|
|
|
@ -509,4 +509,9 @@ bool cFSPropDisplayer::AddGroupnameMapping( const int64& i64gid, const TSTRING&
|
|||
return( ret.second = false ); // returns true if key didn't exist before
|
||||
}
|
||||
|
||||
|
||||
bool cFSPropDisplayer::operator==(const cFSPropDisplayer& rhs) const
|
||||
{
|
||||
return (mpvPropsWeDisplay == rhs.mpvPropsWeDisplay
|
||||
&& uidToUsername == rhs.uidToUsername
|
||||
&& gidToGroupname == rhs.gidToGroupname);
|
||||
}
|
||||
|
|
|
@ -114,6 +114,9 @@ public:
|
|||
virtual bool GetLazy() const;
|
||||
virtual void Read (iSerializer* pSerializer, int32 version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Write(iSerializer* pSerializer) const; // throw (eSerializer, eArchive)
|
||||
|
||||
bool operator==(const cFSPropDisplayer& rhs) const; // for testing
|
||||
|
||||
private:
|
||||
void AddMapping( const iFCOProp* const pProp, const TSTRING& tstrValue, const int propTypeEnum );
|
||||
// pass in a property value and its string representation. for instance: ( FS::PROP_UID --> username )
|
||||
|
|
|
@ -16,7 +16,7 @@ siggen_HEADERS = \
|
|||
siggen.h siggencmdline.h siggenstrings.h stdsiggen.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = ../../bin/siggen
|
||||
CLEANFILES = ../../bin/siggen *.gcno *.gcda
|
||||
|
||||
all: $(sbin_PROGRAMS)
|
||||
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin
|
||||
|
|
|
@ -318,7 +318,7 @@ siggen_SOURCES = \
|
|||
siggen_HEADERS = \
|
||||
siggen.h siggencmdline.h siggenstrings.h stdsiggen.h
|
||||
|
||||
CLEANFILES = ../../bin/siggen
|
||||
CLEANFILES = ../../bin/siggen *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
|
@ -28,39 +28,46 @@ sub initialize() {
|
|||
#
|
||||
sub run() {
|
||||
|
||||
my $twpassed = 1;
|
||||
my $twpassed = 1;
|
||||
|
||||
twtools::logStatus("*** Beginning $description\n");
|
||||
printf("%-30s", "-- $description");
|
||||
twtools::logStatus("*** Beginning $description\n");
|
||||
printf("%-30s", "-- $description");
|
||||
|
||||
# lets see if the system 'cksum' agree's with siggen's crc32 value
|
||||
#
|
||||
my ($crc32, undef) = split(/ /, `cksum $twtools::twrootdir/test`);
|
||||
my $siggen = `$twtools::twrootdir/bin/siggen -h -t -C $twtools::twrootdir/test`;
|
||||
# lets see if the system 'cksum' agree's with siggen's crc32 value
|
||||
#
|
||||
my ($crc32, undef) = split(/ /, `cksum $twtools::twrootdir/test`);
|
||||
|
||||
chomp $crc32;
|
||||
chomp $siggen;
|
||||
if ($crc32 eq "") {
|
||||
++$twtools::twskippedtests;
|
||||
print "SKIPPED\n";
|
||||
return;
|
||||
}
|
||||
|
||||
# cksum issues results in decimal, so get siggen's result in base10.
|
||||
$siggen = hex($siggen);
|
||||
my $siggen = `$twtools::twrootdir/bin/siggen -h -t -C $twtools::twrootdir/test`;
|
||||
|
||||
twtools::logStatus(" cksum reports: $crc32\n");
|
||||
twtools::logStatus("siggen reports: $siggen\n");
|
||||
chomp $crc32;
|
||||
chomp $siggen;
|
||||
|
||||
$twpassed = ($crc32 eq $siggen);
|
||||
# cksum issues results in decimal, so get siggen's result in base10.
|
||||
$siggen = hex($siggen);
|
||||
|
||||
#########################################################
|
||||
#
|
||||
# See if the tests all succeeded...
|
||||
#
|
||||
if ($twpassed) {
|
||||
twtools::logStatus(" cksum reports: $crc32\n");
|
||||
twtools::logStatus("siggen reports: $siggen\n");
|
||||
|
||||
$twpassed = ($crc32 eq $siggen);
|
||||
|
||||
#########################################################
|
||||
#
|
||||
# See if the tests all succeeded...
|
||||
#
|
||||
if ($twpassed) {
|
||||
print "PASSED\n";
|
||||
++$twtools::twpassedtests;
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
++$twtools::twfailedtests;
|
||||
print "*FAILED*\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,12 +35,12 @@ sub PolicyFileString
|
|||
#
|
||||
(rulename="RuleA", severity=30, emailto="elvis@mars")
|
||||
{
|
||||
$root -> \$(ReadOnly)+S; #read only plus SHA-1
|
||||
$root -> \$(ReadOnly) +S -ab; #read only plus SHA-1 minus atime & blocks
|
||||
}
|
||||
|
||||
(rulename="RuleB", severity=200, emailto="elvis@mars")
|
||||
{
|
||||
$root2 -> \$(ReadOnly)+S; #read only plus SHA-1
|
||||
$root2 -> \$(ReadOnly) +S -ab; #read only plus SHA-1 minus atime & blocks
|
||||
}
|
||||
|
||||
POLICY_END
|
||||
|
|
|
@ -31,8 +31,8 @@ sub PolicyFileString
|
|||
return <<POLICY_END;
|
||||
# Policy file generated by polupdate test
|
||||
#
|
||||
$root1 -> \$(ReadOnly)+M; #read only plus MD5
|
||||
$root2 -> \$(ReadOnly)+M; #read only plus MD5
|
||||
$root1 -> \$(ReadOnly) +M -ab; #read only plus MD5 minus atime & blocks
|
||||
$root2 -> \$(ReadOnly) +M -ab; #read only plus MD5 minus atime & blocks
|
||||
|
||||
POLICY_END
|
||||
|
||||
|
@ -46,8 +46,8 @@ sub PolicyFileStringNew
|
|||
return <<POLICY_END;
|
||||
# Policy file generated by polupdate test
|
||||
#
|
||||
$root1 -> \$(ReadOnly)+S; #read only plus SHA1
|
||||
$root3 -> \$(ReadOnly)+S; #read only plus SHA1
|
||||
$root1 -> \$(ReadOnly) +S -ab; #read only plus SHA1 minus atime & blocks
|
||||
$root3 -> \$(ReadOnly) +S -ab; #read only plus SHA1 minus atime & blocks
|
||||
|
||||
POLICY_END
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ BEGIN {
|
|||
EMAILREPORTLEVEL => '3',
|
||||
REPORTLEVEL => '3',
|
||||
MAILMETHOD => 'SENDMAIL',
|
||||
SYSLOGREPORTING => 'false',
|
||||
SYSLOGREPORTING => 'true',
|
||||
MAILPROGRAM => 'cat',
|
||||
MAILFROMADDRESS => 'taz@cat'
|
||||
);
|
||||
|
@ -221,7 +221,7 @@ sub PrintPolicy {
|
|||
|
||||
my (@out) = `$twrootdir/bin/twadmin -m p -c $twrootdir/$twcfgloc -p $twrootdir/$twpolfileloc -S $twrootdir/$twsitekeyloc $params{opts} 2>&1`;
|
||||
|
||||
my ($result) = ${^CHILD_ERROR_NATIVE};
|
||||
my ($result) = $?;
|
||||
|
||||
logStatus(@out);
|
||||
|
||||
|
@ -239,7 +239,7 @@ sub PrintConfig {
|
|||
logStatus "printing config file...\n";
|
||||
my (@out) = `$twrootdir/bin/twadmin -m f -c $twrootdir/$twcfgloc $params{opts} 2>&1`;
|
||||
|
||||
my ($result) = ${^CHILD_ERROR_NATIVE};
|
||||
my ($result) = $?;
|
||||
|
||||
logStatus(@out);
|
||||
|
||||
|
@ -275,7 +275,7 @@ sub GeneratePolicyFile {
|
|||
|
||||
my (@out) = `$twrootdir/bin/twadmin -m P -c $twrootdir/$twcfgloc -Q $twsitepass -p $twrootdir/$twpolfileloc $twrootdir/$twpolicyloc 2>&1`;
|
||||
|
||||
my ($result) = ${^CHILD_ERROR_NATIVE};
|
||||
my ($result) = $?;
|
||||
|
||||
logStatus(@out);
|
||||
|
||||
|
@ -297,7 +297,7 @@ sub CreatePolicy {
|
|||
|
||||
my (@out) = `$twrootdir/bin/twadmin -m P -c $twrootdir/$twcfgloc -Q $twsitepass -p $twrootdir/$twpolfileloc $params{policy-text} 2>&1`;
|
||||
|
||||
my ($result) = ${^CHILD_ERROR_NATIVE};
|
||||
my ($result) = $?;
|
||||
|
||||
logStatus(@out);
|
||||
|
||||
|
@ -315,7 +315,7 @@ sub InitializeDatabase {
|
|||
print "initializing database for '$twmsg' test...\n" if $verbose;
|
||||
my (@out) = `$twrootdir/bin/tripwire -m i -P $twsitepass -p $twrootdir/$twpolfileloc -c $twrootdir/$twcfgloc 2>&1`;
|
||||
|
||||
my ($result) = ${^CHILD_ERROR_NATIVE};
|
||||
my ($result) = $?;
|
||||
|
||||
logStatus(@out);
|
||||
|
||||
|
@ -335,7 +335,7 @@ sub UpdateDatabase {
|
|||
print "updating database for '$twmsg' test...\n" if $verbose;
|
||||
my (@out) = `$twrootdir/bin/tripwire -m u -a -P $twsitepass -Z $params{secure-mode} -p $twrootdir/$twpolfileloc -c $twrootdir/$twcfgloc -r $params{report} 2>&1`;
|
||||
|
||||
my ($result) = ${^CHILD_ERROR_NATIVE};
|
||||
my ($result) = $?;
|
||||
|
||||
logStatus(@out);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ tripwire_HEADERS = \
|
|||
tripwirestrings.h tripwireutil.h twcmdline.h twcmdlineutil.h updatedb.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = ../../bin/tripwire ../../lib/libtripwire.a
|
||||
CLEANFILES = ../../bin/tripwire ../../lib/libtripwire.a *.gcno *.gcda
|
||||
|
||||
all: $(sbin_PROGRAMS)
|
||||
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin
|
||||
|
|
|
@ -326,7 +326,7 @@ tripwire_HEADERS = \
|
|||
stdtripwire.h syslog_trip.h tripwire.h tripwireerrors.h tripwiremsg.h \
|
||||
tripwirestrings.h tripwireutil.h twcmdline.h twcmdlineutil.h updatedb.h
|
||||
|
||||
CLEANFILES = ../../bin/tripwire ../../lib/libtripwire.a
|
||||
CLEANFILES = ../../bin/tripwire ../../lib/libtripwire.a *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
|
@ -254,52 +254,66 @@ static void InitCmdLineCommon(cCmdLineParser& parser)
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
|
||||
{
|
||||
TSTRING str;
|
||||
if(cf.Lookup(TSTRING(_T("POLFILE")), str))
|
||||
pModeInfo->mPolFile = str;
|
||||
if(cf.Lookup(TSTRING(_T("DBFILE")), str))
|
||||
pModeInfo->mDbFile = str;
|
||||
if(cf.Lookup(TSTRING(_T("SITEKEYFILE")), str))
|
||||
pModeInfo->mSiteKeyFile = str;
|
||||
if(cf.Lookup(TSTRING(_T("LOCALKEYFILE")), str))
|
||||
pModeInfo->mLocalKeyFile = str;
|
||||
if(cf.Lookup(TSTRING(_T("REPORTFILE")), str))
|
||||
pModeInfo->mReportFile = str;
|
||||
if(cf.Lookup(TSTRING(_T("EDITOR")), str))
|
||||
pModeInfo->mEditor = str;
|
||||
if(cf.Lookup(TSTRING(_T("LATEPROMPTING")), str))
|
||||
TSTRING str;
|
||||
if(cf.Lookup(TSTRING(_T("POLFILE")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mbLatePassphrase = true;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("RESETACCESSTIME")), str))
|
||||
{
|
||||
// We do not support reset access time on Unix, so we issue a warning.
|
||||
// This used to be a fatal error, however this prevents
|
||||
// cross platform config files.
|
||||
cTWUtil::PrintErrorMsg(eTWInvalidConfigFileKey(_T("RESETACCESSTIME"), eError::NON_FATAL));
|
||||
pModeInfo->mPolFile = str;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("LOOSEDIRECTORYCHECKING")), str))
|
||||
if(cf.Lookup(TSTRING(_T("DBFILE")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mfLooseDirs = true;
|
||||
pModeInfo->mDbFile = str;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("SITEKEYFILE")), str))
|
||||
{
|
||||
pModeInfo->mSiteKeyFile = str;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("LOCALKEYFILE")), str))
|
||||
{
|
||||
pModeInfo->mLocalKeyFile = str;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("REPORTFILE")), str))
|
||||
{
|
||||
pModeInfo->mReportFile = str;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("EDITOR")), str))
|
||||
{
|
||||
pModeInfo->mEditor = str;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("LATEPROMPTING")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mbLatePassphrase = true;
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("RESETACCESSTIME")), str))
|
||||
{
|
||||
// We do not support reset access time on Unix, so we issue a warning.
|
||||
// This used to be a fatal error, however this prevents
|
||||
// cross platform config files.
|
||||
cTWUtil::PrintErrorMsg(eTWInvalidConfigFileKey(_T("RESETACCESSTIME"), eError::NON_FATAL));
|
||||
}
|
||||
if(cf.Lookup(TSTRING(_T("LOOSEDIRECTORYCHECKING")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mfLooseDirs = true;
|
||||
}
|
||||
|
||||
TSTRING temp_directory;
|
||||
cf.Lookup(TSTRING(_T("TEMPDIRECTORY")), temp_directory);
|
||||
TSTRING temp_directory;
|
||||
cf.Lookup(TSTRING(_T("TEMPDIRECTORY")), temp_directory);
|
||||
|
||||
if (temp_directory.length() == 0) {
|
||||
if (temp_directory.empty())
|
||||
{
|
||||
#if IS_AROS
|
||||
temp_directory = "T:";
|
||||
temp_directory = "T:";
|
||||
#else
|
||||
temp_directory = "/tmp/";
|
||||
temp_directory = "/tmp/";
|
||||
#endif
|
||||
}
|
||||
|
||||
// make sure we have a trailing slash -- thanks Jarno...
|
||||
//
|
||||
if (temp_directory[_tcslen(str.c_str())-1] != '/') {
|
||||
temp_directory += '/';
|
||||
if (*temp_directory.rbegin() != '/')
|
||||
{
|
||||
temp_directory.push_back('/');
|
||||
}
|
||||
// make sure it exists...
|
||||
//
|
||||
|
@ -308,41 +322,43 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
|
|||
temp_directory = cDevicePath::AsNative(temp_directory);
|
||||
#endif
|
||||
|
||||
if (access(temp_directory.c_str(), F_OK) != 0) {
|
||||
TSTRING errStr = TSS_GetString( cCore, core::STR_BAD_TEMPDIRECTORY );
|
||||
TSTRING tmpStr = _T("Directory: ");
|
||||
tmpStr += (temp_directory + _T("\n"));
|
||||
tmpStr += errStr;
|
||||
throw eTWInvalidTempDirectory(tmpStr);
|
||||
}
|
||||
else {
|
||||
iFSServices::GetInstance()->SetTempDirName(temp_directory);
|
||||
}
|
||||
|
||||
|
||||
if (cf.Lookup(TSTRING(_T("GLOBALEMAIL")), str)) {
|
||||
|
||||
if (str.length() != 0)
|
||||
pModeInfo->mGlobalEmail = str;
|
||||
}
|
||||
|
||||
//
|
||||
// Set the report-viewing level if one has been specified, use
|
||||
// default level otherwise.
|
||||
//
|
||||
if(cf.Lookup(TSTRING(_T("EMAILREPORTLEVEL")), str))
|
||||
if (access(temp_directory.c_str(), F_OK) != 0)
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("0")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::SINGLE_LINE;
|
||||
else if (_tcsicmp(str.c_str(), _T("1")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::PARSEABLE;
|
||||
else if (_tcsicmp(str.c_str(), _T("2")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::SUMMARY_ONLY;
|
||||
else if (_tcsicmp(str.c_str(), _T("3")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::CONCISE_REPORT;
|
||||
else if (_tcsicmp(str.c_str(), _T("4")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::FULL_REPORT;
|
||||
else
|
||||
TSTRING errStr = TSS_GetString( cCore, core::STR_BAD_TEMPDIRECTORY );
|
||||
TSTRING tmpStr = _T("Directory: ");
|
||||
tmpStr += (temp_directory + _T("\n"));
|
||||
tmpStr += errStr;
|
||||
throw eTWInvalidTempDirectory(tmpStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
iFSServices::GetInstance()->SetTempDirName(temp_directory);
|
||||
}
|
||||
|
||||
|
||||
if (cf.Lookup(TSTRING(_T("GLOBALEMAIL")), str))
|
||||
{
|
||||
if (str.length() != 0)
|
||||
pModeInfo->mGlobalEmail = str;
|
||||
}
|
||||
|
||||
//
|
||||
// Set the report-viewing level if one has been specified, use
|
||||
// default level otherwise.
|
||||
//
|
||||
if(cf.Lookup(TSTRING(_T("EMAILREPORTLEVEL")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("0")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::SINGLE_LINE;
|
||||
else if (_tcsicmp(str.c_str(), _T("1")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::PARSEABLE;
|
||||
else if (_tcsicmp(str.c_str(), _T("2")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::SUMMARY_ONLY;
|
||||
else if (_tcsicmp(str.c_str(), _T("3")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::CONCISE_REPORT;
|
||||
else if (_tcsicmp(str.c_str(), _T("4")) == 0)
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::FULL_REPORT;
|
||||
else
|
||||
{
|
||||
// They specified an illegal level, error.
|
||||
TSTRING errStr = _T("Invalid Level: ");
|
||||
|
@ -350,24 +366,25 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
|
|||
throw eTWInvalidReportLevelCfg( errStr );
|
||||
}
|
||||
}
|
||||
else
|
||||
// no level was specified in the configuration file, use default.
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::CONCISE_REPORT;
|
||||
|
||||
|
||||
// Decide what mail method should be used to email reports
|
||||
if(cf.Lookup(TSTRING(_T("MAILMETHOD")), str))
|
||||
else
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("SENDMAIL")) == 0)
|
||||
pModeInfo->mMailMethod = cMailMessage::MAIL_BY_PIPE;
|
||||
else if( _tcsicmp( str.c_str(), _T("SMTP") ) == 0 )
|
||||
pModeInfo->mMailMethod = cMailMessage::MAIL_BY_SMTP;
|
||||
else
|
||||
pModeInfo->mMailMethod = cMailMessage::INVALID_METHOD;
|
||||
// no level was specified in the configuration file, use default.
|
||||
pModeInfo->mEmailReportLevel = cTextReportViewer::CONCISE_REPORT;
|
||||
}
|
||||
else
|
||||
|
||||
// Decide what mail method should be used to email reports
|
||||
if(cf.Lookup(TSTRING(_T("MAILMETHOD")), str))
|
||||
{
|
||||
pModeInfo->mMailMethod = cMailMessage::NO_METHOD;
|
||||
if (_tcsicmp(str.c_str(), _T("SENDMAIL")) == 0)
|
||||
pModeInfo->mMailMethod = cMailMessage::MAIL_BY_PIPE;
|
||||
else if( _tcsicmp( str.c_str(), _T("SMTP") ) == 0 )
|
||||
pModeInfo->mMailMethod = cMailMessage::MAIL_BY_SMTP;
|
||||
else
|
||||
pModeInfo->mMailMethod = cMailMessage::INVALID_METHOD;
|
||||
}
|
||||
else
|
||||
{
|
||||
pModeInfo->mMailMethod = cMailMessage::NO_METHOD;
|
||||
}
|
||||
|
||||
#if !SUPPORTS_NETWORKING
|
||||
|
@ -375,60 +392,76 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
|
|||
throw eMailSMTPNotSupported();
|
||||
#endif
|
||||
|
||||
// Get the SMTP server
|
||||
if(cf.Lookup(TSTRING(_T("SMTPHOST")), str))
|
||||
pModeInfo->mSmtpHost = str;
|
||||
else
|
||||
pModeInfo->mSmtpHost = _T("127.0.0.1"); // this is the default
|
||||
|
||||
// Get the SMTP port number
|
||||
if(cf.Lookup(TSTRING(_T("SMTPPORT")), str))
|
||||
// Get the SMTP server
|
||||
if(cf.Lookup(TSTRING(_T("SMTPHOST")), str))
|
||||
{
|
||||
int i = _ttoi( str.c_str() );
|
||||
if( i < 0 || i > SHRT_MAX )
|
||||
pModeInfo->mSmtpHost = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
pModeInfo->mSmtpHost = _T("127.0.0.1"); // this is the default
|
||||
}
|
||||
|
||||
// Get the SMTP port number
|
||||
if(cf.Lookup(TSTRING(_T("SMTPPORT")), str))
|
||||
{
|
||||
int i = _ttoi( str.c_str() );
|
||||
if( i < 0 || i > SHRT_MAX )
|
||||
throw eTWInvalidPortNumber( str );
|
||||
pModeInfo->mSmtpPort = static_cast<unsigned short>( i );
|
||||
pModeInfo->mSmtpPort = static_cast<unsigned short>( i );
|
||||
}
|
||||
else
|
||||
pModeInfo->mSmtpPort = 25; // this is the default
|
||||
|
||||
// Get the mail program to use if we're piping our email
|
||||
if(cf.Lookup(TSTRING(_T("MAILPROGRAM")), str))
|
||||
pModeInfo->mMailProgram = str;
|
||||
else
|
||||
pModeInfo->mMailProgram.erase(); // MAILPROGRAM is not required to be specified
|
||||
|
||||
// Get the mail program to use if we're piping our email
|
||||
if(cf.Lookup(TSTRING(_T("MAILNOVIOLATIONS")), str))
|
||||
else
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mMailNoViolations = true;
|
||||
else
|
||||
pModeInfo->mMailNoViolations = false;
|
||||
pModeInfo->mSmtpPort = 25; // this is the default
|
||||
}
|
||||
else
|
||||
pModeInfo->mMailNoViolations = true; // MAILPROGRAM is not required to be specified
|
||||
|
||||
if(cf.Lookup(TSTRING(_T("MAILFROMADDRESS")), str))
|
||||
pModeInfo->mMailFrom = str;
|
||||
// Get the mail program to use if we're piping our email
|
||||
if(cf.Lookup(TSTRING(_T("MAILPROGRAM")), str))
|
||||
{
|
||||
pModeInfo->mMailProgram = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
pModeInfo->mMailProgram.erase(); // MAILPROGRAM is not required to be specified
|
||||
}
|
||||
|
||||
// Get the mail program to use if we're piping our email
|
||||
if(cf.Lookup(TSTRING(_T("MAILNOVIOLATIONS")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mMailNoViolations = true;
|
||||
else
|
||||
pModeInfo->mMailNoViolations = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
pModeInfo->mMailNoViolations = true; // MAILPROGRAM is not required to be specified
|
||||
}
|
||||
|
||||
if(cf.Lookup(TSTRING(_T("MAILFROMADDRESS")), str))
|
||||
{
|
||||
pModeInfo->mMailFrom = str;
|
||||
}
|
||||
|
||||
// SYSLOG reporting
|
||||
if(cf.Lookup(TSTRING(_T("SYSLOGREPORTING")), str))
|
||||
if(cf.Lookup(TSTRING(_T("SYSLOGREPORTING")), str))
|
||||
{
|
||||
#if SUPPORTS_SYSLOG
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mbLogToSyslog = true;
|
||||
else
|
||||
pModeInfo->mbLogToSyslog = false;
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mbLogToSyslog = true;
|
||||
else
|
||||
pModeInfo->mbLogToSyslog = false;
|
||||
#else
|
||||
throw eTWSyslogNotSupported();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
pModeInfo->mbLogToSyslog = false;
|
||||
|
||||
else
|
||||
{
|
||||
pModeInfo->mbLogToSyslog = false;
|
||||
}
|
||||
|
||||
// Crossing file systems
|
||||
if(cf.Lookup(TSTRING(_T("CROSSFILESYSTEMS")), str))
|
||||
if(cf.Lookup(TSTRING(_T("CROSSFILESYSTEMS")), str))
|
||||
{
|
||||
if (_tcsicmp(str.c_str(), _T("true")) == 0)
|
||||
pModeInfo->mbCrossFileSystems = true;
|
||||
|
@ -457,20 +490,20 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
|
|||
iFSServices::GetInstance()->SetResolveNames(false);
|
||||
}
|
||||
|
||||
//
|
||||
// turn all of the file names into full paths (they're relative to the exe dir)
|
||||
//
|
||||
TSTRING fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mPolFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mPolFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mDbFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mDbFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mSiteKeyFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mSiteKeyFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mLocalKeyFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mLocalKeyFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mReportFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mReportFile = fullPath;
|
||||
//
|
||||
// turn all of the file names into full paths (they're relative to the exe dir)
|
||||
//
|
||||
TSTRING fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mPolFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mPolFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mDbFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mDbFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mSiteKeyFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mSiteKeyFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mLocalKeyFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mLocalKeyFile = fullPath;
|
||||
if(iFSServices::GetInstance()->FullPath( fullPath, pModeInfo->mReportFile, cSystemInfo::GetExeDir() ))
|
||||
pModeInfo->mReportFile = fullPath;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -20,6 +20,7 @@ libtw_a_HEADERS = \
|
|||
tw.h twerrors.h twinit.h twstrings.h twutil.h
|
||||
|
||||
DEFS = @DEFS@ -DCONFIG_DIR=\"$(sysconfdir)\"
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libtw_a_OBJECTS)
|
||||
|
|
|
@ -337,6 +337,7 @@ libtw_a_HEADERS = \
|
|||
stdtw.h systeminfo.h textdbviewer.h textreportviewer.h \
|
||||
tw.h twerrors.h twinit.h twstrings.h twutil.h
|
||||
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -523,6 +524,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -17,7 +17,7 @@ twadmin_HEADERS = \
|
|||
twadmincl.h twadminerrors.h twadminstrings.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = ../../bin/twadmin
|
||||
CLEANFILES = ../../bin/twadmin *.gcno *.gcda
|
||||
|
||||
all: $(sbin_PROGRAMS)
|
||||
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin
|
||||
|
|
|
@ -319,7 +319,7 @@ twadmin_HEADERS = \
|
|||
keygeneration.h resource.h stdtwadmin.h twadmin.h \
|
||||
twadmincl.h twadminerrors.h twadminstrings.h
|
||||
|
||||
CLEANFILES = ../../bin/twadmin
|
||||
CLEANFILES = ../../bin/twadmin *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
|
@ -13,6 +13,7 @@ libtwcrypto_a_HEADERS = \
|
|||
stdtwcrypto.h twcrypto.h twcryptoerrors.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libtwcrypto_a_OBJECTS)
|
||||
|
|
|
@ -325,6 +325,7 @@ libtwcrypto_a_HEADERS = \
|
|||
bytequeue.h crypto.h cryptoarchive.h keyfile.h \
|
||||
stdtwcrypto.h twcrypto.h twcryptoerrors.h
|
||||
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -511,6 +512,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -1241,7 +1241,7 @@ cHashedKey192::~cHashedKey192()
|
|||
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
#if HAVE_DEV_URANDOM
|
||||
#if USE_DEV_URANDOM
|
||||
static bool randomize_by_device(const char* device_name, int8* destbuf, int len)
|
||||
{
|
||||
static int rng_device = -1;
|
||||
|
@ -1267,7 +1267,7 @@ static bool gRandomizeBytesSeeded = false;
|
|||
|
||||
void RandomizeBytes(int8* destbuf, int len)
|
||||
{
|
||||
#if HAVE_DEV_URANDOM
|
||||
#if USE_DEV_URANDOM
|
||||
if (randomize_by_device("/dev/urandom", destbuf, len))
|
||||
return;
|
||||
|
||||
|
|
|
@ -116,7 +116,10 @@ cCryptoArchive::~cCryptoArchive()
|
|||
{
|
||||
ASSERT(mAction == MA_UNSTARTED || mAction == MA_UNKNOWN || mAction == MA_FINISHED || mAction == MA_READING);
|
||||
// check we did not leave a buffer unwritten
|
||||
|
||||
|
||||
Finish();
|
||||
|
||||
// Finish() normally zeroes these out, but hey.
|
||||
delete mpDeflator;
|
||||
delete mpInflator;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ libtwparser_a_HEADERS = \
|
|||
yylex.h yyparse.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
|
||||
all: $(noinst_LIBRARIES)
|
||||
$(AR) ru ../../lib/libtripwire.a $(libtwparser_a_OBJECTS)
|
||||
|
|
|
@ -328,6 +328,7 @@ libtwparser_a_HEADERS = \
|
|||
stdtwparser.h twparser.h twparsererrors.h twparserstrings.h \
|
||||
yylex.h yyparse.h
|
||||
|
||||
CLEANFILES = *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -514,6 +515,7 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
|
|
@ -75,6 +75,16 @@ cGenreParseInfo::cGenreParseInfo()
|
|||
InitPredefinedVariables();
|
||||
}
|
||||
|
||||
cGenreParseInfo::~cGenreParseInfo()
|
||||
{
|
||||
RuleListType::iterator itr;
|
||||
for( itr = mRuleList.begin(); itr != mRuleList.end(); ++itr )
|
||||
{
|
||||
delete *itr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// AddStopPoint
|
||||
|
@ -141,6 +151,8 @@ void cGenreParseInfo::InitPredefinedVariables()
|
|||
{
|
||||
mLocalPredefVarTable.Insert( sVarName, sValue );
|
||||
}
|
||||
|
||||
delete pGU;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ class cGenreParseInfo
|
|||
{
|
||||
public:
|
||||
cGenreParseInfo();
|
||||
~cGenreParseInfo();
|
||||
|
||||
void AddStopPoint( const cFCOName& name );
|
||||
// adds the specified path as a stop point -- for now, we just queue it up,
|
||||
|
|
|
@ -478,7 +478,7 @@ static int yy_base[] = {
|
|||
};
|
||||
|
||||
|
||||
#line 152 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
// #line 152 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
|
||||
// MKS LEX prototype scanner code
|
||||
// Copyright 1991 by Mortice Kern Systems Inc.
|
||||
|
@ -505,7 +505,7 @@ const int MIN_NUM_STATES = 20;
|
|||
#define REJECT goto yy_reject
|
||||
#define yymore() goto yy_more
|
||||
|
||||
#line 10 "tokens.l"
|
||||
// #line 10 "tokens.l"
|
||||
|
||||
#include "stdtwparser.h"
|
||||
|
||||
|
@ -515,7 +515,7 @@ const int MIN_NUM_STATES = 20;
|
|||
//#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if HAVE_MALLOC_H && !IS_AROS
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
@ -563,7 +563,7 @@ std::string FormatSyntaxError( char ch, const char* pszAdditionalMsg = NULL )
|
|||
// saves typing
|
||||
#define TRACE_RETURN(x) lextrace(_T(#x)); return x
|
||||
|
||||
#line 178 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
// #line 178 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
|
||||
|
||||
// Constructor for yy_scan. Set up tables
|
||||
|
@ -762,7 +762,7 @@ yy_scan::yylex()
|
|||
int yyoldi, yyoleng; /* base i, yyleng before look-ahead */
|
||||
int yyeof; /* 1 if eof has already been read */
|
||||
|
||||
#line 375 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
// #line 375 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
|
||||
|
||||
#ifdef YYEXIT
|
||||
|
@ -876,43 +876,43 @@ yy_scan::yylex()
|
|||
YY_USER();
|
||||
switch (yy_la_act[yyfmin] & 0777) {
|
||||
case 0:
|
||||
#line 109 "tokens.l"
|
||||
// #line 109 "tokens.l"
|
||||
{
|
||||
BEGIN( globals );
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
#line 114 "tokens.l"
|
||||
// #line 114 "tokens.l"
|
||||
{
|
||||
BEGIN(INITIAL);
|
||||
return TWP_SECTION;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
#line 119 "tokens.l"
|
||||
// #line 119 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_ECHO); }
|
||||
break;
|
||||
case 3:
|
||||
#line 122 "tokens.l"
|
||||
// #line 122 "tokens.l"
|
||||
{
|
||||
lextrace(_T("eating spaces...")); /* eat spaces */
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
#line 125 "tokens.l"
|
||||
// #line 125 "tokens.l"
|
||||
{
|
||||
cParserHelper::IncrementLineNumber();
|
||||
lextrace(_T("eating line continuation...")); /* eat line continuations */
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
#line 129 "tokens.l"
|
||||
// #line 129 "tokens.l"
|
||||
{
|
||||
lextrace(_T("eating comment..."));
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
#line 138 "tokens.l"
|
||||
// #line 138 "tokens.l"
|
||||
{
|
||||
// we must make copy of string, otherwise another lexeme will clobber it
|
||||
cDebug d("\t\t\t\tlexer::string");
|
||||
|
@ -931,7 +931,7 @@ yy_scan::yylex()
|
|||
}
|
||||
break;
|
||||
case 7:
|
||||
#line 155 "tokens.l"
|
||||
// #line 155 "tokens.l"
|
||||
{
|
||||
// we must make copy of string, otherwise another lexeme will clobber it
|
||||
cDebug d("\t\t\t\tlexer::qstring");
|
||||
|
@ -960,19 +960,19 @@ yy_scan::yylex()
|
|||
}
|
||||
break;
|
||||
case 8:
|
||||
#line 182 "tokens.l"
|
||||
// #line 182 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_SEMICOLON); }
|
||||
break;
|
||||
case 9:
|
||||
#line 183 "tokens.l"
|
||||
// #line 183 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_EQUALS); }
|
||||
break;
|
||||
case 10:
|
||||
#line 185 "tokens.l"
|
||||
// #line 185 "tokens.l"
|
||||
{ cParserHelper::IncrementLineNumber(); }
|
||||
break;
|
||||
case 11:
|
||||
#line 186 "tokens.l"
|
||||
// #line 186 "tokens.l"
|
||||
{
|
||||
std::string strError;
|
||||
strError = FormatSyntaxError( yytext[0], "The global section only accepts statements of the form:\n variable = value;\n" );
|
||||
|
@ -981,102 +981,102 @@ yy_scan::yylex()
|
|||
} /* catches anything that cannot be deemed a variable definition and exits. */
|
||||
break;
|
||||
case 12:
|
||||
#line 196 "tokens.l"
|
||||
// #line 196 "tokens.l"
|
||||
{
|
||||
lextrace(_T("eating spaces...")); /* eat spaces */
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
#line 200 "tokens.l"
|
||||
// #line 200 "tokens.l"
|
||||
{
|
||||
cParserHelper::IncrementLineNumber();
|
||||
lextrace(_T("eating line continuation...")); /* eat line continuations */
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
#line 205 "tokens.l"
|
||||
// #line 205 "tokens.l"
|
||||
{
|
||||
lextrace(_T("eating comment..."));
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
#line 209 "tokens.l"
|
||||
// #line 209 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_LBRACE); }
|
||||
break;
|
||||
case 16:
|
||||
#line 210 "tokens.l"
|
||||
// #line 210 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_RBRACE); }
|
||||
break;
|
||||
case 17:
|
||||
#line 213 "tokens.l"
|
||||
// #line 213 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_BANG); }
|
||||
break;
|
||||
case 18:
|
||||
#line 215 "tokens.l"
|
||||
// #line 215 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_RARROW); }
|
||||
break;
|
||||
case 19:
|
||||
#line 216 "tokens.l"
|
||||
// #line 216 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_EQUALS); }
|
||||
break;
|
||||
case 20:
|
||||
#line 218 "tokens.l"
|
||||
// #line 218 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_SEMICOLON); }
|
||||
break;
|
||||
case 21:
|
||||
#line 219 "tokens.l"
|
||||
// #line 219 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_LPAREN); }
|
||||
break;
|
||||
case 22:
|
||||
#line 220 "tokens.l"
|
||||
// #line 220 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_RPAREN); }
|
||||
break;
|
||||
case 23:
|
||||
#line 221 "tokens.l"
|
||||
// #line 221 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_COMMA); }
|
||||
break;
|
||||
case 24:
|
||||
#line 222 "tokens.l"
|
||||
// #line 222 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_PIPE); }
|
||||
break;
|
||||
case 25:
|
||||
#line 226 "tokens.l"
|
||||
// #line 226 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_DOLLAR); }
|
||||
break;
|
||||
case 26:
|
||||
#line 227 "tokens.l"
|
||||
// #line 227 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_OROR); }
|
||||
break;
|
||||
case 27:
|
||||
#line 230 "tokens.l"
|
||||
// #line 230 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_SECTION); }
|
||||
break;
|
||||
case 28:
|
||||
#line 231 "tokens.l"
|
||||
// #line 231 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_IFHOST); }
|
||||
break;
|
||||
case 29:
|
||||
#line 232 "tokens.l"
|
||||
// #line 232 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_ELSE); }
|
||||
break;
|
||||
case 30:
|
||||
#line 233 "tokens.l"
|
||||
// #line 233 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_ENDIF); }
|
||||
break;
|
||||
case 31:
|
||||
#line 234 "tokens.l"
|
||||
// #line 234 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_ERROR); }
|
||||
break;
|
||||
case 32:
|
||||
#line 235 "tokens.l"
|
||||
// #line 235 "tokens.l"
|
||||
{ TRACE_RETURN(TWP_ECHO); }
|
||||
break;
|
||||
case 33:
|
||||
#line 236 "tokens.l"
|
||||
// #line 236 "tokens.l"
|
||||
{ lextrace( _T( "@@end" ) ); return 0; } /* logical end of file */
|
||||
break;
|
||||
case 34:
|
||||
#line 239 "tokens.l"
|
||||
// #line 239 "tokens.l"
|
||||
{
|
||||
// we must make copy of string, otherwise another lexeme will clobber it
|
||||
cDebug d("\t\t\t\tlexer::string");
|
||||
|
@ -1095,7 +1095,7 @@ yy_scan::yylex()
|
|||
}
|
||||
break;
|
||||
case 35:
|
||||
#line 256 "tokens.l"
|
||||
// #line 256 "tokens.l"
|
||||
{
|
||||
// we must make copy of string, otherwise another lexeme will clobber it
|
||||
cDebug d("\t\t\t\tlexer::qstring");
|
||||
|
@ -1134,11 +1134,11 @@ yy_scan::yylex()
|
|||
}
|
||||
break;
|
||||
case 36:
|
||||
#line 309 "tokens.l"
|
||||
// #line 309 "tokens.l"
|
||||
{ cParserHelper::IncrementLineNumber(); }
|
||||
break;
|
||||
case 37:
|
||||
#line 310 "tokens.l"
|
||||
// #line 310 "tokens.l"
|
||||
{
|
||||
std::string strError;
|
||||
strError = FormatSyntaxError( yytext[0] );
|
||||
|
@ -1147,7 +1147,7 @@ yy_scan::yylex()
|
|||
} /* catches anything else that's not in here and quits */
|
||||
break;
|
||||
|
||||
#line 487 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
// #line 487 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
|
||||
}
|
||||
YY_SCANNER();
|
||||
|
@ -1231,7 +1231,7 @@ yy_scan::unput(int c)
|
|||
return c;
|
||||
}
|
||||
|
||||
#line 321 "tokens.l"
|
||||
// #line 321 "tokens.l"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#endif
|
||||
#define YYNEWLINE 10
|
||||
|
||||
#line 1 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
//#line 1 "..\\..\\mkslexyacc\\etc\\yylex.cpp"
|
||||
// MKS LEX prototype scanner header
|
||||
// Copyright 1991 by Mortice Kern Systems Inc.
|
||||
// All rights reserved.
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
// info@tripwire.org or www.tripwire.org.
|
||||
//
|
||||
/* ..\. -LC -o ..\twparser\yyparse.cpp -P ..\..\mkslexyacc\etc\yyparse.cpp -D yyparse.h policy.y */
|
||||
#line 74 "policy.y"
|
||||
// #line 74 "policy.y"
|
||||
|
||||
|
||||
#include "stdtwparser.h"
|
||||
|
@ -349,7 +349,7 @@ int yy_parse::yynrule = 55;
|
|||
|
||||
|
||||
|
||||
#line 2 "..\\..\\mkslexyacc\\etc\\yyparse.cpp"
|
||||
// #line 2 "..\\..\\mkslexyacc\\etc\\yyparse.cpp"
|
||||
// C++ YACC parser code
|
||||
// Copyright 1991 by Mortice Kern Systems Inc. All rights reserved.
|
||||
//
|
||||
|
@ -428,7 +428,7 @@ yy_parse::~yy_parse()
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 //YACC_WINDOWS
|
||||
|
||||
// The initial portion of the yacc parser.
|
||||
// In an windows environment, it will load the desired
|
||||
|
@ -533,7 +533,7 @@ yy_parse::yyparse(yy_scan* ps)
|
|||
#endif /* YACC_WINDOWS */
|
||||
|
||||
{
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 //YACC_WINDOWS
|
||||
short far *yyp; // needed as res tables locked in far memory
|
||||
short far *yyq;
|
||||
#else
|
||||
|
@ -594,7 +594,7 @@ yyEncore:
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 //YACC_WINDOWS
|
||||
if (yystate >= Sizeof_yypact) /* simple state */
|
||||
#else /* YACC_WINDOWS */
|
||||
if (yystate >= (int)sizeof yypact/(int)sizeof yypact[0]) /* simple state */
|
||||
|
@ -640,7 +640,7 @@ yyEncore:
|
|||
* Fell through - take default action
|
||||
*/
|
||||
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 //YACC_WINDOWS
|
||||
if (yystate >= Sizeof_yydef) /* simple state */
|
||||
#else /* YACC_WINDOWS */
|
||||
if (yystate >= (int)sizeof yydef /(int)sizeof yydef[0])
|
||||
|
@ -689,22 +689,22 @@ yyEncore:
|
|||
switch (yyi) { /* perform semantic action */
|
||||
|
||||
case YYr6: { /* statement : variable_assignment TWP_SEMICOLON */
|
||||
#line 194 "policy.y"
|
||||
// #line 194 "policy.y"
|
||||
cParserHelper::IncrementScopeStatementCount();
|
||||
} break;
|
||||
|
||||
case YYr7: { /* statement : global_variable_assignment TWP_SEMICOLON */
|
||||
#line 195 "policy.y"
|
||||
// #line 195 "policy.y"
|
||||
cParserHelper::IncrementScopeStatementCount();
|
||||
} break;
|
||||
|
||||
case YYr8: { /* statement : rule TWP_SEMICOLON */
|
||||
#line 196 "policy.y"
|
||||
// #line 196 "policy.y"
|
||||
cParserHelper::IncrementScopeStatementCount();
|
||||
} break;
|
||||
|
||||
case YYr12: { /* scoped_block : TWP_LPAREN attribute_list_with_opt_trailing_comma TWP_RPAREN TWP_LBRACE */
|
||||
#line 204 "policy.y"
|
||||
// #line 204 "policy.y"
|
||||
|
||||
cDebug d("Parse::scope");
|
||||
|
||||
|
@ -721,7 +721,7 @@ case YYr12: { /* scoped_block : TWP_LPAREN attribute_list_with_opt_trailing_c
|
|||
} break;
|
||||
|
||||
case YYr13: { /* scoped_block : TWP_LPAREN attribute_list_with_opt_trailing_comma TWP_RPAREN TWP_LBRACE $12 opt_statement_list TWP_RBRACE */
|
||||
#line 218 "policy.y"
|
||||
// #line 218 "policy.y"
|
||||
|
||||
if( 0 == cParserHelper::GetScopeStatementCount() && iUserNotify::GetInstance()->GetVerboseLevel() == iUserNotify::V_VERBOSE )
|
||||
{
|
||||
|
@ -737,7 +737,7 @@ case YYr13: { /* scoped_block : TWP_LPAREN attribute_list_with_opt_trailing_c
|
|||
} break;
|
||||
|
||||
case YYr14: { /* directive_block : TWP_IFHOST host_name_list */
|
||||
#line 234 "policy.y"
|
||||
// #line 234 "policy.y"
|
||||
|
||||
cDebug d("Parse::#ifhost");
|
||||
|
||||
|
@ -763,7 +763,7 @@ case YYr14: { /* directive_block : TWP_IFHOST host_name_list */
|
|||
} break;
|
||||
|
||||
case YYr15: { /* directive_block : TWP_IFHOST host_name_list $14 opt_statement_list opt_else_host TWP_ENDIF */
|
||||
#line 257 "policy.y"
|
||||
// #line 257 "policy.y"
|
||||
|
||||
cDebug d("Parse::#endif");
|
||||
cPreprocessor::PopState();
|
||||
|
@ -773,7 +773,7 @@ case YYr15: { /* directive_block : TWP_IFHOST host_name_list $14 opt_statemen
|
|||
} break;
|
||||
|
||||
case YYr16: { /* directive_block : TWP_SECTION string */
|
||||
#line 264 "policy.y"
|
||||
// #line 264 "policy.y"
|
||||
|
||||
cDebug d("Parse::#section");
|
||||
|
||||
|
@ -787,7 +787,7 @@ case YYr16: { /* directive_block : TWP_SECTION string */
|
|||
} break;
|
||||
|
||||
case YYr17: { /* directive_block : TWP_ERROR string */
|
||||
#line 275 "policy.y"
|
||||
// #line 275 "policy.y"
|
||||
|
||||
if( cPreprocessor::GetState() == cPreprocessor::STATE_ACCEPT && !cParserHelper::ParseOnly() )
|
||||
{
|
||||
|
@ -801,7 +801,7 @@ case YYr17: { /* directive_block : TWP_ERROR string */
|
|||
} break;
|
||||
|
||||
case YYr18: { /* directive_block : TWP_ECHO string */
|
||||
#line 286 "policy.y"
|
||||
// #line 286 "policy.y"
|
||||
|
||||
if( cPreprocessor::GetState() == cPreprocessor::STATE_ACCEPT && !cParserHelper::ParseOnly() )
|
||||
{
|
||||
|
@ -814,7 +814,7 @@ case YYr18: { /* directive_block : TWP_ECHO string */
|
|||
} break;
|
||||
|
||||
case YYr19: { /* host_name_list : host_name_list TWP_OROR host_name */
|
||||
#line 299 "policy.y"
|
||||
// #line 299 "policy.y"
|
||||
|
||||
yyval.mpStringList = yypvt[-2].mpStringList;
|
||||
yyval.mpStringList->push_back( *yypvt[0].mpString );
|
||||
|
@ -822,7 +822,7 @@ case YYr19: { /* host_name_list : host_name_list TWP_OROR host_name */
|
|||
} break;
|
||||
|
||||
case YYr20: { /* host_name_list : host_name */
|
||||
#line 304 "policy.y"
|
||||
// #line 304 "policy.y"
|
||||
|
||||
yyval.mpStringList = new cParseStringList;
|
||||
yyval.mpStringList->push_back( *yypvt[0].mpString );
|
||||
|
@ -830,7 +830,7 @@ case YYr20: { /* host_name_list : host_name */
|
|||
} break;
|
||||
|
||||
case YYr21: { /* opt_else_host : TWP_ELSE */
|
||||
#line 312 "policy.y"
|
||||
// #line 312 "policy.y"
|
||||
|
||||
cDebug d("Parse::#else");
|
||||
|
||||
|
@ -848,7 +848,7 @@ case YYr21: { /* opt_else_host : TWP_ELSE */
|
|||
} break;
|
||||
|
||||
case YYr24: { /* variable_assignment : variable_name TWP_EQUALS multi_string */
|
||||
#line 332 "policy.y"
|
||||
// #line 332 "policy.y"
|
||||
|
||||
cDebug d("Parse::variable_assignment");
|
||||
|
||||
|
@ -869,7 +869,7 @@ case YYr24: { /* variable_assignment : variable_name TWP_EQUALS multi_string
|
|||
} break;
|
||||
|
||||
case YYr25: { /* global_variable_assignment : global_string TWP_EQUALS global_multi_string */
|
||||
#line 353 "policy.y"
|
||||
// #line 353 "policy.y"
|
||||
|
||||
cDebug d("Parse::global variable_assignment");
|
||||
|
||||
|
@ -890,7 +890,7 @@ case YYr25: { /* global_variable_assignment : global_string TWP_EQUALS global
|
|||
} break;
|
||||
|
||||
case YYr26: { /* rule : fco_name TWP_RARROW spec_masks */
|
||||
#line 374 "policy.y"
|
||||
// #line 374 "policy.y"
|
||||
|
||||
cDebug d("Parse::rule(fco_name TWP_RARROW spec_masks)");
|
||||
if( cPreprocessor::GetState() == cPreprocessor::STATE_IGNORE )
|
||||
|
@ -927,6 +927,7 @@ case YYr26: { /* rule : fco_name TWP_RARROW spec_masks */
|
|||
// add to our lists
|
||||
cParserHelper::GetGenreInfo()->AddStopPoint( fcoName );
|
||||
cParserHelper::GetGenreInfo()->AddRule( pnode );
|
||||
delete pGU;
|
||||
}
|
||||
|
||||
delete yypvt[-2].mpStringList;
|
||||
|
@ -935,7 +936,7 @@ case YYr26: { /* rule : fco_name TWP_RARROW spec_masks */
|
|||
} break;
|
||||
|
||||
case YYr27: { /* rule : TWP_BANG fco_name */
|
||||
#line 416 "policy.y"
|
||||
// #line 416 "policy.y"
|
||||
|
||||
cDebug d("Parse::rule(!fconame)");
|
||||
|
||||
|
@ -959,6 +960,7 @@ case YYr27: { /* rule : TWP_BANG fco_name */
|
|||
|
||||
// add to stop list
|
||||
cParserHelper::GetGenreInfo()->AddStopPoint( fcoName );
|
||||
delete pGU;
|
||||
}
|
||||
|
||||
delete yypvt[0].mpStringList;
|
||||
|
@ -966,7 +968,7 @@ case YYr27: { /* rule : TWP_BANG fco_name */
|
|||
} break;
|
||||
|
||||
case YYr28: { /* spec_masks : prop_vector opt_spec_attributes */
|
||||
#line 447 "policy.y"
|
||||
// #line 447 "policy.y"
|
||||
|
||||
if( cPreprocessor::GetState() == cPreprocessor::STATE_ACCEPT )
|
||||
{
|
||||
|
@ -978,6 +980,7 @@ case YYr28: { /* spec_masks : prop_vector opt_spec_attributes */
|
|||
yypvt[0].mpAttrList->MergeNoOverwrite( cParserHelper::GetGlobalAttrList() );
|
||||
|
||||
yyval.mpNode = pNode;
|
||||
delete pGU;
|
||||
}
|
||||
|
||||
delete yypvt[-1].mpString;
|
||||
|
@ -987,28 +990,28 @@ case YYr28: { /* spec_masks : prop_vector opt_spec_attributes */
|
|||
} break;
|
||||
|
||||
case YYr29: { /* opt_spec_attributes : TWP_LPAREN attribute_list_with_opt_trailing_comma TWP_RPAREN */
|
||||
#line 485 "policy.y"
|
||||
// #line 485 "policy.y"
|
||||
|
||||
yyval.mpAttrList = yypvt[-1].mpAttrList;
|
||||
|
||||
} break;
|
||||
|
||||
case YYr30: { /* opt_spec_attributes : */
|
||||
#line 489 "policy.y"
|
||||
// #line 489 "policy.y"
|
||||
|
||||
yyval.mpAttrList = new cParseNamedAttrList;
|
||||
|
||||
} break;
|
||||
|
||||
case YYr31: { /* attribute_list_with_opt_trailing_comma : attribute_list opt_comma */
|
||||
#line 515 "policy.y"
|
||||
// #line 515 "policy.y"
|
||||
|
||||
yyval.mpAttrList = yypvt[-1].mpAttrList;
|
||||
|
||||
} break;
|
||||
|
||||
case YYr32: { /* attribute_list : attribute_list TWP_COMMA attribute */
|
||||
#line 522 "policy.y"
|
||||
// #line 522 "policy.y"
|
||||
|
||||
cDebug d("Parse::attribute_list");
|
||||
ASSERT( yypvt[-2].mpAttrList && yypvt[0].mpAttr );
|
||||
|
@ -1024,7 +1027,7 @@ case YYr32: { /* attribute_list : attribute_list TWP_COMMA attribute */
|
|||
} break;
|
||||
|
||||
case YYr33: { /* attribute_list : attribute */
|
||||
#line 535 "policy.y"
|
||||
// #line 535 "policy.y"
|
||||
|
||||
cDebug d("Parse::attribute_list");
|
||||
|
||||
|
@ -1038,7 +1041,7 @@ case YYr33: { /* attribute_list : attribute */
|
|||
} break;
|
||||
|
||||
case YYr34: { /* attribute : attribute_name TWP_EQUALS attribute_value */
|
||||
#line 548 "policy.y"
|
||||
// #line 548 "policy.y"
|
||||
|
||||
cDebug d("Parse::attribute");
|
||||
|
||||
|
@ -1055,7 +1058,7 @@ case YYr34: { /* attribute : attribute_name TWP_EQUALS attribute_value */
|
|||
} break;
|
||||
|
||||
case YYr37: { /* variable : TWP_DOLLAR TWP_LPAREN variable_name TWP_RPAREN */
|
||||
#line 618 "policy.y"
|
||||
// #line 618 "policy.y"
|
||||
|
||||
cDebug d( " parser::variable" );
|
||||
|
||||
|
@ -1082,7 +1085,7 @@ case YYr37: { /* variable : TWP_DOLLAR TWP_LPAREN variable_name TWP_RPAREN */
|
|||
} break;
|
||||
|
||||
case YYr38: { /* prop_vector : multi_string */
|
||||
#line 662 "policy.y"
|
||||
// #line 662 "policy.y"
|
||||
|
||||
yyval.mpString = new cParseString;
|
||||
*yyval.mpString = ConcatenateStrings( yypvt[0].mpStringList );
|
||||
|
@ -1091,7 +1094,7 @@ case YYr38: { /* prop_vector : multi_string */
|
|||
} break;
|
||||
|
||||
case YYr39: { /* attribute_name : string */
|
||||
#line 671 "policy.y"
|
||||
// #line 671 "policy.y"
|
||||
|
||||
cDebug d(" parser::string(attribute_name)");
|
||||
yyval.mpString = yypvt[0].mpString;
|
||||
|
@ -1099,7 +1102,7 @@ case YYr39: { /* attribute_name : string */
|
|||
} break;
|
||||
|
||||
case YYr40: { /* attribute_value : multi_string */
|
||||
#line 679 "policy.y"
|
||||
// #line 679 "policy.y"
|
||||
|
||||
yyval.mpString = new cParseString;
|
||||
cDebug d(" parser::multi_string(attribute_value)");
|
||||
|
@ -1109,7 +1112,7 @@ case YYr40: { /* attribute_value : multi_string */
|
|||
} break;
|
||||
|
||||
case YYr41: { /* fco_name : multi_string */
|
||||
#line 689 "policy.y"
|
||||
// #line 689 "policy.y"
|
||||
|
||||
cDebug d(" parser::multi_string(fco_name)");
|
||||
yyval.mpStringList = yypvt[0].mpStringList;
|
||||
|
@ -1117,7 +1120,7 @@ case YYr41: { /* fco_name : multi_string */
|
|||
} break;
|
||||
|
||||
case YYr42: { /* fco_name : multi_string TWP_PIPE multi_string */
|
||||
#line 695 "policy.y"
|
||||
// #line 695 "policy.y"
|
||||
|
||||
|
||||
yypvt[-2].mpStringList->push_back( _T("|") );
|
||||
|
@ -1129,7 +1132,7 @@ case YYr42: { /* fco_name : multi_string TWP_PIPE multi_string */
|
|||
} break;
|
||||
|
||||
case YYr43: { /* host_name : string */
|
||||
#line 710 "policy.y"
|
||||
// #line 710 "policy.y"
|
||||
|
||||
|
||||
cDebug d(" parser::multi_string(host_name)");
|
||||
|
@ -1138,7 +1141,7 @@ case YYr43: { /* host_name : string */
|
|||
} break;
|
||||
|
||||
case YYr44: { /* variable_name : TWP_STRING */
|
||||
#line 719 "policy.y"
|
||||
// #line 719 "policy.y"
|
||||
|
||||
cDebug d(" parser::string(variable_name)");
|
||||
yyval.mpString = yypvt[0].mpString;
|
||||
|
@ -1146,7 +1149,7 @@ case YYr44: { /* variable_name : TWP_STRING */
|
|||
} break;
|
||||
|
||||
case YYr45: { /* multi_string : multi_string string */
|
||||
#line 728 "policy.y"
|
||||
// #line 728 "policy.y"
|
||||
|
||||
yyval.mpStringList->push_back( *yypvt[0].mpString );
|
||||
delete yypvt[0].mpString;
|
||||
|
@ -1154,7 +1157,7 @@ case YYr45: { /* multi_string : multi_string string */
|
|||
} break;
|
||||
|
||||
case YYr46: { /* multi_string : string */
|
||||
#line 733 "policy.y"
|
||||
// #line 733 "policy.y"
|
||||
|
||||
yyval.mpStringList = new cParseStringList;
|
||||
yyval.mpStringList->push_back( *yypvt[0].mpString );
|
||||
|
@ -1163,7 +1166,7 @@ case YYr46: { /* multi_string : string */
|
|||
} break;
|
||||
|
||||
case YYr47: { /* global_multi_string : global_multi_string global_string */
|
||||
#line 742 "policy.y"
|
||||
// #line 742 "policy.y"
|
||||
|
||||
yyval.mpStringList->push_back( *yypvt[0].mpString );
|
||||
delete yypvt[0].mpString;
|
||||
|
@ -1171,7 +1174,7 @@ case YYr47: { /* global_multi_string : global_multi_string global_string */
|
|||
} break;
|
||||
|
||||
case YYr48: { /* global_multi_string : global_string */
|
||||
#line 747 "policy.y"
|
||||
// #line 747 "policy.y"
|
||||
|
||||
yyval.mpStringList = new cParseStringList;
|
||||
yyval.mpStringList->push_back( *yypvt[0].mpString );
|
||||
|
@ -1180,7 +1183,7 @@ case YYr48: { /* global_multi_string : global_string */
|
|||
} break;
|
||||
|
||||
case YYr49: { /* string : TWP_STRING */
|
||||
#line 757 "policy.y"
|
||||
// #line 757 "policy.y"
|
||||
|
||||
cDebug d(" parser::string(normal)");
|
||||
d.TraceNever("--(STRING)--> got string (%s)\n", yypvt[0].mpString);
|
||||
|
@ -1189,7 +1192,7 @@ case YYr49: { /* string : TWP_STRING */
|
|||
} break;
|
||||
|
||||
case YYr50: { /* string : variable */
|
||||
#line 763 "policy.y"
|
||||
// #line 763 "policy.y"
|
||||
|
||||
cDebug d(" parser::string(normal)");
|
||||
d.TraceNever("--(STRING)--> got string (%s)\n", yypvt[0].mpString);
|
||||
|
@ -1198,14 +1201,14 @@ case YYr50: { /* string : variable */
|
|||
} break;
|
||||
|
||||
case YYr51: { /* global_string : TWP_GLOBAL_STRING */
|
||||
#line 772 "policy.y"
|
||||
// #line 772 "policy.y"
|
||||
|
||||
cDebug d(" parser::string(normal)");
|
||||
d.TraceNever("--(STRING)--> got string (%s)\n", yypvt[0].mpString);
|
||||
yyval.mpString = yypvt[0].mpString;
|
||||
|
||||
} break;
|
||||
#line 343 "..\\..\\mkslexyacc\\etc\\yyparse.cpp"
|
||||
// #line 343 "..\\..\\mkslexyacc\\etc\\yyparse.cpp"
|
||||
case YYrACCEPT:
|
||||
YYACCEPT;
|
||||
case YYrERROR:
|
||||
|
@ -1265,7 +1268,7 @@ yyError:
|
|||
, yytp--
|
||||
#endif
|
||||
) {
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 //YACC_WINDOWS
|
||||
if (*yyps >= Sizeof_yypact) /* simple state */
|
||||
#else /* YACC_WINDOWS */
|
||||
if (*yyps >= (int)sizeof yypact/(int)sizeof yypact[0])
|
||||
|
|
|
@ -133,7 +133,7 @@ typedef struct yyTypedRules_tag { /* Typed rule table */
|
|||
} yyTypedRules;
|
||||
#endif
|
||||
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 // YACC_WINDOWS
|
||||
|
||||
// include all windows prototypes, macros, constants, etc.
|
||||
|
||||
|
@ -155,7 +155,7 @@ extern HANDLE hInst;
|
|||
class yy_parse {
|
||||
protected:
|
||||
|
||||
#ifdef YACC_WINDOWS
|
||||
#if 0 // YACC_WINDOWS
|
||||
|
||||
// protected member function for actual scanning
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ twprint_HEADERS = \
|
|||
twprinterrors.h twprintstrings.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = ../../bin/twprint
|
||||
CLEANFILES = ../../bin/twprint *.gcno *.gcda
|
||||
|
||||
all: $(sbin_PROGRAMS)
|
||||
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin
|
||||
|
|
|
@ -319,7 +319,7 @@ twprint_HEADERS = \
|
|||
resource.h stdtwprint.h twprint.h twprintcmdline.h \
|
||||
twprinterrors.h twprintstrings.h
|
||||
|
||||
CLEANFILES = ../../bin/twprint
|
||||
CLEANFILES = ../../bin/twprint *.gcno *.gcda
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
|
@ -19,7 +19,7 @@ cmdlineparser_t.cpp \
|
|||
codeconvert_t.cpp \
|
||||
configfile_t.cpp \
|
||||
cryptoarchive_t.cpp \
|
||||
crytpo_t.cpp \
|
||||
crypto_t.cpp \
|
||||
dbdatasource_t.cpp \
|
||||
debug_t.cpp \
|
||||
displayencoder_t.cpp \
|
||||
|
@ -81,7 +81,13 @@ wchar16_t.cpp
|
|||
twtest_HEADERS = stdtest.h stringutil_t.h test.h
|
||||
|
||||
DEFS = @DEFS@ # This gets rid of the -I. so AM_CPPFLAGS must be more explicit
|
||||
CLEANFILES = ../../bin/twtest
|
||||
|
||||
clean-local: clean-local-check
|
||||
.PHONY: clean-local-check
|
||||
clean-local-check:
|
||||
-rm -rf ../../bin/TWTestData
|
||||
-rm -f ../../bin/twtest
|
||||
-rm -f *.gcno *.gcda
|
||||
|
||||
all: $(sbin_PROGRAMS)
|
||||
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin
|
||||
|
|
|
@ -109,7 +109,7 @@ am_twtest_OBJECTS = archive_t.$(OBJEXT) blockfile_t.$(OBJEXT) \
|
|||
blockrecordarray_t.$(OBJEXT) charutil_t.$(OBJEXT) \
|
||||
cmdlineparser_t.$(OBJEXT) codeconvert_t.$(OBJEXT) \
|
||||
configfile_t.$(OBJEXT) cryptoarchive_t.$(OBJEXT) \
|
||||
crytpo_t.$(OBJEXT) dbdatasource_t.$(OBJEXT) debug_t.$(OBJEXT) \
|
||||
crypto_t.$(OBJEXT) dbdatasource_t.$(OBJEXT) debug_t.$(OBJEXT) \
|
||||
displayencoder_t.$(OBJEXT) error_t.$(OBJEXT) \
|
||||
errorbucketimpl_t.$(OBJEXT) fcocompare_t.$(OBJEXT) \
|
||||
fcodatabasefile_t.$(OBJEXT) fconame_t.$(OBJEXT) \
|
||||
|
@ -360,7 +360,7 @@ cmdlineparser_t.cpp \
|
|||
codeconvert_t.cpp \
|
||||
configfile_t.cpp \
|
||||
cryptoarchive_t.cpp \
|
||||
crytpo_t.cpp \
|
||||
crypto_t.cpp \
|
||||
dbdatasource_t.cpp \
|
||||
debug_t.cpp \
|
||||
displayencoder_t.cpp \
|
||||
|
@ -420,7 +420,6 @@ usernotifystdout_t.cpp \
|
|||
wchar16_t.cpp
|
||||
|
||||
twtest_HEADERS = stdtest.h stringutil_t.h test.h
|
||||
CLEANFILES = ../../bin/twtest
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -645,7 +644,6 @@ install-strip:
|
|||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
@ -656,7 +654,7 @@ maintainer-clean-generic:
|
|||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
|
||||
clean-am: clean-generic clean-local clean-sbinPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
|
@ -724,15 +722,15 @@ uninstall-am: uninstall-sbinPROGRAMS uninstall-twtestHEADERS
|
|||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \
|
||||
distclean-compile distclean-generic distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
|
||||
install-strip install-twtestHEADERS installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
clean-local clean-sbinPROGRAMS cscopelist-am ctags ctags-am \
|
||||
distclean distclean-compile distclean-generic distclean-tags \
|
||||
distdir dvi dvi-am html html-am info info-am install \
|
||||
install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-sbinPROGRAMS install-strip install-twtestHEADERS \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-sbinPROGRAMS uninstall-twtestHEADERS
|
||||
|
@ -740,6 +738,13 @@ uninstall-am: uninstall-sbinPROGRAMS uninstall-twtestHEADERS
|
|||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
clean-local: clean-local-check
|
||||
.PHONY: clean-local-check
|
||||
clean-local-check:
|
||||
-rm -rf ../../bin/TWTestData
|
||||
-rm -f ../../bin/twtest
|
||||
-rm -f *.gcno *.gcda
|
||||
|
||||
all: $(sbin_PROGRAMS)
|
||||
@test -d ../../bin && $(LN) -f $(sbin_PROGRAMS) ../../bin
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
TSS_EXCEPTION(eTestArchiveError, eError);
|
||||
|
||||
void TestArchive()
|
||||
void TestMemoryArchive()
|
||||
{
|
||||
// cMemoryArchive
|
||||
cMemoryArchive memarch;
|
||||
|
@ -52,7 +52,7 @@ void TestArchive()
|
|||
memarch.WriteInt32(3);
|
||||
memarch.WriteInt32(4);
|
||||
|
||||
TSTRING s = _T("Weenus");
|
||||
TSTRING s = _T("Iridogorgia");
|
||||
memarch.WriteString(s);
|
||||
|
||||
memarch.WriteInt64(1234567L);
|
||||
|
@ -74,7 +74,7 @@ void TestArchive()
|
|||
|
||||
TSTRING s2;
|
||||
memarch.ReadString(s2);
|
||||
TEST(s2.compare(_T("Weenus")) == 0);
|
||||
TEST(s2.compare(_T("Iridogorgia")) == 0);
|
||||
|
||||
memarch.ReadInt64(l);
|
||||
TEST(l == 1234567L);
|
||||
|
@ -101,37 +101,61 @@ void TestArchive()
|
|||
TEST(memarch.GetMappedOffset() == 4 * sizeof(int32) + sizeof(int32) + 6);
|
||||
TEST(memarch.GetMappedLength() == sizeof(int64));
|
||||
// TEST(tw_ntohll(*(int64*)memarch.GetMap()) == 1234567L);
|
||||
}
|
||||
|
||||
void TestLockedTemporaryArchive()
|
||||
{
|
||||
TSTRING s = _T("Metallogorgia");
|
||||
|
||||
bool threw = false;
|
||||
// cLockedTemporaryFileArchive
|
||||
TSTRING lockedFileName = TwTestPath("inaccessable_file.bin");
|
||||
// lockedFileName += _T("/inaccessable_file.bin");
|
||||
|
||||
cLockedTemporaryFileArchive lockedArch;
|
||||
|
||||
// try to create an archive using a temp file
|
||||
lockedArch.OpenReadWrite();
|
||||
lockedArch.Close();
|
||||
try
|
||||
{
|
||||
// try to create an archive using a temp file
|
||||
lockedArch.OpenReadWrite();
|
||||
lockedArch.Close();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
threw = true;
|
||||
}
|
||||
|
||||
// this should open and lock the file -- shouldn't be able to access it
|
||||
lockedArch.OpenReadWrite(lockedFileName.c_str());
|
||||
lockedArch.Seek(0, cBidirArchive::BEGINNING);
|
||||
try
|
||||
{
|
||||
// this should open and lock the file -- shouldn't be able to access it
|
||||
lockedArch.OpenReadWrite(lockedFileName.c_str());
|
||||
lockedArch.Seek(0, cBidirArchive::BEGINNING);
|
||||
|
||||
// shouldn't be able to see these changes
|
||||
lockedArch.WriteInt32(1);
|
||||
lockedArch.WriteInt32(2);
|
||||
lockedArch.WriteInt32(3);
|
||||
lockedArch.WriteInt32(4);
|
||||
lockedArch.WriteString(s);
|
||||
lockedArch.WriteInt64(1234567L);
|
||||
lockedArch.WriteInt16(42);
|
||||
// shouldn't be able to see these changes
|
||||
lockedArch.WriteInt32(1);
|
||||
lockedArch.WriteInt32(2);
|
||||
lockedArch.WriteInt32(3);
|
||||
lockedArch.WriteInt32(4);
|
||||
lockedArch.WriteString(s);
|
||||
lockedArch.WriteInt64(1234567L);
|
||||
lockedArch.WriteInt16(42);
|
||||
|
||||
// this should delete the file
|
||||
lockedArch.Close();
|
||||
// this should delete the file
|
||||
lockedArch.Close();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
threw = true;
|
||||
}
|
||||
|
||||
// cFileArchive
|
||||
TEST(!threw);
|
||||
}
|
||||
|
||||
void TestFileArchive()
|
||||
{
|
||||
bool threw = false;
|
||||
TSTRING s = _T("Acanthogorgia");
|
||||
// cFileArchive
|
||||
TSTRING fileName = TwTestPath("archive_test.bin");
|
||||
//fileName += _T("/archive_test.bin");
|
||||
|
||||
cFileArchive filearch;
|
||||
filearch.OpenReadWrite(fileName.c_str());
|
||||
|
@ -163,7 +187,7 @@ void TestArchive()
|
|||
|
||||
TSTRING s3;
|
||||
filearch.ReadString(s3);
|
||||
TEST(s3.compare(_T("Weenus")) == 0);
|
||||
TEST(s3.compare(_T("Acanthogorgia")) == 0);
|
||||
filearch.ReadInt64(k);
|
||||
TEST(k == 1234567L);
|
||||
|
||||
|
@ -181,8 +205,16 @@ void TestArchive()
|
|||
}
|
||||
catch (eError& e)
|
||||
{
|
||||
TEST(false);
|
||||
threw=true;
|
||||
(void)e;
|
||||
}
|
||||
|
||||
TEST(!threw);
|
||||
}
|
||||
|
||||
void RegisterSuite_Archive()
|
||||
{
|
||||
RegisterTest("Archive", "MemoryArchive", TestMemoryArchive);
|
||||
RegisterTest("Archive", "LockedTemporaryArchive)", TestLockedTemporaryArchive);
|
||||
RegisterTest("Archive", "FileArchive", TestFileArchive);
|
||||
}
|
||||
|
|
|
@ -109,3 +109,9 @@ void TestBlockFile()
|
|||
|
||||
bf.Close();
|
||||
}
|
||||
|
||||
void RegisterSuite_BlockFile()
|
||||
{
|
||||
RegisterTest("BlockFile", "Basic", TestBlockFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -125,3 +125,7 @@ void TestBlockRecordArray()
|
|||
#endif
|
||||
}
|
||||
|
||||
void RegisterSuite_BlockRecordArray()
|
||||
{
|
||||
RegisterTest("BlockRecordArray", "Basic", TestBlockRecordArray);
|
||||
}
|
||||
|
|
|
@ -75,11 +75,7 @@ void TestCharUtilBasic()
|
|||
PrintChars( _T("fo\x23 54") );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
TSS_BeginTestSuiteFrom( cCharEncoderTest )
|
||||
|
||||
TSS_AddTestCase( Basic );
|
||||
|
||||
TSS_EndTestSuite( cCharEncoderTest )
|
||||
*/
|
||||
void RegisterSuite_CharUtil()
|
||||
{
|
||||
RegisterTest("CharUtil", "Basic", TestCharUtilBasic);
|
||||
}
|
||||
|
|
|
@ -161,3 +161,10 @@ void TestCmdLineParser()
|
|||
// TODO -- test a bunch more!!!
|
||||
}
|
||||
|
||||
void RegisterSuite_CmdLineParser()
|
||||
{
|
||||
RegisterTest("CmdLineParser", "Basic", TestCmdLineParser);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -185,7 +185,8 @@ char NonZeroChar( char ch )
|
|||
//TestMbToDb in codeconvert_t.cpp seems to hit an infinite loop or runs verrrry long; ifdef'd"
|
||||
void TestMbToDb()
|
||||
{
|
||||
TCERR << "\nTODO: TestMbToDb in codeconvert_t.cpp is flaky & needs to be fixed/replaced; currently disabled." << std::endl;
|
||||
skip("This test is flaky & needs to be fixed/replaced; currently disabled.");
|
||||
|
||||
#if 0
|
||||
std::string s;
|
||||
s.resize( 0x10000 * 2 ); // two bytes for each combination
|
||||
|
@ -240,7 +241,8 @@ void TestMbToDb()
|
|||
// dbchar_t to mbchar_t
|
||||
void TestDbToMb()
|
||||
{
|
||||
TCERR << "\nTODO: TestDbToMb in codeconvert_t.cpp fails, most likely due to not speaking UTF-16. Should fix this." << std::endl;
|
||||
skip("This test fails, most likely due to not speaking UTF-16. Should fix this.");
|
||||
|
||||
#if 0
|
||||
wc16_string ws;
|
||||
wc16_string::size_type n;
|
||||
|
@ -344,4 +346,8 @@ bool LowASCIILooksLikeUCS2InWchart()
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
void RegisterSuite_CodeConvert()
|
||||
{
|
||||
RegisterTest("CodeConvert", "MbToDb", TestMbToDb);
|
||||
RegisterTest("CodeConvert", "DbToMb", TestDbToMb);
|
||||
}
|
||||
|
|
|
@ -47,83 +47,101 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
static void assertParse(const std::string& configLineIn, bool expectValid)
|
||||
{
|
||||
static const std::string sMandatory = \
|
||||
"\nPOLFILE=foo" \
|
||||
"\nDBFILE=foo" \
|
||||
"\nREPORTFILE=foo" \
|
||||
"\nSITEKEYFILE=foo" \
|
||||
"\nLOCALKEYFILE=foo";
|
||||
|
||||
bool threw = false;
|
||||
cConfigFile cfg;
|
||||
|
||||
std::string configLine = configLineIn + sMandatory;
|
||||
|
||||
try
|
||||
{
|
||||
cfg.ReadString( configLine );
|
||||
}
|
||||
catch( eConfigFileMissReqKey& e)
|
||||
{
|
||||
TCERR << "Got a missing key exception, which should not happen" << std::endl;
|
||||
TEST(false);
|
||||
}
|
||||
catch( eConfigFile& e )
|
||||
{
|
||||
e.SetFatality(false);
|
||||
cTWUtil::PrintErrorMsg( e );
|
||||
|
||||
threw = true;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
TCERR << "LINE [" << configLineIn << "]" << std::endl << "Expected = " << expectValid << std::endl << "Threw = " << threw << std::endl;
|
||||
#endif
|
||||
|
||||
TEST(expectValid != threw);
|
||||
}
|
||||
|
||||
|
||||
void TestConfigFile(void)
|
||||
{
|
||||
TSTRING asConfigFileText[] =
|
||||
{
|
||||
_T("BRIAN=foo"), // 0 fine
|
||||
_T("BRIAN=foo\nBILL=bar"), // 1 fine
|
||||
_T("BRIAN=foo\r\nBILL=bar"), // 2 fine
|
||||
_T("BRIAN=foo\n\n\rBILL=bar\n"),// 3 fine
|
||||
_T(" WS=foo \n\n\r BILL=bar\n"), // 4 fine
|
||||
_T(" WS = foo \n\n\r BILL = bar \n"), // 5 fine
|
||||
_T("FOO=foo\nBAR=$(FOO)"), // 6 fine
|
||||
_T("FOO=foo\nBAR=$(FO)"), // 7 undefined var
|
||||
_T("FOO=foo\nBAR=$(FOO"), // 8 no r paren
|
||||
_T("FOO=foo\nBAR=$(FOO "), // 9 no r paren
|
||||
_T("BAR=$(FOO\n"), // 10 no r paren
|
||||
_T(" VAR =foo \nWS = $(VAR)\n"), // 11 fine
|
||||
_T(""), // 12 fine
|
||||
_T("\n"), // 13 fine
|
||||
_T("\r"), // 14 fine
|
||||
_T("\r\n"), // 15 fine
|
||||
_T("B=POO\nA"), // 16 no equals
|
||||
_T(" B=POO \n A \r"), // 17 no equals
|
||||
_T("B=POO\nB=CRAP"), // 18 redefined var
|
||||
_T("DATE=CRAP"), // 19 redefine predefine var
|
||||
_T("B=POO\nDATE=CRAP"), // 20 redefine predefine var
|
||||
_T("A=1\nB=$(A)\nC=$(B)"), // 21 fine -- checking var sub
|
||||
_T("A=$(DATE)"), // 22 fine -- checking predef var sub
|
||||
_T("A=1\nB=$(A)\nC=$(DATE)"), // 23 fine -- checking predef var sub
|
||||
_T("A=1\n=$(A)\nC=$(DATE)"), // 24 no key
|
||||
_T("A=$(DATE)-B"), // 25 fine -- check that the '-' shows up
|
||||
_T("A=$(DATE)-$(DATE)"), // 26 fine -- check that the '-' shows up
|
||||
};
|
||||
// should succeed
|
||||
assertParse( _T("BRIAN=foo"), true ); // 0 fine
|
||||
assertParse( _T("BRIAN=foo\nBILL=bar"), true ); // 1 fine
|
||||
assertParse( _T("BRIAN=foo\r\nBILL=bar"), true ); // 2 fine
|
||||
assertParse( _T("BRIAN=foo\n\n\rBILL=bar\n"), true ); // 3 fine
|
||||
assertParse( _T(" WS=foo \n\n\r BILL=bar\n"), true ); // 4 fine
|
||||
assertParse( _T(" WS = foo \n\n\r BILL = bar \n"), true ); // 5 fine
|
||||
assertParse( _T("FOO=foo\nBAR=$(FOO)"), true ); // 6 fine
|
||||
|
||||
/*
|
||||
TSTRING sMandatory = \
|
||||
_T("\nPOLFILE=foo") \
|
||||
_T("\nDBFILE=foo") \
|
||||
_T("\nREPORTFILE=foo") \
|
||||
_T("\nSITEKEYFILE=foo") \
|
||||
_T("\nLOCALKEYFILE=foo");
|
||||
*/
|
||||
// should fail
|
||||
assertParse( _T("FOO=foo\nBAR=$(FO)"), false ); // 7 undefined var
|
||||
assertParse( _T("FOO=foo\nBAR=$(FOO"), false ); // 8 no r paren
|
||||
assertParse( _T("FOO=foo\nBAR=$(FOO "), false ); // 9 no r paren
|
||||
assertParse( _T("BAR=$(FOO\n"), false ); // 10 no r paren
|
||||
|
||||
// should succeed
|
||||
assertParse( _T(" VAR =foo \nWS = $(VAR)\n"), true ); // 11 fine
|
||||
assertParse( _T(""), true ); // 12 fine
|
||||
assertParse( _T("\n"), true ); // 13 fine
|
||||
assertParse( _T("\r"), true ); // 14 fine
|
||||
assertParse( _T("\r\n"), true ); // 15 fine
|
||||
|
||||
for( TSTRING* at = &asConfigFileText[0];
|
||||
at != &asConfigFileText[countof(asConfigFileText)];
|
||||
at++ )
|
||||
{
|
||||
cConfigFile cfg;
|
||||
//*at += sMandatory;
|
||||
// should fail
|
||||
assertParse( _T("B=POO\nA"), false ); // 16 no equals
|
||||
assertParse( _T(" B=POO \n A \r"), false ); // 17 no equals
|
||||
|
||||
/* This next test asserts that you can't change a variable once you've defined it.
|
||||
However there's no actual code in cConfigFile to check for this, and
|
||||
OST appears to work fine if you redefine a config variable, so I'm not going
|
||||
to change the current behavior. Leaving this test in w/ a note for reference.
|
||||
|
||||
assertParse( _T("B=POO\nB=CRAP"), false ); // 18 redefined var
|
||||
*/
|
||||
assertParse( _T("DATE=CRAP"), false ); // 19 redefine predefine var
|
||||
assertParse( _T("B=POO\nDATE=CRAP"), false ); // 20 redefine predefine var
|
||||
// should succeed
|
||||
assertParse( _T("A=1\nB=$(A)\nC=$(B)"), true ); // 21 fine -- checking var sub
|
||||
assertParse( _T("A=$(DATE)"), true ); // 22 fine -- checking predef var sub
|
||||
assertParse( _T("A=1\nB=$(A)\nC=$(DATE)"), true ); // 23 fine -- checking predef var sub
|
||||
|
||||
// should fail
|
||||
assertParse( _T("A=1\n=$(A)\nC=$(DATE)"), false ); // 24 no key
|
||||
|
||||
// should succeed
|
||||
assertParse( _T("A=$(DATE)-B"), true ); // 25 fine -- check that the '-' shows up
|
||||
assertParse( _T("A=$(DATE)-$(DATE)"), true ); // 26 fine -- check that the '-' shows up
|
||||
|
||||
TCERR << _T("*** line:") << std::endl;
|
||||
TCERR << *at << std::endl;
|
||||
TCERR << _T("*** eol:") << std::endl;
|
||||
try
|
||||
{
|
||||
cfg.ReadString( *at );
|
||||
}
|
||||
catch( eConfigFileMissReqKey& )
|
||||
{
|
||||
// ignore....
|
||||
}
|
||||
catch( eConfigFile& e )
|
||||
{
|
||||
int offset = ( at - asConfigFileText );
|
||||
int itemSize = sizeof( asConfigFileText[0] );
|
||||
int num = offset / itemSize;
|
||||
TCERR << num << std::endl;
|
||||
cTWUtil::PrintErrorMsg( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TestConfigFile2(void)
|
||||
{
|
||||
cDebug d("Testconfigfile");
|
||||
d.TraceDetail("Entering...\n");
|
||||
iFSServices* pFSServices = iFSServices::GetInstance();
|
||||
//iFSServices* pFSServices = iFSServices::GetInstance();
|
||||
|
||||
//Define some test values for <name, value> pairs to be
|
||||
//stored in a test config. module. I'm going to use the
|
||||
|
@ -175,5 +193,10 @@ void TestConfigFile2(void)
|
|||
TEST( lookup2 == "test.twd" );
|
||||
|
||||
d.TraceDetail("Tests Passed!\n");
|
||||
//#endif // NOT_BRIANS_TEST
|
||||
}
|
||||
|
||||
void RegisterSuite_ConfigFile()
|
||||
{
|
||||
RegisterTest("ConfigFile", "Basic 1", TestConfigFile);
|
||||
RegisterTest("ConfigFile", "Basic 2", TestConfigFile2);
|
||||
}
|
||||
|
|
|
@ -44,9 +44,13 @@ void TestCrypto()
|
|||
|
||||
const int BUFSIZE = 9000;
|
||||
|
||||
char source[BUFSIZE];
|
||||
char crypt[COUNT + BUFSIZE]; // needs to be able to hold even number of blocks
|
||||
char dest[COUNT];
|
||||
std::vector<char> source_buf(BUFSIZE);
|
||||
std::vector<char> crypt_buf(COUNT + BUFSIZE); // needs to be able to hold even number of blocks
|
||||
std::vector<char> dest_buf(COUNT);
|
||||
|
||||
char* source = &source_buf[0];
|
||||
char* crypt = &crypt_buf[0];
|
||||
char* dest = &dest_buf[0];
|
||||
|
||||
memcpy(source, "I love the smell of the sheep.", 31);
|
||||
|
||||
|
@ -407,6 +411,13 @@ void TestCrypto()
|
|||
|
||||
delete pPublic;
|
||||
delete pPrivate;
|
||||
delete pPublic2;
|
||||
delete pPrivate2;
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterSuite_Crypto()
|
||||
{
|
||||
RegisterTest("Crypto", "Basic", TestCrypto);
|
||||
}
|
||||
|
|
@ -299,4 +299,7 @@ void TestCryptoArchive()
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
void RegisterSuite_CryptoArchive()
|
||||
{
|
||||
RegisterTest("CryptoArchive", "Basic", TestCryptoArchive);
|
||||
}
|
||||
|
|
|
@ -212,3 +212,8 @@ void TestDbDataSourceBasic()
|
|||
db.AssertAllBlocksValid();
|
||||
#endif
|
||||
}
|
||||
|
||||
void RegisterSuite_DbDataSource()
|
||||
{
|
||||
RegisterTest("DbDataSource", "Basic", TestDbDataSourceBasic);
|
||||
}
|
||||
|
|
|
@ -90,4 +90,7 @@ void TestDebug()
|
|||
d.TraceDebug("Exiting...\n");
|
||||
}
|
||||
|
||||
|
||||
void RegisterSuite_Debug()
|
||||
{
|
||||
RegisterTest("Debug", "Basic", TestDebug);
|
||||
}
|
||||
|
|
|
@ -321,17 +321,16 @@ void TestDisplayEncoderBasic()
|
|||
// make sure there are '\' and '"' in it )
|
||||
}
|
||||
|
||||
/*TSS_BeginTestSuiteFrom( cDisplayEncoderTest )
|
||||
|
||||
TSS_AddTestCase( Basic );
|
||||
TSS_AddTestCase( TestHexToChar );
|
||||
TSS_AddTestCase( TestCharToHex );
|
||||
TSS_AddTestCase( TestStringToHex );
|
||||
TSS_AddTestCase( TestHexToString );
|
||||
TSS_AddTestCase( TestUnconvertable );
|
||||
TSS_AddTestCase( TestUnprintable );
|
||||
TSS_AddTestCase( TestQuoteAndBackSlash );
|
||||
|
||||
TSS_EndTestSuite( cDisplayEncoderTest )*/
|
||||
void RegisterSuite_DisplayEncoder()
|
||||
{
|
||||
RegisterTest("DisplayEncoder", "Basic", TestDisplayEncoderBasic);
|
||||
RegisterTest("DisplayEncoder", "CharToHex", TestCharToHex);
|
||||
RegisterTest("DisplayEncoder", "HexToChar", TestHexToChar);
|
||||
RegisterTest("DisplayEncoder", "StringToHex", TestStringToHex);
|
||||
RegisterTest("DisplayEncoder", "HexToString", TestHexToString);
|
||||
//RegisterTest("DisplayEncoder", "Unconvertable", TestUnconvertable);
|
||||
//RegisterTest("DisplayEncoder", "Unprintable", TestUnprintable);
|
||||
RegisterTest("DisplayEncoder", "QuoteAndBackSlash", TestQuoteAndBackSlash);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -81,3 +81,8 @@ void TestError()
|
|||
|
||||
TEST(threw);
|
||||
}
|
||||
|
||||
void RegisterSuite_Error()
|
||||
{
|
||||
RegisterTest("Error", "Basic", TestError);
|
||||
}
|
||||
|
|
|
@ -143,3 +143,7 @@ void TestErrorBucketImpl()
|
|||
|
||||
}
|
||||
|
||||
void RegisterSuite_ErrorBucketImpl()
|
||||
{
|
||||
RegisterTest("ErrorBucketImpl", "Basic", TestErrorBucketImpl);
|
||||
}
|
||||
|
|
|
@ -158,3 +158,8 @@ void TestFCOCompare()
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOCompare()
|
||||
{
|
||||
RegisterTest("FCOCompare", "Basic", TestFCOCompare);
|
||||
}
|
||||
|
|
|
@ -32,9 +32,16 @@
|
|||
// fcodatabasefile.cpp
|
||||
#include "tw/stdtw.h"
|
||||
#include "tw/fcodatabasefile.h"
|
||||
#include "test.h"
|
||||
|
||||
void TestFCODatabaseFile()
|
||||
{
|
||||
cDebug d("TestFCODatabaseFile");
|
||||
d.TraceError("Implement this!\n");
|
||||
skip("TestFCODatabaseFile not implemented");
|
||||
}
|
||||
|
||||
void RegisterSuite_FCODatabaseFile()
|
||||
{
|
||||
RegisterTest("FCODatabaseFile", "Basic", TestFCODatabaseFile);
|
||||
}
|
||||
|
|
|
@ -139,4 +139,7 @@ void TestFCOName()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void RegisterSuite_FCOName()
|
||||
{
|
||||
RegisterTest("FCOName", "Basic", TestFCOName);
|
||||
}
|
||||
|
|
|
@ -61,3 +61,8 @@ void TestFCONameTbl()
|
|||
pNode4->Release();
|
||||
pNode5->Release();
|
||||
}
|
||||
|
||||
void RegisterSuite_FCONameTbl()
|
||||
{
|
||||
RegisterTest("FCONameTbl", "Basic", TestFCONameTbl);
|
||||
}
|
||||
|
|
|
@ -115,3 +115,7 @@ void TestUnprintable( const TCHAR* pchName, const TCHAR* pchGenre )
|
|||
TEST( fcoNameNew == fcoName );
|
||||
}
|
||||
|
||||
void RegisterSuite_FCONameTranslator()
|
||||
{
|
||||
RegisterTest("FCONameTranslator", "Basic", TestFCONameTranslator);
|
||||
}
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
#include "core/debug.h"
|
||||
#include "twtest/test.h"
|
||||
|
||||
void TestFCOPropImpl()
|
||||
void TestNumeric()
|
||||
{
|
||||
cDebug d("TestFCOPropImpl");
|
||||
cDebug d("TestNumeric");
|
||||
d.TraceDebug("Entering...\n");
|
||||
|
||||
// print the enum key:
|
||||
|
@ -69,12 +69,18 @@ void TestFCOPropImpl()
|
|||
|
||||
d.TraceDebug("333ui64 == 456ui64 = %d\n", pui64.Compare(&pui64b, iFCOProp::OP_EQ));
|
||||
TEST( iFCOProp::CMP_FALSE == p2i64.Compare(&pi64, iFCOProp::OP_EQ));
|
||||
|
||||
}
|
||||
|
||||
void TestStrings()
|
||||
{
|
||||
cDebug d("TestStrings");
|
||||
cFCOPropTSTRING pt1;
|
||||
cFCOPropTSTRING pt2;
|
||||
pt1.SetValue(TSTRING(_T("bar")));
|
||||
pt2.SetValue(TSTRING(_T("foo")));
|
||||
|
||||
cFCOPropInt64 pi64;
|
||||
pi64.SetValue(8675309);
|
||||
|
||||
d.TraceDebug(_T("property TSTRING = (should be \"bar\") %s\n"), pt1.AsString().c_str());
|
||||
TEST(pt1.AsString() == "bar");
|
||||
|
||||
|
@ -94,3 +100,8 @@ void TestFCOPropImpl()
|
|||
return;
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOPropImpl()
|
||||
{
|
||||
RegisterTest("FCOPropImpl", "Numeric", TestNumeric);
|
||||
RegisterTest("FCOPropImpl", "Strings", TestStrings);
|
||||
}
|
||||
|
|
|
@ -192,3 +192,8 @@ static void objManip (cFCOPropVector &testV, cDebug& d)
|
|||
v3.AddItem(3);
|
||||
TEST((v1 ^ v2) == v3);
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOPropVector()
|
||||
{
|
||||
RegisterTest("FCOPropVector", "Basic", TestFCOPropVector);
|
||||
}
|
||||
|
|
|
@ -171,3 +171,7 @@ void TestFCOReport()
|
|||
d.TraceDebug("Leaving...\n");
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOReport()
|
||||
{
|
||||
RegisterTest("FCOReport", "Basic", TestFCOReport);
|
||||
}
|
||||
|
|
|
@ -75,10 +75,12 @@ void TestFCOSetImpl()
|
|||
pFCO3->Release();
|
||||
|
||||
// let's iterate over the fcos
|
||||
cIterProxy<iFCOIter> pit(set.GetIter());
|
||||
iFCOIter* pIter = set.GetIter();
|
||||
cIterProxy<iFCOIter> pit(pIter);
|
||||
pit->SeekBegin();
|
||||
PrintIter(pit, d);
|
||||
|
||||
|
||||
// lookup a specific fco
|
||||
cIterProxy<iFCOIter> pit2(set.Lookup(cFCOName(_T("fco2"))));
|
||||
if(! (iFCOIter*)pit2)
|
||||
|
@ -113,10 +115,14 @@ void TestFCOSetImpl()
|
|||
// test operator=
|
||||
cFCOSetImpl set2;
|
||||
set2 = set;
|
||||
pit = set2.GetIter();
|
||||
|
||||
pIter->DestroyIter();
|
||||
pIter = set2.GetIter();
|
||||
pit = pIter;
|
||||
d.TraceDebug("Made a new set and set it equal to the first with operator=; printing out...\n");
|
||||
PrintIter(pit, d);
|
||||
|
||||
|
||||
// test IsEmpty
|
||||
set.Clear();
|
||||
TEST(set.IsEmpty());
|
||||
|
@ -142,9 +148,14 @@ void TestFCOSetImpl()
|
|||
pit = set3.GetIter();
|
||||
PrintIter(pit, d);
|
||||
|
||||
pIter->DestroyIter();
|
||||
|
||||
d.TraceDebug("Leaving...\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOSetImpl()
|
||||
{
|
||||
RegisterTest("FCOSetImpl", "Basic", TestFCOSetImpl);
|
||||
}
|
||||
|
|
|
@ -51,3 +51,8 @@ void TestFCOSpec()
|
|||
cout << "End\tTestFCOSpec" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOSpec()
|
||||
{
|
||||
RegisterTest("FCOSpec", "Basic", TestFCOSpec);
|
||||
}
|
||||
|
|
|
@ -85,6 +85,13 @@ void TestFCOSpecAttr()
|
|||
// trace contents...
|
||||
TraceSpecAttr(pNew, d);
|
||||
|
||||
TEST( *pAttr == *pNew );
|
||||
|
||||
pNew->Release();
|
||||
pAttr->Release();
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOSpecAttr()
|
||||
{
|
||||
RegisterTest("FCOSpecAttr", "Basic", TestFCOSpecAttr);
|
||||
}
|
||||
|
|
|
@ -129,3 +129,8 @@ void TestFCOSpecHelper()
|
|||
delete pHelp1;
|
||||
delete pHelp2;
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOSpecHelper()
|
||||
{
|
||||
RegisterTest("FCOSpecHelper", "Basic", TestFCOSpecHelper);
|
||||
}
|
||||
|
|
|
@ -164,3 +164,7 @@ void TestFCOSpecList()
|
|||
return;
|
||||
}
|
||||
|
||||
void RegisterSuite_FCOSpecList()
|
||||
{
|
||||
RegisterTest("FCOSpecList", "Basic", TestFCOSpecList);
|
||||
}
|
||||
|
|
|
@ -80,3 +80,8 @@ void TestFcoSpecUtil()
|
|||
|
||||
d.TraceDebug("Leaving..\n");
|
||||
}
|
||||
|
||||
void RegisterSuite_FcoSpecUtil()
|
||||
{
|
||||
RegisterTest("FcoSpecUtil", "Basic", TestFcoSpecUtil);
|
||||
}
|
||||
|
|
|
@ -58,3 +58,7 @@ void TestFile()
|
|||
TEST(testStream);
|
||||
}
|
||||
|
||||
void RegisterSuite_File()
|
||||
{
|
||||
RegisterTest("File", "Basic", TestFile);
|
||||
}
|
||||
|
|
|
@ -126,3 +126,8 @@ void TestFileHeader()
|
|||
TEST(memcmp(buf, "abc123", 6) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterSuite_FileHeader()
|
||||
{
|
||||
RegisterTest("FileHeader", "Basic", TestFileHeader);
|
||||
}
|
||||
|
|
|
@ -71,3 +71,7 @@ void TestFileUtil()
|
|||
unlink(source.c_str());
|
||||
}
|
||||
|
||||
void RegisterSuite_FileUtil()
|
||||
{
|
||||
RegisterTest("FileUtil", "Basic", TestFileUtil);
|
||||
}
|
||||
|
|
|
@ -62,13 +62,12 @@ static void PrintDb( cHierDatabase::iterator iter, cDebug d, bool bFirst = true
|
|||
|
||||
static void PrintIter( cFSDataSourceIter iter, cDebug& d )
|
||||
{
|
||||
//
|
||||
//debug stuff
|
||||
//
|
||||
|
||||
int count = 0;
|
||||
|
||||
if( ! iter.CanDescend() )
|
||||
{
|
||||
d.TraceError( "Iterator cannot descend; returning!\n");
|
||||
TEST(!"Unexpected !CanDescend at beginning of test");
|
||||
return;
|
||||
}
|
||||
iter.Descend();
|
||||
|
@ -76,6 +75,7 @@ static void PrintIter( cFSDataSourceIter iter, cDebug& d )
|
|||
|
||||
for( iter.SeekBegin(); ! iter.Done(); iter.Next() )
|
||||
{
|
||||
count++;
|
||||
iFCO* pFCO = iter.CreateFCO();
|
||||
if( pFCO )
|
||||
{
|
||||
|
@ -85,6 +85,7 @@ static void PrintIter( cFSDataSourceIter iter, cDebug& d )
|
|||
else
|
||||
{
|
||||
d.TraceError( "*** Create of FCO failed!\n");
|
||||
fail("CreateFCO() failure");
|
||||
}
|
||||
if( iter.CanDescend() )
|
||||
{
|
||||
|
@ -92,20 +93,32 @@ static void PrintIter( cFSDataSourceIter iter, cDebug& d )
|
|||
PrintIter(iter, d);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(count > 0);
|
||||
}
|
||||
|
||||
|
||||
void TestFSDataSourceIter()
|
||||
{
|
||||
skip("Fix this test");
|
||||
|
||||
cFSDataSourceIter iter;
|
||||
cDebug d("TestFSDataSourceIter");
|
||||
|
||||
cFCOName base(TwTestDir());
|
||||
|
||||
// go to my temp directory and iterate over everything!
|
||||
iter.SeekToFCO( cFCOName(_T("/tmp")) );
|
||||
iter.SeekToFCO( cFCOName(TwTestDir()) );
|
||||
|
||||
//
|
||||
// print out everything below the iterator
|
||||
//
|
||||
PrintIter( iter, d );
|
||||
}
|
||||
|
||||
void RegisterSuite_FSDataSourceIter()
|
||||
{
|
||||
RegisterTest("FSDataSourceIter", "Basic", TestFSDataSourceIter);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,9 +32,16 @@
|
|||
// fsobject_t -- the file system object test driver
|
||||
#include "fs/stdfs.h"
|
||||
#include "fs/fsobject.h"
|
||||
#include "test.h"
|
||||
|
||||
void TestFSObject()
|
||||
{
|
||||
cDebug d("TestFSObject");
|
||||
d.TraceError("Implement this!\n");
|
||||
skip("TestFSObject not implemented");
|
||||
}
|
||||
|
||||
void RegisterSuite_FSObject()
|
||||
{
|
||||
RegisterTest("FSObject", "Basic", TestFSObject);
|
||||
}
|
||||
|
|
|
@ -155,4 +155,8 @@ void TestGetSymLinkStr()
|
|||
TEST(arch.Length() == (int64)file.size());
|
||||
}
|
||||
|
||||
|
||||
void RegisterSuite_FSPropCalc()
|
||||
{
|
||||
RegisterTest("FSPropCalc", "Basic", TestFSPropCalc);
|
||||
RegisterTest("FSPropCalc", "GetSymLinkStr", TestGetSymLinkStr);
|
||||
}
|
||||
|
|
|
@ -83,11 +83,11 @@ void cTestFSPropDisplayer::Test()
|
|||
|
||||
pPDNew->Merge( pPD );
|
||||
|
||||
/*
|
||||
|
||||
////////////////////////
|
||||
// write pd
|
||||
cFileArchive outFile;
|
||||
outFile.OpenReadWrite(_T("c:\\tmp\\tmp.pd"));
|
||||
outFile.OpenReadWrite( TwTestPath("tmp.pd").c_str() );
|
||||
cSerializerImpl outSer(outFile, cSerializerImpl::S_WRITE);
|
||||
|
||||
outSer.Init();
|
||||
|
@ -101,16 +101,17 @@ void cTestFSPropDisplayer::Test()
|
|||
////////////////////////
|
||||
// read pd
|
||||
cFileArchive inFile;
|
||||
inFile.OpenRead(_T("c:\\tmp\\tmp.pd"));
|
||||
inFile.OpenRead( TwTestPath("tmp.pd").c_str() );
|
||||
cSerializerImpl inSer(inFile, cSerializerImpl::S_READ);
|
||||
|
||||
cFSPropDisplayer* pPDNew = new cFSPropDisplayer();
|
||||
cFSPropDisplayer* pPDRead = new cFSPropDisplayer();
|
||||
inSer.Init();
|
||||
|
||||
pPDNew->Read( &inSer );
|
||||
pPDRead->Read( &inSer );
|
||||
inSer.Finit();
|
||||
*/
|
||||
|
||||
|
||||
TEST( *pPD == *pPDRead );
|
||||
|
||||
TSTRING strRet;
|
||||
for( i = 0; i < 26; i++ )
|
||||
{
|
||||
|
@ -127,7 +128,14 @@ void cTestFSPropDisplayer::Test()
|
|||
d.TraceDebug("\n");
|
||||
}
|
||||
|
||||
delete pPD;
|
||||
delete pPDNew;
|
||||
delete pPDRead;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void RegisterSuite_FSPropDisplayer()
|
||||
{
|
||||
RegisterTest("FSPropDisplayer", "Basic", TestFSPropDisplayer);
|
||||
}
|
||||
|
|
|
@ -92,3 +92,8 @@ void TestFSPropSet()
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
void RegisterSuite_FSPropSet()
|
||||
{
|
||||
RegisterTest("FSPropSet", "Basic", TestFSPropSet);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue