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

Issue 689713006: Allow POSIX callers to specify a new file's mode. (Closed)

Created:
6 years, 1 month ago by palmer
Modified:
6 years, 1 month ago
Reviewers:
asanka
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, darin-cc_chromium.org, asanka, erikwright+watch_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Allow POSIX callers to specify a new file's mode. Retain the tight 0640 mode for most existing callers, but honor the user's umask for downloaded files. This is a re-land of https://codereview.chromium.org/639253004/. BUG=409416, 362887 TBR=asanka,mdempsky,rvargas Committed: https://crrev.com/931e35070097af9837f79ff19f8668e45b92ed3a Cr-Commit-Position: refs/heads/master@{#302113}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -21 lines) Patch
M base/files/file_util.h View 2 chunks +8 lines, -0 lines 0 comments Download
M base/files/file_util_posix.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M base/files/file_util_unittest.cc View 1 chunk +22 lines, -0 lines 2 comments Download
M content/browser/download/base_file_posix.cc View 1 chunk +28 lines, -21 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/689713006/1
6 years, 1 month ago (2014-10-30 17:21:55 UTC) #2
commit-bot: I haz the power
Committed patchset #1 (id:1)
6 years, 1 month ago (2014-10-30 18:29:31 UTC) #3
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/931e35070097af9837f79ff19f8668e45b92ed3a Cr-Commit-Position: refs/heads/master@{#302113}
6 years, 1 month ago (2014-10-30 18:30:13 UTC) #4
csharp1
A revert of this CL (patchset #1 id:1) has been created in https://codereview.chromium.org/693493004/ by csharp@google.com. ...
6 years, 1 month ago (2014-10-30 20:10:36 UTC) #5
palmer
On 2014/10/30 20:10:36, csharp1 wrote: > A revert of this CL (patchset #1 id:1) has ...
6 years, 1 month ago (2014-10-30 20:30:41 UTC) #6
asanka
6 years, 1 month ago (2014-11-03 14:44:58 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/689713006/diff/1/base/files/file_util_unittes...
File base/files/file_util_unittest.cc (right):

https://codereview.chromium.org/689713006/diff/1/base/files/file_util_unittes...
base/files/file_util_unittest.cc:2152: if (PathExists(data_dir)) {
This test, and the creation of a separate test directory should not be necessary
since it implies that temp_dir_ is not unique. The test fixture is supposed to
guarantee that it is unique per test. I.e. each individual test is given a
freshly constructed fixture including its own temp directory.

https://codereview.chromium.org/689713006/diff/1/base/files/file_util_unittes...
base/files/file_util_unittest.cc:2163: ASSERT_EQ(0, stat(foobar.value().c_str(),
&status));
Is there's a more aggressive umask on the MSan bots? If the umask is something
like 066, then we could end up with the results we are seeing. I can't tell for
sure without knowing what the configuration there is.

I agree with you that unless there's a memory access error or something, a test
that passes on the Linux bot should pass on the Linux MSan bot. But I also think
it might be best for the test to account for non-standard umasks, either by
explicitly setting a umask, or taking the umask into account.

This has to be done carefully, since if the test is not running in its own
process, then it is running in series with other tests. So we have to restore
the umask to its former glory before returning.

I prefer setting an explicit umask since otherwise the test wouldn't be testing
anything if the umask in effect is overly aggressive.

Powered by Google App Engine
This is Rietveld 408576698