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

Not working in FreeBSD if sudo not available #11

Closed
jupiter126 opened this issue Oct 13, 2022 · 5 comments
Closed

Not working in FreeBSD if sudo not available #11

jupiter126 opened this issue Oct 13, 2022 · 5 comments

Comments

@jupiter126
Copy link

In followup to r-darwish/topgrade#1023

I was trying out topgrade and getting polkit errors, preventing topgrade from running.

Installing sudo solved the issue - but not sure topgrade should depend on sudo

(FreeBSD 13.1-RELEASE-p2)

I do not have doas installed!

desinstalled sudo to reproduce error:

root#: topgrade

―― 13:57:08 - FreeBSD Packages

Error checking for authorization org.freedesktop.policykit.exec: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: get_kinfo_proc() failed for pid 3001: No such process

Retry? (y)es/(N)o/(s)hell/(q)uit

―― 13:57:16 - Composer

Changed current directory to /root/.composer

Do not run Composer as root/super user! See https://getcomposer.org/root for details

Loading composer repositories with package information

Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/

Info from https://repo.packagist.org: #StandWithUkraine

Updating dependencies (including require-dev)

Nothing to install or update

Generating autoload files

―― 13:57:17 - FreeBSD Update

Error checking for authorization org.freedesktop.policykit.exec: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: get_kinfo_proc() failed for pid 3001: No such process

Retry? (y)es/(N)o/(s)hell/(q)uit

―― 13:57:21 - Summary

FreeBSD Packages: FAILED

composer: OK

FreeBSD Upgrade: FAILED

Error checking for authorization org.freedesktop.policykit.exec: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: get_kinfo_proc() failed for pid 3001: No such process

@s34m
Copy link
Member

s34m commented Oct 13, 2022

Currently topgrade only supports privilege elevation with the help of tools like sudo or doas. Currently supported are doas, sudo, gsudo and pkexec as given by the following function.

pub fn sudo() -> Option<PathBuf> { which("doas") .or_else(|| which("sudo")) .or_else(|| which("gsudo")) .or_else(|| which("pkexec")) }

As far as I know there is no way to elevate privileges without those tools. Maybe it's possible through dbus and polkit but this would require a lot of tinkering and is probably not worth the effort.

If you use another piece of software instead of sudo/doas for privilege elevation it could be possible to get it to work as an alternative to sudo.

@jupiter126
Copy link
Author

jupiter126 commented Oct 13, 2022 via email

@s34m
Copy link
Member

s34m commented Oct 13, 2022

I'll look into that because normally it's not intended to be run directly as root.

@s34m
Copy link
Member

s34m commented Oct 19, 2022

I looked into that but as far as I can tell solving this would require a rework of the way we run code as root.

@jupiter126
Copy link
Author

jupiter126 commented Oct 19, 2022 via email

@s34m s34m closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2022
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

No branches or pull requests

2 participants