From 5f0928b65e1e1c2a92818ecea0eb81aa547f4a95 Mon Sep 17 00:00:00 2001 From: Bryan McNulty Date: Thu, 17 Apr 2025 02:09:50 -0500 Subject: Fix connection error with smb2 - remove Close() --- pkg/goexec/smb/client.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'pkg') diff --git a/pkg/goexec/smb/client.go b/pkg/goexec/smb/client.go index 384f4bc..35fe5c8 100644 --- a/pkg/goexec/smb/client.go +++ b/pkg/goexec/smb/client.go @@ -80,15 +80,17 @@ func (c *Client) Close(ctx context.Context) (err error) { log := c.Logger(ctx) - // Close TCP connection - if c.conn != nil { - defer func() { - if err = c.conn.Close(); err != nil { - log.Debug().Err(err).Msgf("Failed to close %s connection", c.String()) - } - log.Debug().Msgf("Closed %s connection", c.String()) - }() - } + // Close TCP connection - Not needed? + /* + if c.conn != nil { + defer func() { + if err = c.conn.Close(); err != nil { + log.Debug().Err(err).Msgf("Failed to close %s connection", c.String()) + } + log.Debug().Msgf("Closed %s connection", c.String()) + }() + } + */ // Close SMB session if c.sess != nil { -- cgit v1.2.3