[libvirt] [PATCH] lxc: allow empty path in URI for historical compatibility

Daniel P. Berrangé posted 1 patch 5 years, 4 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20181224151114.28745-1-berrange@redhat.com
src/lxc/lxc_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[libvirt] [PATCH] lxc: allow empty path in URI for historical compatibility
Posted by Daniel P. Berrangé 5 years, 4 months ago
The use of 'lxc://' was mistakenly broken in:

  commit 4c8574c85c554e68de0d8bf9b85727954a5bea91
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Mar 28 12:49:29 2018 +0100

    driver: ensure NULL URI isn't passed to drivers with whitelisted URIs

Allow it again for historical compatibility.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/lxc/lxc_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index de045c80bb..df15a0da50 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -140,7 +140,8 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn,
     virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
 
     /* If path isn't '/' then they typoed, tell them correct path */
-    if (STRNEQ(conn->uri->path, "/") &&
+    if (STRNEQ(conn->uri->path, "") &&
+        STRNEQ(conn->uri->path, "/") &&
         STRNEQ(conn->uri->path, "/system")) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unexpected LXC URI path '%s', try lxc:///system"),
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] lxc: allow empty path in URI for historical compatibility
Posted by Michal Privoznik 5 years, 3 months ago
On 12/24/18 4:11 PM, Daniel P. Berrangé wrote:
> The use of 'lxc://' was mistakenly broken in:
> 
>   commit 4c8574c85c554e68de0d8bf9b85727954a5bea91
>   Author: Daniel P. Berrangé <berrange@redhat.com>
>   Date:   Wed Mar 28 12:49:29 2018 +0100
> 
>     driver: ensure NULL URI isn't passed to drivers with whitelisted URIs
> 
> Allow it again for historical compatibility.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/lxc/lxc_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

ACK

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list