Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cd -s symlink hangs (sometimes?)
- X-seq: zsh-workers 26813
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: cd -s symlink hangs (sometimes?)
- Date: Mon, 6 Apr 2009 13:07:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FhUPIMELABuiQXJFYvQbDHMCQV9BTYcdPpeN0etI9kg=; b=Z/z2H/Ynm5oOQYaFjv7wprk5kzcQQSffKGYg9ZPoMwFdq+P2bVFiK5lr3CoYpzkFkK R2GAIWOfhdCmiyoUkzri7dU8qpXPNuzSkRBZ4ECrYmyfHDyLzFfyd5viqMOErpX4cr5G mALkXQ0rFD0+jbG7tMgloYNIIaxXHA+VHGtaA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=J59wXdBikYBhCqSPzvw23bCWHooPR9w60/F0N2qcn5B8ARykBTSSFxTptQgFa1mBc2 4h1Aei9hMjX+XUeE4CFxpt6m4TbdavhCFlpLuSg4REPunxADXOOX+zZv3qSxZB2Osr11 qjFxpUf0SpGbPasSUMMyObMbwd96L+HaMiup0=
- In-reply-to: <20090324124612.26017e86@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0903201412h2a7b99c9ya5101509a3972313@xxxxxxxxxxxxxx> <20090320224856.73dae001@pws-pc> <237967ef0903201615x72769fe4va86273c3fa07cb2e@xxxxxxxxxxxxxx> <20090322125410.66a9d294@pws-pc> <237967ef0903221605h11983bb4v4eda8d2a1c41a1c9@xxxxxxxxxxxxxx> <20090323104928.0c59c30f@news01> <237967ef0903230446u6810c06cs511fddcc21fd2a8a@xxxxxxxxxxxxxx> <20090323122714.3373526a@news01> <20090324124612.26017e86@news01>
2009/3/24 Peter Stephenson <pws@xxxxxxx>:
> On Mon, 23 Mar 2009 12:27:14 +0000
> Peter Stephenson <pws@xxxxxxx> wrote:
>> On Mon, 23 Mar 2009 12:46:10 +0100
>> Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> > 2009/3/23 Peter Stephenson <pws@xxxxxxx>:
>> > Trying the patch now and it does stop the leak... but you didn't think
>> > this adventure was over yet, did you?
>>
>> No, I definitely want to fix the diagnostics and at the least the internal
>> setting of pwd when a cd fails, but I'm not sure what a neat way is.
>
> On top of this, I've found another pre-existing bug down to poorly thought
> out code structure, which may be something to do with the side effect
> Mikael was seeing: Âon failure, restoredir() could call upchdir()
> repeatedly because it thought it was doing a recursive glob since the "level"
> element wasn't initialised. ÂI only got this sometimes with an optimised
> compilation; before, I was using a debug build which didn't show it up at
> all. ÂI've now put the initialisation for a "struct dirsav" in a
> subroutine.
>
> For the diagnostics and pwd, I've just borrowed what the recursive handling
> in zsh/files does, which is cd to /, set pwd consistently, and report the
> error. ÂThis is at least much better; an algorithm for fixing up the
> current directory even better is a good deal more complicated and given you
> can't cd to the correct directory in this case it's not clear how useful it
> is. ÂSo I'm tempted to leave it at this.
>
> In addition to "cd -s", this may address theoretical problems with recursive
> globs under similar circumstances.
I wasn't able to make it happen, but is it possible that under some
circumstance, a command of the form
/unimportant/dir% ls **/*; rm -rf *
could now remove everything in my home directory?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author