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

Re: Installing files in user directories



On 20-Oct-98, 05:22 (CDT), Santiago Vila <sanvila@unex.es> wrote: 
> Maybe you are simply surprised by the fact that base-files recently
> changed from installing a default /root/.bash_profile to installing a
> default /root/.profile (which is slightly "more POSIX").

No, I just noticed because I *have* a .bash_profile (but no .bashrc).

> 1. If ~/.bash_profile exists and ~/.profile does not, move
> automatically ~/.bash_profile to ~/.profile.

Yuck.

> 3. If neither ~/.bash_profile, ~/.bash_login or ~/.profile exist, install
> a default ~/.profile.

Borderline acceptable, although I really don't like it. 

> Therefore if the user has already a working .bash_profile and base-files
> installs a default .profile, it will be completely harmless.

Unfortunately, you also install a .bashrc, which is not. Here it
is:
=============================================================
# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\h:\w\$ '
umask 022
#
[snip of commented out aliases]
=============================================================

1. Neither of those commands have any reason to be in .bashrc -- they
are inherited from the parent (login) shell.

2. If I change my prompt or umask in .bash_profile, you just scrogged my
choices.

I understand that there is a need to have an initial setup for root. All
the Unices that I can remember do this by checking for a root login in
/etc/profile. There is no security hazard in this. (Any user is free to
change their PATH, after all). It's easy to comment/explain, so that the
sysadmin is unlikely to screw it up. 

Here are some problems with the current "solution":

1. Who said that root's home dir is /root?

2. If I deleted my .profile and .bash_profile and (whatever) from
   ~root, that's what I wanted to do. I don't want them replaced.

3. There way more ways for root to screw things up. This is a pretty
   limited fix. I suspect it's far more like for the novice user
   to screw up his/her .profile in vi than to rm it completely.

In my opinion, the bad effects of the cure far outway the disease.

Here's what I'd like to see:

1. Put root's PATH and "umask 022" in /etc/profile, where it belongs.

or 

2. Provide some sort of prompting *before* you copy the default .profile
(and only if none of the potential startup files are there, either by
hand or via the conffile mechanism (better).

In either case, get rid of the .bashrc. If root wants an example,
there's always /etc/skel. Heck, if you want to copy dot.profile and
dot.bashrc to /root, no problem. Just stop screwing with the files that
are actually used!

Regards,
Steve


Reply to: