tags 767321 + moreinfo
thanks

Hey,

On 30/10/14 07:31, Julien Viard de Galbert wrote:
> how-can-i-help is normally run through apt with sudo but creates some
> cache files in my home dir. Later running how-can-i-help as user
> resulted in an error:
> <CUT>

It appears that your problem is caused by the fact that when sudo-ing
apt your $HOME is resolved to your user $HOME instead of your root
$HOME. how-can-i-help writes to your $HOME/.cache (that is your user
$HOME) and sets normal permissions for the user who called it (root when
running apt with sudo). Your normal user can read those files but he is
not allowed to modify them.

Are you running sudo with '-E' (preserve environment) or did you
configure your sudoers file so that it preserves environment variables
(I'm thinking about $HOME)?


> how-can-i-help --old works (and is more useful in that case) but the
> first idea is just to type how-can-i-help :)

Running with '--old' doesn't mark shown packages as already shown, so
hcih doesn't need to modify seen.json (so the lack of write permissions
is not an issue). However, if hcih needed to download a new version of
data file (how-can-i-help.json.gz) it would crash as well. It didn't
happen only because data file was already updated by running apt (with
sudo and root write permissions).


> Changing ownerchip of files just work, but is seams strange to have to
> do that since the .cache/ directory contains other files that seams
> related to apt but are not owned by root (apt-file/ or axi-cache.state).

Files in your .cache directory shouldn't be created with root as an
owner. However, I'm not sure if your problem is limited to
how-can-i-help (we are just resolving and writing to $HOME; nothing
special). I was unable to replicate your problem, unless I was running
sudo with my $HOME preserved. So let's diagnose the root issue here
first, before we think about any potential fixes :)

Anyway, changing ownership will work as a workaround. You can also just
delete ~/.cache/how-can-i-help and run how-can-i-help from your normal
user account (without sudo-ing and before you do any apt related stuff).
This will create all required files and set correct permissions.


Thanks for your report and helping with how-can-i-help! :)


Regards,
T.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to