Skip to content
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

ProxyFactory: do not generate long file names #10893

Closed

Conversation

JanTvrdik
Copy link
Contributor

This is a follow up to doctrine/common#1005, because the logic was moved from doctrine/common to doctrine/orm in 2.17.


The maximum file name length when using eCryptfs is 143 bytes. This causes issues with Doctrine proxies where with current implementation this limit can be exceeded.

This PR changes how proxy file name is generated to avoid hitting this limit.

eCryptfs can only store filenames of up to 143 characters when filename encryption is enabled. The remaining 112 characters are used for storing metadata such as the encrypted filename prefix, the signature of the filename encryption key, and an identifier for the cipher used, as well as random bytes to make /foo/file and /bar/file encrypt to different ciphertext and padding bytes to achieve proper cipher block size alignment.
https://bugs.launchpad.net/ecryptfs/+bug/344878

@derrabus
Copy link
Member

derrabus commented Aug 9, 2023

Thank you. Can you please have a look at the failing test? It looks related.

Furthermore, I think we should document this change in the UPGRADE.md file.

@derrabus
Copy link
Member

derrabus commented Aug 9, 2023

Also, please have a look at the Doctrine\ORM\Proxy\Autoloader class. It's deprecated and we discourage its usage, but as long as the class exists, we must not break it. I think that after your change, the generated proxies are written to a different location than this autoloader would expect them to be.

Thanks for the hint, @nicolas-grekas!

@derrabus derrabus requested a review from stof August 9, 2023 09:19
@JanTvrdik JanTvrdik force-pushed the proxy-file-name-length-limit branch from 8199a04 to 1b37955 Compare August 9, 2023 09:20
@JanTvrdik
Copy link
Contributor Author

I'm not sure how to solve the Doctrine\ORM\Proxy\Autoloader behavior without at least partially reverting #10837. The Autoloader is a static class with behavior that has to be kept in sync both with doctrine/common and doctrine/orm. As long as the Autoloader exists in common, the file name logic cannot be safely moved to ORM.

I updated the original PR in doctrine/common to change the Autoload behavior as well.

@derrabus
Copy link
Member

derrabus commented Aug 9, 2023

That's difficult indeed. So maybe, we won't get around changing doctrine/common after all.

We could release a new version of doctrine/common with the new file name mapping and then have ORM 2.17 depend on that new release.

Copy link
Contributor

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Oct 20, 2024
Copy link
Contributor

This pull request was closed due to inactivity.

@github-actions github-actions bot closed this Oct 28, 2024
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.

2 participants