NetBSD Problem Report #48404

From neitzel@hackett.marshlabs.gaertner.de  Sun Nov 24 18:19:45 2013
Return-Path: <neitzel@hackett.marshlabs.gaertner.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C31A2A61B3
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 24 Nov 2013 18:19:45 +0000 (UTC)
Message-Id: <20131124181940.7FA495704@hackett.marshlabs.gaertner.de>
Date: Sun, 24 Nov 2013 19:19:40 +0100 (CET)
From: neitzel@hackett.marshlabs.gaertner.de
Reply-To: neitzel@marshlabs.gaertner.de
To: gnats-bugs@gnats.NetBSD.org
Subject: msgs -c "cleanup" threshold documented with wrong syntax
X-Send-Pr-Version: 3.95

>Number:         48404
>Category:       bin
>Synopsis:       msgs -c "cleanup" threshold documented with wrong syntax
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 24 18:20:00 +0000 2013
>Closed-Date:    Sun Nov 24 21:34:59 +0000 2013
>Last-Modified:  Sun Nov 24 21:34:59 +0000 2013
>Originator:     Martin Neitzel
>Release:        NetBSD 2.0 through 6.1.2
>Organization:
	Marshlabs
>Environment:


System: NetBSD hackett.marshlabs.gaertner.de 6.1_STABLE NetBSD 6.1_STABLE (GENERIC) #0: Tue Oct 22 21:04:23 CEST 2013 neitzel@hackett.marshlabs.gaertner.de:/scratch/obj/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	"msgs -c" for cleaning up the msgs(1) spool accepts an optional
	further argument specifing a non-default cut-off threshold.
	An editorial change in 2003 omitted the required dash in front
	of this threshold argument.  Actual non-dashed -c thresholds
	will be silently ignored, though, resulting in the default
	(21 days) still being applied.

>How-To-Repeat:
	(1) Make sure your have some worthless test message submitted:
	If needs be, enable "mail msgs" by activating the /etc/mail/aliases
	entry and obeying the additioal notes form PR 46790.
	Submit a test msg.

	(2) Wait 4 days.   (But less then three weeks, because "msgs -c"
	will be run from the default /etc/daily)

	(3) As root, run "msgs -c 2"  (as (incorrectly) documented).
	Find your test msg still surviving in /var/msgs.
	(In fact, the code will apply the default threshold of 21 days.)

	(4) As root, run "msgs -c -2" (as implemented and previously
	documented).  ==> clean.

>Fix:
	While the "dashed" argument syntax is a bit strange, its
	implemention quite hacky, and a change of the program
	to actually implement the non-dashed syntax would be trivial,
	I recommend to stick with historical practice.

	So here's the patch for the documentation:

Index: msgs.1
===================================================================
RCS file: /cvsroot/src/usr.bin/msgs/msgs.1,v
retrieving revision 1.17
diff -u -r1.17 msgs.1
--- msgs.1	3 Sep 2004 14:24:50 -0000	1.17
+++ msgs.1	24 Nov 2013 14:20:57 -0000
@@ -43,7 +43,7 @@
 .Nm
 .Op Fl s
 .Nm
-.Op Fl c Op Ar days
+.Op Fl c Op Ar \-days
 .Sh DESCRIPTION
 .Nm
 is used to read system messages.

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48404 CVS commit: src/usr.bin/msgs
Date: Sun, 24 Nov 2013 19:49:22 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sun Nov 24 19:49:22 UTC 2013

 Modified Files:
 	src/usr.bin/msgs: msgs.1

 Log Message:
 Fix documentation of how to expire old messages. For some reason the
 expiration period must be given as a negative number, indicating how
 many days ago to place the expire threshold.

 PR 48404 from Martin Neitzel.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 src/usr.bin/msgs/msgs.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 24 Nov 2013 21:34:59 +0000
State-Changed-Why:
Fixed in HEAD, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.