-
Notifications
You must be signed in to change notification settings - Fork 6
The compared phars are altered #6
Comments
Try opening two identical PHP archives with the same filename (and thus, the same alias) from different directories. |
I see, so maybe we should copy the PHARs before comparing them? |
@paragonie-scott what's your opinion here? Willing to go that way or you would prefer tackling the issue from another angle? |
I don't really have any strong opinions on the best way forward. If you think copying the PHARs before comparing them will solve the problem, please feel free to give it a shot. I just recall having two PHARs with the same alias (which IIRC defaults to the filename) caused a conflict issue. |
The PHARs requires to have a different alias hence Pharaoh set a unique alias. It however alters the orignal PHAR which is not desirable. This patch copies the PHAR to a temporary directory first and compare this copy instead. Closes paragonie#6
The problem persist indeed, but this means two identical PHARs will always show as different (because the alias, hence the signature, will differ). I've decided to not compare the signatures & aliases in Box since I really don't know how to handle this either. |
When executing a diff between two PHAR files, their contents are altered. This can be seen with Box for example:
The issue seems to come from setting the alias which alters the original PHAR.
I'm not sure why setting the alias is necessary, but restoring the alias after usage does not seem to help, so maybe Pharaoh should manipulate a copied PHAR instead.
The text was updated successfully, but these errors were encountered: