Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Issue 2001013: Use realpath() to find the path to the extension unpack dir on posix systems. (Closed)

Created:
10 years, 7 months ago by Sam Kerner (Chrome)
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Use realpath() to find the path to the extension unpack dir on posix systems. Extensions are unpacked by a sandboxed utility process. The sandbox forbids file access outside the directory the extension will be unpacked in. If the path to that directory contains a symbolic link, then unpacking will fail because following the link will cause file system access outside the sandbox path. Use realpath() to get a symlink free path to the directory where the extension will be unpacked. A similar issue exists on windows, with junctions instead of symlinks. This will be fixed in another change. BUG=13044, 35198 TEST=FileUtilTest.RealPath Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=47032

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -1 line) Patch
M base/file_util.h View 1 chunk +7 lines, -0 lines 0 comments Download
M base/file_util_posix.cc View 2 chunks +10 lines, -0 lines 2 comments Download
M base/file_util_unittest.cc View 1 chunk +51 lines, -0 lines 0 comments Download
M chrome/browser/utility_process_host.cc View 1 chunk +18 lines, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Sam Kerner (Chrome)
This patch is intended to fix the "could not create directory for unzipping" error for ...
10 years, 7 months ago (2010-05-11 21:21:48 UTC) #1
tkent
The code seems ok. Could write the reason why we use realpath() for this purpose ...
10 years, 7 months ago (2010-05-12 01:21:54 UTC) #2
Sam Kerner (Chrome)
On 2010/05/12 01:21:54, Kent Tamura wrote: > The code seems ok. > Could write the ...
10 years, 7 months ago (2010-05-12 01:39:04 UTC) #3
tkent
LGTM
10 years, 7 months ago (2010-05-12 01:40:48 UTC) #4
Timur Iskhodzhanov
Looks like FileUtilTest.RealPath is not working on Mac/Valgrind bots: http://build.chromium.org/buildbot/memory/builders/Chromium%20Mac%20(valgrind)/builds/4759
10 years, 7 months ago (2010-05-12 18:08:20 UTC) #5
Timur Iskhodzhanov
This looks like a bug in Valgrind http://code.google.com/p/chromium/issues/detail?id=44001 On 2010/05/12 18:08:20, Timur Iskhodzhanov wrote: > ...
10 years, 7 months ago (2010-05-12 18:12:06 UTC) #6
Lei Zhang
http://codereview.chromium.org/2001013/diff/1/3 File base/file_util_posix.cc (right): http://codereview.chromium.org/2001013/diff/1/3#newcode17 base/file_util_posix.cc:17: #include <sys/param.h> nit: My Linux man page says this ...
10 years, 7 months ago (2010-05-12 18:53:31 UTC) #7
Sam Kerner (Chrome)
10 years, 7 months ago (2010-05-12 20:02:57 UTC) #8
http://codereview.chromium.org/2001013/diff/1/3
File base/file_util_posix.cc (right):

http://codereview.chromium.org/2001013/diff/1/3#newcode17
base/file_util_posix.cc:17: #include <sys/param.h>
On 2010/05/12 18:53:32, Lei Zhang wrote:
> nit: My Linux man page says this should be <limits.h> ?

I used the mac man page, then tested on linux...  Will send you a CL with an
update shortly.

Powered by Google App Engine
This is Rietveld 408576698