Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tmancill opened this issue Mar 12, 2017 · 3 comments
Closed

Comments

@tmancill
Copy link

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);
@Siedlerchr
Copy link
Member

Thank you very much for forwarding this bug report and also for providing a solution.
I agree that having the x-bit set does not make sense.
I will provide a fix.

Siedlerchr added a commit that referenced this issue Mar 12, 2017
Siedlerchr added a commit that referenced this issue Mar 12, 2017
* Set POSIX filepermissions to 644
Fix for #2635

* Add changelog and add missing dots
@Siedlerchr
Copy link
Member

Thank you for reporting this issue. We think, that is already fixed in our development version and consequently the change will be included in the next release.

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you.

@tmancill
Copy link
Author

Hi @Siedlerchr - I tested locally and the permissions were as expected. Thank you for the quick turn around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants