[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] test release for GSL 2.4
From: |
Patrick Alken |
Subject: |
Re: [Help-gsl] test release for GSL 2.4 |
Date: |
Thu, 22 Jun 2017 09:48:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
> Hello,
>
> what is wrong about using tmpnam + fopen ?
>
> See "Remarks" section in
> https://msdn.microsoft.com/en-us/library/x8x7sakw.aspx
>
> It should solve the problem with placing the file in other path than
> root directory. According to linux manpages, both tmpnam and fopen
> should be C89 compatible.
> https://msdn.microsoft.com/de-de/subscriptions/hs3e7355(v=vs.80).aspx
> states it is ANSI compatible implementation available since Windows 95.
>
> David
>
Yes I should have clarified before, tmpnam() is a possible alternative,
however it is generally recommended to avoid this function.
For example, see
https://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html
Quote:
----
Warning: Between the time the pathname is constructed and the file is
created another process might have created a file with the same name
using tmpnam, leading to a possible security hole. The implementation
generates names which can hardly be predicted, but when opening the file
you should use the O_EXCL flag. Using tmpfile or mkstemp is a safe way
to avoid this problem.
----
So I should have said that tmpfile() appears to be the only ANSI C89
method of using temporary files which is thread-safe and also does not
contain the security vulnerability described above. The Linux man page
for tmpnam() also includes this:
----
BUGS
Never use this function. Use mkstemp(3) or tmpfile(3) instead.
----
- Re: [Help-gsl] test release for GSL 2.4, (continued)
- Re: [Help-gsl] test release for GSL 2.4, Max Gaspa, 2017/06/21
- Re: [Help-gsl] test release for GSL 2.4, ƦOB COASTN, 2017/06/21
- Re: [Help-gsl] test release for GSL 2.4, sisyphus1, 2017/06/21
- Re: [Help-gsl] test release for GSL 2.4, maxgacode, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4, sisyphus1, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4, Max Gaspa, 2017/06/23
- Re: [Help-gsl] test release for GSL 2.4, sisyphus1, 2017/06/23
- Re: [Help-gsl] test release for GSL 2.4, Max Gaspa, 2017/06/29
- Re: [Help-gsl] test release for GSL 2.4, Patrick Alken, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4, David Komanek, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4,
Patrick Alken <=
- Re: [Help-gsl] test release for GSL 2.4, Mohammad Akhlaghi, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4, Patrick Alken, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4, Mohammad Akhlaghi, 2017/06/22
- Re: [Help-gsl] test release for GSL 2.4, David Komanek, 2017/06/22
Re: [Help-gsl] test release for GSL 2.4, Piotr Tryniecki, 2017/06/14
Re: [Help-gsl] test release for GSL 2.4, Piotr Tryniecki, 2017/06/15
Re: [Help-gsl] test release for GSL 2.4, Brian Gladman, 2017/06/22