Skip to content

file permissions after Fix #2279 are very permissive and set the execute bit #2635

@tmancill

Description

@tmancill

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:

  1. Open JabRef and select File -> New BibTeX Database
  2. Select File -> Save Database
  3. 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);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions