]> Cypherpunks.ru repositories - nncp.git/commitdiff
Merge branch 'develop' v7.6.0
authorSergey Matveev <stargrave@stargrave.org>
Sun, 8 Aug 2021 12:26:44 +0000 (15:26 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 8 Aug 2021 12:26:44 +0000 (15:26 +0300)
36 files changed:
doc/admin.texi
doc/building.texi
doc/cfg/general.texi
doc/cmd/index.texi
doc/cmd/nncp-file.texi
doc/download.texi
doc/index.texi
doc/install.texi
doc/log.texi
doc/mirrors.texi [new file with mode: 0644]
doc/news.ru.texi
doc/news.texi
doc/pkt/plain.texi
doc/sources.texi
doc/thanks.texi
makedist.sh
ports/nncp/Makefile
src/call.go
src/cfg.go
src/check.go
src/cmd/nncp-bundle/main.go
src/cmd/nncp-caller/main.go
src/cmd/nncp-cfgenc/main.go
src/cmd/nncp-daemon/main.go
src/cmd/nncp-reass/main.go
src/cmd/nncp-xfer/main.go
src/ctx.go
src/jobs.go
src/lockdir.go
src/log.go
src/nncp.go
src/pipe.go
src/sp.go
src/tmp.go
src/toss.go
src/tx.go

index 9a4c8e8df6fcee4453cf5120c7350dc6e5807bb4..86caeb9264f0c76ff5293845f97c51639e7d5966 100644 (file)
@@ -100,7 +100,8 @@ uucp        stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -
 
 @item
     Or it can be also run as a @command{daemontools} daemon under
-    @url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP}:
+    @url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP}. In the example
+    below it uses native daemontools's logging capability:
 
 @example
 # mkdir -p /var/service/.nncp-daemon/log
@@ -108,13 +109,13 @@ uucp      stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -
 
 # cat > run <<EOF
 #!/bin/sh -e
-exec envuidgid nncpuser tcpserver -DHRU -l 0 ::0 uucp \
-       /usr/local/bin/nncp-daemon -quiet -ucspi
+NNCPLOG=FD:4 exec envuidgid nncpuser tcpserver -DHRU -l 0 ::0 uucp \
+       /usr/local/bin/nncp-daemon -quiet -ucspi 4>&1
 EOF
 
 # cat > log/run <<EOF
 #!/bin/sh -e
-exec setuidgid uucp multilog ./main
+exec setuidgid uucp multilog ./main
 EOF
 
 # chmod -R 755 /var/service/.nncp-daemon
