Hey,

On 31/10/14 06:40, Julien Viard de Galbert wrote:
> On Fri, Oct 31, 2014 at 02:24:57AM +0100, Tomasz Nitecki wrote:
>> 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)?
>>
> Oh, that rings an old bell... Yes my configuration preserve HOME.
> Not preserving HOME was a change in sudo 1.7.4p4-2 if I believe le NEWS
> file, and this advertised how to keep the old behaviour... so at the
> time I did exactly that !

While debugging this issue, I've noticed that sudoing in Ubuntu is
supposed to preserve user $HOME by default [1]. Since how-can-i-help is
also available in Ubuntu [2] and sudoing is preferred way of doing
things in Ubuntu, this issue will most likely also affect Ubuntu users
with default configurations.

While I could try to implement a workaround inside hcih, I don't think
it's a good idea - it would be error prone and would just fix a single,
specific issue. However, adding a simple read/write check before
performing a file operation is safe, simple and will be way more
generic. Nothing special - if hcich cannot read/write to its files it
will just print a warning (mentioning which files need to be chowned)
and exit gracefully. I'll also add a short notice about running with
sudo in man page.


> I guess it's time to drop this old config :)
> And now it works as expected.
> 
> Thanks for the help and all the detailed explanations !

I'm glad I could help :)


> Now it's time to look at how-can-i-help's output :)

Good luck here! And thanks for helping :)


Regards,
T.

[1] https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/1373495
[2] http://packages.ubuntu.com/trusty/devel/how-can-i-help

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to