Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bellcore!cellar!krohn From: krohn@cellar.bae.bellcore.com (Eric Krohn) Newsgroups: comp.sys.3b1 Subject: Re: su and/or ksh change history file's group and ownership Message-ID: <1991Feb13.152147.29180@bellcore.bellcore.com> Date: 13 Feb 91 15:21:47 GMT References: <1991Feb12.055727.23183@ms.uky.edu> <1991Feb13.005632.19801@ceilidh.beartrack.com> Sender: usenet@bellcore.bellcore.com (Poster of News) Reply-To: krohn@bae.bellcore.com Organization: Bell Communications Research Lines: 44 In article <1991Feb13.005632.19801@ceilidh.beartrack.com>, dnichols@ceilidh.beartrack.com (DoN Nichols) writes: |> In article <1991Feb12.055727.23183@ms.uky.edu> amir@s.ms.uky.edu (Amir Sadr) writes: |> >I've just noticed that during Ksh, becoming super user via /bin/su will |> >change the owner and group ID of $HISTFILE (in my case $HOME/.kshistory) |> >to root. Once I become a regular user again, the group and owner ID of the |> >history file however remain as root. This will, I assume, force Ksh to keep |> >a history of my session in core (since I can still walk through my commands). |> |> Yes, it happened to me, too! I had given up using su(1), and just |> logged out and back in when needing root powers. This was with the new ksh |> from the fixdisk2.0. .... |> After getting the new ksh from osu-cis, and verifying that it fixed |> the Cnews problem, I tried the su, just for fun, and was overjoyed to find |> that problem fixed. Getting a working ksh is obviously the preferred solution. However, I've also used a technique of switching HISTFILE based on user name (even with a working ksh :-). I run su cplus -c "exec $bin/myksh" where myksh runs id(1) to get the new user name and does HISTFILE=$HOME/history/$ID exec ksh I will also do HISTFILE=$HOME/history/parser exec ksh when I want to work on my parser. Advantages: * different user IDs use different history files (my $HOME/history directory is mode 777), so no permission problems. * different user IDs and projects maintain different saved history. When I'm root, or cplus, I usually want to run different commands than when I'm me. When I'm working on my parser, I want to search for the make command germane to it rather than some other make for a different piece of software. Disadvantages: * You cannot share history file contents. (That's what cut and paste are for!) -- Eric J. Krohn krohn@bae.bellcore.com or uunet!bellcore!bae!krohn Bell Communications Research, 444 Hoes Ln, Piscataway, NJ 08854