index 5bb5888367c93bd6931dc446cb6664e24a46c38c..e6699233e0bab2f24241591b5d04159a184b8f79 100644 (file)
@@ -21,20 +21,20 @@ $ redo all
 
 After that you should get various @command{bin/nncp-*} binaries and
 @command{bin/hjson-cli} command (only for your convenience, not
-necessary installation). Documentation for example for
+necessary installation). For example, documentation for
 @command{nncp-bundle} command can be get with
 @command{info doc/nncp.info -n nncp-bundle}.
 
 It uses @url{http://cr.yp.to/redo.html, redo} build system for that
-examples. You can use either dozen of various implementations, or at
-least minimalistic POSIX shell @command{contrib/do} (just replace
+examples. You can use one of its various implementations, or at least
+minimalistic POSIX shell @command{contrib/do} (just replace
 @command{redo} with @command{contrib/do} in the example above) included
 in tarball. Following ones are tested to work with:
 @url{http://www.goredo.cypherpunks.ru/, goredo} (NNCP's author creation),
 @url{https://redo.readthedocs.io/, apenwarr/redo} (@code{contrib/do} is
 from that project), @url{https://github.com/leahneukirchen/redo-c, redo-c}.
 
-There is @command{install} target respecting @env{DESTDIR}. It will
+There is @command{install} target respecting @env{$DESTDIR}. It will
 install binaries and info-documentation:
 
 @example
index 63d0757692af0fb347684426567be94ad68c2f92..971b585025ead47d384a1ed60f6aff2f270c62e4 100644 (file)
@@ -21,7 +21,12 @@ mcd-send: {em0: 60, igb1: 5}
 @item spool
 Absolute path to the @ref{Spool, spool} directory.
 @item log
-Absolute path to the @ref{Log, log} file.
+Either:
+    @itemize
+    @item absolute path to the @ref{Log, log} file
+    @item @code{FD:XXX}, where @code{XXX} is a decimal file descriptor
+        to write records too
+    @end itemize
 @item umask
 Will force all invoked commands to override their umask to specified
 octal mask. Useful for using with @ref{Shared spool, shared spool directories}.
index b4cdce8c52e3ec46da202a8b09c5f5c801362c90..5727db82ba9538656e363d5ab19c4de3fb35aa1f 100644 (file)
@@ -5,7 +5,7 @@ Nearly all commands have the following common options:
 
 @table @option
 @item -cfg
-    Path to configuration file. May be overridden by @env{NNCPCFG}
+    Path to configuration file. May be overridden by @env{$NNCPCFG}
     environment variable. If file file is an encrypted @ref{EBlob,
     eblob}, then ask for passphrase to decrypt it first.
 @item -debug
@@ -26,9 +26,9 @@ Nearly all commands have the following common options:
     With @verb{|-via -|} you can disable relaying at all.
 @item -spool
     Override path to spool directory. May be specified by
-    @env{NNCPSPOOL} environment variable.
+    @env{$NNCPSPOOL} environment variable.
 @item -log
-    Override path to logfile. May be specified by @env{NNCPLOG}
+    Override path to logfile. May be specified by @env{$NNCPLOG}
     environment variable.
 @item -quiet
     Print only errors, omit simple informational messages. In any case
index 29f061af29b9f666cc3d9f02e6e7d1b51525125a..24dafde0c554b486e35b44d52701a7226b9957fd 100644 (file)
@@ -21,7 +21,7 @@ file and copy everything taken from @code{stdin} to it and use for outbound
 packet creation. Pay attention that if you want to send 1 GiB of data
 taken from @code{stdin}, then you have to have more than 2 GiB of disk space
 for that temporary file and resulting encrypted packet. You can control
-temporary file location directory with @env{TMPDIR} environment
+temporary file location directory with @env{$TMPDIR} environment
 variable. Encryption is performed in AEAD mode with
 @url{https://cr.yp.to/chacha.html, ChaCha20}-@url{https://en.wikipedia.org/wiki/Poly1305, Poly1305}
 algorithms. Data is divided on 128 KiB blocks. Each block is encrypted
index 3e682038a90a46eafe18ed31c9e99dea0ac73140..2ffde485798d95e5c46543b02c1b4fa3f55d124c 100644 (file)
@@ -2,7 +2,8 @@
 @section Prepared tarballs
 
 You can obtain releases source code prepared tarballs from the links below.
-Do not forget to check tarball @ref{Integrity, integrity}.
+Do not forget to check tarball @ref{Integrity, integrity}! Also there
+are @ref{Mirrors, mirrors} of this website.
 
 Tarballs include all necessary required libraries:
 
@@ -28,6 +29,10 @@ Tarballs include all necessary required libraries:
 @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
 @headitem Version @tab Date @tab Size @tab Tarball @tab SHA256 checksum
 
+@item @ref{Release 7_5_1, 7.5.1} @tab 2021-08-05 @tab 1147 KiB
+@tab @url{download/nncp-7.5.1.tar.xz, link} @url{download/nncp-7.5.1.tar.xz.sig, sign}
+@tab @code{B093A745 C2EB9F5F E8341ED2 A6F1EE75 701B2646 B5701BAA F4E760D9 32CDD91A}
+
 @item @ref{Release 7_5_0, 7.5.0} @tab 2021-07-28 @tab 1151 KiB
 @tab @url{download/nncp-7.5.0.tar.xz, link} @url{download/nncp-7.5.0.tar.xz.sig, sign}
 @tab @code{14D92DC5 B8164EE4 4926D7AF 46DA9F23 0C8F6207 350CC747 6DB5CDFB 8E7C3FE4}
index fc2ab374d4f686f51e9f151353452203e6fbddf7..39cc8e462a848a4d28038f99e1494ccfce3639a7 100644 (file)
@@ -57,6 +57,7 @@ There are also articles about its usage outside this website:
 * Sync protocol: Sync
 * MultiCast Discovery: MCD
 * EBlob format: EBlob
+* Mirrors::
 * Thanks::
 * Contacts and feedback: Contacts
 * Copying conditions: Copying
@@ -84,6 +85,7 @@ There are also articles about its usage outside this website:
 @include sp.texi
 @include mcd.texi
 @include eblob.texi
+@include mirrors.texi
 @include thanks.texi
 @include contacts.texi
 
index 722170d39f2ff8b15f63637aa819136bc7ff70e1..9d96e7dc05ec4147c5236b09c51017db4f5300b8 100644 (file)
@@ -20,7 +20,7 @@ convenience. @url{https://www.gnu.org/software/texinfo/, Texinfo} is
 used for building documentation (although tarballs already include it).
 
 In general you must get @ref{Tarballs, the tarball}, check its
-@ref{Integrity, integrity and authenticity} and run @command{make}.
+@ref{Integrity, integrity and authenticity} and run @command{redo}.
 Look for general and platform-specific @ref{Build-instructions, build
 instructions}.
 
index 3c91f61454e2fb3b96756f5ce8996c052b649149..74a8c6d562ca9fd09b99c0b93aba6b32eec0a4f6 100644 (file)
@@ -6,3 +6,28 @@ Log is a plaintext file consisting of
 read by human, but it is better to use either @ref{nncp-log}, or
 @command{recutils} utilities for selecting and formatting the required
 fields.
+
+Two example records from it:
+
+@verbatim
+When: 2021-08-07T20:30:49.042460622Z
+Who: sp-file-done
+Node: BYRRQUULEHINPKEFN7CHMSHR5I5CK7PMX5HQNCYERTBAR4BOCG6Q
+Nice: 255
+Type: file
+XX: rx
+Pkt: VQFR6KXC5N4UGL3HKKJKPXE4TN3G4UQGFXQTEYFZ7ZZIKWUVKOGA
+Size: 5229
+FullSize: 5229
+Msg: Got packet VQFR6KXC5N4UGL3HKKJKPXE4TN3G4UQGFXQTEYFZ7ZZIKWUVKOGA 100% (5.1 KiB / 5.1 KiB): done
+
+When: 2021-08-07T20:30:49.131766306Z
+Who: rx
+Node: BYRRQUULEHINPKEFN7CHMSHR5I5CK7PMX5HQNCYERTBAR4BOCG6Q
+Pkt: VQFR6KXC5N4UGL3HKKJKPXE4TN3G4UQGFXQTEYFZ7ZZIKWUVKOGA
+Nice: 96
+Size: 4741
+Type: exec
+Dst: sendmail stargrave@stargrave.org
+Msg: Got exec from gw to sendmail stargrave@stargrave.org (4.6 KiB)
+@end verbatim
diff --git a/doc/mirrors.texi b/doc/mirrors.texi
new file mode 100644 (file)
index 0000000..c809260
--- /dev/null
@@ -0,0 +1,34 @@
+@node Mirrors
+@unnumbered Mirrors
+
+Main NNCP website is hosted on two geographically distant servers
+located in Moscow region, Russian Federation. One of server's IPv6
+connectivity is provided by Hurricane Electric tunnel broker. Only one
+of those servers supports TLS and another just proxies the traffic to
+it. So TLS-capable version has less availability.
+
+It can be authenticated with
+@url{http://ca.cypherpunks.ru/, ca.cypherpunks.ru} certificate, through the
+@url{https://datatracker.ietf.org/doc/html/rfc6698, DANE} record, that
+in turn can be authenticated with
+@url{https://dnscurve.org/, DNSCurve}-secured
+@url{http://www.stargrave.org/Trust-anchor.html, trust anchors}.
+Both @code{ca.cypherpunks.ru} and DNSCurve trust anchors are
+signed with @code{CF60 E89A 5923 1E76 E263 6422 AE1A 8109 E498 57EF}
+@url{https://en.wikipedia.org/wiki/OpenPGP, OpenPGP}
+@url{http://www.stargrave.org/Contacts.html, public key}.
+
+@table @asis
+
+@item @url{https://nncp.mirrors.quux.org/}
+
+Its creation @url{http://lists.cypherpunks.ru/archive/nncp-devel/2108/0310.html, announcement}.
+Mirror of the whole NNCP's website with all tarballs, made by John Goerzen.
+It uses @url{https://letsencrypt.org/, Let's Encrypt} certificate
+authority, so can be more easily accessible for some people. If you have
+got NNCP-peering with
+@url{http://lists.cypherpunks.ru/archive/nncp-devel/2108/0283.html, nncp.quux.org}
+node, then you can also @ref{nncp-freq, freq} the @ref{Tarballs, tarballs}
+from it.
+
+@end table
index 8218c805bf1f6678d857c47cca430e85e8de74d1..5de3cbadaaab076ba79631adce43eabde360b5b1 100644 (file)
@@ -1,6 +1,21 @@
 @node Новости
 @section Новости
 
+@node Релиз 7.6.0
+@subsection Релиз 7.6.0
+@itemize
+
+@item
+Журналирование может производиться в назначенный открытый файловый
+дескриптор (@env{$NNCPLOG=FD:5} например).
+Что дружелюбно к использованию под @command{daemontools}.
+
+@item
+Добавлены дополнительные проверки наличия публичных ключей в
+конфигурационном файле, предотвращающие падения некоторых команд.
+
+@end itemize
+
 @node Релиз 7.5.1
 @subsection Релиз 7.5.1
 @itemize
@@ -348,7 +363,7 @@ online демоны не выполнят проверку целостност
 Вы можете настраивать опции автоматического tosser для каждого вызова.
 
 @item
-Использовать vendoring вместо переопределения @env{GOPATH} во время
+Использовать vendoring вместо переопределения @env{$GOPATH} во время
 установки tarball, так как текущая минимальная версия Go это 1.12,
 поддерживающая модули.
 
@@ -359,7 +374,7 @@ online демоны не выполнят проверку целостност
 @itemize
 
 @item
-Уважать @env{BINDIR}, @env{INFODIR} и @env{DOCDIR} переменные окружения
+Уважать @env{$BINDIR}, @env{$INFODIR} и @env{$DOCDIR} переменные окружения
 в @file{config} во время установки.
 
 @end itemize
@@ -750,7 +765,7 @@ Chunked файлы, меньшего размера чем указанный ch
 
 @item
 Exec команды вызываются с дополнительными переменными окружения
-@env{NNCP_NICE} и @env{NNCP_SELF}.
+@env{$NNCP_NICE} и @env{$NNCP_SELF}.
 
 @item
 Отправляемые файлы в ответ на запрос имеют приоритет указанный в запросе.
@@ -826,7 +841,7 @@ HKDF-BLAKE2b-256 KDF алгоритм заменён на BLAKE2Xb XOF. Ещё 
 @node Релиз 0.12
 @subsection Релиз 0.12
 @itemize
-@item Команда sendmail вызывается с @env{NNCP_SENDER} переменной окружения.
+@item Команда sendmail вызывается с @env{$NNCP_SENDER} переменной окружения.
 @end itemize
 
 @node Релиз 0.11
index 85c7acdc1ed3bc13f09e30633da85f33b1071cde..e737a52fe347649399554d30830619f237ca1707 100644 (file)
@@ -3,6 +3,21 @@
 
 See also this page @ref{Новости, on russian}.
 
+@node Release 7_6_0
+@section Release 7.6.0
+@itemize
+
+@item
+Logging may be done to specified opened file descriptor
+(@env{$NNCPLOG=FD:5} for example).
+That is friendly to use under @command{daemontools}.
+
+@item
+Added additional checks of public keys existence in configuration file,
+preventing some commands from failing.
+
+@end itemize
+
 @node Release 7_5_1
 @section Release 7.5.1
 @itemize
@@ -339,7 +354,7 @@ second while it is active.
 automatic tosser options.
 
 @item
-Use vendoring, instead of @env{GOPATH} overriding during tarball
+Use vendoring, instead of @env{$GOPATH} overriding during tarball
 installation, because current minimal Go's version is 1.12 and it
 supports modules.
 
@@ -350,7 +365,7 @@ supports modules.
 @itemize
 
 @item
-Respect for @env{BINDIR}, @env{INFODIR} and @env{DOCDIR} environment
+Respect for @env{$BINDIR}, @env{$INFODIR} and @env{$DOCDIR} environment
 variables in @file{config} during installation.
 
 @end itemize
@@ -727,8 +742,8 @@ Chunked files, having size less than specified chunk size, will be sent
 as an ordinary single file.
 
 @item
-Exec commands are invoked with additional @env{NNCP_NICE} and
-@env{NNCP_SELF} environment variables.
+Exec commands are invoked with additional @env{$NNCP_NICE} and
+@env{$NNCP_SELF} environment variables.
 
 @item
 Files, that are sent as a reply to freq, have niceness level taken from
@@ -804,7 +819,7 @@ command line argument, or environment variable.
 @node Release 0_12
 @section Release 0.12
 @itemize
-@item Sendmail command is called with @env{NNCP_SENDER} environment variable.
+@item Sendmail command is called with @env{$NNCP_SENDER} environment variable.
 @end itemize
 
 @node Release 0_11
index 211bdd2a8cc74b981a8f406316ad48e946ab66a5..46d66eadc9450e5800d8ecc3e8b234d6a24500e0 100644 (file)
@@ -67,7 +67,7 @@ Also depending on packet's type, niceness level means:
 
 @itemize
 @item Preferable niceness level for files sent by freq
-@item @env{NNCP_NICE} variable's value passed during @ref{CfgExec} invocation.
+@item @env{$NNCP_NICE} variable's value passed during @ref{CfgExec} invocation.
 @end itemize
 
 So plain packets can hold following paths and payloads:
index 990639cc97d831c082c1c4d521400d643fd3b488..9ff82a9238155b356921b29503be23d3c04c8b88 100644 (file)
@@ -7,9 +7,7 @@ libraries source code. Because of that, it is recommended for porters
 to use @ref{Tarballs, tarballs} instead.
 
 @example
-$ git clone git://git.cypherpunks.ru/nncp.git
-$ cd nncp
-$ git checkout develop
+$ git clone --branch develop git://git.cypherpunks.ru/nncp.git nncp
 @end example
 
 You can also use @url{https://git.cypherpunks.ru/nncp.git}.
index f4cee431d509945bff909cc6190bc89a63b83c4e..12592bc570e73043596fa9d9095af31c45b5cdbb 100644 (file)
@@ -12,6 +12,7 @@ NNCP under Ubuntu GNU/Linux distributions and bug reports.
 feedback and NixOS package maintenance.
 
 @item @url{mailto:jgoerzen@@complete.org, John Goerzen} for his feature
-suggestions, bugreports and Debian package maintenance.
+suggestions, bugreports, Debian package and mirror maintenance, and the
+whole project popularization.
 
 @end itemize
index 4fa4796db0fc4e6381268816f10d1c2e08c1339d..e89d1bc0dc6d4dd6c9dfbfd71a85874f8a9e9c62 100755 (executable)
@@ -32,8 +32,9 @@ cp ~/work/redo/minimal/do contrib/do
 cat > doc/download.texi <<EOF
 @node Tarballs
 @section Prepared tarballs
-You can obtain releases source code prepared tarballs on
-@url{http://www.nncpgo.org/}.
+You can obtain releases source code prepared tarballs from
+@url{http://www.nncpgo.org/} and from one of its
+@url{http://www.nncpgo.org/Mirrors.html, mirrors}.
 EOF
 perl -i -ne 'print unless /include pedro/' doc/index.texi doc/about.ru.texi
 perl -p -i -e 's/^(.verbatiminclude) .*$/$1 PUBKEY.asc/g' doc/integrity.texi
@@ -170,6 +171,9 @@ SHA256 hash: $hash
 GPG key ID: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
 Fingerprint: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
 
+There are mirrors where you can also get the source code tarballs:
+http://www.nncpgo.org/Mirrors.html
+
 Please send questions regarding the use of NNCP, bug reports and patches
 to mailing list: http://lists.cypherpunks.ru/nncp_002ddevel.html
 EOF
@@ -219,6 +223,9 @@ SHA256 хэш: $hash
 Идентификатор GPG ключа: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
 Отпечаток: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
 
+Есть и зеркала где вы также можете получить архивы с исходным кодом:
+http://www.nncpgo.org/Mirrors.html
+
 Пожалуйста, все вопросы касающиеся использования NNCP, отчёты об ошибках
 и патчи отправляйте в nncp-devel почтовую рассылку:
 http://lists.cypherpunks.ru/nncp_002ddevel.html
index 70b6311792ce8f43b267f56dc762cfb9ab99ad0f..6ff741a63b4370ff472432d0bf6505a552ae0d74 100644 (file)
@@ -1,5 +1,5 @@
 PORTNAME=      nncp
-DISTVERSION=   7.4.0
+DISTVERSION=   7.6.0
 CATEGORIES=    net
 MASTER_SITES=  http://www.nncpgo.org/download/
 
index e8b3f765233175b1f87339da8c1bf8b92371b4f9..f916a8290646a61d340bbe78dedfb7a65e6d20ec 100644 (file)
@@ -134,13 +134,13 @@ func (ctx *Ctx) CallNode(
                                )
                        })
                        isGood = true
-                       conn.Close() // #nosec G104
+                       conn.Close()
                        break
                } else {
                        ctx.LogE("call-started", les, err, func(les LEs) string {
                                return fmt.Sprintf("Connection to %s (%s)", node.Name, addr)
                        })
-                       conn.Close() // #nosec G104
+                       conn.Close()
                }
        }
        return
index 5a404edd67b2149d0673c3af5054bbbf522a9672..55c9dd0a2479cbe93ae98d97edb2aeb846098ff7 100644 (file)
@@ -21,6 +21,7 @@ import (
        "bytes"
        "encoding/json"
        "errors"
+       "fmt"
        "log"
        "os"
        "path"
@@ -445,6 +446,9 @@ func NewArea(ctx *Ctx, name string, cfg *AreaJSON) (*Area, error) {
                copy(area.Pub[:], pub)
        }
        if cfg.Prv != nil {
+               if area.Pub == nil {
+                       return nil, fmt.Errorf("area %s: prv requires pub presence", name)
+               }
                prv, err := Base32Codec.DecodeString(*cfg.Prv)
                if err != nil {
                        return nil, err
@@ -462,12 +466,12 @@ func NewArea(ctx *Ctx, name string, cfg *AreaJSON) (*Area, error) {
 func CfgParse(data []byte) (*CfgJSON, error) {
        var err error
        if bytes.Compare(data[:8], MagicNNCPBv3.B[:]) == 0 {
-               os.Stderr.WriteString("Passphrase:") // #nosec G104
+               os.Stderr.WriteString("Passphrase:")
                password, err := term.ReadPassword(0)
                if err != nil {
                        log.Fatalln(err)
                }
-               os.Stderr.WriteString("\n") // #nosec G104
+               os.Stderr.WriteString("\n")
                data, err = DeEBlob(data, password)
                if err != nil {
                        return nil, err
index d6a98fac805f3bcbff2b84af5da4ef804424d56c..811bab0340e2333db7d327154600743733bf8038 100644 (file)
@@ -62,7 +62,7 @@ func (ctx *Ctx) checkXxIsBad(nodeId *NodeId, xx TRxTx) bool {
                        return true
                }
                gut, err := Check(fd, job.Size, job.HshValue[:], les, ctx.ShowPrgrs)
-               fd.Close() // #nosec G104
+               fd.Close()
                if err != nil {
                        ctx.LogE("checking", les, err, logMsg)
                        return true
index da2aafdbc568996b243b52d419042c44dba6f411..9911395b7c60daad5f3a26fc1682f19ebdb4ad27 100644 (file)
@@ -221,7 +221,7 @@ func main() {
                                if err == io.EOF {
                                        break
                                }
-                               bufStdin.Discard(bufStdin.Buffered() - (len(nncp.NNCPBundlePrefix) - 1)) // #nosec G104
+                               bufStdin.Discard(bufStdin.Buffered() - (len(nncp.NNCPBundlePrefix) - 1))
                                continue
                        }
                        if _, err = bufStdin.Discard(prefixIdx); err != nil {
index 614a0512a4a0068c3e6e978f5029e5c37bf0f0d7..177065fce845a4b10f7615f64e8a6fd6572a7e12 100644 (file)
@@ -94,6 +94,9 @@ func main() {
                        if err != nil {
                                log.Fatalln("Invalid NODE specified:", err)
                        }
+                       if node.NoisePub == nil {
+                               log.Fatalln("Node", nodeId, "does not have online communication capability")
+                       }
                        if len(node.Calls) == 0 {
                                ctx.LogD(
                                        "caller-no-calls",
index 7c41ee097943bf05a679c3fde8c71b5eb957d5d9..1516d23f031b5fe7d421f561775d86abd2f435a9 100644 (file)
@@ -96,7 +96,7 @@ func main() {
                return
        }
 
-       os.Stderr.WriteString("Passphrase:") // #nosec G104
+       os.Stderr.WriteString("Passphrase:")
        password1, err := term.ReadPassword(0)
        if err != nil {
                log.Fatalln(err)
@@ -106,15 +106,15 @@ func main() {
                if err != nil {
                        log.Fatalln(err)
                }
-               os.Stdout.Write(cfgRaw) // #nosec G104
+               os.Stdout.Write(cfgRaw)
                return
        }
-       os.Stderr.WriteString("\nRepeat passphrase:") // #nosec G104
+       os.Stderr.WriteString("\nRepeat passphrase:")
        password2, err := term.ReadPassword(0)
        if err != nil {
                log.Fatalln(err)
        }
-       os.Stderr.WriteString("\n") // #nosec G104
+       os.Stderr.WriteString("\n")
        if bytes.Compare(password1, password2) != 0 {
                log.Fatalln(errors.New("Passphrases do not match"))
        }
@@ -122,5 +122,5 @@ func main() {
        if err != nil {
                log.Fatalln(err)
        }
-       os.Stdout.Write(eblob) // #nosec G104
+       os.Stdout.Write(eblob)
 }
index 485199ceb629e93480409bef7ee11e0244c116ec..266fc7a8f699baa98ef623b65994c3b948db670e 100644 (file)
@@ -168,7 +168,7 @@ func main() {
        ctx.Umask()
 
        if *ucspi {
-               os.Stderr.Close() // #nosec G104
+               os.Stderr.Close()
                conn := &nncp.UCSPIConn{R: os.Stdin, W: os.Stdout}
                nodeIdC := make(chan *nncp.NodeId)
                addr := nncp.UCSPITCPRemoteAddr()
@@ -196,7 +196,7 @@ func main() {
                        close(autoTossFinish)
                        <-autoTossBadCode
                }
-               conn.Close() // #nosec G104
+               conn.Close()
                return
        }
 
@@ -262,7 +262,7 @@ func main() {
                                close(autoTossFinish)
                                <-autoTossBadCode
                        }
-                       conn.Close() // #nosec G104
+                       conn.Close()
                }(conn)
        }
 }
index d7774c95bd2fb718136d62b8a43dff5e1b8f1561..a1ee4a3a9c97aca146f2dfd8c6b44df82ce5fdac 100644 (file)
@@ -66,7 +66,7 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo
                })
                return false
        }
-       fd.Close() // #nosec G104
+       fd.Close()
        if metaPkt.Magic == nncp.MagicNNCPMv1.B {
                ctx.LogE("reass", les, nncp.MagicNNCPMv1.TooOld(), logMsg)
                return false
@@ -163,7 +163,7 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo
                ); err != nil {
                        log.Fatalln(err)
                }
-               fd.Close() // #nosec G104
+               fd.Close()
                if bytes.Compare(hsh.Sum(nil), metaPkt.Checksums[chunkNum][:]) != 0 {
                        ctx.LogE(
                                "reass-chunk",
@@ -219,7 +219,7 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo
                ); err != nil {
                        log.Fatalln(err)
                }
-               fd.Close() // #nosec G104
+               fd.Close()
                if !keep {
                        if err = os.Remove(chunkPath); err != nil {
                                ctx.LogE(
@@ -298,7 +298,7 @@ func findMetas(ctx *nncp.Ctx, dirPath string) []string {
                return nil
        }
        fis, err := dir.Readdir(0)
-       dir.Close() // #nosec G104
+       dir.Close()
        if err != nil {
                ctx.LogE("reass", nncp.LEs{{K: "Path", V: dirPath}}, err, logMsg)
                return nil
index 0acba4b8edcb50804e8be030e66e9b5c8185383a..fb7a0e0807e1aa8edb45af08acce79ac65907527 100644 (file)
@@ -141,7 +141,7 @@ func main() {
                goto Tx
        }
        fis, err = dir.Readdir(0)
-       dir.Close() // #nosec G104
+       dir.Close()
        if err != nil {
                ctx.LogE("xfer-self-read", les, err, func(les nncp.LEs) string {
                        return logMsg(les) + ": reading"
@@ -185,7 +185,7 @@ func main() {
                        continue
                }
                fisInt, err := dir.Readdir(0)
-               dir.Close() // #nosec G104
+               dir.Close()
                if err != nil {
                        ctx.LogE("xfer-rx-read", les, err, func(les nncp.LEs) string {
                                return logMsg(les) + ": reading"
@@ -241,14 +241,14 @@ func main() {
                                                return logMsg(les) + ": not valid packet: " + err.Error()
                                        },
                                )
-                               fd.Close() // #nosec G104
+                               fd.Close()
                                continue
                        }
                        if pktEnc.Nice > nice {
                                ctx.LogD("xfer-rx-too-nice", les, func(les nncp.LEs) string {
                                        return logMsg(les) + ": too nice"
                                })
-                               fd.Close() // #nosec G104
+                               fd.Close()
                                continue
                        }
                        les = append(les, nncp.LE{K: "Size", V: fiInt.Size()})
@@ -261,7 +261,7 @@ func main() {
                        }
                        if !ctx.IsEnoughSpace(fiInt.Size()) {
                                ctx.LogE("xfer-rx", les, errors.New("is not enough space"), logMsg)
-                               fd.Close() // #nosec G104
+                               fd.Close()
                                continue
                        }
                        if _, err = fd.Seek(0, 0); err != nil {
@@ -279,7 +279,7 @@ func main() {
                                }
                                if err != nil {
                                        ctx.LogE("xfer-rx", les, err, logMsg)
-                                       w.CloseWithError(err) // #nosec G104
+                                       w.CloseWithError(err)
                                }
                        }()
                        if _, err = nncp.CopyProgressed(
@@ -294,7 +294,7 @@ func main() {
                                ctx.LogE("xfer-rx", les, err, logMsg)
                                isBad = true
                        }
-                       fd.Close() // #nosec G104
+                       fd.Close()
                        if isBad {
                                tmp.Cancel()
                                continue
@@ -446,7 +446,7 @@ Tx:
                                ctx.LogE("xfer-tx-open", les, err, func(les nncp.LEs) string {
                                        return logMsg(les) + ": opening"
                                })
-                               tmp.Close() // #nosec G104
+                               tmp.Close()
                                isBad = true
                                continue
                        }
@@ -456,17 +456,17 @@ Tx:
                                append(les, nncp.LE{K: "FullSize", V: job.Size}),
                                ctx.ShowPrgrs,
                        )
-                       fd.Close() // #nosec G104
+                       fd.Close()
                        if err != nil {
                                ctx.LogE("xfer-tx-copy", les, err, func(les nncp.LEs) string {
                                        return logMsg(les) + ": copying"
                                })
-                               tmp.Close() // #nosec G104
+                               tmp.Close()
                                isBad = true
                                continue
                        }
                        if err = bufW.Flush(); err != nil {
-                               tmp.Close() // #nosec G104
+                               tmp.Close()
                                ctx.LogE("xfer-tx-flush", les, err, func(les nncp.LEs) string {
                                        return logMsg(les) + ": flushing"
                                })
@@ -474,7 +474,7 @@ Tx:
                                continue
                        }
                        if err = tmp.Sync(); err != nil {
-                               tmp.Close() // #nosec G104
+                               tmp.Close()
                                ctx.LogE("xfer-tx-sync", les, err, func(les nncp.LEs) string {
                                        return logMsg(les) + ": syncing"
                                })
@@ -500,7 +500,7 @@ Tx:
                                isBad = true
                                continue
                        }
-                       os.Remove(filepath.Join(dstPath, pktName+".part")) // #nosec G104
+                       os.Remove(filepath.Join(dstPath, pktName+".part"))
                        les = les[:len(les)-1]
                        ctx.LogI(
                                "xfer-tx",
index 7e4d726751f149963fb189dfa5df46bc03727581..58dba44df6156381216ee90e5043587d9b538039 100644 (file)
@@ -23,6 +23,8 @@ import (
        "io/ioutil"
        "os"
        "path/filepath"
+       "strconv"
+       "strings"
 
        "syscall"
 )
@@ -135,6 +137,18 @@ func CtxFromCmdline(
        } else {
                ctx.LogPath = logPath
        }
+       if strings.HasPrefix(ctx.LogPath, LogFdPrefix) {
+               ptr, err := strconv.ParseUint(
+                       strings.TrimPrefix(ctx.LogPath, LogFdPrefix), 10, 64,
+               )
+               if err != nil {
+                       return nil, err
+               }
+               LogFd = os.NewFile(uintptr(ptr), CfgLogEnv)
+               if LogFd == nil {
+                       return nil, errors.New("can not open:" + ctx.LogPath)
+               }
+       }
        if showPrgrs {
                ctx.ShowPrgrs = true
        }
index 6e428770a3473edd4552f9d77e06486910fb6394..6f18f51452d1294839c784d6b1418c8d29756685 100644 (file)
@@ -99,7 +99,7 @@ func (ctx *Ctx) jobsFind(nodeId *NodeId, xx TRxTx, nock, part bool) chan Job {
                        return
                }
                fis, err := dir.Readdir(0)
-               dir.Close() // #nosec G104
+               dir.Close()
                if err != nil {
                        return
                }
index 902ec22124b624c73c145b20463f0616cf3d1595..e94117b191395af94dc97ee9b0a5ed2de63b677a 100644 (file)
@@ -45,7 +45,7 @@ func (ctx *Ctx) LockDir(nodeId *NodeId, lockCtx string) (*os.File, error) {
                ctx.LogE("lockdir-flock", LEs{{"Path", lockPath}}, err, func(les LEs) string {
                        return "Locking directory: locking " + lockPath
                })
-               dirLock.Close() // #nosec G104
+               dirLock.Close()
                return nil, err
        }
        return dirLock, nil
@@ -53,7 +53,7 @@ func (ctx *Ctx) LockDir(nodeId *NodeId, lockCtx string) (*os.File, error) {
 
 func (ctx *Ctx) UnlockDir(fd *os.File) {
        if fd != nil {
-               unix.Flock(int(fd.Fd()), unix.LOCK_UN) // #nosec G104
-               fd.Close()                             // #nosec G104
+               unix.Flock(int(fd.Fd()), unix.LOCK_UN)
+               fd.Close()
        }
 }
index 7bb59a3b97cf798e5c35c01d0c76c19154445ba6..78f9acc8e99083740f9fbfdf0ccc234f474b07e5 100644 (file)
@@ -27,6 +27,10 @@ import (
        "golang.org/x/sys/unix"
 )
 
+const LogFdPrefix = "FD:"
+
+var LogFd *os.File
+
 type LE struct {
        K string
        V interface{}
@@ -64,6 +68,10 @@ func (les LEs) Rec() string {
 }
 
 func (ctx *Ctx) Log(rec string) {
+       if LogFd != nil {
+               LogFd.WriteString(rec)
+               return
+       }
        fdLock, err := os.OpenFile(
                ctx.LogPath+".lock",
                os.O_CREATE|os.O_WRONLY,
@@ -90,8 +98,8 @@ func (ctx *Ctx) Log(rec string) {
                fmt.Fprintln(os.Stderr, "Can not open log:", err)
                return
        }
-       fd.WriteString(rec) // #nosec G104
-       fd.Close()          // #nosec G104
+       fd.WriteString(rec)
+       fd.Close()
 }
 
 func (ctx *Ctx) LogD(who string, les LEs, msg func(LEs) string) {
index 8e04f041316b694be2d9e7eebfe53cb67946d4b2..c641668d62b181b3b813bec8862919d5218bfa3b 100644 (file)
@@ -40,7 +40,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.`
 const Base32Encoded32Len = 52
 
 var (
-       Version string = "7.5.1"
+       Version string = "7.6.0"
 
        Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
 )
index ef25a9115a8319ed951579345a2a8a785ab1dcc0..35c4871b76ce654958a9d005eb1fb526a79a9af4 100644 (file)
@@ -69,7 +69,7 @@ func (c PipeConn) Close() (err error) {
        err = c.w.Close()
        go c.cmd.Wait()
        time.AfterFunc(time.Duration(10*time.Second), func() {
-               c.cmd.Process.Kill() // #nosec G104
+               c.cmd.Process.Kill()
        })
        return
 }
index 66fa0375797d2d53fb1cacea0d6143bcf7b0096e..3de629b59b5108b9c2d49bae226f9041cb8ccbe9 100644 (file)
--- a/src/sp.go
+++ b/src/sp.go
@@ -438,7 +438,7 @@ func (state *SPState) StartI(conn ConnDeadlined) error {
                        NicenessFmt(state.Nice),
                )
        })
-       conn.SetWriteDeadline(time.Now().Add(DefaultDeadline)) // #nosec G104
+       conn.SetWriteDeadline(time.Now().Add(DefaultDeadline))
        if err = state.WriteSP(conn, buf, false); err != nil {
                state.Ctx.LogE("sp-startI", les, err, func(les LEs) string {
                        return fmt.Sprintf(
@@ -457,7 +457,7 @@ func (state *SPState) StartI(conn ConnDeadlined) error {
                        NicenessFmt(state.Nice),
                )
        })
-       conn.SetReadDeadline(time.Now().Add(DefaultDeadline)) // #nosec G104
+       conn.SetReadDeadline(time.Now().Add(DefaultDeadline))
        if buf, err = state.ReadSP(conn); err != nil {
                state.Ctx.LogE("sp-startI-read", les, err, func(les LEs) string {
                        return fmt.Sprintf(
@@ -537,7 +537,7 @@ func (state *SPState) StartR(conn ConnDeadlined) error {
        }
        les := LEs{{"Nice", int(state.Nice)}}
        state.Ctx.LogD("sp-startR", les, logMsg)
-       conn.SetReadDeadline(time.Now().Add(DefaultDeadline)) // #nosec G104
+       conn.SetReadDeadline(time.Now().Add(DefaultDeadline))
        if buf, err = state.ReadSP(conn); err != nil {
                state.Ctx.LogE("sp-startR-read", les, err, logMsg)
                return err
@@ -549,6 +549,9 @@ func (state *SPState) StartR(conn ConnDeadlined) error {
 
        var node *Node
        for _, n := range state.Ctx.Neigh {
+               if n.NoisePub == nil {
+                       continue
+               }
                if subtle.ConstantTimeCompare(state.hs.PeerStatic(), n.NoisePub[:]) == 1 {
                        node = n
                        break
@@ -611,7 +614,7 @@ func (state *SPState) StartR(conn ConnDeadlined) error {
                state.dirUnlock()
                return err
        }
-       conn.SetWriteDeadline(time.Now().Add(DefaultDeadline)) // #nosec G104
+       conn.SetWriteDeadline(time.Now().Add(DefaultDeadline))
        if err = state.WriteSP(conn, buf, false); err != nil {
                state.Ctx.LogE("sp-startR-write", les, err, func(les LEs) string {
                        return fmt.Sprintf(
@@ -752,7 +755,7 @@ func (state *SPState) StartWorkers(
                                break
                        Deadlined:
                                state.SetDead()
-                               conn.Close() // #nosec G104
+                               conn.Close()
                        case now := <-pingTicker.C:
                                if now.After(state.TxLastSeen.Add(PingTimeout)) {
                                        state.wg.Add(1)
@@ -986,7 +989,7 @@ func (state *SPState) StartWorkers(
                                )
                        }
                        state.Ctx.LogD("sp-sending", append(les, LE{"Size", int64(len(payload))}), logMsg)
-                       conn.SetWriteDeadline(time.Now().Add(DefaultDeadline)) // #nosec G104
+                       conn.SetWriteDeadline(time.Now().Add(DefaultDeadline))
                        ct, err := state.csOur.Encrypt(nil, nil, payload)
                        if err != nil {
                                state.Ctx.LogE("sp-encrypting", les, err, logMsg)
@@ -1013,7 +1016,7 @@ func (state *SPState) StartWorkers(
                                )
                        }
                        state.Ctx.LogD("sp-recv-wait", les, logMsg)
-                       conn.SetReadDeadline(time.Now().Add(DefaultDeadline)) // #nosec G104
+                       conn.SetReadDeadline(time.Now().Add(DefaultDeadline))
                        payload, err := state.ReadSP(conn)
                        if err != nil {
                                if err == io.EOF {
@@ -1087,7 +1090,7 @@ func (state *SPState) StartWorkers(
                state.SetDead()
                state.wg.Done()
                state.SetDead()
-               conn.Close() // #nosec G104
+               conn.Close()
        }()
 
        return nil
index a1ef2e86f53f2981a8979920050950c35760946e..7b9ded1b6220450a61aa0d2b301caf7b11842ce9 100644 (file)
@@ -71,9 +71,9 @@ func (ctx *Ctx) NewTmpFileWHash() (*TmpFileWHash, error) {
 }
 
 func (tmp *TmpFileWHash) Cancel() {
-       tmp.Fd.Truncate(0)       // #nosec G104
-       tmp.Fd.Close()           // #nosec G104
-       os.Remove(tmp.Fd.Name()) // #nosec G104
+       tmp.Fd.Truncate(0)
+       tmp.Fd.Close()
+       os.Remove(tmp.Fd.Name())
 }
 
 func DirSync(dirPath string) error {
@@ -83,7 +83,7 @@ func DirSync(dirPath string) error {
        }
        err = fd.Sync()
        if err != nil {
-               fd.Close() // #nosec G104
+               fd.Close()
                return err
        }
        return fd.Close()
@@ -99,11 +99,11 @@ func (tmp *TmpFileWHash) Commit(dir string) error {
                return err
        }
        if err = tmp.W.Flush(); err != nil {
-               tmp.Fd.Close() // #nosec G104
+               tmp.Fd.Close()
                return err
        }
        if err = tmp.Fd.Sync(); err != nil {
-               tmp.Fd.Close() // #nosec G104
+               tmp.Fd.Close()
                return err
        }
        if err = tmp.Fd.Close(); err != nil {
index 21d3007e74ecd263c86030dbc1bdf1f9e06998a4..a398649535cfc49441cd0acea808e680f26af7d9 100644 (file)
@@ -309,7 +309,7 @@ func jobProcess(
                                return err
                        }
                        if err = bufW.Flush(); err != nil {
-                               tmp.Close() // #nosec G104
+                               tmp.Close()
                                ctx.LogE("rx-flush", les, err, func(les LEs) string {
                                        return fmt.Sprintf(
                                                "Tossing file %s/%s (%s): %s: flushing",
@@ -320,7 +320,7 @@ func jobProcess(
                                return err
                        }
                        if err = tmp.Sync(); err != nil {
-                               tmp.Close() // #nosec G104
+                               tmp.Close()
                                ctx.LogE("rx-sync", les, err, func(les LEs) string {
                                        return fmt.Sprintf(
                                                "Tossing file %s/%s (%s): %s: syncing",
index a3f44fe4ecfa75a1b7fbd4f0785a18a217b0d8a3..0ddbd510db5411e62ae4abbe2d8db79b2ca41b08 100644 (file)
--- a/src/tx.go
+++ b/src/tx.go
@@ -60,7 +60,7 @@ func (ctx *Ctx) Tx(
        if areaId != nil {
                area = ctx.AreaId2Area[*areaId]
                if area.Prv == nil {
-                       return nil, errors.New("unknown area id")
+                       return nil, errors.New("area has no encryption keys")
                }
        }
        hops := make([]*Node, 0, 1+len(node.Via))
@@ -116,7 +116,7 @@ func (ctx *Ctx) Tx(
                        )
                        pktEncRaws <- pktEncRaw
                        errs <- err
-                       dst.Close() // #nosec G104
+                       dst.Close()
                }(curSize, src, pipeW)
                curSize = PktEncOverhead + PktSizeOverhead + sizeWithTags(PktOverhead+curSize)
                curSize += padSize
@@ -142,7 +142,7 @@ func (ctx *Ctx) Tx(
                        )
                        pktEncRaws <- pktEncRaw
                        errs <- err
-                       dst.Close() // #nosec G104
+                       dst.Close()
                }(curSize, padSize, src, pipeW)
                curSize = PktEncOverhead + PktSizeOverhead + sizeWithTags(PktOverhead+curSize)
                curSize += padSize
@@ -170,7 +170,7 @@ func (ctx *Ctx) Tx(
                        )
                        pktEncRaws <- pktEncRaw
                        errs <- err
-                       dst.Close() // #nosec G104
+                       dst.Close()
                }(curSize, pipeRPrev, pipeW)
                curSize = PktEncOverhead + PktSizeOverhead + sizeWithTags(PktOverhead+curSize)
        }
@@ -197,7 +197,7 @@ func (ctx *Ctx) Tx(
                        pktEncRaw, err := PktEncWrite(ctx.Self, node, pkt, nice, size, 0, src, dst)
                        pktEncRaws <- pktEncRaw
                        errs <- err
-                       dst.Close() // #nosec G104
+                       dst.Close()
                }(hops[i], pktTrns, curSize, pipeRPrev, pipeW)
                curSize = PktEncOverhead + PktSizeOverhead + sizeWithTags(PktOverhead+curSize)
        }
@@ -220,13 +220,13 @@ func (ctx *Ctx) Tx(
        for i := 0; i <= wrappers; i++ {
                err = <-errs
                if err != nil {
-                       tmp.Fd.Close() // #nosec G104
+                       tmp.Fd.Close()
                        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)) // #nosec G104
+       os.Symlink(nodePath, filepath.Join(ctx.Spool, lastNode.Name))
        if err != nil {
                return lastNode, err
        }
@@ -288,7 +288,7 @@ func throughTmpFile(r io.Reader) (
                rerr = err
                return
        }
-       os.Remove(src.Name()) // #nosec G104
+       os.Remove(src.Name())
        tmpW := bufio.NewWriter(src)
        tmpKey := make([]byte, chacha20poly1305.KeySize)
        if _, rerr = rand.Read(tmpKey[:]); rerr != nil {
@@ -320,7 +320,7 @@ func throughTmpFile(r io.Reader) (
                        nonce[i] = 0
                }
                if _, err := aeadProcess(aead, nonce, nil, false, bufio.NewReader(src), w); err != nil {
-                       w.CloseWithError(err) // #nosec G104
+                       w.CloseWithError(err)
                }
        }()
        reader = r
@@ -439,14 +439,14 @@ func prepareTxFile(srcPath string) (
                        }
                        fd, err := os.Open(e.path)
                        if err != nil {
-                               fd.Close() // #nosec G104
+                               fd.Close()
                                return w.CloseWithError(err)
                        }
                        if _, err = io.Copy(tarWr, bufio.NewReader(fd)); err != nil {
-                               fd.Close() // #nosec G104
+                               fd.Close()
                                return w.CloseWithError(err)
                        }
-                       fd.Close() // #nosec G104
+                       fd.Close()
                }
                if err = tarWr.Close(); err != nil {
                        return w.CloseWithError(err)
@@ -706,7 +706,7 @@ func (ctx *Ctx) TxExec(
                        return err
                }
                if _, err = io.Copy(compressor, in); err != nil {
-                       compressor.Close() // #nosec G104
+                       compressor.Close()
                        return err
                }
                if err = compressor.Close(); err != nil {
@@ -733,7 +733,7 @@ func (ctx *Ctx) TxExec(
                go func() {
                        _, err := io.Copy(compressor, in)
                        if err != nil {
-                               compressor.Close() // #nosec G104
+                               compressor.Close()
                                copyErr <- err
                        }
                        err = compressor.Close()
@@ -828,6 +828,6 @@ func (ctx *Ctx) TxTrns(node *Node, nice uint8, size int64, src io.Reader) error
        } else {
                ctx.LogI("tx", append(les, LE{"Err", err}), logMsg)
        }
-       os.Symlink(nodePath, filepath.Join(ctx.Spool, node.Name)) // #nosec G104
+       os.Symlink(nodePath, filepath.Join(ctx.Spool, node.Name))
        return err
 }