From owner-freebsd-bugs Wed Jul 24 10:10:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F26A37B401 for ; Wed, 24 Jul 2002 10:10:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D1F243E84 for ; Wed, 24 Jul 2002 10:10:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6OHA5JU057274 for ; Wed, 24 Jul 2002 10:10:05 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6OHA5j8057273; Wed, 24 Jul 2002 10:10:05 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ECF5A37B400 for ; Wed, 24 Jul 2002 10:06:20 -0700 (PDT) Received: from mleko.xocolatl.com (xocolatl.com [216.240.48.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9031943E3B for ; Wed, 24 Jul 2002 10:06:20 -0700 (PDT) (envelope-from frf@xocolatl.com) Received: from mleko.xocolatl.com (localhost [127.0.0.1]) by mleko.xocolatl.com (8.12.5/8.12.5) with ESMTP id g6OH6KoW090931 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 24 Jul 2002 10:06:20 -0700 (PDT) (envelope-from frf@mleko.xocolatl.com) Received: (from frf@localhost) by mleko.xocolatl.com (8.12.5/8.12.5/Submit) id g6OH6K6k090930; Wed, 24 Jul 2002 10:06:20 -0700 (PDT) (envelope-from frf) Message-Id: <200207241706.g6OH6K6k090930@mleko.xocolatl.com> Date: Wed, 24 Jul 2002 10:06:20 -0700 (PDT) From: frf Reply-To: frf To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/40960: periodic security leaves tmp files behind Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40960 >Category: bin >Synopsis: periodic security leaves tmp files behind >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 24 10:10:04 PDT 2002 >Closed-Date: >Last-Modified: >Originator: frf@xocolatl.com >Release: FreeBSD 4.6-STABLE i386 >Organization: >Environment: System: FreeBSD mleko.xocolatl.com 4.6-STABLE FreeBSD 4.6-STABLE >Description: Most of the scripts in /etc/periodic/security use mktemp to create temp files, and then they go into a case statement to decide if the body of the script should be run. If the "case" is YES, then the tempfile is removed at the bottom of the statement. If the "case" is "not YES", the 'rm -f ${TMP} is never reached and a zero length temp file remains behind after the script exits. >How-To-Repeat: Change YES to NO for any of the "periodic security" options that create a temp file >Fix: move the TMP=`mktemp` bit inside the case statement (preferred) duplicate the rm $TMP for the default case move the rm $TMP outside the case statement >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message