su and/or ksh change history file's group and ownership
DoN Nichols
dnichols at ceilidh.beartrack.com
Wed Feb 13 11:56:32 AEST 1991
In article <1991Feb12.055727.23183 at ms.uky.edu> amir at 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: <dnichols at ceilidh.beartrack.com>
--- Black Holes are where God is dividing by zero ---
More information about the Comp.sys.3b1
mailing list