Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Filesystem] Consider the umask setting when dumping a file#19872

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.1fromleofeyer:hotfix/dump-file-chmod
Sep 14, 2016
Merged

[Filesystem] Consider the umask setting when dumping a file#19872

fabpot merged 1 commit intosymfony:3.1fromleofeyer:hotfix/dump-file-chmod
Sep 14, 2016

Conversation

@leofeyer
Copy link
Contributor

@leofeyerleofeyer commentedSep 6, 2016
edited
Loading

QA
Branch?3.1
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#14246 ,#17063
LicenseMIT
Doc PR-

Filesystem::dumpFile() does not consider the umask setting and thus creates files with write permissions for everyone (0666). Otherchmod() calls in Symfony do consider the umask setting (see e.g.here orhere), therefore I have adjusted thedumpFile() method accordingly.

@nicolas-grekas
Copy link
Member

ping@hboomsma since you wrote this line in#17063: any comment here?

@hboomsma
Copy link

@nicolas-grekas I original also added the part that would listen to the umask, but that would have been a BC break, so I left it out. I do support the idea of adding it.

👍


// Ignore for filesystems that do not support umask
@chmod($tmpFile,0666);
@chmod($tmpFile,0666 & ~umask());

Choose a reason for hiding this comment

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

Can you also adjust the test case to test this behavior? (be aware of windows not having umask)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

There is nothing I could adjust, because the Symfony unit test suite explicitly sets the umask to0, so the expected file permissions in the tests will always be666 on both Unix and Windows.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@hboomsma Ah, I see. Thank you. 😄

@leofeyerleofeyer changed the titleConsider the umask setting when dumping a file[Filesystem] Consider the umask setting when dumping a fileSep 8, 2016
@nicolas-grekas
Copy link
Member

@leofeyer can you please rebase so that the merge commit goes away?

@leofeyer
Copy link
ContributorAuthor

Done.

@nicolas-grekas
Copy link
Member

I'd be 👍 here, looks consistent to me.

@jakzal
Copy link
Contributor

👍

1 similar comment
@hboomsma
Copy link

👍

@fabpot
Copy link
Member

Thank you@leofeyer.

@fabpotfabpot merged commitfdd266f intosymfony:3.1Sep 14, 2016
fabpot added a commit that referenced this pull requestSep 14, 2016
…e (leofeyer)This PR was merged into the 3.1 branch.Discussion----------[Filesystem] Consider the umask setting when dumping a file| Q             | A| ------------- | ---| Branch?       | 3.1| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#14246 ,#17063| License       | MIT| Doc PR        | -`Filesystem::dumpFile()` does not consider the umask setting and thus creates files with write permissions for everyone (`0666`). Other `chmod()` calls in Symfony do consider the umask setting (see e.g. [here](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/File/File.php#L101) or [here](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/File/UploadedFile.php#L230)), therefore I have adjusted the `dumpFile()` method accordingly.Commits-------fdd266f Consider the umask setting when dumping a file.
@fabpotfabpot mentioned this pull requestOct 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@leofeyer@nicolas-grekas@hboomsma@jakzal@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp