Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: [for consideration] TMPSUFFIX
- X-seq: zsh-workers 39466
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: [for consideration] TMPSUFFIX
- Date: Tue, 27 Sep 2016 12:20:50 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=s1aYmITw4pdsfY+yj5e+z6esKhEbMOISRI58By44zxM=; b=JQqGfmDPCIH523jWYbElhECj+HxGRE1U7H0Dc05Yjl5TDenJ2ENqziPoftVYObeCRw hBcWX40rJx92FQ8//CX+ULOklymG0R3N32l1oAexmEC789A2zm2ajohS0PbfvCXC4tsu tqZBnKERR06x8Y3a7T6vCb8105RX324YaiLg8F6GHpLgWcSIdv+Ht5GbmhTEBLQIJzwM lP3hZ2ziZIONN/0LMpPSqt1OHBN5p2pBnCZ/vdPKgzK81XWO0csTJZDFT97LbwsblEyj wxqqgdFcqVtn7zEt7NSKEmbcAveJEzHqhneYkmMee3LDjffYuUOw1zCy9Fe6uarV+0Yp MCZA==
- In-reply-to: <20160927070039.GA20798@fujitsu.shahaf.local2>
- 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: <160925155112.ZM23899@torch.brasslantern.com> <20160926072546.GA28316@fujitsu.shahaf.local2> <160926091922.ZM26758@torch.brasslantern.com> <20160927070039.GA20798@fujitsu.shahaf.local2>
On Sep 27, 7:00am, Daniel Shahaf wrote:
}
} > won't assert the attack is 100% impossible, but there's nothing more
} > we can do about that than we already have.
}
} Yes, there is: we should stop calling addfilelist(nam) if open(nam)
} returns negative.
That's not the "that" I was talking about.
} (Sidebar: that mktemp() call is the only warning in my build; it'd be
} nice to get rid of it while we're here.)
zsh-workers had this conversation years ago and landed where we are now
(except I don't think this bit about =() returning the name even if it
wasn't opened was noticed/considered).
} > It'd have to be an error on the same order as "bad substitution" so the
} > whole command context fails. Hence bringing it up for discussion.
}
} I don't know what's best here.
}
} Using ERRFLAG_ERROR risks aborting too much code (39154 being a recent
} example).
I'm not sure that's really a valid example for this case -- the trouble
there was not that too much code was aborted, rather that because of a
surrounding use of "eval" not *enough* code was aborted; a scripting
error.
} A middle way would be to force the simple command that =(:) was part to
} return 127.
If we were to parallel other redirection errors, the command should
just return 1. Otherwise I'd say we should report the actual error
number instead of always 127. However, I don't see any obvious way
to do either of those things from inside stringsubst().
The code in stringsubst() expects getoutputfile() to return NULL and
then substitutes nothing as the replacement, which could change the
number of arguments in the command -- so that isn't ideal either.
We could just call zwarn() [instead of zerr()] and return "/dev/null"
to supply an empty file as if the command inside the =() had failed,
but I'm more inclined to just call zerr() and allow things to abort.
This obviously isn't a very common occurrence or we'd have seen it come
up before; this is hardly an obscure or little-used feature.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author