Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Fix leak during Y shortcircuit glob qualifier
- X-seq: zsh-workers 36621
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: Fix leak during Y shortcircuit glob qualifier
- Date: Thu, 24 Sep 2015 20:55:29 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=C+BcBWGEwaDI7ig7XQGlHQYtuLjUnN5ms0fej1Q/8WE=; b=Yg5FUct1eP80uOfRhGfM4QmE9nD+5MSADDnXymmDB8cfMt28o2i1SSzkT/lbMJICs4 xYEcTYqD6MA7nCdDQmblSZKwEmV741kYURH21K2Iy0XITHmB3DzGYKesPcusS90h+d/H ssydz2vRcvUxjrGGN/PlNk5rAz+NQsiclYVudtImPJCjGgJAMCxrdz067kMYSsUGp2qK gHNz3ZEbjk9oxwHd4KAjsKqCskF72k4AmRBb2oukpst4j3lQ/S2BFkWvN2rtADqbiquP ER/B1NI3r4qn2byqsb4CJ0E8bNU0an8jsLNTkRQQMlYzIphmrfy9rG7xyihl0BLBAi03 aBtg==
- In-reply-to: <150923221810.ZM32365@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1443045290-26615-1-git-send-email-mikachu@gmail.com> <150923201201.ZM32285@torch.brasslantern.com> <CAHYJk3QnWQPVzBcgpmES=ka11tD5ra53fsA-C9cFpUHN0zEpdA@mail.gmail.com> <150923221810.ZM32365@torch.brasslantern.com>
On Thu, Sep 24, 2015 at 7:18 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 24, 5:38am, Mikael Magnusson wrote:
> }
> } % : ./*(-.Y1N); ls -l /proc/$$/fd
> }
> } was my test case, so not much would happen to $PWD in that particular
> } case. I tried */*/*(-.Y5N) instead now, and nothing untoward seemed to
> } happen then either (without and with my patch, so no weird pwd
> } changing or errors about double frees, respectively).
>
> Glancing at scanner() in glob.c and lchdir() in utils.c, it appears that
> the working directory would only be changed if the full path to the target
> directory is VERY long, i.e., does not fit in a PATH_MAX buffer. So it
> probably is necessary to restore, but also probably really difficult to
> construct an example actually goes through that code path.
I've gone the safe route for now and only committed the closedir(lock) part.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author