[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: identity confusion



On Fri, Jan 24, 2020 at 12:48:51AM -0800, didier.gaumet@gmail.com wrote:
> 
> Does the --login option provide the same result?
> EXcerpt from the su man page:
>       "For backward compatibility, su defaults to not change the  current  di‐
>        rectory  and to only set the environment variables HOME and SHELL (plus
>        USER and LOGNAME if the target user is not root).  It is recommended to
>        always use the --login option (instead of its shortcut -) to avoid side
>        effects caused by mixing environments."

The --login and -l and - options to (this version of) su all do exactly
the same thing.  They're even listed on the same line in the manual.

       -, -l, --login
              Start  the shell as a login shell with an environment similar to
              a real login:

That weird-ass parenthetical comment that you cited, that EVERYONE always
cites, is just poorly written crap and should be ignored.  What it's
TRYING to say is "You should use --login rather than the legacy - form,
because we don't like the legacy - form, even though you need to use it
on commercial Unixes, and even though it's the only semi-portable choice,
and even though it's what everyone always uses."

In an ideal world, the parenthetical clause should be expunged from
the manual, because it is misleading, and is causing people to become
confused.

But, based on my past experience with submitting patches to man pages,
I'm going to go ahead and assume that any patch submitted to remove
the confusing and misleading commentary from the manual will not be
applied.  I'll save a lot of time and frustration that way.

If upstream ever *decides* that it wants to correct its documentation,
then maybe we'll see an improvement.  But we, the end users, don't get
to participate in that.


Reply to: