[1] | 1 | #! /bin/sh
|
---|
| 2 |
|
---|
[27] | 3 | #
|
---|
| 4 | # Copyright Rainer Wichmann (2006)
|
---|
| 5 | #
|
---|
| 6 | # License Information:
|
---|
| 7 | # This program is free software; you can redistribute it and/or modify
|
---|
| 8 | # it under the terms of the GNU General Public License as published by
|
---|
| 9 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 10 | # (at your option) any later version.
|
---|
| 11 | #
|
---|
| 12 | # This program is distributed in the hope that it will be useful,
|
---|
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | # GNU General Public License for more details.
|
---|
| 16 | #
|
---|
| 17 | # You should have received a copy of the GNU General Public License
|
---|
| 18 | # along with this program; if not, write to the Free Software
|
---|
| 19 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 20 | #
|
---|
[1] | 21 |
|
---|
[170] | 22 | MAXTEST=7; export MAXTEST
|
---|
[19] | 23 | LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
|
---|
| 24 | RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE
|
---|
[1] | 25 |
|
---|
[170] | 26 | testrun1b_modrc ()
|
---|
| 27 | {
|
---|
| 28 | ORIGINAL="\[EOF\]"
|
---|
| 29 | REPLACEMENT="\[PortCheck\]"
|
---|
| 30 | ex -s $RCFILE <<EOF
|
---|
| 31 | %s/$ORIGINAL/$REPLACEMENT/g
|
---|
| 32 | wq
|
---|
| 33 | EOF
|
---|
| 34 |
|
---|
| 35 | echo "PortCheckActive = yes" >>"$RCFILE"
|
---|
| 36 | echo "PortCheckInterface = 127.0.0.1" >>"$RCFILE"
|
---|
| 37 | }
|
---|
| 38 |
|
---|
[19] | 39 | testrun1b_internal ()
|
---|
[1] | 40 | {
|
---|
[19] | 41 | BUILDOPTS="$1"
|
---|
[1] | 42 | #
|
---|
| 43 | # test standalone compilation
|
---|
| 44 | #
|
---|
[19] | 45 | [ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
|
---|
[1] | 46 | #
|
---|
| 47 | if test -r "Makefile"; then
|
---|
[22] | 48 | $MAKE distclean >/dev/null >&1
|
---|
[1] | 49 | fi
|
---|
| 50 | #
|
---|
[159] | 51 | # Bootstrapping
|
---|
[1] | 52 | #
|
---|
[159] | 53 | ${TOP_SRCDIR}/configure >/dev/null 2>/dev/null
|
---|
| 54 | if test x$? = x0; then
|
---|
| 55 | [ -z "$verbose" ] || log_msg_ok "configure (bootstrap)...";
|
---|
| 56 | $MAKE > /dev/null 2>&1
|
---|
| 57 | if test x$? = x0; then
|
---|
| 58 | [ -z "$verbose" ] || log_msg_ok "make (bootstrap)...";
|
---|
| 59 | else
|
---|
| 60 | [ -z "$quiet" ] && log_msg_fail "make (bootstrap)...";
|
---|
| 61 | return 1
|
---|
| 62 | fi
|
---|
| 63 |
|
---|
| 64 | else
|
---|
| 65 | [ -z "$quiet" ] && log_msg_fail "configure (bootstrap)...";
|
---|
| 66 | return 1
|
---|
| 67 | fi
|
---|
[1] | 68 | #
|
---|
| 69 | #
|
---|
[539] | 70 | ${TOP_SRCDIR}/configure ${BUILDOPTS} 2>/dev/null
|
---|
[159] | 71 | #
|
---|
| 72 | #
|
---|
[1] | 73 | if test x$? = x0; then
|
---|
[19] | 74 | [ -z "$verbose" ] || log_msg_ok "configure...";
|
---|
[22] | 75 | $MAKE > /dev/null 2>&1
|
---|
[1] | 76 | if test x$? = x0; then
|
---|
[19] | 77 | [ -z "$verbose" ] || log_msg_ok "make...";
|
---|
[1] | 78 | else
|
---|
[19] | 79 | [ -z "$quiet" ] && log_msg_fail "make...";
|
---|
| 80 | return 1
|
---|
[1] | 81 | fi
|
---|
| 82 |
|
---|
| 83 | else
|
---|
[19] | 84 | [ -z "$quiet" ] && log_msg_fail "configure...";
|
---|
| 85 | return 1
|
---|
[1] | 86 | fi
|
---|
| 87 |
|
---|
[19] | 88 | SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' ${SCRIPTDIR}/test.sh`
|
---|
[1] | 89 |
|
---|
[19] | 90 | tail -n "+$SKIP" ${SCRIPTDIR}/test.sh >/dev/null 2>&1
|
---|
| 91 | if [ $? -eq 0 ]; then
|
---|
[159] | 92 | tail -n "+$SKIP" ${SCRIPTDIR}/test.sh | gunzip -c - 2>/dev/null | tar xf - && \
|
---|
[19] | 93 | mv "./testrc.gpg.asc" "$RCFILE"
|
---|
| 94 | else
|
---|
[159] | 95 | tail "+$SKIP" ${SCRIPTDIR}/test.sh | gunzip -c - 2>/dev/null | tar xf - && \
|
---|
[19] | 96 | mv "./testrc.gpg.asc" "$RCFILE"
|
---|
| 97 | fi
|
---|
| 98 | if test x$? = x0; then
|
---|
| 99 | [ -z "$verbose" ] || log_msg_ok "extract gpg signed files...";
|
---|
| 100 | else
|
---|
| 101 | [ -z "$quiet" ] && log_msg_fail "extract gpg signed files...";
|
---|
| 102 | return 1
|
---|
| 103 | fi
|
---|
| 104 |
|
---|
[52] | 105 | if test "x$2" = "x"; then
|
---|
| 106 | :
|
---|
| 107 | else
|
---|
| 108 | CONVERT="$2"
|
---|
| 109 | if test -f "${TOP_SRCDIR}/stealth_template.jpg"; then
|
---|
| 110 | [ -z "$verbose" ] || log_msg_ok "convert..."
|
---|
| 111 | "${CONVERT}" +compress "${TOP_SRCDIR}/stealth_template.jpg" stealth_template.ps >/dev/null
|
---|
| 112 | else
|
---|
| 113 | [ -z "$quiet" ] && log_msg_fail "cannot find file stealth_template.jpg"
|
---|
| 114 | return 1
|
---|
| 115 | fi
|
---|
| 116 | if [ $? -ne 0 ]; then
|
---|
| 117 | [ -z "$quiet" ] && log_msg_fail "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
|
---|
| 118 | return 1
|
---|
| 119 | fi
|
---|
| 120 |
|
---|
| 121 | [ -z "$verbose" ] || log_msg_ok "hide..."
|
---|
| 122 | ./samhain_stealth -s stealth_template.ps "$RCFILE" >/dev/null
|
---|
| 123 | if [ $? -ne 0 ]; then
|
---|
| 124 | [ -z "$quiet" ] && log_msg_fail "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
|
---|
| 125 | return 1
|
---|
| 126 | fi
|
---|
| 127 |
|
---|
| 128 | mv -f stealth_template.ps "$RCFILE"
|
---|
| 129 | if [ $? -ne 0 ]; then
|
---|
| 130 | [ -z "$quiet" ] && log_msg_fail "mv -f stealth_template.ps $RCFILE";
|
---|
| 131 | return 1
|
---|
| 132 | fi
|
---|
| 133 |
|
---|
| 134 | fi
|
---|
| 135 |
|
---|
[1] | 136 | rm -f ./.samhain_file
|
---|
| 137 | rm -f ./.samhain_log
|
---|
| 138 | rm -f ./.samhain_lock
|
---|
| 139 |
|
---|
[19] | 140 | ./samhain -t init -p none -l info
|
---|
[1] | 141 |
|
---|
| 142 | if test x$? = x0; then
|
---|
[19] | 143 | [ -z "$verbose" ] || log_msg_ok "init...";
|
---|
| 144 | else
|
---|
| 145 | [ -z "$quiet" ] && log_msg_fail "init...";
|
---|
| 146 | return 1
|
---|
| 147 | fi
|
---|
[1] | 148 |
|
---|
[19] | 149 | mv $PW_DIR/.samhain_file.asc $PW_DIR/.samhain_file
|
---|
| 150 | }
|
---|
[1] | 151 |
|
---|
[169] | 152 | testrun1b_nogpg ()
|
---|
| 153 | {
|
---|
| 154 | BUILDOPTS="$1"
|
---|
| 155 | #
|
---|
| 156 | # test standalone compilation
|
---|
| 157 | #
|
---|
| 158 | [ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
|
---|
| 159 | #
|
---|
| 160 | if test -r "Makefile"; then
|
---|
| 161 | $MAKE distclean >/dev/null >&1
|
---|
| 162 | fi
|
---|
| 163 |
|
---|
| 164 | ${TOP_SRCDIR}/configure ${BUILDOPTS} 2>/dev/null
|
---|
| 165 | #
|
---|
| 166 | #
|
---|
| 167 | if test x$? = x0; then
|
---|
| 168 | [ -z "$verbose" ] || log_msg_ok "configure...";
|
---|
| 169 | $MAKE > /dev/null 2>&1
|
---|
| 170 | if test x$? = x0; then
|
---|
| 171 | [ -z "$verbose" ] || log_msg_ok "make...";
|
---|
| 172 | else
|
---|
| 173 | [ -z "$quiet" ] && log_msg_fail "make...";
|
---|
| 174 | return 1
|
---|
| 175 | fi
|
---|
| 176 |
|
---|
| 177 | else
|
---|
| 178 | [ -z "$quiet" ] && log_msg_fail "configure...";
|
---|
| 179 | return 1
|
---|
| 180 | fi
|
---|
| 181 |
|
---|
| 182 | rm -f ./.samhain_file
|
---|
| 183 | rm -f ./.samhain_log
|
---|
| 184 | rm -f ./.samhain_lock
|
---|
| 185 |
|
---|
| 186 | cp "${SCRIPTDIR}/testrc_1" "${RCFILE}"
|
---|
| 187 |
|
---|
[170] | 188 | if test "x$2" = "xmodrc"; then
|
---|
| 189 | [ -z "$verbose" ] || log_msg_ok "mod rc...";
|
---|
| 190 | testrun1b_modrc
|
---|
| 191 | fi
|
---|
| 192 |
|
---|
[169] | 193 | ./samhain -t init -p none -l info
|
---|
| 194 |
|
---|
| 195 | if test x$? = x0; then
|
---|
| 196 | [ -z "$verbose" ] || log_msg_ok "init...";
|
---|
| 197 | else
|
---|
| 198 | [ -z "$quiet" ] && log_msg_fail "init...";
|
---|
| 199 | return 1
|
---|
| 200 | fi
|
---|
| 201 |
|
---|
| 202 | }
|
---|
| 203 |
|
---|
[19] | 204 | do_test_1b () {
|
---|
| 205 |
|
---|
| 206 | ./samhain -t check -p none -l info
|
---|
| 207 |
|
---|
| 208 | if test x$? = x0; then
|
---|
| 209 | ./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
|
---|
| 210 | if [ $? -ne 0 ]; then
|
---|
| 211 | [ -z "$quiet" ] && log_msg_fail "mv logfile...";
|
---|
| 212 | return 1
|
---|
[1] | 213 | fi
|
---|
[19] | 214 | [ -z "$verbose" ] || log_msg_ok "check...";
|
---|
| 215 | else
|
---|
| 216 | [ -z "$quiet" ] && log_msg_fail "check...";
|
---|
| 217 | return 1
|
---|
| 218 | fi
|
---|
| 219 | #
|
---|
| 220 | tmp=`egrep "Checking.*/etc(>|\")" $LOGFILE 2>/dev/null | wc -l`
|
---|
| 221 | if [ $tmp -ne 2 ]; then
|
---|
| 222 | [ -z "$verbose" ] || log_msg_fail "/etc";
|
---|
[60] | 223 | return 1
|
---|
[19] | 224 | fi
|
---|
| 225 | tmp=`egrep "Checking.*(>|\")" $LOGFILE 2>/dev/null | wc -l`
|
---|
[262] | 226 | if [ $tmp -ne 10 ]; then
|
---|
[19] | 227 | [ -z "$verbose" ] || log_msg_fail "checking";
|
---|
[60] | 228 | return 1
|
---|
[19] | 229 | fi
|
---|
[60] | 230 | egrep "ADDED" $LOGFILE >/dev/null 2>&1
|
---|
| 231 | if [ $? -eq 0 ]; then
|
---|
| 232 | [ -z "$verbose" ] || log_msg_fail "init was incomplete";
|
---|
| 233 | return 1
|
---|
| 234 | fi
|
---|
[19] | 235 | #
|
---|
| 236 | return 0
|
---|
[1] | 237 | }
|
---|
| 238 |
|
---|
[19] | 239 | do_test_1b_2 () {
|
---|
[1] | 240 |
|
---|
[562] | 241 | #rm -f $PW_DIR/test_log_prelude
|
---|
| 242 | test_log_prelude="/var/log/prelude/prelude-text.log"
|
---|
| 243 | echo -n >"${test_log_prelude}"
|
---|
| 244 |
|
---|
| 245 | #[ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
|
---|
| 246 | #"$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
|
---|
| 247 | #PID=$!
|
---|
[1] | 248 |
|
---|
[562] | 249 | #five_sec_sleep
|
---|
[1] | 250 |
|
---|
[20] | 251 | ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null
|
---|
[19] | 252 |
|
---|
| 253 | if test x$? = x0; then
|
---|
| 254 | ./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
|
---|
| 255 | if [ $? -ne 0 ]; then
|
---|
| 256 | [ -z "$quiet" ] && log_msg_fail "mv logfile...";
|
---|
| 257 | kill $PID
|
---|
| 258 | return 1
|
---|
| 259 | fi
|
---|
| 260 | [ -z "$verbose" ] || log_msg_ok "check...";
|
---|
| 261 | else
|
---|
| 262 | [ -z "$quiet" ] && log_msg_fail "check...";
|
---|
[562] | 263 | #kill $PID
|
---|
[19] | 264 | return 1
|
---|
| 265 | fi
|
---|
| 266 | #
|
---|
[562] | 267 | tmp=`egrep 'File original:.*name=etc.*path=/etc' ${test_log_prelude} 2>/dev/null | wc -l`
|
---|
[81] | 268 | if [ $tmp -lt 1 ]; then
|
---|
[19] | 269 | [ -z "$verbose" ] || log_msg_fail "/etc";
|
---|
[562] | 270 | #kill $PID
|
---|
[206] | 271 | return 1
|
---|
[19] | 272 | fi
|
---|
[562] | 273 | tmp=`egrep 'Classification text: Checking' ${test_log_prelude} 2>/dev/null | wc -l`
|
---|
[81] | 274 | if [ $tmp -lt 1 ]; then
|
---|
[19] | 275 | [ -z "$verbose" ] || log_msg_fail "checking";
|
---|
[562] | 276 | #kill $PID
|
---|
[206] | 277 | return 1
|
---|
[19] | 278 | fi
|
---|
[170] | 279 | #
|
---|
| 280 | if test "x$2" = "xmodrc"; then
|
---|
[562] | 281 | tmp=`egrep 'Classification text: Service opened' ${test_log_prelude} 2>/dev/null | wc -l`
|
---|
[170] | 282 | if [ $tmp -lt 1 ]; then
|
---|
| 283 | [ -z "$verbose" ] || log_msg_fail "service";
|
---|
[562] | 284 | #kill $PID
|
---|
[206] | 285 | return 1
|
---|
[170] | 286 | fi
|
---|
[562] | 287 | tmp=`egrep 'Service: port=5500' ${test_log_prelude} 2>/dev/null | wc -l`
|
---|
[170] | 288 | if [ $tmp -lt 1 ]; then
|
---|
| 289 | [ -z "$verbose" ] || log_msg_fail "port 5500";
|
---|
[562] | 290 | #kill $PID
|
---|
[206] | 291 | return 1
|
---|
[170] | 292 | fi
|
---|
[19] | 293 | fi
|
---|
| 294 | #
|
---|
[562] | 295 | #kill $PID
|
---|
[19] | 296 | return 0
|
---|
| 297 | }
|
---|
[1] | 298 |
|
---|
[19] | 299 | testrun1b ()
|
---|
| 300 | {
|
---|
| 301 | log_start "RUN STANDALONE W/STEALTH W/GPG"
|
---|
| 302 | GPG=`find_path gpg`
|
---|
| 303 | if [ -z "$GPG" ]; then
|
---|
| 304 | log_skip 1 $MAXTEST 'gpg not found in $PATH'
|
---|
| 305 | log_skip 2 $MAXTEST 'gpg not found in $PATH'
|
---|
[100] | 306 | log_skip 3 $MAXTEST 'gpg not found in $PATH'
|
---|
[170] | 307 | log_skip 4 $MAXTEST 'gpg not found in $PATH'
|
---|
| 308 | log_skip 5 $MAXTEST 'gpg not found in $PATH'
|
---|
| 309 | log_skip 6 $MAXTEST 'gpg not found in $PATH'
|
---|
| 310 | log_skip 7 $MAXTEST 'gpg not found in $PATH'
|
---|
[19] | 311 | else
|
---|
| 312 | eval "$GPG" --list-keys 0F571F6C >/dev/null 2>/dev/null
|
---|
| 313 | if [ $? -ne 0 ]; then
|
---|
| 314 | log_skip 1 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
| 315 | log_skip 2 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
[100] | 316 | log_skip 3 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
[163] | 317 | log_skip 4 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
| 318 | log_skip 5 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
[170] | 319 | log_skip 6 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
| 320 | log_skip 7 $MAXTEST 'public PGP key 0x0F571F6C not present'
|
---|
[19] | 321 | else
|
---|
[52] | 322 | #
|
---|
| 323 | # ------------- first test -------------
|
---|
| 324 | #
|
---|
[163] | 325 | BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
[52] | 326 | testrun1b_internal "${BUILDOPTS}"
|
---|
[19] | 327 | do_test_1b
|
---|
| 328 | if [ $? -eq 0 ]; then
|
---|
| 329 | log_ok 1 $MAXTEST 'gpg signed config/database files'
|
---|
| 330 | else
|
---|
| 331 | log_fail 1 $MAXTEST 'gpg signed config/database files'
|
---|
| 332 | fi
|
---|
[52] | 333 |
|
---|
| 334 |
|
---|
| 335 | #
|
---|
| 336 | # ------------- second test -------------
|
---|
| 337 | #
|
---|
[163] | 338 | BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
| 339 | testrun1b_internal "${BUILDOPTS}"
|
---|
| 340 | do_test_1b
|
---|
| 341 | if [ $? -eq 0 ]; then
|
---|
| 342 | log_ok 2 $MAXTEST 'gpg signed config/database files'
|
---|
| 343 | else
|
---|
| 344 | log_fail 2 $MAXTEST 'gpg signed config/database files'
|
---|
| 345 | fi
|
---|
| 346 |
|
---|
| 347 |
|
---|
| 348 | #
|
---|
| 349 | # ------------- third test -------------
|
---|
| 350 | #
|
---|
| 351 | BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum --with-fp=EF6CEF54701A0AFDB86AF4C31AAD26C80F571F6C --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
| 352 | testrun1b_internal "${BUILDOPTS}"
|
---|
| 353 | do_test_1b
|
---|
| 354 | if [ $? -eq 0 ]; then
|
---|
| 355 | log_ok 3 $MAXTEST 'gpg signed config/database files'
|
---|
| 356 | else
|
---|
| 357 | log_fail 3 $MAXTEST 'gpg signed config/database files'
|
---|
| 358 | fi
|
---|
| 359 |
|
---|
| 360 |
|
---|
| 361 | #
|
---|
| 362 | # ------------- fourth test -------------
|
---|
| 363 | #
|
---|
[52] | 364 | PRECONV=`find_path convert`
|
---|
| 365 | "${PRECONV}" --help | grep ImageMagick >/dev/null 2>&1 && \
|
---|
| 366 | CONVERT="${PRECONV}"
|
---|
| 367 |
|
---|
| 368 | if [ -z "$CONVERT" ]; then
|
---|
| 369 | log_skip 2 $MAXTEST 'ImageMagick convert not found in $PATH'
|
---|
| 370 | else
|
---|
[159] | 371 | BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum --enable-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
[52] | 372 | testrun1b_internal "${BUILDOPTS}" "$CONVERT"
|
---|
| 373 | do_test_1b
|
---|
| 374 | if [ $? -eq 0 ]; then
|
---|
[163] | 375 | log_ok 4 $MAXTEST 'gpg signed config/database files'
|
---|
[52] | 376 | else
|
---|
[163] | 377 | log_fail 4 $MAXTEST 'gpg signed config/database files'
|
---|
[52] | 378 | fi
|
---|
| 379 | fi
|
---|
| 380 |
|
---|
| 381 |
|
---|
| 382 | #
|
---|
[163] | 383 | # ------------- fifth test -------------
|
---|
[52] | 384 | #
|
---|
[170] | 385 | if ! test -d /var/run/prelude-manager
|
---|
[96] | 386 | then
|
---|
[170] | 387 | [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager...";
|
---|
| 388 | sudo mkdir /var/run/prelude-manager
|
---|
| 389 | sudo chown prelude:rainer /var/run/prelude-manager
|
---|
| 390 | sudo chmod 770 /var/run/prelude-manager
|
---|
[96] | 391 | fi
|
---|
| 392 | #
|
---|
[19] | 393 | PM=`find_path prelude-manager`
|
---|
| 394 | if [ -z "$PM" ]; then
|
---|
[163] | 395 | log_skip 5 $MAXTEST 'prelude-manager not found in $PATH'
|
---|
[19] | 396 | elif [ -z "$doall" ]; then
|
---|
[163] | 397 | log_skip 5 $MAXTEST 'logging to prelude (or use --really-all)'
|
---|
[19] | 398 | else
|
---|
[159] | 399 | BUILDOPTS="--quiet $TRUST --enable-debug --with-prelude --with-gpg=${GPG} --with-checksum --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
[20] | 400 | testrun1b_internal "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1"
|
---|
[19] | 401 | do_test_1b_2
|
---|
| 402 | if [ $? -eq 0 ]; then
|
---|
[163] | 403 | log_ok 5 $MAXTEST 'logging to prelude'
|
---|
[19] | 404 | else
|
---|
[163] | 405 | log_fail 5 $MAXTEST 'logging to prelude'
|
---|
[19] | 406 | fi
|
---|
| 407 | fi
|
---|
[169] | 408 |
|
---|
| 409 | #
|
---|
| 410 | # ------------- sixth test -------------
|
---|
| 411 | #
|
---|
[170] | 412 | if ! test -d /var/run/prelude-manager
|
---|
[169] | 413 | then
|
---|
[170] | 414 | [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager...";
|
---|
| 415 | sudo mkdir /var/run/prelude-manager
|
---|
| 416 | sudo chown prelude:rainer /var/run/prelude-manager
|
---|
| 417 | sudo chmod 770 /var/run/prelude-manager
|
---|
[169] | 418 | fi
|
---|
| 419 | #
|
---|
| 420 | PM=`find_path prelude-manager`
|
---|
| 421 | if [ -z "$PM" ]; then
|
---|
| 422 | log_skip 6 $MAXTEST 'prelude-manager not found in $PATH'
|
---|
| 423 | elif [ -z "$doall" ]; then
|
---|
| 424 | log_skip 6 $MAXTEST 'logging to prelude (or use --really-all)'
|
---|
| 425 | else
|
---|
| 426 | BUILDOPTS="--quiet $TRUST --with-prelude --enable-login-watch --enable-mounts-check --enable-process-check --enable-port-check --enable-suidcheck --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
| 427 | testrun1b_nogpg "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1"
|
---|
| 428 | do_test_1b_2
|
---|
| 429 | if [ $? -eq 0 ]; then
|
---|
| 430 | log_ok 6 $MAXTEST 'logging to prelude'
|
---|
| 431 | else
|
---|
| 432 | log_fail 6 $MAXTEST 'logging to prelude'
|
---|
| 433 | fi
|
---|
| 434 | fi
|
---|
| 435 |
|
---|
[170] | 436 | #
|
---|
| 437 | # ------------- seventh test -----------
|
---|
| 438 | #
|
---|
| 439 | if ! test -d /var/run/prelude-manager
|
---|
| 440 | then
|
---|
| 441 | [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager...";
|
---|
| 442 | sudo mkdir /var/run/prelude-manager
|
---|
| 443 | sudo chown prelude:rainer /var/run/prelude-manager
|
---|
| 444 | sudo chmod 770 /var/run/prelude-manager
|
---|
| 445 | fi
|
---|
| 446 | #
|
---|
| 447 | PM=`find_path prelude-manager`
|
---|
| 448 | if [ -z "$PM" ]; then
|
---|
| 449 | log_skip 7 $MAXTEST 'prelude-manager not found in $PATH'
|
---|
| 450 | elif [ -z "$doall" ]; then
|
---|
| 451 | log_skip 7 $MAXTEST 'logging to prelude (or use --really-all)'
|
---|
| 452 | else
|
---|
| 453 | BUILDOPTS="--quiet $TRUST --with-prelude --enable-login-watch --enable-mounts-check --enable-process-check --enable-port-check --enable-suidcheck --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
|
---|
| 454 | testrun1b_nogpg "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1" "modrc"
|
---|
| 455 | do_test_1b_2
|
---|
| 456 | if [ $? -eq 0 ]; then
|
---|
| 457 | log_ok 7 $MAXTEST 'logging to prelude'
|
---|
| 458 | else
|
---|
| 459 | log_fail 7 $MAXTEST 'logging to prelude'
|
---|
| 460 | fi
|
---|
| 461 | fi
|
---|
| 462 |
|
---|
[19] | 463 | fi
|
---|
| 464 | fi
|
---|
| 465 | log_end "RUN STANDALONE W/STEALTH W/GPG"
|
---|
| 466 | return 0
|
---|
| 467 | }
|
---|
[1] | 468 |
|
---|