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

Failed to access '/root', Permission denied #613

Closed
cristianovitorino opened this issue Jun 8, 2020 · 8 comments
Closed

Failed to access '/root', Permission denied #613

cristianovitorino opened this issue Jun 8, 2020 · 8 comments

Comments

@cristianovitorino
Copy link
Contributor

cristianovitorino commented Jun 8, 2020

I'm unable to either update or install any packages. I always get this type of error no matter the package.

I did nothing unusual, followed the same instructions as always. It just simply stopped working.

sdjfgi35y

Full error, trying to install the cheat app for example:

asfdgj56

This is a problem with Aura, since Yay works normally:

gfd7g4j

@VannTen
Copy link

VannTen commented Jun 9, 2020

Hi, I have the exact same problems.
It think this is caused by commit 38471fb
Using sudo -E -u <builduser> as the command for build has the following effect :

$ sudo sudo -E -u max env # One would normally run aura for installing as `sudo aura ... etc`
LOGNAME=max
USER=max
HOME=/root # That is the problem I think
SHELL=/bin/bash
SUDO_COMMAND=/usr/bin/env
SUDO_USER=root
SUDO_UID=0
SUDO_GID=0
BROWSER=/usr/bin/firefox
EDITOR=vim

The problem seems to be that the second sudo preserves root environment, and so it gets the wrong home.
Maybe a better fix for #606 would be to use --preserve-env=list (see man sudo) for whitelisting env variables that sould be preserverd ? And maybe add a options or flags to aura for that list ?

-- Or maybe with a more general solution, allows the user to customize the sudo commandline that aura uses ?

EDIT: I saw another possibilites in the sudo man : using the --set-home (-H) option explicitely. This would have the advantage of playing nice with the -E option

$ sudo sudo -E -u max --set-home env 
COLORTERM=truecolor
LANG=en_US.UTF-8
TERM=xterm-termite
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
MAIL=/var/mail/root
LOGNAME=max
USER=max
HOME=/home/max # Good to go o/
SHELL=/bin/bash
SUDO_COMMAND=/usr/bin/env
SUDO_USER=root
SUDO_UID=0
SUDO_GID=0
BROWSER=/usr/bin/firefox
EDITOR=vim

@VannTen
Copy link

VannTen commented Jun 9, 2020

A temporay workaround for making aura work is to use it with sudo -E, by the way ; you got the correct HOME that way

@cristianovitorino
Copy link
Contributor Author

cristianovitorino commented Jun 9, 2020

A temporay workaround for making aura work is to use it with sudo -E, by the way ; you got the correct HOME that way

I got the same errors still. But thanks for trying to help.

@fosskers
Copy link
Owner

fosskers commented Jun 9, 2020

I think this is due to the most recent release where I pass -E through with sudo when switching to the underlying user to run makepkg. It seems this had unintended effects, sorry folks. I'm going to plan a fix tomorrow morning.

@fosskers
Copy link
Owner

Hi folks, apologies for the breakage. I just released 3.1.2 that revokes the previous -E change. Can you test it?

@cristianovitorino
Copy link
Contributor Author

@fosskers Working flawlessly for me now, thank you!

@fosskers
Copy link
Owner

fosskers commented Jun 10, 2020

Oh wonderful! Sorry about that again. Note to self: don't release software and then immediately go camping 😅

Can we close the issue?

@cristianovitorino
Copy link
Contributor Author

Oh wonderful! Sorry about that again. Note to self: don't release software and then immediately go camping

Can we close the issue?

There is no need to apologize dude, thank you very much for worrying that much as to fix it so quickly!

You can close it, it's working flawlessly, I tested it thoroughly.

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

3 participants