VERSION | 2 +- doc/Makefile | 4 ++-- doc/about.ru.texi | 4 ++-- doc/about.texi | 4 ++-- doc/bundles.texi | 2 +- doc/cmds.texi | 2 +- doc/download.texi | 4 ++++ doc/index.texi | 4 +++- doc/news.ru.texi | 12 ++++++++++++ doc/news.texi | 12 ++++++++++++ doc/pedro.txt | 11 +++++++++++ makedist.sh | 1 + src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go | 28 ++++++++++++++++++++++++++-- diff --git a/VERSION b/VERSION index eac7f115ab4ad1209330f28ff2c5bc44db822d0dd059bf1863830486cb93ffd4..c0431d09ec2f32c68d8ee7484cb0f15fd20f59d2bd7d7ec5cbb204f3b373287f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1 +3.2 diff --git a/doc/Makefile b/doc/Makefile index be97c884832d44eb608571126d8795c9d729e21397778fef7293424679c593d5..db0299cc785175d4f4206b43342acd8f76563b379d6168e7dddd9a4c0b0d8a48 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,12 +2,12 @@ all: nncp.info nncp.html MAKEINFO ?= makeinfo -nncp.info: *.texi +nncp.info: *.texi pedro.txt $(MAKEINFO) -o nncp.info index.texi CSS != cat style.css -nncp.html: *.texi +nncp.html: *.texi pedro.txt rm -f nncp.html/*.html $(MAKEINFO) --html \ --set-customization-variable CSS_LINES='$(CSS)' \ diff --git a/doc/about.ru.texi b/doc/about.ru.texi index 9dad003ce1654232bc09a6544db0edbff26fda7e14c135a6f5bd4f1d78a03591..958c3892f689e4bd6908ece4e858f0eedac769b760b3b8cfdb313647b81c3260 100644 --- a/doc/about.ru.texi +++ b/doc/about.ru.texi @@ -1,8 +1,8 @@ @node Об утилитах @section Подробнее об утилитах NNCP -NNCP (Node to Node copy) это набор утилит упрощающий безопасный обмен -файлами и почтой в режиме сохранить-и-переслать. +@strong{NNCP} (Node to Node copy) это набор утилит упрощающий безопасный +обмен файлами и почтой в режиме сохранить-и-переслать. Эти утилиты предназначены помочь с построением однораговых @url{https://ru.wikipedia.org/wiki/DTN, устойчивых к разрывам} сетей diff --git a/doc/about.texi b/doc/about.texi index cfb521d21f64d237e671a8ce99cf6fb02564a6efce368247a21c01fd6f6608f6..7df53ca29babe74238e0932f8d8ae81576a8dfa68e1d1f4d49004126dc495b0c 100644 --- a/doc/about.texi +++ b/doc/about.texi @@ -1,5 +1,5 @@ -NNCP (Node to Node copy) is a collection of utilities simplifying -secure store-and-forward files and mail exchanging. +@strong{NNCP} (Node to Node copy) is a collection of utilities +simplifying secure store-and-forward files and mail exchanging. See also this page @ref{Об утилитах, on russian}. diff --git a/doc/bundles.texi b/doc/bundles.texi index e00c3326914cfd6bac78eac251a844789880432059bc17d9e935158683426a36..66978a18af3be598db3673c01a01e188a3c710b98a3d8d0d2a4a1138c32b0470 100644 --- a/doc/bundles.texi +++ b/doc/bundles.texi @@ -49,7 +49,7 @@ @end itemize Technically bundle is valid POSIX.1-2001 (pax) -@url{http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5, tar archive}, +@url{http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html, tar archive}, with directory/files hierarchy identical to that is used in @ref{nncp-xfer}: @file{NNCP/RECIPIENT/SENDER/PACKET}. So bundle can also be created by manual tar-ing of @command{nncp-xfer} resulting directory. diff --git a/doc/cmds.texi b/doc/cmds.texi index 5aae007cb1d65205547250e43b141b07a808b53300a33dcca20a4005f6728eb3..020cac7975a4742d916c8a54389475aaadc8356c3d7a746a80ef2078a2bbbf5c 100644 --- a/doc/cmds.texi +++ b/doc/cmds.texi @@ -87,7 +87,7 @@ % nncp-bundle -tx ALICE BOB WHATEVER | cdrecord -tao - % dd if=/dev/cd0 bs=2048 | nncp-bundle -rx -delete @end verbatim -@option{-dryrun} option prevents any writing to the spool. This is +@option{-dryrun} option prevents any writes to the spool. This is useful when you need to see what packets will pass by and possibly check their integrity. diff --git a/doc/download.texi b/doc/download.texi index b914cff9297fad610997a5ee19c0181786dd888f36983e72b9fd6283676f8efa..d37470531cfb1868903b50f0cfcc94ec72e5934dc4e7591e320ecc34686a34a4 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -23,6 +23,10 @@ @multitable {XXXXX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @headitem Version @tab Size @tab Tarball @tab SHA256 checksum +@item @ref{Release 3.1, 3.1} @tab 1145 KiB +@tab @url{download/nncp-3.1.tar.xz, link} @url{download/nncp-3.1.tar.xz.sig, sign} +@tab @code{B9344516 4230B58E 8AAADAA2 066F37F2 493CCB71 B025126B BCAD8FAD 6535149F} + @item @ref{Release 3.0, 3.0} @tab 993 KiB @tab @url{download/nncp-3.0.tar.xz, link} @url{download/nncp-3.0.tar.xz.sig, sign} @tab @code{248B2257 2F576E79 A19672E9 B82EB649 18FC95A9 194408C0 67EA4DD3 0468286D} diff --git a/doc/index.texi b/doc/index.texi index 2d578a2170b92d35b57ea20e0f306112b4fc765a5bfd2a450ad647a7eebde362..c0ff5e7a24c85180ea80236ded89c0b4dfae8a6907017a1ba48f0d2b6aaf57e1 100644 --- a/doc/index.texi +++ b/doc/index.texi @@ -18,7 +18,9 @@ @end quotation @end copying @node Top -@top NNCP +@top + +@verbatiminclude pedro.txt @include about.texi diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 6d2d4f0e1213d163bc8c04ecbc515f277e3702d0ade5b55ae2b46a2901a89209..66901534dbc3ca6f8d414aca8c6e569c467725ce4485b450f0bf15b05f0964ea 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,18 @@ @node Новости @section Новости +@node Релиз 3.2 +@subsection Релиз 3.2 +@itemize +@item +@strong{Несовместимое} изменение формата @emph{bundle} архивов и +работоспособность @command{nncp-bundle} команды с Go 1.10+. Bundle +должен быть корректным tar архивом, но Go 1.9 делал его недействительным +из-за длинных путей внутри. NNCP нечаянно был зависим от этой баги. +Явное добавление @file{NNCP/} директории в архив восстанавливает +работоспособность с корректными tar архивами. +@end itemize + @node Релиз 3.1 @subsection Релиз 3.1 @itemize diff --git a/doc/news.texi b/doc/news.texi index 16aa63237c348bedff88475624f64db1ef3db799b0e1302a3ae339fef058c1aa..87dbeb0df56b5bdd25f99f34afa29721425b1bf37cad1afe7883b75f67e8ecd1 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,6 +3,18 @@ @unnumbered News See also this page @ref{Новости, on russian}. +@node Release 3.2 +@section Release 3.2 +@itemize +@item +@strong{Incompatible} @emph{bundle} archive format changes and +@command{nncp-bundle} workability with Go 1.10+. Bundles must be +valid tar archives, but Go 1.9 made them invalid because of long paths +inside. NNCP accidentally was dependant on that bug. Explicit adding of +@file{NNCP/} directory in archive restores workability with valid tar +archives. +@end itemize + @node Release 3.1 @section Release 3.1 @itemize diff --git a/doc/pedro.txt b/doc/pedro.txt new file mode 100644 index 0000000000000000000000000000000000000000..d9fc4de1a3be2f7295333b3c170b041180cc699de1a8be31ac8293b5e3727561 --- /dev/null +++ b/doc/pedro.txt @@ -0,0 +1,11 @@ + ____/\____ + (__________) + (oo)\_______ + (__)\ . . )\/\ + U ||----v|| + || || + _ _ _ /+ ____/+___ +| \ | | \ | |/ ___| _ \ +| \| | \| | | | |_) | +| |\ | |\ | |___| __/ +|_| \_|_| \_|\____|_| diff --git a/makedist.sh b/makedist.sh index 2a96bd9a46bbe9e725c204caf15d69b9c694554108956e0ecdd716dc8eea25bc..2f422df0ac54eccb535fe37354e10a06aa9adf9871d2b80c8211fe02cd2abeb1 100755 --- a/makedist.sh +++ b/makedist.sh @@ -50,6 +50,7 @@ golang.org/x/sys/CONTRIBUTORS golang.org/x/sys/LICENSE golang.org/x/sys/PATENTS golang.org/x/sys/README.md +golang.org/x/sys/cpu golang.org/x/sys/unix EOF tar cfCI - src $tmp/includes | tar xfC - $tmp diff --git a/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go b/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go index 9ced7349fe7e88b39195b1f19a665265241bfd3bc587124678aa0c35db25e16d..9dcb88018fc2f3cde788d63f4729f030dd54737bbe607907d65f1025868e37d1 100644 --- a/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go +++ b/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go @@ -60,7 +60,7 @@ doRx = flag.Bool("rx", false, "Receive packets") doTx = flag.Bool("tx", false, "Transfer packets") doDelete = flag.Bool("delete", false, "Delete transferred packets") doCheck = flag.Bool("check", false, "Check integrity while receiving") - dryRun = flag.Bool("dryrun", false, "Do not writings") + dryRun = flag.Bool("dryrun", false, "Do no writes") spoolPath = flag.String("spool", "", "Override path to spool") logPath = flag.String("log", "", "Override path to logfile") quiet = flag.Bool("quiet", false, "Print only errors") @@ -120,13 +120,22 @@ job.Fd.Close() continue } if err = tarWr.WriteHeader(&tar.Header{ + Format: tar.FormatUSTAR, + Name: nncp.NNCPBundlePrefix, + Mode: 0700, + Typeflag: tar.TypeDir, + }); err != nil { + log.Fatalln("Error writing tar header:", err) + } + if err = tarWr.WriteHeader(&tar.Header{ + Format: tar.FormatPAX, Name: strings.Join([]string{ nncp.NNCPBundlePrefix, nodeId.String(), ctx.SelfId.String(), pktName, }, "/"), - Mode: 0440, + Mode: 0400, Size: job.Size, Typeflag: tar.TypeReg, }); err != nil { @@ -183,6 +192,21 @@ } bufStdin.Discard(prefixIdx) tarR = tar.NewReader(bufStdin) sds["xx"] = string(nncp.TRx) + entry, err = tarR.Next() + if err != nil { + if err != io.EOF { + ctx.LogD( + "nncp-bundle", + nncp.SdsAdd(sds, nncp.SDS{"err": err}), + "error reading tar", + ) + } + continue + } + if entry.Typeflag != tar.TypeDir { + ctx.LogD("nncp-bundle", sds, "Expected NNCP/") + continue + } entry, err = tarR.Next() if err != nil { if err != io.EOF {