php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #874 tempnam function does not support $TMPDIR overriding
Submitted: 1998-10-26 03:10 UTC Modified: 1998-10-26 06:04 UTC
From: bbonev at netage dot bg Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.5 OS: Linux 2.0.34
Private report: No CVE-ID: None
 [1998-10-26 03:10 UTC] bbonev at netage dot bg
in file.c:
-------
        if (f = getenv("TMPDIR")) {
                (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f,
                                           *(f + strlen(f) - 1) == '/'? "": "/",
 pfx);
                if (f = mktemp(name))
                        return(f);
        }

        if (f = (char *)dir) {
--------
solution: swap getenv("TMPDIR") and (char*)dir :-))

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-10-26 06:04 UTC] rasmus
The standard tempnam() function is supposed to use the TMPDIR env variable over all else if it is present.  The function is correct as written as far as I can tell.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 10 22:01:30 2024 UTC