The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3744

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Closes #3726.

Signed-off-by: Christian Brauner <[email protected]>
From baba9d5e556f76a78dbd3be281c645949597cb2a Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Thu, 31 Aug 2017 02:31:54 +0200
Subject: [PATCH] ceph: sanitize path return from rbd map

Closes #3726.

Signed-off-by: Christian Brauner <[email protected]>
---
 lxd/storage_ceph_utils.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/storage_ceph_utils.go b/lxd/storage_ceph_utils.go
index 060f30d12..1f4ec0e2e 100644
--- a/lxd/storage_ceph_utils.go
+++ b/lxd/storage_ceph_utils.go
@@ -133,6 +133,12 @@ func cephRBDVolumeMap(clusterName string, poolName string, 
volumeName string,
                return "", err
        }
 
+       idx := strings.Index(devPath, "/dev/rbd")
+       if idx < 0 {
+               return "", fmt.Errorf("Failed to detect mapped device path")
+       }
+
+       devPath = devPath[idx:]
        return strings.TrimSpace(devPath), nil
 }
 
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to