Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

can't write zsh_history



Hi all,

Every now and then I need to su on some servers that I work on (mostly old freebsd systems that don't have sudo installed and have no outbound net connections, i.e. installing sudo is not an option). The problem, which is really more of an annoyance than a problem, is that if I su to run some command and I don't cd first, my .zsh_history file becomes owned by root. After I exit from # and run a command as my regular user, zsh tells me that it can't write the history file, which of course it can't because it's now owned by root. Is there something I can do to alter the way zsh writes to my history file when I am root? Something like "if uid is 0 then write the history to root's history file and leave .zsh_history alone"? It should be noted that on these machines root's shell is tcsh, except in one case where it's ksh (not my idea I promise!) so I'm not sure why .zsh_history is touched at all when I'm root. Another oddity is that if I chown the file to my user, the file becomes corrupt, which is even more frustrating. The version of zsh for each of these machines is 4.2.6.

As I said, this is a minor annoyance, but I figured I'd ask in case someone else has experienced this before and has a remedy.

Thanks!

Mike H


PS. I just tested this on an openbsd 3.9 firewall that I have, with zsh version 4.2.6, and where root's shell is ksh. Same thing happens.



Messages sorted by: Reverse Date, Date, Thread, Author