Path: csiph.com!aioe.org!news.glorb.com!usenet.stanford.edu!not-for-mail From: isabella parakiss Newsgroups: gnu.bash.bug Subject: cannot declare local variables if they're readonly Date: Thu, 23 Jul 2015 01:12:01 +0200 Lines: 23 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: usenet.stanford.edu 1437606730 9035 208.118.235.17 (22 Jul 2015 23:12:10 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=qBxsNElpF7hMjJD2+NEh7vXMuIgQKJFjQPv8PCUGh24=; b=axexnq7F1LBmBs1fzkdNNycalrVGhw1noT/Y21jzj0POVWCOdcCLnNMYhkt1HHIz+L iBULvrjziRqx9kYzuDvYrJeIDrAKieDV8uTGfrWaGuQET8AV75veT8sWDRmgfZIx5N6k y/ldupY2AUzSS7ag47mjK02rvVC4lxmD12KUEJqIk7FT96xa43msYcb6jVECSAFRSGs0 v0hyRs00KwqLCYmYUcDKP15Wt7d9UW6KSlvnJ87sEpdWFNte5nS/oL3cy8uWuXiBNBs0 HObEZi1dfCPSDJIOL7atimjJbiF9aWscjLYyUWtsoLNmKkw/Gdh37C4RbMaGyu5W+8E3 7ceQ== X-Received: by 10.50.43.230 with SMTP id z6mr38944340igl.64.1437606721107; Wed, 22 Jul 2015 16:12:01 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22a X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: aioe.org gnu.bash.bug:11252 >From variables.c The test against old_var's context level is to disallow local copies of readonly global variables (since I believe that this could be a security hole). Can you please explain how that can be a security hole? $ readonly wtf; fn () { local wtf; }; fn bash: local: wtf: readonly variable You can't even be sure that you can set *local* variables in a function. This is a problem. Most of the shells that support local variables (ksh93, mksh, zsh, dash...) allow this. The only one I could find that doesn't is busybox. --- xoxo iza