zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Fix leak during Y shortcircuit glob qualifier
Date: Wed, 23 Sep 2015 22:18:10 -0700	[thread overview]
Message-ID: <150923221810.ZM32365@torch.brasslantern.com> (raw)
In-Reply-To: <CAHYJk3QnWQPVzBcgpmES=ka11tD5ra53fsA-C9cFpUHN0zEpdA@mail.gmail.com>

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.


  reply	other threads:[~2015-09-24  5:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 21:54 Mikael Magnusson
2015-09-24  3:12 ` Bart Schaefer
2015-09-24  3:38   ` Mikael Magnusson
2015-09-24  5:18     ` Bart Schaefer [this message]
2015-09-24 18:55       ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150923221810.ZM32365@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).