Franco Martelli wrote:
>> The question is, will users realise that they're putting the files in
>> *root's* home directory, and will they even know where that is?
> 
> A minimal assumption of knowledge base of the FHS ¹  and tilde-expansion
> should be take by Release Notes writers. I think we shouldn't worry about
> this.

It's possible to be a heavy commandline user for a long time without
discovering that ~/ can expand to /root/.  But we've got onto a
sidetrack from the main issue of this bugreport, and I probably
shouldn't have brought it up in the first place, since files are
dropped into ~/ in quite a few of the recipes in the Release Notes,
and changing them all would be more trouble than it's worth.

(So this email really ought to stop here.)
 
>> If we really can't suggest using /var/tmp for this, that seems a pity;
>> that location *shouldn't* be wiped on reboot, and it's usable whether
>> you're running "sudo; screen" or "sudo screen" or "screen; sudo".
> 
> It's more popular to use a non-privileged home directory.

I don't follow: /var/tmp is a non-privileged location that anybody can
write to, and continue accessing before and after switching to a
different user account.  On the other hand, files created in /root/
aren't accessible to normal users, even if they know where to look.

> Few people strictly adhere to the FHS ¹  specifications.

People who diverge from the standards (e.g. by setting up an
overenthusiastic tmpreaper, if that's what you're thinking of) need to
remember their automated footguns and make allowances for them.

> This is why I am in favor of
> using tilde-expansion. No matters if the reader becomes root or runs
> "script" as non-privileged user: the files will always go in the home
> directory, where they will be used by "scriptreplay" command. By doing so we
> won't have to take care of where the files reside.

This is backwards.  If I use ~/, it expands to whatever home directory
is listed in /etc/password for my current user, and that can vary
non-obviously depending on what user I am.  The alternative is to give
an explicit path like /root/, in which case it's obvious what location
it's talking about - though it'll fail if they haven't run sudo yet.

Then again there's the option of using ./, which is another can of
worms.  Part of the problem is that we don't have a section saying
"start by getting a root commandline in a sane shell with a sane PWD";
if we did, that would also be a good place to go into the question of
appropriate locales.  Or maybe it would just encourage users to skip
that whole boring section to get to the "apt full-upgrade" part.

> ¹ https://refspecs.linuxfoundation.org/fhs.shtml

Most users haven't read that.  I know *I* hadn't looked at it since
before they updated it for /run and usrmerge and so on.
-- 
JBR     with qualifications in linguistics, experience as a Debian
        sysadmin, and probably no clue about this particular package

Reply via email to