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

firecfg: Only use fix_desktop_files automatically when run through sudo #3382

Merged
merged 2 commits into from
Jun 4, 2020
Merged

firecfg: Only use fix_desktop_files automatically when run through sudo #3382

merged 2 commits into from
Jun 4, 2020

Conversation

backspac
Copy link
Contributor

It also fixes this error when running firecfg as root:

Error: this option is not supported for root user; please run as a regular user.

@rusty-snake
Copy link
Collaborator

Why? A loot user will end with unfixed .desktop files.

IMHO it would be better to make it conditional either add --nofix or better:

if ROOT AND SUDO {
  fix_desktop_files()
}

@backspac
Copy link
Contributor Author

Right. I see what you mean.
My main issue was that I was trying to setup a Pacman hook and it ran with errors.
In these conditions, I still have to manually run firecfg --fix as my regular user whenever I install a new desktop application.
Why doesn't firecfg handle /usr/local/share/applications? I don't see why it overwrites executables system-wide but desktop files user-wide.

@glitsj16
Copy link
Collaborator

My main issue was that I was trying to setup a Pacman hook and it ran with errors.

What went wrong exactly?

Why doesn't firecfg handle /usr/local/share/applications? I don't see why it overwrites executables system-wide but desktop files user-wide.

I think the choice for ${HOME}/.local/share/applications is to ensure desktop integration works (more) reliable due to it having precedence over /usr/local/share/applications. E.g. a non-firecfg'ed firefox.desktop under ${HOME} would be executed rather than what firecfg would drop under /usr/local. That would onlt create confusion and/or a false sense of security IMO.

@backspac
Copy link
Contributor Author

What went wrong exactly?

When I run pacman -Syu, I get this "error":

(#/#) Configure symlinks in /usr/local/bin based on firecfg.config...
error: command failed to execute correctly

I say "error" because everything went fine in the end. It's just reported as such. It's mainly due to firecfg returning 1.

@rusty-snake's fix is a good solution to this issue IMHO.

That would only create confusion and/or a false sense of security IMO.

That makes sense, but don't you think it would be even better to make the package manager take care of everything, like putting desktop files in /usr/local/share/applications, and then giving the user the possibility to run firecfg --fix locally to go beyond security-wise.
In this way, it wouldn't require a manual action from the user every time they install a new application.

@rusty-snake
Copy link
Collaborator

@backspac do you want do add this conditional fix?

@backspac
Copy link
Contributor Author

backspac commented May 1, 2020

There you go.
Should I make a new issue for the handling of /usr/local/share/applications?

@backspac backspac changed the title firecfg: Only use fix_desktop_files when --fix is specified firecfg: Only use fix_desktop_files automatically when run through sudo May 1, 2020
@rusty-snake
Copy link
Collaborator

Should I make a new issue for the handling of /usr/local/share/applications?

You can, but ATM there is one who fix firecfg bugs. That's why I started firecfg.py, I plan to suport also /etc/xdg/autostart.

@rusty-snake rusty-snake merged commit 61260a6 into netblue30:master Jun 4, 2020
@rusty-snake
Copy link
Collaborator

Merged, Thanks.

@matu3ba matu3ba mentioned this pull request Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants