-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Hi,
I am forwarding Debian bug report #857351 regarding the default file permissions for a newly created BibTeX database. Instead creating the new file with mode -rwxrwxrwx (0777), a default of -rw-rw-r-- (0664) or -rw-rw---- (0660) or -rw-r----- (0640) seems more appropriate. In any case, having the execute bit set doesn't make sense for a non-executable data file.
The current behavior was introduced by this line in PR #2281.
JabRef version 3.8.1 running on Linux
Steps to reproduce:
- Open JabRef and select File -> New BibTeX Database
- Select File -> Save Database
- Observe the permission of the newly created file as having mode
-rwxrwxrwx(0777)
There are several ways to fix this - e.g.:
// Try to save file permissions to restore them later (by default: 664)
Set<PosixFilePermission> oldFilePermissions = PosixFilePermissions.fromString("rw-rw-r--");
# OR
// Try to save file permissions to restore them later (by default: 664)
Set<PosixFilePermission> oldFilePermissions = EnumSet.of(
PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE,
PosixFilePermission.GROUP_READ, PosixFilePermission.GROUP_WRITE,
PosixFilePermission.OTHERS_READ);