Creating temporary files in current dir is mistake

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Hubbitus
Posts: 66
Joined: 2010-05-04T10:50:21-07:00
Authentication code: 8675308
Location: Russia, Saint-Petersburg

Creating temporary files in current dir is mistake

Post by Hubbitus »

Hello.

In SELinux restricted environment it is big problem because we can't properly mark such files.
Could you please see on https://bugzilla.redhat.com/show_bug.cgi?id=825874

May be it will be possible make such directory widely configurable? Say by some env variable?
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Creating temporary files in current dir is mistake

Post by glennrp »

I seem to recall that TMPDIR and MAGICK_TMPDIR can be used for this.

[edit] MAGICK_TMPDIR works fine on my Ubuntu 12-04 platform:
  • glenn.rp> mkdir $HOME/TEMP
    glenn.rp> TMPDIR=$HOME/TEMP make check
resulted in lots of magick-* files in my TEMP directory while
validate-formats-in-memory was running.
Hubbitus
Posts: 66
Joined: 2010-05-04T10:50:21-07:00
Authentication code: 8675308
Location: Russia, Saint-Petersburg

Re: Creating temporary files in current dir is mistake

Post by Hubbitus »

Thank you for the answer. We trying it.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Creating temporary files in current dir is mistake

Post by broucaries »

Sorry do you means that imagemagick create temp dir on ./ or in /tmp ?

Thanks

Bastien
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Creating temporary files in current dir is mistake

Post by magick »

By default, ImageMagick puts temporary files in a folder defined by P_tmpdir. This can be overridden by the the environment variables MAGICK_TEMPORARY_PATH, MAGICK_TMPDIR, or TMPDIR. It can also be overridden by the temporary-path policy define in policy.xml. However, if the path is not a directory or if its not readable, the temporary files are put in the current path.
Post Reply