#!/bin/sh
#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
#  bin/rlogin.sara
#
#  Does host trust us?  What is in hosts.equiv (probably a "+", if
# this works...)  Should run as "root"
#
#  CHANGES TO BE DONE: do something with the output.
#
# version 2, Sat Apr  8 21:02:49 1995, last mod by wietse
# version 2, Mon Mar  8 23:30:00 1999, last mod by todd
#
. config/paths.sh

user=bin
tmp_file="./tmp_file.$$"

# arg stuff:
while $TEST $# != 0
        do       case "$1" in
        -u)      user=$2 ; shift ;;
        *)       target=$1
        esac
        shift
        done

if $TEST "X$target" = "X" ; then
        $ECHO Usage $0 [-u user] target
        exit 1
        fi

# used in final output
# target=$1
service="login"
status="a"
service_output=""


$TIMEOUT 10 $RLOGIN $target > $tmp_file 2> /dev/null
$STTY sane
if $GREP -i password  "$tmp_file" >/dev/null ; then
	severity="zwoi"
	trustee="ANY@$target"
	trusted="ANY@$target"
	service_output="Doubtful Internet service"
	text="confirm that rlogin should be running"
	fi

$ECHO "$target|$service|$status|$severity|$trustee|$trusted|$service_output|$text"

$RM -f $tmp_file

exit 0

# finis
