[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libguile-2.2.2 uses tmpnam

From: Roel Janssen
Subject: Re: libguile-2.2.2 uses tmpnam
Date: Tue, 24 Oct 2017 14:11:10 +0200
User-agent: mu4e 0.9.18; emacs 25.1.1

Jeffrey Walton writes:

> On Sat, Oct 21, 2017 at 5:05 AM, Jeffrey Walton <address@hidden> wrote:
>> My apologies for writing about this. I found one previous thread that
>> mentioned it, but it was working a clock_t problem. Cf.,
>> ...
>> I'm happy to configure libguile to remove tmpnam and break other
>> libraries. I don't believe its a configuration option at the moment.
>> `./configure --help | egrep 'tmpnam|insecure'` returns 0 hits.
> --disable-deprecated does not remove it. I'm fairly certain Posix
> deprecated the function about a decade ago, so its not clear to me how
> its not being removed with the option.
> Any hints on getting rid of this would be greatly appreciated.
> Jeff

First, I am not a developer of GNU Guile itself.  So my advice may be

The only place where tmpnam seems to be used in libguile is posix.c:

>From the libguile/ directory:
$ grep -r "tmpnam" .
./ChangeLog-1996-1999:  * posix.h (scm_tmpnam): Added prototype.
./ChangeLog-1996-1999:  * posix.c (scm_tmpnam): New function.
./ChangeLog-1996-1999:  * fports.c: remove ttyname and tmpnam declarations.
./ChangeLog-2008:       (scm_environ, scm_tmpnam, scm_mkstemp, scm_access, 
./ChangeLog-2008:       * posix.c (scm_tmpnam): check that return value from 
tmpnam is not
./ChangeLog-scm:        * sys.c (ltmpnam): return value of mktemp call tested 
in accord
./ChangeLog-scm:        * scm.c (tmpnam): support for mktemp added.
./ChangeLog-scm:        * scm.c (tmpnam): added.
./posix.c:#ifdef L_tmpnam
./posix.c:SCM_DEFINE (scm_tmpnam, "tmpnam", 0, 0, 0,
./posix.c:          "process will not create the file after @code{tmpnam} is 
./posix.c:#define FUNC_NAME s_scm_tmpnam
./posix.c:  char name[L_tmpnam];
./posix.c:  SCM_SYSCALL (rv = tmpnam (name));
./posix.c:    SCM_MISC_ERROR ("tmpnam failed", SCM_EOL);
./posix.h:SCM_API SCM scm_tmpnam (void);

So, I would guess removing the call to SCM_DEFINE on line 1562 would
achieve your goal.

I don't think there is Guile code that actually uses this function,
except for allowing users to call tmpnam in Scheme code.  We can
find out whether this is true by disabling tmpnam there, and see if
anything breaks.

Kind regards,
Roel Janssen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]