Bug 27367 - Flatpak permissions not letting install via Discover & apps not running as well..
Summary: Flatpak permissions not letting install via Discover & apps not running as ...
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-06 21:42 CEST by Ezequiel Partida
Modified: 2020-12-19 17:05 CET (History)
3 users (show)

See Also:
Source RPM: flatpak-1.8.1-1.mga8.x86_64
CVE:
Status comment:


Attachments

Description Ezequiel Partida 2020-10-06 21:42:05 CEST
Description of problem:

This is what I did as root to install spotify from flathub.org from konsole.

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

$ flatpak install flathub com.spotify.Client

Everything seems to install correctly but it didn't run from the mageia menu in Plasma so I removed it using Discover.

I later click on the install button to install it again using Discover but it didn't work so I reinstalled spotify in konsole again.

Once installed, I ran it using my user (not root) and I got this errors.

$ flatpak run com.spotify.Client
error: While opening repository /home/ezequielpartida/.local/share/flatpak/repo: opening repo: opendir(/home/ezequielpartida/.local/share/flatpak/repo): Permission denied

So I changed the permissios with chmod -Rfv a+xrw /home/ezequielpartida/.local/share/flatpak

After this everything works great.

It has been like this for a while in all  my installations of MGA8.

Regards,
Ezequiel Partida (ZekeMX)
Comment 1 Aurelien Oudelet 2020-10-06 21:52:42 CEST
Hi thanks reporting this.

With latest all packages installed from repos with Mageia Cauldron,
I really can't reproduce this.

Spotify installs well and fins well. Even from Konsole, Menu from Plasma and from Discovery... All runs well.

So with which ISO did you install Cauldron?

CC: (none) => ouaurelien

