You are not logged in.

#1 2016-05-21 21:00:29

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

[SOLVED] Google Keep Desktop Entry Regenerates Default

I have an ongoing battle with the icon for google keep in chromium. I will make a small edit to the .desktop file in ~/.local/share/applications but after some time, usually a week or two it will go back to being the way that it was before. I tried removing write permissions for my user on the file and I tried changing the owner to root but the file still seems to be overwritten back to its original condition eventually.

It shows this:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Google Keep - notes and lists
Exec=/usr/bin/chromium "--profile-directory=Profile 2" --app-id=hmjkmjkepdijhoojdojkdfohbdgmmhki
Icon=chrome-hmjkmjkepdijhoojdojkdfohbdgmmhki-Profile_2
StartupWMClass=crx_hmjkmjkepdijhoojdojkdfohbdgmmhki

But I would like for it to show this:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Google Keep
Exec=/usr/bin/chromium "--profile-directory=Profile 2" --app-id=hmjkmjkepdijhoojdojkdfohbdgmmhki
Icon=google-keep
StartupWMClass=crx_hmjkmjkepdijhoojdojkdfohbdgmmhki

Last edited by TheChickenMan (2016-05-25 22:02:59)


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#2 2016-05-23 19:09:40

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: [SOLVED] Google Keep Desktop Entry Regenerates Default

~/.local/share/applications

-r--r--r-- 1 root      root       316 May 23 15:00 chrome-hmjkmjkepdijhoojdojkdfohbdgmmhki-Profile_2.desktop

I made changes, set owner to root and removed write permissions to the file for everyone. Hopefully this stops it from changing on its own again.
If it does not, is there some way to check exactly what process and when / why / how it was altered?
Chromium should not be running as root so, as far as I am aware, it should not be able to change a file owned by root.


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#3 2016-05-23 19:32:51

netadmin
Member
Registered: 2016-04-28
Posts: 45

Re: [SOLVED] Google Keep Desktop Entry Regenerates Default

I have used auditctl (audit framework) in the past to monitor what/who was altering a file. I have not used this in years, but it may help.

Offline

#4 2016-05-24 09:08:25

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] Google Keep Desktop Entry Regenerates Default

On ext4, you can use "chattr +i file" to make it immutable.

Offline

#5 2016-05-24 21:59:15

The Loko
Member
From: Spain
Registered: 2014-07-23
Posts: 100

Re: [SOLVED] Google Keep Desktop Entry Regenerates Default

I think Chromium updates the desktop file each time is opened, but as you changed permissions it shouldn't happen anymore.

Offline

#6 2016-05-24 23:44:59

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: [SOLVED] Google Keep Desktop Entry Regenerates Default

The Loko wrote:

I think Chromium updates the desktop file each time is opened, but as you changed permissions it shouldn't happen anymore.

I do not think that it is this simple:

  • I have several computers running Arch. I have made the same changes to the desktop file for chromium on both my workstation and laptop but have not noticed (yet) any issue on the laptop.

  • While the timing (looking at modification times) do seem to coincide with opening chromium it does not seem to happen after "every" time chromium is opened. I'm still not sure what the trigger is.

  • Even after changing the permissions on the file to read only and owner to root, the file was still overwritten by some process. Chromium does not run as root and so should not be able to do this.

I am running ext4 and have taken the suggestion to set the immutable bit on the file. Thanks for that idea by the way. Since doing that I have yet to have this issue but will let it run for a couple days before calling it solved since the issue was rather intermittent before.

I would still kind of like to know "how" this was happening though. Blocking file access feels a bit like putting a bandaid on the problem to me and I don't really like the idea that some unknown process has permissions to overwrite files owned by root.


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

Board footer

Powered by FluxBB