[ 
https://issues.apache.org/jira/browse/PDFBOX-6185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069315#comment-18069315
 ] 

Maruan Sahyoun edited comment on PDFBOX-6185 at 3/28/26 7:41 PM:
-----------------------------------------------------------------

I've done the following improvements
 - use a temp directory instead of storing the files in tmp
 - set permissons instead of relying on defaults for the directory
 - use a shutdown hook for cleanup

I've let Claude AI review the implementation and added special handling for 
Windows using ACL instead of setReadable() etc.

[~tilman]  if you are on Windows could you review the directory permissions for 
the created temp directory there as I'm Linux and Mac only? If you are happy 
with the approach I'd move it to IOUtils and we can use it in PDFDebugger as 
well as ScratchFile.

NOTE: is neither Posix attributes nor ACL work I'm currently throwing an 
exception instead of using potentially less secure ways. We could of course 
loosen that.

We can also wait what Sonar has to say about it.


was (Author: msahyoun):
I've done the following improvements
 - use a temp directory instead of storing the files in tmp
 - set permissons instead of relying on defaults for the directory
 - use a shutdown hook for cleanup

I've let Claude AI review the implementation and added special handling for 
Windows using ACL instead of setReadable() etc.

[~tilman]  if you are on Windows could you review the directory permissions for 
the created temp directory there as I'm Linux and Mac only? If you are happy 
with the approach I'd move it to IOUtils and we can use it in PDFDebugger as 
well as ScratchFile.

NOTE: is neither Posix attributes nor ACL work I'm currently throwing an 
exception instead of using potentially less secure ways. We could of course 
loosen that.

> Fix handling of files in temp directory
> ---------------------------------------
>
>                 Key: PDFBOX-6185
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6185
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.36, 3.0.7 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Maruan Sahyoun
>            Priority: Minor
>             Fix For: 2.0.37, 3.0.8 PDFBox, 4.0.0
>
>
> As discussed in PDFBOX-5660 and mentioned in the Sonar hotspots



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to