Hoodas / winetricks

Automatically exported from code.google.com/p/winetricks
0 stars 0 forks source link

/tmp/early_wine.err.txt: Permission denied #449

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a file /tmp/early_wine.err.txt owned by one user with write 
permission only for the owner (for example, run winetricks)
2. Run winetricks as a different user

What is the expected output? What do you see instead?
Expected no problem; got "/opt/local/bin/winetricks: line 2204: 
/tmp/early_wine.err.txt: Permission denied"

What version of the product are you using? On what operating system?
winetricks 20141130 on OS X 10.10.1

Please provide any additional information below.
You are assuming that /tmp is the best temporary directory to use. Please use 
/tmp only as a fallback, if the $TMPDIR variable is defined.

You are using a fixed temp file name, which is subject to denial of service 
attacks and other problems. Instead, use the mktemp utility to create a random 
temp file name that won't have these problems.

Original issue reported on code.google.com by ryandesi...@gmail.com on 1 Dec 2014 at 7:55

GoogleCodeExporter commented 8 years ago
Correction: use /tmp/ only if $TMPDIR is *not* defined; otherwise use $TMPDIR.

Original comment by ryandesi...@gmail.com on 1 Dec 2014 at 7:56

GoogleCodeExporter commented 8 years ago
Thanks for the report, I've been meaning to fix that and finally got an 
incentive :).

Should be fixed by 
https://code.google.com/p/winetricks/source/detail?r=a3bff9004e13dc2d163c57689d4
df2578d512797

Original comment by austinenglish@gmail.com on 6 Dec 2014 at 12:28

GoogleCodeExporter commented 8 years ago
Thanks, but although I'm sure that works with the version of mktemp provided by 
GNU coreutils, it doesn't work with the BSD-derived version of mktemp provided 
by OS X:

$ ./winetricks 
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
mkdir: /w.rschmidt.10630/metadata/apps: Permission denied
mkdir: /w.rschmidt.10630/metadata/benchmarks: Permission denied
mkdir: /w.rschmidt.10630/metadata/dlls: Permission denied
mkdir: /w.rschmidt.10630/metadata/fonts: Permission denied
mkdir: /w.rschmidt.10630/metadata/games: Permission denied
mkdir: /w.rschmidt.10630/metadata/settings: Permission denied
./winetricks: line 2216: /early_wine.err.txt: Permission denied
cat: /early_wine.err.txt: No such file or directory
------------------------------------------------------
wine cmd.exe /c echo '%ProgramFiles%' returned empty string, error message "" 
------------------------------------------------------

BSD mktemp requires either a template or a prefix. I always use a template. I 
would use something like:

mktemp -d "${TMPDIR:-/tmp}/winetricks.XXXXXXXX"

This works with both BSD and GNU mktemp.

Original comment by ryandesi...@gmail.com on 6 Dec 2014 at 3:47

GoogleCodeExporter commented 8 years ago
https://code.google.com/p/winetricks/source/detail?r=3eb3f879de0e0559761777e92f3
6c18ac437d7cc

Original comment by austinenglish@gmail.com on 6 Dec 2014 at 11:32