You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by GitBox <gi...@apache.org> on 2020/05/19 12:47:05 UTC

[GitHub] [poi] netmackan opened a new pull request #182: Fix root property size calculation.

netmackan opened a new pull request #182:
URL: https://github.com/apache/poi/pull/182


   Before this patch the POIFSMiniStore.syncWithDataStore() method sets the root property size to be based on the number of sectors in each block that is used. 
   
   However it can happen is some files that a block is not only filled in the beginning. Instead there could be gaps with unused sectors within it and currently POI does not count those. However the MS tool (in this case signtool) calculates the occupied size (i.e. the size from beginning of block up to and including the last used sector). Specifically for Windows Installer (MSI) files, if the root size is not calculated this way the digital signature will not show up as correct.
   
   This pull request changes the calculation of the root property so that Windows will not complain also for files with blocks that has unused sectors in the middle.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] netmackan commented on pull request #182: Fix root property size calculation.

Posted by GitBox <gi...@apache.org>.
netmackan commented on pull request #182:
URL: https://github.com/apache/poi/pull/182#issuecomment-641781168


   Hi @pjfanning, 
   Unfortunately, I do not own the test file so I can not share it. But I will try to create a new one and get back as soon as I get time. 
   
   The file (MSI/Windows Installer) was created with MS Visual Studio 2017 15.9 and it happened that only some of the created files would have a fragmented block and trigger the issue.
   
   Regarding the scenario, my thought on why this has not been seen before is probably because in most scenarios it is not important that the root property has the right size. For the MSI use case probably Windows is more strict in verifying things as part of the digital signature verification. On top of that this only happens when the file added to the POIFS is larger then 4096 bytes (i.e. not a small block) and only when the original file happens to have a block that is having gaps in it so that the size calculation will be different than the current implementation.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] netmackan commented on pull request #182: Fix root property size calculation.

Posted by GitBox <gi...@apache.org>.
netmackan commented on pull request #182:
URL: https://github.com/apache/poi/pull/182#issuecomment-630794652


   I also have patches for 4.1.2, 4.0.1 and 3.15 if wanted.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] pjfanning commented on pull request #182: Fix root property size calculation.

Posted by GitBox <gi...@apache.org>.
pjfanning commented on pull request #182:
URL: https://github.com/apache/poi/pull/182#issuecomment-641356071


   @netmackan is there any extra context you can give us on this issue? The code has probably never supported the scenario you seem to want to fix.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] pjfanning commented on pull request #182: Fix root property size calculation.

Posted by GitBox <gi...@apache.org>.
pjfanning commented on pull request #182:
URL: https://github.com/apache/poi/pull/182#issuecomment-631722702


   @netmackan do you have a file that demos this problem?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] [poi] asfgit closed pull request #182: Fix root property size calculation.

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #182:
URL: https://github.com/apache/poi/pull/182


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org