Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!samsung!rex!ukma!amir From: amir@s.ms.uky.edu (Amir Sadr) Newsgroups: comp.sys.3b1 Subject: su and/or ksh change history file's group and ownership Message-ID: <1991Feb12.055727.23183@ms.uky.edu> Date: 12 Feb 91 05:57:27 GMT Sender: amir@ms.uky.edu (Amir Sadr) Organization: U of Kentucky, Computer & Mathematical Sciences Division Lines: 26 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@ms.uky.edu - University of Kentucky amir@UKMA.BITNET - Lexington, KY 40506-0027 [rutgers,uunet]!ukma!amir --