Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!beartrk!ceilidh!dnichols From: dnichols@ceilidh.beartrack.com (DoN Nichols) Newsgroups: comp.sys.3b1 Subject: Re: su and/or ksh change history file's group and ownership Message-ID: <1991Feb13.005632.19801@ceilidh.beartrack.com> Date: 13 Feb 91 00:56:32 GMT References: <1991Feb12.055727.23183@ms.uky.edu> Organization: D and D Data, Vienna, VA. Lines: 49 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). >But once I terminate Ksh and restart another one, not only the commands >issued after su are lost, but the new Ksh no longer has permission to >write to $HISTFILE. And thus even though no error or warning message is >given, any recorded history is lost once a Ksh session is terminated. > [...] > >Has anyone else noticed this phenomenon, or is it just me doing something >wrong? I am running version 3.51m and I'd be interested to hear if others >have experienced the same? I can't recall, but I think a new Ksh was >delivered as part of 3.51m upgrade. Did the 3.51a version do this too? >I hadn't noticed this then? Can this some how be patched? Thank you- 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. I had been having problems with some code failing in some Cnews scripts unless run under sh(1). I had read mention recently of the ksh on osu-cis being the better one to use for the unix-pc, so I snarfed it. (KSH+IN.Z) Not only did it execute the Cnews code properly, but it also didn't give the ownership change of .kshistory. I had been trying to post the very question you posted just after installing Cnews, and the system kept rejecting my articles because 'comp.sys.3b1' wasn't in the active file (when I KNEW it was there - I had PUT it there :-). By the time I generated a workaround for the Cnews problem, I had more pressing things to post about. 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. If you have ftp access through some system at work or whatever, ftp to 'cheops.cis.ohio-state.edu' (128.146.8.62), set binary mode, and 'get ~/pub/att7300/STORE/KSH+IN.Z'. It comes with documentation which assumes that you'll be installing it as '/bin/sh'. I have found no need to do that, since everything for which I wish to use it, lets me specify the login shell as '/bin/ksh' with no problems. (I'm running 3.51m). Good Luck DoN. -- Donald Nichols (DoN.) | Voice (Days): (703) 664-1585 D&D Data | Voice (Eves): (703) 938-4564 Disclaimer: from here - None | Email: --- Black Holes are where God is dividing by zero ---