NetBSD Problem Report #40758

From www@NetBSD.org  Thu Feb 26 12:37:56 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 3E54263C1C0
	for <gnats-bugs@gnats.netbsd.org>; Thu, 26 Feb 2009 12:37:56 +0000 (UTC)
Message-Id: <20090226123755.D290863BD40@www.NetBSD.org>
Date: Thu, 26 Feb 2009 12:37:55 +0000 (UTC)
From: mdehling@uni-math.gwdg.de
Reply-To: mdehling@uni-math.gwdg.de
To: gnats-bugs@NetBSD.org
Subject: send-pr(.sh) creates lock-files even when unneeded and forgets to remove them.
X-Send-Pr-Version: www-1.0

>Number:         40758
>Category:       misc
>Synopsis:       send-pr(.sh) creates lock-files even when unneeded and forgets to remove them.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 26 12:40:00 +0000 2009
>Originator:     Malte Dehling
>Release:        NetBSD-4/NetBSD-5
>Organization:
>Environment:
NetBSD venom.local 4.0_STABLE NetBSD 4.0_STABLE (IBM_THINKPAD_X31) #1: Mon Feb 23 13:25:24 CET 2009  root@venom.local:/home/src/sys/arch/i386/compile/obj/IBM_THINKPAD_X31 i386
>Description:
send-pr uses mktemp to safely create temp-files even if unneeded and in some cases (e.g. send-pr -L) does not remove them.

>How-To-Repeat:
# send-pr -L
Known categories:
[...]
# ls /tmp
/tmp/p.013342aa     /tmp/pbad.013246aa  /tmp/pf.013508aa
>Fix:
Create temp-files only later in the script so that send-pr -L will not create any unneeded temp-files.

Apply the following patch to src/gnu/usr.bin/send-pr/send-pr.sh :

# diff -u send-pr.sh.orig send-pr.sh
--- send-pr.sh.orig     2009-02-26 12:53:22.000000000 +0100
+++ send-pr.sh  2009-02-26 13:25:05.000000000 +0100
@@ -82,10 +82,6 @@
   fi
 fi

-TEMP=`mktemp -t p` || exit 1
-BAD=`mktemp -t pbad` || exit 1
-REF=`mktemp -t pf` || exit 1
-
 # find a user name
 if [ "$LOGNAME" = "" ]; then
        if [ "$USER" != "" ]; then
@@ -270,6 +266,11 @@
 HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
 FIX_C='<how to correct or work around the problem, if known (multiple lines)>'

+# Safely create temporary files.
+TEMP=`mktemp -t p` || exit 1
+BAD=`mktemp -t pbad` || exit 1
+REF=`mktemp -t pf` || exit 1
+
 # Catch some signals. ($xs kludge needed by Sun /bin/sh)
 xs=0
 TRAP_EXIT_ACTION='rm -f $REF $TEMP; exit $xs'

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.