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

Re: bash logins: a little buggy (and potentially dangerous)?



Rob Browning <rlb@cs.utexas.edu> writes:

A few mostly minor corrections:

>   if [ "${BASH_INITIALIZED}" != "true" ]

   if [ x"${BASH_INITIALIZED}" != xtrue ]

Don't export THIS_REALLY_IS_A_LOGIN_SHELL, or all the sub-shells will
get it too...

>   export THIS_REALLY_IS_A_LOGIN_SHELL=true
>   . ${HOME}/.bashrc

   THIS_REALLY_IS_A_LOGIN_SHELL=true
   . ${HOME}/.bashrc

Set the path and umask in all top level shells, not just official
login shells...

>   if [ "${THIS_REALLY_IS_A_LOGIN_SHELL}" != "true" ]
>   then
>     PATH=whatever     # reset the path since it got clobbered.
>     umask 007         # reset the umask since it got clobbered.
>   fi

   if [ x"${THIS_REALLY_IS_A_LOGIN_SHELL}" != x"true" -o \
        x"${BASH_INITIALIZED}" != xtrue ]
   then
     PATH=whatever     # reset the path since it got clobbered.
     umask 007         # reset the umask since it got clobbered.
   fi

-- 
Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930


Reply to: