Skip to content

Fix GH-12838: [SOAP] Temporary WSDL cache files not being deleted #12841

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

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

If there are two users that can execute the script that caches a WSDL, but the script is owned by a single user, then the caching code will name the cached file with the file owner username and a hash of the uri. When one of the two tries to rename the file created by the other process, this does not work because it has no permission to do so. This then leaves temporary files floating in the temp directory.

To fix the immediate problem, unlink the file after rename has failed. On the long term, this has to be fixed by taking the username of the process instead of the username of the file owner.

Closes #12838.

If there are two users that can execute the script that caches a WSDL,
but the script is owned by a single user, then the caching code will
name the cached file with the file owner username and a hash of the uri.
When one of the two tries to rename the file created by the other
process, this does not work because it has no permission to do so.
This then leaves temporary files floating in the temp directory.

To fix the immediate problem, unlink the file after rename has failed.
On the long term, this has to be fixed by taking the username of the
process instead of the username of the file owner.
@nielsdos nielsdos linked an issue Nov 30, 2023 that may be closed by this pull request
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM

@nielsdos nielsdos closed this in 4eee81b Dec 1, 2023
@nielsdos
Copy link
Member Author

nielsdos commented Dec 1, 2023

@patrickallaert @ramsey Is it possible to still include this in PHP-8.1? This fixes a regression introduced in 8.1.25 (although the situation wherein it occurs should be quite rare).

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.

[SOAP] Temporary WSDL cache files not being deleted
2 participants