Bug #9122
set_simple_config_key is buggy
100%
Description
set_simple_config_key()
in /usr/local/lib/tails-shell-library/common.sh
doesn’t update config keys but sets them, replacing whatever is in the file.
Here’s simple testcase:
root@amnesia:/tmp# cat > testfile << EOF
value1=a
value2=b
value3=c
EOF
root@amnesia:/tmp# cat testfile
value1=a
value2=b
value3=c
root@amnesia:/tmp# . /usr/local/lib/tails-shell-library/common.sh
root@amnesia:/tmp# set_simple_config_key value2 "bird" /tmp/testfile
root@amnesia:/tmp# cat /tmp/testfile
value2=bird
Subtasks
History
#1 Updated by intrigeri 2015-03-29 11:19:40
I guess that removing -n
and the p
command should be enough to fix that.
#2 Updated by anonym 2015-03-30 11:52:42
- Status changed from Confirmed to In Progress
Applied in changeset commit:5bbddc2ee9f08ab792d1ecee4d348221c1bd1db1.
#3 Updated by anonym 2015-03-30 11:57:06
- Target version changed from Tails_1.3.2 to Tails_1.4
- % Done changed from 0 to 50
- QA Check set to Ready for QA
- Feature Branch set to bugfix/9122-fix-set_simple_config_key
Indeed, good catch! I’ve pushed a fix.
Luckily, we weren’t hit by the bug in the only placed that function was used, config/chroot_local-includes/usr/local/lib/tails-shell-library/i2p.sh
, since by default, the line we want to set doesn’t already exist in ${I2P_DEFAULT_CONFIG}/router.config
. Delaying until Tails 1.4 since it doesn’t affect anything that will end up in Tails 1.3.2.
#4 Updated by intrigeri 2015-05-01 10:06:24
- Assignee set to intrigeri
#6 Updated by intrigeri 2015-05-01 11:47:08
- Status changed from In Progress to Fix committed
- % Done changed from 60 to 100
Applied in changeset commit:a9f85067023de4e51892555688c0f7f1940f3d09.
#7 Updated by BitingBird 2015-05-01 11:50:04
- QA Check changed from Ready for QA to Pass
#8 Updated by intrigeri 2015-05-01 11:53:42
- Assignee deleted (
intrigeri)
#9 Updated by BitingBird 2015-05-12 18:40:59
- Status changed from Fix committed to Resolved