Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug: can't write history file
- X-seq: zsh-workers 22902
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: bug: can't write history file
- Date: Tue, 24 Oct 2006 16:37:42 +0100
- In-reply-to: <20061024141740.GA18951@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20061024141740.GA18951@xxxxxxxxxxxxxxxxxxxxx>
Dmitry Karasik wrote:
> Hello,
>
> After upgrading to 4.3.2, I've found that one of the features I love in zsh i
> s
> broken, namely the possibility to use the history file for both root and
> non-root sessions. Now, after I logout from "sudo zsh", I get this:
>
> zsh: can't write history file /home/dk/.zsh-history
>
> I found that it is savehistfile() to blame, because it apparently is called
> with writeflags=0, which bypasses all append/rewrite logic, falling back to
> saving the file by renaming it to .zsh-history.new, and (correctly) refusing
> to
> overwrite .zsh-history because the euid is different. If I'm correct in
> this, the patch below fixes the problem:
>
>...
> - savehistfile(fn, err, 0);
> + savehistfile(fn, err, writeflags & HFILE_APPEND);
>...
That line is the same in 4.2, so I presume what has changed is the
default options (how it reaches this code). In that case it's
plausible that this should always have had that flag. It would
be best if Wayne could comment about what he thinks did change,
but I'm not sure if he's around at the moment.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author