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

Control entropy for $tmpFileName (file name to long) #86

Open
akomm opened this issue Jul 16, 2019 · 5 comments
Open

Control entropy for $tmpFileName (file name to long) #86

akomm opened this issue Jul 16, 2019 · 5 comments
Labels

Comments

@akomm
Copy link

akomm commented Jul 16, 2019

I just hit the roof of file (not path) length on my fs (encrypted ext4 = 143 bytes):

AppHydrator__PM__ThingContainerYToxOntzOjc6ImZhY3RvcnkiO3M6NDE6IkdlbmVyYXRlZEh5ZHJhdG9yXEZhY3RvcnlcSHlkcmF0b3JGYWN0b3J5Ijt9.php.5d2dc0a9162c80.87561400

Its 151 bytes, without namespaces.

While in production it will be 255 bytes, maybe a control over entropy is a good idea?

Ah I see. Its the encoded params base64-encoded via NameInflector. Damn.

@Ocramius
Copy link
Owner

I suppose that we should use tempnam() instead

@Ocramius Ocramius added the bug label Jul 16, 2019
@akomm
Copy link
Author

akomm commented Jul 16, 2019

@Ocramius But you will probably still need to encode params to distinguish hydrators created with different params, right?

Alternatively maybe write it as comment line into generate files instead? Cost would be additional file read per hydrator. But maybe not that much of a prob for generated code? Or does it imply to many changes?

@Ocramius
Copy link
Owner

Yes, but it could be solved by using a hash and a signature on the hydrator. I do something similar on ocramius/proxy-manager

@akomm
Copy link
Author

akomm commented Jul 16, 2019

Its actually CodeGenerationUtils. ocramius/proxy-manager does not seem to use it. So you want to opt-out from CodeGenerationUtils, change it, or make different implementations here with the interfaces?

@flowl
Copy link

flowl commented May 13, 2020

This is still a problem for windows users, especially while the namespace and everything is included in the resulting filename.

No issues on MacOS or Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants