Skip to content

[Filesystem] Check that directory is writable after created it in dumpFile() #21200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Jan 8, 2017

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20612 (comment)
License MIT
Doc PR n/a

In case permissions have been changed meanwhile

} elseif (!is_writable($dir)) {
}

if (!is_writable($dir)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is already bundled into file_put_contents' failure handling. You're just making this case more explicit, but file_put_contents can fail for more reasons.
So, should it be considered a new feature? Should we use error_get_last to generate a more useful error message? should this go on master?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handling was already there before. It just didn't take into account that the directory could have been created by another process.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it :)

@nicolas-grekas
Copy link
Member

👍

@xabbuh
Copy link
Member

xabbuh commented Jan 8, 2017

👍

Status: Reviewed

@javiereguiluz
Copy link
Member

👍

@fabpot
Copy link
Member

fabpot commented Jan 8, 2017

Thank you @chalasr.

@fabpot fabpot merged commit dbc4148 into symfony:2.7 Jan 8, 2017
fabpot added a commit that referenced this pull request Jan 8, 2017
…d it in dumpFile() (chalasr)

This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] Check that directory is writable after created it in dumpFile()

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20612 (comment)
| License       | MIT
| Doc PR        | n/a

In case permissions have been changed meanwhile

Commits
-------

dbc4148 [Filesystem] Check that the directory is writable after created it in dumpFile()
@chalasr chalasr deleted the filesystem/dumpfile-writable-dir branch January 8, 2017 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants