Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16635

Re: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
Date 2020-07-28 09:22 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.201.1595942537.2739.bug-bash@gnu.org> (permalink)
References <CAGP6PO+BCwmkfqEtX-a1Hi73LAU_jsCEFKpUUwwOPrZpfyLdkA@mail.gmail.com> <96966c3d-1f67-8f98-32e3-e8aeb72d04cd@case.edu>

Show all headers | View raw


On 7/28/20 8:19 AM, Hongyi Zhao wrote:
> Hi,
> 
> On Ubuntu 20.04, I try to compile the git master version of bash with
> the followin steps:
> 
> $ sudo apt-get build-dep bash
> $ git clone https://git.savannah.gnu.org/git/bash.git bash.git
> $ cd bash.git
> $ ./configure
> $ make -j44
> [...]
> /usr/bin/ld: ./lib/sh/libsh.a(tmpfile.o): in function `sh_mktmpname':
> /home/werner/Public/repo/git.savannah.gnu.org/git/bash.git/lib/sh/tmpfile.c:152:
> warning: the use of `mktemp' is dangerous, better use `mkstemp' or
> `mkdtemp'
> [...]
> 
> 
> Any hints for fix this warning?

It's a spurious warning, with no apparent way to disable. The warning
assumes that you immediately want a file descriptor or a directory, but
provides no way to indicate that you are going to follow with mkfifo().
If you're going to do that, the warning is just wrong.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' Chet Ramey <chet.ramey@case.edu> - 2020-07-28 09:22 -0400

csiph-web