NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/47757: mktemp(3) mangles the pathname if not given an absolute path
The following reply was made to PR bin/47757; it has been noted by GNATS.
From: Eric Radman <ericshane%eradman.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost,
ericshane%eradman.com@localhost
Subject: Re: bin/47757: mktemp(3) mangles the pathname if not given an
absolute path
Date: Sun, 21 Apr 2013 20:03:13 -0400
On Sun, Apr 21, 2013 at 07:45:05PM +0000, Martin Husemann wrote:
> The following reply was made to PR bin/47757; it has been noted by GNATS.
>
> From: Martin Husemann <martin%duskware.de@localhost>
>
> Did the relative ./tmp path exist?
Hi Martin,
No the path doesn't exist, but on other platforms that I've tried (MacOS,
Linux, OpenBSD, FreeBSD) *template is modified correctly weather the
path exists or not.
> The function incorrectly does not return NULL on this type of failure.
>
> Note that you should use mkstemp(3) anyway.
Perhaps I should explain my use case a little more. I'm using this
function as part of a unit test that generates pathnames for functions
that would normally expect user input (argv[1]). Part of the syntax for
the user supplies is an optional prefix, '+'
+/path/to/fifo
The utility strips off the '+' later on, but I need to generate random
paths that include this pattern. I could invent a workaround that adds
the prefix after running mktemp(3)/mkstemp(3), but the man page doesn't
indicate that the paths must start with '/'.
Eric
Home |
Main Index |
Thread Index |
Old Index