From hsu@mail.clinet.fi  Tue Dec 15 05:03:33 1998
Received: from lohi.clinet.fi (lohi.clinet.fi [194.100.0.7])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA25603
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Dec 1998 05:03:31 -0800 (PST)
          (envelope-from hsu@mail.clinet.fi)
Received: from katiska.clinet.fi (katiska.clinet.fi [194.100.0.4])
	by lohi.clinet.fi (8.9.1/8.9.0) with ESMTP id PAA06804
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Dec 1998 15:03:44 +0200 (EET)
Received: (from root@localhost)
	by katiska.clinet.fi (8.9.0/8.9.0) id PAA20298;
	Tue, 15 Dec 1998 15:03:23 +0200 (EET)
Message-Id: <199812151303.PAA20298@katiska.clinet.fi>
Date: Tue, 15 Dec 1998 15:03:23 +0200 (EET)
From: Heikki Suonsivu <hsu@clinet.fi>
Reply-To: hsu@clinet.fi
To: FreeBSD-gnats-submit@freebsd.org
Subject: daily/weekly/monthly/security strip hostname
X-Send-Pr-Version: 3.2

>Number:         9091
>Category:       bin
>Synopsis:       [PATCH] daily/weekly/monthly/security strip hostname
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    billf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 15 05:10:00 PST 1998
>Closed-Date:    Fri Jan 1 09:46:22 PST 1999
>Last-Modified:  Fri Jan  1 09:47:55 PST 1999
>Originator:     Heikki Suonsivu
>Release:        FreeBSD 2.2.7-STABLE i386
>Organization:
Clinet, Espoo, Finland
>Environment:

-stable.

>Description:

daily, weekly, monthly and security strip domain part out of hostname.
This causes a mess when there are lots of hosts being managed.  I get some
10 daily/security reports from "www" (.company.{com,fi}) and 10
"central-gw" (.town.fi) and so on.  In particular this makes security
auditing difficult when building automatic systems to watch daily stuff and
summarize them to avoid reading > 200 mails which all say "everything is
fine", as actual host has to be parsed from Received lines.

>How-To-Repeat:

Manage lots of FreeBSD computers.

>Fix:
	
Index: daily
===================================================================
RCS file: /usr/CVS/src/etc/Attic/daily,v
retrieving revision 1.21.2.4
diff -c -r1.21.2.4 daily
*** daily	1998/09/13 23:10:08	1.21.2.4
--- daily	1998/10/14 12:46:28
***************
*** 4,10 ****
  #	@(#)daily	5.12 (Berkeley) 5/24/91
  #
  PATH=/bin:/usr/bin:/sbin:/usr/sbin
! host=`hostname -s`
  echo "Subject: $host daily run output"
  bak=/var/backups
  
--- 4,10 ----
  #	@(#)daily	5.12 (Berkeley) 5/24/91
  #
  PATH=/bin:/usr/bin:/sbin:/usr/sbin
! host=`hostname`
  echo "Subject: $host daily run output"
  bak=/var/backups
  
Index: weekly
===================================================================
RCS file: /usr/CVS/src/etc/Attic/weekly,v
retrieving revision 1.17.2.2
diff -c -r1.17.2.2 weekly
*** weekly	1998/01/10 00:06:55	1.17.2.2
--- weekly	1998/12/15 12:54:27
***************
*** 6,12 ****
  PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
  export PATH
  
! host=`hostname -s`
  echo "Subject: $host weekly run output"
  
  #echo ""
--- 6,12 ----
  PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
  export PATH
  
! host=`hostname`
  echo "Subject: $host weekly run output"
  
  #echo ""
Index: monthly
===================================================================
RCS file: /usr/CVS/src/etc/Attic/monthly,v
retrieving revision 1.6.2.2
diff -c -r1.6.2.2 monthly
*** monthly	1998/09/13 23:10:08	1.6.2.2
--- monthly	1998/12/15 12:54:20
***************
*** 5,11 ****
  #
  
  PATH=/bin:/usr/bin:/sbin:/usr/sbin
! host=`hostname -s`
  echo "Subject: $host monthly run output"
  
  W=/var/log/wtmp
--- 5,11 ----
  #
  
  PATH=/bin:/usr/bin:/sbin:/usr/sbin
! host=`hostname`
  echo "Subject: $host monthly run output"
  
  W=/var/log/wtmp
Index: security
===================================================================
RCS file: /usr/CVS/src/etc/security,v
retrieving revision 1.16.2.6
diff -c -r1.16.2.6 security
*** security	1998/07/08 22:44:08	1.16.2.6
--- security	1998/12/15 12:54:37
***************
*** 11,17 ****
  	echo ""
  }
  
! host=`hostname -s`
  echo "Subject: $host security check output"
  
  LOG=/var/log
--- 11,17 ----
  	echo ""
  }
  
! host=`hostname`
  echo "Subject: $host security check output"
  
  LOG=/var/log


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: billf 
State-Changed-When: Tue Dec 22 15:10:12 PST 1998 
State-Changed-Why:  
The changes seem reasonable and work on my system. 
If no-one objects on -CURRENT, whom I've mailed they should be committed. 


Responsible-Changed-From-To: freebsd-bugs->billf 
Responsible-Changed-By: billf 
Responsible-Changed-When: Tue Dec 22 15:10:12 PST 1998 
Responsible-Changed-Why:  
I will commit these if no-one has any problems with the changes. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: billf 
State-Changed-When: Fri Jan 1 09:46:22 PST 1999 
State-Changed-Why:  
Committed, thanks. 
These patches were for -STABLE, but I updated -CURRENT to have the same behaviour 
>Unformatted:
