Skip to content

Commit a34deb6

Browse files
committed
ensure filename in SMB does not start with slash
Signed-off-by: Avi Deitcher <[email protected]>
1 parent c1549a3 commit a34deb6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/storage/smb/smb.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func (s *SMB) Push(ctx context.Context, target, source string, logger *log.Entry
8282
)
8383
err = s.exec(s.url, func(fs *smb2.Share, sharepath string) error {
8484
smbFilename := fmt.Sprintf("%s%c%s", sharepath, smb2.PathSeparator, target)
85+
smbFilename = strings.TrimPrefix(smbFilename, fmt.Sprintf("%c", smb2.PathSeparator))
8586
from, err := os.Open(source)
8687
if err != nil {
8788
return err

0 commit comments

Comments
 (0)