]> git.proxmox.com Git - mirror_lxc.git/commit
Fix NULL-ptr derefs for container without rootfs
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 2 Feb 2016 13:43:33 +0000 (14:43 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 2 Feb 2016 13:43:33 +0000 (14:43 +0100)
commit1ec0e8e3fd766ff77c6128f384772f407f9b75da
treef1fc7247e825b64199e98b56b98e7514a16a565e
parent06b5b4d96a6dc4aa3b4b5e4c009f410fd7bb1dc8
Fix NULL-ptr derefs for container without rootfs

Since we allow containers to be created without a rootfs most checks in conf.c
are not sane anymore. Instead of just checking if rootfs->path != NULL we need
to check whether rootfs != NULL.

Minor fixes:
- Have mount_autodev() always return -1 on failure: mount_autodev() returns 0
  on success and -1 on failure. But when the return value of safe_mount() was
  checked in mount_autodev() we returned false (instead of -1) which caused
  mount_autodev() to return 0 (success) instead of the correct -1 (failure).

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/bdev/lxcoverlay.c
src/lxc/conf.c