]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-destroy: Fix regular expression for getting rootfs
authorFranz Pletz <fpletz@fnordicwalking.de>
Mon, 12 Aug 2013 12:01:39 +0000 (14:01 +0200)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 12 Aug 2013 13:00:08 +0000 (08:00 -0500)
commit034a01593a4ae10d6f1e49b71afbfff70cfc226c
treec670f115205a3819deb32c1c970b7f6288b10144
parent54e339f91785368a7825b2edaad04c2177a1a382
lxc-destroy: Fix regular expression for getting rootfs

The `lxc-destroy` script was using a simple `grep` for extracting
`lxc.rootfs` from the lxc config. This regex also matches commented lines
and breaks at least removing btrfs subvolumes if the string `lxc.rootfs`
is mentioned in a comment. Furthermore, due to the unescaped dot in the
regex it would also match other wrong strings like `lxc rootfs`.

This patch modifies the regular expression to correctly match the beginning
of the line plus potential whitespace characters and the string
`lxc.rootfs`.

Signed-off-by: Franz Pletz <fpletz@fnordicwalking.de>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc-destroy.in