su and/or ksh change history file's group and ownership
Amir Sadr
amir at s.ms.uky.edu
Tue Feb 12 16:57:27 AEST 1991
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.
History files should be read and write protected from others and in fact
that is the way Ksh creates them if they do not exist. I suppose this
problem could be ridden if I allow others write permission to my history
file, but I don't think this is reasonable. Or I could just avoid
become super user by using /bin/su and instead login as root.
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-
--
- Amir Sadr, Dept. of Computer Science amir at ms.uky.edu
- University of Kentucky amir at UKMA.BITNET
- Lexington, KY 40506-0027 [rutgers,uunet]!ukma!amir
--
More information about the Comp.sys.3b1
mailing list