Bug#987675: sensible-utils: select-editor misbehaves on missing HOME variable

2021-08-07 Thread Bastien Roucariès
Package: sensible-utils
Version: 0.0.14
Followup-For: Bug #987675
Control: block -1 by 991984

This bug is really hard to fix.

Even your proposition to use getent will fail because under env -i $USER is not
set.

So for now, sensible-utils will check if $HOME is set, and if not set use
fallback to EDITOR, SELECTED_EDITOR, and editor

Note that nano should also be fixed see #991984

Bastien



Bug#987675: sensible-utils: select-editor misbehaves on missing HOME variable

2021-04-27 Thread Guillem Jover
Package: sensible-utils
Version: 0.0.14
Severity: normal

Hi!

The select-editor program misbehaves when the environment does not
contain the HOME variable set. For normal users this means the code
will be unable to write to «/.selected_editor», for root that means
the code will pollute the «/» directory.

Please check whether HOME is set, and otherwise initialize it with a
sensible value, f.ex. from «getent passwd $user|cut -d: -f6» or
similar.

An easy way to test this is with «env -i sensible-editor».

Thanks,
Guillem