]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-exec/main.go
Ability to forcefully override umask
[nncp.git] / src / cmd / nncp-exec / main.go
index 18a93a6f4180280c67893aeed4e5a45818f2eb86..54394e8863e99c786d5e76d2ae35023713f4d447 100644 (file)
@@ -22,11 +22,10 @@ import (
        "bufio"
        "flag"
        "fmt"
-       "io/ioutil"
        "log"
        "os"
 
-       "go.cypherpunks.ru/nncp/v4"
+       "go.cypherpunks.ru/nncp/v5"
 )
 
 func usage() {
@@ -87,11 +86,7 @@ func main() {
        }
 
        nncp.ViaOverride(*viaOverride, ctx, node)
-
-       body, err := ioutil.ReadAll(bufio.NewReader(os.Stdin))
-       if err != nil {
-               log.Fatalln("Can not read body from stdin:", err)
-       }
+       ctx.Umask()
 
        if err = ctx.TxExec(
                node,
@@ -99,7 +94,7 @@ func main() {
                replyNice,
                flag.Args()[1],
                flag.Args()[2:],
-               body,
+               bufio.NewReader(os.Stdin),
                int64(*minSize)*1024,
        ); err != nil {
                log.Fatalln(err)