Skip to content

Commit 34d0e46

Browse files
author
Maruan Sahyoun
committed
PDFBOX-6185: warn if permission setting didn't work
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1932730 13f79535-47bb-0310-9956-ffa450edef68
1 parent bc3dceb commit 34d0e46

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

io/src/main/java/org/apache/pdfbox/io/IOUtils.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,15 @@ private static void applyOwnerOnlyPermissions(Path dir) throws IOException
384384
if (aclView == null)
385385
{
386386
File tempDir = dir.toFile();
387-
tempDir.setReadable(true, true);
388-
tempDir.setWritable(true, true);
389-
tempDir.setExecutable(true, true);
387+
boolean isReadable = tempDir.setReadable(true, true);
388+
boolean isWritable = tempDir.setWritable(true, true);
389+
boolean isExecutable = tempDir.setExecutable(true, true);
390+
if (!isReadable || !isWritable || !isExecutable)
391+
{
392+
LOG.warn("Unable to set owner-only permissions on temporary directory: {}. " +
393+
"Please ensure that the temporary directory is protected against unauthorized access.",
394+
dir);
395+
}
390396
return;
391397
}
392398

0 commit comments

Comments
 (0)