diff --git a/src/main/java/org/jabref/logic/exporter/FileSaveSession.java b/src/main/java/org/jabref/logic/exporter/FileSaveSession.java index 14514cd4ad7..60c1eb00d73 100644 --- a/src/main/java/org/jabref/logic/exporter/FileSaveSession.java +++ b/src/main/java/org/jabref/logic/exporter/FileSaveSession.java @@ -38,7 +38,6 @@ public class FileSaveSession extends SaveSession { private static final String TEMP_SUFFIX = "save.bib"; private final Path temporaryFile; - public FileSaveSession(Charset encoding, boolean backup) throws SaveException { this(encoding, backup, createTemporaryFile()); } @@ -86,8 +85,12 @@ public void commit(Path file) throws SaveException { LOGGER.error("Error when creating lock file.", ex); } - // Try to save file permissions to restore them later (by default: allow everything) - Set oldFilePermissions = EnumSet.allOf(PosixFilePermission.class); + // Try to save file permissions to restore them later (by default: 664) + Set oldFilePermissions = EnumSet.of(PosixFilePermission.OWNER_READ, + PosixFilePermission.OWNER_WRITE, + PosixFilePermission.GROUP_READ, + PosixFilePermission.GROUP_WRITE, + PosixFilePermission.OTHERS_READ); if (FileUtil.isPosixCompilant && Files.exists(file)) { try { oldFilePermissions = Files.getPosixFilePermissions(file);