> Date: Sat, 16 Aug 2014 16:44:12 -0500
> From: Bruce Dubbs <[email protected]>
> To: BLFS Development List <[email protected]>
> Subject: Re: [blfs-dev] postlfs/profile.html : '/etc/profile' : add 'unset
> script' ?
>
> akhiezer wrote:
> >> Date: Sat, 16 Aug 2014 14:38:19 -0500
> >> From: Bruce Dubbs <[email protected]>
> >> To: BLFS Development List <[email protected]>
> >> Subject: Re: [blfs-dev] postlfs/profile.html : '/etc/profile' : add 'unset
> >> script' ?
> >>
> >> akhiezer wrote:
> >>>
> >>> Hi,
> >>>
> >>>
> >>> On svn blfs page:
> >>>
> >>> http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html
> >>>
> >>> , in section '/etc/profile' there is at the end of the code:
> >>> --
> >>> for script in /etc/profile.d/*.sh ; do
> >>> if [ -r $script ] ; then
> >>> . $script
> >>> fi
> >>> done
> >>> --
> >>> But no ~usual-style 'unset script' follows it. Any particular reason for
> >>> that: or should there be such a line added in the ~usual way.
> >>
> >> After booting and from the command line, run `set|grep script`. Do you
> >> see anything?
> >>
> >> For another clue, see man bash and look for the builtin command 'export'.
> >>
> >
> >
> > Lol, you've at times an unerring capability of entirely missing the point
> > ;) . You've missed the most obvious scope of the variable. But, 's ok -
>
> You have an unerring capability of not making your point clear. :) Is it
There's "no accounting for" wilful obduracy ;) . Here then is it re-cast in
the form of your 'teaching' 'style' above: "Here's a clue: read man-bash
section Invocation; or man-ash section Invocation - it's even simpler
and more direct."; but imho such posturing talk is a bit silly. So here
instead are a few clue-bats:
- it's concerning basic proactive defensive programming. Which of course
is a core element of good security. And in many quarters is valued
educationally, financially, as well as from many other standpoints.
- as any fule kno, when a query is raised about leaving a variable in a non-
nailed-down state, then that query is concerning defensive-programming;
an automatic flag goes up.
- the variable in question, as it stands, persists through - but not
intentionally - to the user's relevant ~/. files
(.profile/.bash_profile/.bash_login) and to any files sourced from there,
et seq. ("Put some 'echo $script' lines in those chains of files. Then login
&/or run an appropriate shell invocation. Do you see anything?"). As such,
its scope should be addressed. And in this case that should be with an
'unset' in the specified place.
- if/as/when such matters are dismissed haughtily by a person, then keep
an eye on them: they're probably not carrying out the role that they're
purporting to, as properly as they might have people believe. And even
moreso if they try to throw some red-herrings into the mix.
> you want to make the structure the same as other places in the book or
> that you think that the variable hangs around after running the script?
>
> We don't add instructions that are not needed. It might be an
See above.
Ref also:
http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html
, sec '~/.bash_profile'
, code-line 'unset append' :
why do *you* think that's needed?
> interesting question to ask a student to research why it isn't needed.
See above.
Sounds like they might have to find out for themselves (no bad thing,
of course), why it *is* needed.
hth,
Akhiezer
>
> -- Bruce
>
--
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page