Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: File descriptor leakage?
- X-seq: zsh-users 19184
- From: lilydjwg <lilydjwg@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: File descriptor leakage?
- Date: Mon, 29 Sep 2014 21:58:51 +0800
- Cc: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Disposition-notification-to: missyou11@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to :disposition-notification-to:user-agent; bh=sFLk7IsJvt+dFWADzpofx3ni3FpXPYTQWiuttAcSNhI=; b=hBiHHJ0sx/dqCMbkioaBgBePsbqL4BJlBclNPHVdpfIJaLmciuBHJ58kKwxfN5cdJ4 6/EJF6gASxXNTY6zKOLTijd6HwrQoBTFgb/yd9Sjq/Lq7sHhUBXEJVWjShJ0LevQV3AX Ev7Hll2bZUUBY44oDzxB/JV2jJL6XAwBonQObwAhqJ40OoebKvBQs8fqkRXT0TZ5hhPT AOkvyqnzJ3OB8SqZnSo+hRuQcDBtHpq8nQL4BA8NCZTjhxZOpvGzIEbiUuNijq8v+Lrm 0zliS4V2luR1wP9kMp7dtUAG7tjHs1luFJftaxv4TTj5aYIS6v3O7Um/GqRsMGcebSZV JgBA==
- In-reply-to: <20140929115901.255bacb9@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20140929035338.GA29747@lilyforest> <140928230710.ZM5202@torch.brasslantern.com> <20140929115901.255bacb9@pwslap01u.europe.root.pri>
On Mon, Sep 29, 2014 at 11:59:01AM +0100, Peter Stephenson wrote:
> [...]
>
> Hmm, that's to do with file locking. That might suggest some path
> through the code where this isn't handled that neither Bart nor I have
> spotted yet.
>
> diff --git a/Src/hist.c b/Src/hist.c
> index d29a65a..4660fd0 100644
> --- a/Src/hist.c
> +++ b/Src/hist.c
> @@ -2593,7 +2593,12 @@ savehistfile(char *fn, int err, int writeflags)
> out = NULL;
> } else {
> int fd = open(tmpfile, O_CREAT | O_WRONLY | O_EXCL, 0600);
> - out = fd >= 0 ? fdopen(fd, "w") : NULL;
> + if (fd >=0) {
> + out = fdopen(fd, "w");
> + if (!out)
> + close(fd);
> + } else
> + out = NULL;
> }
>
> #ifdef HAVE_FCHMOD
>
Hi, I'm sorry I didn't test master. It turns out that this has already
been fix at commit 4414e54ea7ffe50acca851c11c2ef49dc867c55d. And the
patch above doesn't fix it for me (patched against that bad commit).
--
Best regards,
lilydjwg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author