Skip to content

[Process] Fix write access check for pipes on Windows #19428

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
Jul 28, 2016

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #19336, #19416
License MIT
Doc PR -

$h = fopen($file, 'xb');
if (!$h && false === strpos($error, 'File exists')) {
restore_error_handler();
throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable');
Copy link
Contributor

Choose a reason for hiding this comment

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

What about this?

A temporary file could not be opened to write the process output to. Verify that your TEMP environment variable is writable.

I've changed it to a full stop before Verify and added one on the end for consistency with other exceptions.

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't change exception messages in minor versions...

Copy link
Member

@fabpot fabpot Jul 26, 2016

Choose a reason for hiding this comment

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

Yes we can

Copy link
Member Author

@nicolas-grekas nicolas-grekas Jul 26, 2016

Choose a reason for hiding this comment

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

If we can, then I'd even prefer: sprintf('A temporary file could not be opened to write the process output: %s', $error)

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@fernandobandeira
Copy link

fernandobandeira commented Jul 27, 2016

Status: Reviewed

Thank you for this quick PR.
I've done more tests and had no more problems since this PR,
Before the exception were killing the process, now it's just a warning.

I was waiting for the author of #19336 to test his issue but it's been over a week, so at least for me this fixes my issue and should also fix his.

@nicolas-grekas
Copy link
Member Author

Thanks. The warning should be gone btw.

@nicolas-grekas nicolas-grekas merged commit 66e694e into symfony:2.7 Jul 28, 2016
nicolas-grekas added a commit that referenced this pull request Jul 28, 2016
…olas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Fix write access check for pipes on Windows

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19336, #19416
| License       | MIT
| Doc PR        | -

Commits
-------

66e694e [Process] Fix write access check for pipes on Windows
@nicolas-grekas nicolas-grekas deleted the fix-19416-win-pipes branch July 28, 2016 06:53
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.

5 participants