"size": size,
}, "wrote")
errs <- PktEncWrite(ctx.Self, hops[0], pkt, nice, size, padSize, src, dst)
- dst.Close()
+ dst.Close() // #nosec G104
}(curSize, src, pipeW)
curSize = PktEncOverhead + PktSizeOverhead + sizeWithTags(PktOverhead+curSize) + padSize
"size": size,
}, "trns wrote")
errs <- PktEncWrite(ctx.Self, node, pkt, nice, size, 0, src, dst)
- dst.Close()
+ dst.Close() // #nosec G104
}(hops[i], pktTrns, curSize, pipeRPrev, pipeW)
curSize = PktEncOverhead + PktSizeOverhead + sizeWithTags(PktOverhead+curSize)
}
for i := 0; i <= len(hops); i++ {
err = <-errs
if err != nil {
- tmp.Fd.Close()
+ tmp.Fd.Close() // #nosec G104
return nil, err
}
}
nodePath := filepath.Join(ctx.Spool, lastNode.Id.String())
err = tmp.Commit(filepath.Join(nodePath, string(TTx)))
- os.Symlink(nodePath, filepath.Join(ctx.Spool, lastNode.Name))
+ os.Symlink(nodePath, filepath.Join(ctx.Spool, lastNode.Name)) // #nosec G104
return lastNode, err
}
rerr = err
return
}
- os.Remove(src.Name())
+ os.Remove(src.Name()) // #nosec G104
tmpW := bufio.NewWriter(src)
tmpKey := make([]byte, chacha20poly1305.KeySize)
if _, rerr = rand.Read(tmpKey[:]); rerr != nil {
r, w := io.Pipe()
go func() {
if _, err := aeadProcess(aead, nonce, false, bufio.NewReader(src), w); err != nil {
- w.CloseWithError(err)
+ w.CloseWithError(err) // #nosec G104
}
}()
reader = r
closer = DummyCloser{}
fileSize += 2 * TarBlockSize // termination block
- go func() {
+ go func() error {
tarWr := tar.NewWriter(w)
hdr := tar.Header{
Typeflag: tar.TypeDir,
hdr.Name = basePath + e.path[len(rootPath):]
hdr.ModTime = e.modTime
if err = tarWr.WriteHeader(&hdr); err != nil {
- w.CloseWithError(err)
+ return w.CloseWithError(err)
}
}
hdr.Typeflag = tar.TypeReg
hdr.ModTime = e.modTime
hdr.Size = e.size
if err = tarWr.WriteHeader(&hdr); err != nil {
- w.CloseWithError(err)
+ return w.CloseWithError(err)
}
fd, err := os.Open(e.path)
if err != nil {
} else {
ctx.LogI("tx", SdsAdd(sds, SDS{"err": err}), "sent")
}
- os.Symlink(nodePath, filepath.Join(ctx.Spool, node.Name))
+ os.Symlink(nodePath, filepath.Join(ctx.Spool, node.Name)) // #nosec G104
return err
}