Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh-workers 43616, typeset doesn't report tied parameters
- X-seq: zsh-workers 43652
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: TS <debts@xxxxxxx>
- Subject: Re: zsh-workers 43616, typeset doesn't report tied parameters
- Date: Tue, 9 Oct 2018 09:27:26 +0100
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jySTNZerFXGXKPQg8vM1+QYOmAaQ5aex0Pc/FK/6aT8=; b=e9Y7u463ltXScDS2l+MjcLU+5yRUPEeJB+n5rCwdflJvMrs23FLTODB4oeFNAaBXSg X84nNT5y07CKoto3YItdvcajWV/D1jmA5gC9nh1R3B89V9dlHV3PN7DGOWiRxE/9CPST Txv/yKXQCtYZrIbSsN+NZqMw4WW0E9oX7kMWUPR6hGFrC5gdulLCR5T8vxfBDceBW3Xp OH7vU2wV9FbAtT8Y7rJkTzsWi3n4LDs9vTWzLBvLrdHa1HBjwzmiNZ8+1zF2rLjV3lEi j++1/jAV5NlF3bEnTxsbtTMjy/vtgUcoieFGRTsBoVL5czEsM6BbCdtPdpIcBEbHROv5 F7Gw==
- In-reply-to: <816f3f14-f4d9-13f5-5e46-61da75e2eb6a@xk2c.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: TS <debts@xxxxxxx>, Zsh workers <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <f181228f-ebf8-26bd-7c3a-578d29d4689a@xk2c.de> <20181009073138.c6uxzj6uljevwqcx@chaz.gmail.com> <816f3f14-f4d9-13f5-5e46-61da75e2eb6a@xk2c.de>
2018-10-09 10:00:14 +0200, TS:
[...]
> % prv() { print -l "${(t)${(P)1}} ${1}=${(P)1}" ; }
> % IMPORTANTVAR=foo
> % prv IMPORTANTVAR
> scalar IMPORTANTVAR=foo
> % readonly IMPORTANTVAR
[...]
> % importantvar=(buuz)
> % prv IMPORTANTVAR
> scalar-readonly-tag_local IMPORTANTVAR=buuz
>
> basically currently the readonly flag is bypasable this way for every var
> and therefore mood. Somehow i can't believe this is by design, instead of an
> overlook.
[...]
But no need for that to change the value of a readonly variable.
readonly is not a security feature (except maybe for specials,
but even then that's pointless unless you use the restricted
mode (and even then, I'd argue the shell is not the right place
to restrict the user, it's better to use OS containing
features)).
$ readonly VAR=foo
$ typeset +r VAR
$ VAR=bar
$ echo $VAR
bar
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author