Skip to content

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

Closed
ndossche wants to merge 1 commit into
php:PHP-8.2from
ndossche:soap-tmp
Closed

ndossche wants to merge 1 commit into
php:PHP-8.2from
ndossche:soap-tmp

Conversation

@ndossche

Copy link
Copy Markdown
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.
@ndossche ndossche linked an issue Nov 30, 2023 that may be closed by this pull request

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ndossche ndossche closed this in 4eee81b Dec 1, 2023
@ndossche

ndossche commented Dec 1, 2023

Copy link
Copy Markdown
Member Author

@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