NetBSD Problem Report #55441

From  Wed Jul  1 03:46:05 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 42A4B1A9217
	for <>; Wed,  1 Jul 2020 03:46:05 +0000 (UTC)
Message-Id: <20200701034556.551EA1AECC5@kafka.localdomain>
Date: Wed,  1 Jul 2020 06:45:56 +0300 (EEST)
Sender: j ruohonen <>
Subject: mktemp(3) does not accept an arbitrary number of 'X's
X-Send-Pr-Version: 3.95

>Number:         55441
>Category:       lib
>Synopsis:       mktemp(3) does not accept an arbitrary number of 'X's
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 01 03:50:00 +0000 2020
>Closed-Date:    Mon Jan 11 20:30:39 +0000 2021
>Last-Modified:  Mon Jan 11 20:30:39 +0000 2021
>Release:        NetBSD 9.99.68
System: NetBSD kafka 9.99.68 NetBSD 9.99.68 (CUSTOM) #0: Tue Jun 23 11:22:56 EEST 2020 jruoho@kafka:/tmp/obj/sys/arch/amd64/compile/CUSTOM amd64
Architecture: x86_64
Machine: amd64
The mktemp(3) manual page says: 

"Although the NetBSD mplementation of the functions will accept any number
of trailing ‘X’s [...]".

However, this claim seems to be untrue. Note that the whole mktemp(3) family
of functions is affected.

Try mktemp(3) with a template containing, e.g., PATH_MAX of 'X's.
Either fix the implementation or the documentation.


From: "Jukka Ruohonen" <>
Subject: PR/55441 CVS commit: src/tests/lib/libc/stdlib
Date: Wed, 1 Jul 2020 05:37:25 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Wed Jul  1 05:37:25 UTC 2020

 Modified Files:
 	src/tests/lib/libc/stdlib: t_mktemp.c

 Log Message:
 Add basic tests for the rest of the mktemp(3) family of functions, including
 a case for PR lib/55441.

 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdlib/t_mktemp.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-When: Mon, 11 Jan 2021 15:30:39 -0500
The bug is in the test code. You can't create PATH_MAX filenames, only NAME_MAX.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.