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

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) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 32ce171885f40b2ecfaf1c4449c89ea0f33c9bb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Sat, 15 Feb 2020 23:05:10 -0500
Subject: [PATCH] shared: Fix HostPathFollow for stdin/stdout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 shared/util.go | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/shared/util.go b/shared/util.go
index aae5defc6f..ae9da6d281 100644
--- a/shared/util.go
+++ b/shared/util.go
@@ -109,6 +109,16 @@ func IsUnixSocket(path string) bool {
 // HostPathFollow takes a valid path (from HostPath) and resolves it
 // all the way to its target or to the last which can be resolved.
 func HostPathFollow(path string) string {
+       // Ignore empty paths
+       if len(path) == 0 {
+               return path
+       }
+
+       // Don't prefix stdin/stdout
+       if path == "-" {
+               return path
+       }
+
        // Check if we're running in a snap package.
        _, inSnap := os.LookupEnv("SNAP")
        snapName := os.Getenv("SNAP_NAME")
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to