Bug 20575

Summary: /etc/security errors if no old compressed files
Product: Base System Reporter: sjr <sjr>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   

Description sjr 2000-08-13 16:10:01 UTC
	When /etc/security is run on a new install, it errors
	since there are no old zgipped files:

	XXX login failures:
	/var/log/messages.0*.gz: No such file or directory

	XXX refused connections:
	/var/log/messages.0*.gz: No such file or directory

Fix: 

There are probably two different solutions to this problem, either
	redirect error output to /dev/null, or implement a similiar
	solution to the one in 460.status-mail-rejects.

	See PR (http://www.freebsd.org/cgi/query-pr.cgi?pr=20514)
Comment 1 Brian Somers 2000-08-14 00:16:38 UTC
> >Number:         20575
> >Category:       misc
> >Synopsis:       /etc/security errors if no old compressed files

Perhaps zcat needs a -s option (as cat(1) has).
-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !
Comment 2 Sheldon Hearn 2000-08-14 11:06:53 UTC
On Sun, 13 Aug 2000 16:30:05 MST, Brian Somers wrote:

>  > >Number:         20575
>  > >Category:       misc
>  > >Synopsis:       /etc/security errors if no old compressed files
>  
>  Perhaps zcat needs a -s option (as cat(1) has).

Perhaps, but you could get around this problem quite easily with the
following patch.

Ciao,
Sheldon.

Index: security
===================================================================
RCS file: /home/ncvs/src/etc/security,v
retrieving revision 1.41
diff -u -d -r1.41 security
--- security	2000/08/07 09:08:35	1.41
+++ security	2000/08/14 10:05:05
@@ -136,16 +136,22 @@
 	fi
 fi
 
+msgfiles="`ls $LOG/messages.0* $LOG/messages 2>/dev/null`"
+
 # Show login failures
 #
 separator
 echo "${host} login failures:"
-zcat -f $LOG/messages.0* $LOG/messages | grep -i "^$yesterday.*login failure"
+if [ -n "${msgfiles}" ]; then
+	zcat -f ${msgfiles} | grep -i "^$yesterday.*login failure"
+fi
 
 # Show tcp_wrapper warning messages
 #
 separator
 echo "${host} refused connections:"
-zcat -f $LOG/messages.0* $LOG/messages | grep -i "^$yesterday.*refused connect"
+if [ -n "${msgfiles}" ]; then
+	zcat -f ${msgfiles} | grep -i "^$yesterday.*refused connect"
+fi
 
 rm -f ${TMP}
Comment 3 Brian Somers freebsd_committer freebsd_triage 2000-09-20 22:29:04 UTC
State Changed
From-To: open->closed

This was fixed with the latest version of /etc/security in -stable and -current