NetBSD Problem Report #58565

From www@netbsd.org  Sat Aug 10 02:43:03 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3FF181A923E
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 10 Aug 2024 02:43:03 +0000 (UTC)
Message-Id: <20240810024302.00AD31A9241@mollari.NetBSD.org>
Date: Sat, 10 Aug 2024 02:43:01 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: lib/libcurses/t_curses writes to /tmp and doesn't clean up
X-Send-Pr-Version: www-1.0

>Number:         58565
>Category:       misc
>Synopsis:       lib/libcurses/t_curses writes to /tmp and doesn't clean up
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 10 02:45:00 +0000 2024
>Last-Modified:  Sat Aug 10 09:00:01 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, ...
>Organization:
The /tmp/NetBSD.windation
>Environment:
>Description:
After `cd /usr/tests/lib/libcurses && atf-run', a file called /tmp/getwin.win remains.
>How-To-Repeat:
cd /usr/tests/lib/libcurses && atf-run
>Fix:
Yes, please!

Ideally, it should use the atf work directory.

Failing that, it should respect $TMPDIR instead of having /tmp hard-coded.

And in any case it should clean up after itself.

>Audit-Trail:
From: Sunil Nimmagadda <sunil@nimmagadda.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/58565: lib/libcurses/t_curses writes to /tmp and doesn't
 clean up
Date: Sat, 10 Aug 2024 14:27:53 +0530

 campbell+netbsd@mumble.net writes:

 >>Number:         58565
 >>Category:       misc
 >>Synopsis:       lib/libcurses/t_curses writes to /tmp and doesn't clean up
 >>Confidential:   no
 >>Severity:       serious
 >>Priority:       medium
 >>Responsible:    misc-bug-people
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Sat Aug 10 02:45:00 +0000 2024
 >>Originator:     Taylor R Campbell
 >>Release:        current, ...
 >>Organization:
 > The /tmp/NetBSD.windation
 >>Environment:
 >>Description:
 > After `cd /usr/tests/lib/libcurses && atf-run', a file called /tmp/getwin.win remains.
 >>How-To-Repeat:
 > cd /usr/tests/lib/libcurses && atf-run
 >>Fix:
 > Yes, please!
 >
 > Ideally, it should use the atf work directory.
 >
 > Failing that, it should respect $TMPDIR instead of having /tmp hard-coded.
 >
 > And in any case it should clean up after itself.

 This diff lets the test create its temp file in the working directory
 which is subsequently cleared by atf.

 PS: New to atf(7) and tests(7) part of the tree.

 diff --git a/tests/lib/libcurses/tests/getwin b/tests/lib/libcurses/tests/getwin
 --- a/tests/lib/libcurses/tests/getwin
 +++ b/tests/lib/libcurses/tests/getwin
 @@ -1,7 +1,7 @@
  include window
  call OK mvwaddch $win1 2 3 `\001a` 
  call OK wrefresh $win1
 -assign FILE "/tmp/getwin.win" 
 +assign FILE "getwin.win"
  call OK putwin $win1 $FILE
  call win2 getwin $FILE
  check win2 NON_NULL

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.