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

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: Thomas Hipp <thomas.h...@canonical.com>
From acd0645e45c14be07907d5b2cc9f6a068b0794cf Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.h...@canonical.com>
Date: Thu, 27 Feb 2020 14:17:11 +0100
Subject: [PATCH] shared: Close created files

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
---
 shared/chroot.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/shared/chroot.go b/shared/chroot.go
index 6b27b01..e15540e 100644
--- a/shared/chroot.go
+++ b/shared/chroot.go
@@ -44,10 +44,11 @@ func setupMounts(rootfs string, mounts []ChrootMount) error 
{
                                return err
                        }
                } else {
-                       _, err = os.Create(tmpTarget)
+                       f, err := os.Create(tmpTarget)
                        if err != nil {
                                return err
                        }
+                       f.Close()
                }
 
                // Mount to the temporary path
@@ -109,10 +110,11 @@ func moveMounts(mounts []ChrootMount) error {
                                return err
                        }
                } else {
-                       _, err = os.Create(target)
+                       f, err := os.Create(target)
                        if err != nil {
                                return err
                        }
+                       f.Close()
                }
 
                // Move the mount to its destination
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to