Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Sun Jan 30, 2005 8:05 am    Post subject: bash question Reply with quote

I rarely use bash but I'd like to know how to disable the writing of $HOME/.bash_history for *all* users. I've added these lines to /etc/profile and even /etc/profile.env:
Code:
export HISTFILESIZE=0
unset HISTFILE
export HISTSIZE=100

I've invoked the shell as bash and as sh with no success. If I set the variables manually it works. So what global file does bash/sh parse? It doesn't appear to be /etc/profile.
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Sun Jan 30, 2005 8:10 am    Post subject: Reply with quote

you can put the variables in ~/.bash_profile however the system should source /etc/profile when you log in.
Back to top
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Sun Jan 30, 2005 8:33 am    Post subject: Reply with quote

nobspangle wrote:
you can put the variables in ~/.bash_profile however the system should source /etc/profile when you log in.

Yeah I know that. I wanted a global solution and not have to put a file in every user's home directory to disable a function that should be off by default. I edited /etc/profile to set a test variable and it doesn't get set. The permissions are 0644 and the owner is root. I have no clue why this file isn't getting parsed...
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Sun Jan 30, 2005 8:38 am    Post subject: Reply with quote

/etc/profile is definatley parsed on my system, I did
Code:
echo export\ DAVE=5 >> /etc/profile
su -
echo $DAVE

and I get 5 as the result. The only thing I can think is that the variables you are trying to set are being set by another script after /etc/profile is parsed.
Back to top
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Sun Jan 30, 2005 8:56 am    Post subject: Reply with quote

Figured it out. It has to be a login shell for /etc/profile to get parsed. I updated the cshrc file with an alias for sh to call bash -l and everything seems to be fine. I still think it's stupid to have a security hole like that on be default though.
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
thebigslide
l33t
l33t


Joined: 23 Dec 2004
Posts: 792
Location: under a car or on top of a keyboard

PostPosted: Sun Jan 30, 2005 4:43 pm    Post subject: Reply with quote

also, putting 'source /etc/profile' near the top of .bashrc will work.
Back to top
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Sun Jan 30, 2005 4:50 pm    Post subject: Reply with quote

thebigslide wrote:
also, putting 'source /etc/profile' near the top of .bashrc will work.

I don't have a $HOME/.bashrc, a $HOME/.bash_profile or a $HOME/.profile. My point was I use bash very rarely (I use tcsh) and didn't want more files in the home directories just to turn this "feature" off.
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum