Bug 67351 - Xfig creates temporary files insecurely
Xfig creates temporary files insecurely
Product: Red Hat Linux
Classification: Retired
Component: xfig (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
: Security
Depends On:
  Show dependency treegraph
Reported: 2002-06-23 04:56 EDT by Jarno Huuskonen
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-06-23 04:56:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jarno Huuskonen 2002-06-23 04:56:13 EDT
Description of Problem:
Xfig (tested both 3.2.3_beta1 and 3.2.3d) creates temporary files with
code like this:
    sprintf(tmpfile, "%s/%s%06d", TMPDIR, "xfig-eps", getpid());
    if ((tmpfp = fopen(tmpfile, "wb")) == NULL) {
(TMPDIR is either $XFIGTMPDIR or /tmp)
So the tempfile name is easy to guess and xfig doesn't use O_EXCL when opening

Version-Release number of selected component (if applicable):

Additional Information:
I started working on a patch, but I don't have the time test it enough (it makes
xfig use mkstemp, so parts of xfig where code create tempfiles with certain
suffix: eg. xfig-pid.pic, the patch loses the suffix ...)
Comment 1 Ngo Than 2002-06-25 12:27:50 EDT
already added your patch file into next release. thanks

Note You need to log in before you can comment on or make changes to this bug.