Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #12020

rewriting a readonly var should exit

From Aurelien ROUGEMONT <beorn@gandi.net>
Newsgroups gnu.bash.bug
Subject rewriting a readonly var should exit
Date 2015-12-15 12:12 +0100
Organization Gandi S.A.
Message-ID <mailman.2155.1450189555.31583.bug-bash@gnu.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib
-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wall
uname output: Linux clamavsig1 3.16.0-4-amd64 #1 SMP Debian
3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.3
Patch Level: 30
Release Status: release

Description:
	in the posix shell specification [1] when a script tries to to
overwrite a readonly variable it should crash the script.

Repeat-By:
        #!/bin/bash
        readonly rovar="goodvalue"
        rovar="badvalue"
	echo "You should not see this message"

Fix:
	the bash interpreter should exit when the readonly var is being asked
for an overwrite



[1]
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01



-- 
 Aurelien                                  Domain Name Registrar
   \o/                                     Hosting For Geeks and more...
    Gandi.net                                  No Bullshit !

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

rewriting a readonly var should exit Aurelien ROUGEMONT <beorn@gandi.net> - 2015-12-15 12:12 +0100

csiph-web