[lxc-devel] lxc-destroy.in sanity check and precautions

Rémi Laurent remi.laurent at conostix.com
Thu Jan 5 15:52:33 UTC 2012


Hi LXC dev mailing list,

I've been using LXC for a few days now and so far I'm pretty happy with
the near instant deployment of VMs, so thank you for all the work.

I've stumbled upon few minor bugs and I would at least submit a patch
for lxc-destroy to perform a bit more sanity check before trying to kill
random LV and directories by accident.

The following patch tries to address a few problems:
- validity of the container name, no "../../../etc/"
- checking for config file read existence
- sane actions if $rootdev is undef
- non interactive lvremove call
- and a few aesthetic and minor fixes

It also contains a patch submited by Andrea Rota in his
"lxc-destroy crosses filesystem boundaries - ID: 3463349" ticket,
addressing potential problems if the container contains other (remote)
mounted filesytems.

Don't hesitate to rewrite this or give any feedback you'll find
necessary.

Thanks,
-- 
Rémi Laurent

  Phone: +352 26 10 30 61
  General Support: support at conostix.com
  GPG FP: 27F4 6810 2B0E 1AA0 CDAE  7C7B 3DC9 085A 0FA0 0601
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lxc-destroy-sanity-checks-and-precautions.patch
Type: text/x-diff
Size: 2510 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20120105/2220eaeb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20120105/2220eaeb/attachment.pgp>


More information about the lxc-devel mailing list