Comment 2 Ezequiel Partida 2020-10-07 00:14:19 CEST
(In reply to Aurelien Oudelet from comment #1)
> Hi thanks reporting this.
> 
> With latest all packages installed from repos with Mageia Cauldron,
> I really can't reproduce this.
> 
> Spotify installs well and fins well. Even from Konsole, Menu from Plasma and
> from Discovery... All runs well.
> 
> So with which ISO did you install Cauldron?

Hello,

The latest was installedusing Mageia-Cauldron-netinstall-nonfree-x86_64.iso

It also happens with Mageia-Cauldron-netinstall-nonfree-x86_64.iso

I install flatpak using urpmi flatpak

flatpak repo as well as apps are installed as root.

Regards
Ezequiel Partida
Comment 3 Lewis Smith 2020-10-11 12:25:36 CEST
@Aurelien : thanks for running through all this for real.

Comment 0 is enigmatic re com.spotify.Client.
- Installed from terminal, it did not run [unspecified]
- Re-installed from Discover, it did not run [unspecified]
- Re-installed from terminal, it did not run; details & remedy given.
Can we take it that the first two failures were for the same reason?

This is a bit late, but have you Ezequiel any record of what the post-install file permissions were in & below:
 /home/ezequielpartida/.local/share/flatpak
since you corrected them?

And the same for Aurelien? To compare the original permissions, which A did not need to fiddle, but E did. If they are different - why?

Accepting the need to install flatpak itself as root:
Ezequiel says above: "flatpak repo as well as apps are installed as root", but in comment 0, all the commands shown are as the normal user.

Aurelien: can you say what you did as what user in comment 1 ?

Source RPM: (none) => flatpak
CC: (none) => lewyssmith
Status: NEW => UNCONFIRMED
Ever confirmed: 1 => 0

Comment 4 Aurelien Oudelet 2020-10-14 18:28:40 CEST
(In reply to Lewis Smith from comment #3)
> @Aurelien : thanks for running through all this for real.
> 
> Comment 0 is enigmatic re com.spotify.Client.
> - Installed from terminal, it did not run [unspecified]
> - Re-installed from Discover, it did not run [unspecified]
> - Re-installed from terminal, it did not run; details & remedy given.
> Can we take it that the first two failures were for the same reason?
> 
> This is a bit late, but have you Ezequiel any record of what the
> post-install file permissions were in & below:
>  /home/ezequielpartida/.local/share/flatpak
> since you corrected them?

No. flatpak installs in /var/lib/flatpak/app/ and $HOME/.var/app contains user's config/cache.

This directory is 1000:1000 drxw------ and so does $HOME/.local/share/flatpak.
 
> And the same for Aurelien? To compare the original permissions, which A did
> not need to fiddle, but E did. If they are different - why?
> 
> Accepting the need to install flatpak itself as root:
> Ezequiel says above: "flatpak repo as well as apps are installed as root",
> but in comment 0, all the commands shown are as the normal user.
> 
> Aurelien: can you say what you did as what user in comment 1 ?

All flatpak commands are done as user in CLI and Discover does the same.
You can install as root also. All is OK on my Cauldron system.

Source RPM: flatpak => flatpak-1.8.1-1.mga8.x86_64

Comment 5 Aurelien Oudelet 2020-10-14 18:29:29 CEST
@Ezequiel, do you have a wrong umask? Mine is 0022.
Comment 6 Ezequiel Partida 2020-11-17 03:44:01 CET
I did a test and plan to do another one tomorrow.

step 1. I installed mageia and install flatpak as root as normal.

step 2/ I later installed the flathub reposity as root using:

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

step 3. I later installed the application as root using:

flatpak install flathub com.spotify.Client

Once installed it does not run tom mageia menu, if I run it from konsole as normal user I get: 

$ flatpak run com.spotify.Client
error: While opening repository /home/ezequielpartida/.local/share/flatpak/repo: opening repo: opendir(/home/ezequielpartida/.local/share/flatpak/repo): Permission denied

I think is when I install step 3 as root. If I do it as normal user I don't have problems

I will test this tomorrow.

Regards
Comment 7 Dave Hodgins 2020-11-17 04:02:55 CET
(In reply to Ezequiel Partida from comment #6)
> $ flatpak run com.spotify.Client
> error: While opening repository
> /home/ezequielpartida/.local/share/flatpak/repo: opening repo:
> opendir(/home/ezequielpartida/.local/share/flatpak/repo): Permission denied

Looks likely to have been caused by using "su" to become root instead of "su -".
See https://wiki.mageia.org/en/Never_use_just_su

CC: (none) => davidwhodgins

Comment 8 Aurelien Oudelet 2020-12-19 17:02:33 CET
(In reply to Ezequiel Partida from comment #6)
> I did a test and plan to do another one tomorrow.
> 
> step 1. I installed mageia and install flatpak as root as normal.
> 
> step 2/ I later installed the flathub reposity as root using:
> 
> $ flatpak remote-add --if-not-exists flathub
> https://flathub.org/repo/flathub.flatpakrepo
> 
> step 3. I later installed the application as root using:
> 
> flatpak install flathub com.spotify.Client
> 
> Once installed it does not run tom mageia menu, if I run it from konsole as
> normal user I get: 
> 
> $ flatpak run com.spotify.Client
> error: While opening repository
> /home/ezequielpartida/.local/share/flatpak/repo: opening repo:
> opendir(/home/ezequielpartida/.local/share/flatpak/repo): Permission denied
> 
> I think is when I install step 3 as root. If I do it as normal user I don't
> have problems
> 
> I will test this tomorrow.
> 
> Regards

flatpak applications should NEVER be installed as root user.
The infrastructure is to add applications as user, using ever Plasma-discover or gnome-software.
Also, at command line, it must be used as user.
Comment 9 Aurelien Oudelet 2020-12-19 17:05:20 CET
Tagging this INVALID.

Seems a permission error in user directory.

Resolution: (none) => INVALID
Status: UNCONFIRMED => RESOLVED


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