Subject: Re: Warning message: Why do I care?
To: David Maxwell <david@vex.net>
From: Greywolf <greywolf@starwolf.com>
List: current-users
Date: 07/19/2002 13:28:52
My question remains:
Is there a way to disable these warnings? I'm getting log generations
from these that are amazing. These should probably be kern.notice or
kern.info level. Something that I can use to avoid the detritus.
I'd like to see them unto their own class. The verbosity, for my
purposes, is excessive.
On Fri, 19 Jul 2002, David Maxwell wrote:
# Date: Fri, 19 Jul 2002 11:49:56 -0400
# From: David Maxwell <david@vex.net>
# To: Greywolf <greywolf@starwolf.com>
# Cc: Steven M. Bellovin <smb@research.att.com>,
# Peter Seebach <seebs@plethora.net>, current-users@netbsd.org
# Subject: Re: Warning message: Why do I care?
#
# On Thu, Jul 18, 2002 at 07:13:58PM -0700, Greywolf wrote:
# > Is there a way to disable these warnings? This level of warning seems
# > over the top to me. But I'd like other warnings at the same pri.level
# > possibly to come through.
#
# A specific example might help convince you that these are significant...
#
# Suppose you invoke /usr/bin/passwd (which is setuid root), with an
# invalid command line argument...
#
# $ /usr/bin/passwd -h
# passwd: illegal option -- h
# usage:
# passwd [-y] [user]
# passwd [-l] [user]
#
#
# Simple enough, you get an error. Now, using the shell, close the stderr
# handle first:
#
# $ /usr/bin/passwd -h 2>&-
#
# No output is returned, you just get your prompt back.
# Now, passwd is smart enough to check its arguments first, and return the
# error message immediately - but let's pretend for a moment that it
# didn't do that right away, and instead opened up some filehandles...
#
# If it opens /etc/passwd first, it will be assigned descriptor 2 'stderr',
# and when the usage statement is printed, your passwd file is now
# corrupt.
#
# Since the kernel can't sanity check the operation of programs, the best
# it can do is warn about this so that you know. So, unless absolutely
# neccessary - don't close FDs before running programs.
#
# --
# David Maxwell, david@vex.net|david@maxwell.net --> Although some of you out
# there might find a microwave oven controlled by a Unix system an attractive
# idea, controlling a microwave oven is easily accomplished with the smallest
# of microcontrollers. - Russ Hersch - (Microcontroller primer and FAQ)
#
#
--*greywolf;
--
NetBSD: it'll be there when you're ready for it.