NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/40758: send-pr(.sh) creates lock-files even when unneeded and forgets to remove them.



>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@localhost:/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'



Home | Main Index | Thread Index | Old Index