NetBSD Problem Report #3525

Received: (qmail-queue invoked from smtpd); 22 Apr 1997 17:33:45 -0000
Message-Id: <199704221733.NAA04741@goofball.omniscient.com>
Date: Tue, 22 Apr 1997 13:33:42 -0400 (EDT)
From: Mike Grupenhoff <kashmir@omniscient.com>
Reply-To: kashmir@omniscient.com
To: gnats-bugs@gnats.netbsd.org
Subject: small race in motd frob in /etc/rc
X-Send-Pr-Version: 3.95

>Number:         3525
>Category:       security
>Synopsis:       small race in motd frob in /etc/rc
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 22 10:35:03 +0000 1997
>Closed-Date:    Sat Apr 26 04:19:29 +0000 1997
>Last-Modified:  Sat Apr 26 04:19:48 +0000 1997
>Originator:     Mike Grupenhoff
>Release:        -current 4/22/97
>Organization:

>Environment:
-current as of 4/22/97

>Description:
	/etc/rc frobs the current kernel version string by using a file in
	/tmp.  However, this occurs after inetd is started, and the file
	is created non-atomically, so there is a smallish potential for
	someone to sneak a symlink in place.
>How-To-Repeat:
	Inspect the following code in /etc/rc:

T=/tmp/_motd
rm -f $T
sysctl -n kern.version | sed 1q > $T
echo "" >> $T
sed '1,/^$/d' < /etc/motd >> $T
cmp -s $T /etc/motd || cp $T /etc/motd
rm -f $T

	Notice that inetd is started before this runs.

>Fix:
	Either move the tmp file to a non-world writeable dir,
	perhaps /etc/_motd, or create a subdirectory in /tmp and
	play in there, or have this occur earlier in /etc/rc before
	any other daemons are started.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mrg 
State-Changed-When: Fri Apr 25 21:19:29 PDT 1997 
State-Changed-Why:  
perry fixed this a few days ago. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.