Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1353998 - Permissions not set to files below /var/lib/flatpak
Summary: Permissions not set to files below /var/lib/flatpak
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: flatpak
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David King
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-08 16:29 UTC by Christian Stadelmann
Modified: 2018-10-08 10:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Christian Stadelmann 2016-07-08 16:29:42 UTC
Description of problem:
When umask root is 0077, files in /var/lib/flatpak are created with wrong permissions, i.e. not readable by users. This breaks running flatpak as non-privileged user.

Version-Release number of selected component (if applicable):
flatpak-0.6.7-1.fc24.x86_64

How reproducible:
always

Steps to Reproduce:
0. have root's umask set to 0077
1. run `flatpak remote-add` or any other command writing to /var/lib/flatpak as root
2. run `flatpak remote-ls gnome` as unprivileged user

Actual results:
running `flatpak remote-ls gnome` as unprivileged user fails with an error:
error: GPG: Error opening file: Permission denied

Expected results:
flatpak should make sure permissions are correct even if root has a custom umask.

Additional info:
strace reveals this shortly before flatpak exits:
open("/var/lib/flatpak/repo/gnome.trustedkeys.gpg", O_RDONLY) = -1 EACCES (Permission denied)

Comment 1 Fedora End Of Life 2017-07-25 21:41:01 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 2 Christian Stadelmann 2017-08-01 21:10:59 UTC
Issue still present with flatpak-0.9.7-1.fc26.x86_64.

Comment 3 Fedora End Of Life 2018-05-03 08:38:54 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Christian Stadelmann 2018-05-21 15:10:38 UTC
Still present with flatpak-0.11.7-1.fc28.x86_64.

Comment 5 Christian Stadelmann 2018-10-08 09:51:05 UTC
Still present with flatpak-1.0.2-1.fc29.x86_64 (Fedora 29 beta).

Steps to reproduce:
1. Delete /var/lib/flatpak
2. `# dnf reinstall flatpak` to initialize /var/lib/flatpak correctly
3. # umask 0077
4. # flatpak remote-add flathub [the .flatpakrepo file from https://flathub.org/repo/flathub.flatpakrepo]
5. Have a look at /var/lib/flatpak permissions

What happens:
/var/lib/flatpak/repo/flathub.trustedkeys.gpg has -rw------ permissions.

What should happen:
/var/lib/flatpak/repo/flathub.trustedkeys.gpg permissions should be -r--r--r-- or -rw-r--r-- instead.

Comment 6 Christian Stadelmann 2018-10-08 10:11:00 UTC
The issue is probably also present for other files and folders within /var/lib/flatpak. /var/lib/flatpak/repo/tmp/cache/summaries may be one example.

After running
# flatpak install flathub org.freedesktop.Platform//18.08
the folder /var/lib/flatpak/runtime has permissions drwx------ which is incorrect and shoud be dr-xr-xr-x. The same issue applies to files and folders within that folder.


Note You need to log in before you can comment on or make changes to this bug.