From 3781df82050581c91c07d51d4f19e0951d5146e1 Mon Sep 17 00:00:00 2001 From: Antonio Mika Date: Fri, 10 Nov 2023 17:24:14 -0500 Subject: [PATCH] Report same issues on receive --- wish/send/rsync/rsync.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wish/send/rsync/rsync.go b/wish/send/rsync/rsync.go index 70476d5b..9079cccd 100644 --- a/wish/send/rsync/rsync.go +++ b/wish/send/rsync/rsync.go @@ -200,11 +200,29 @@ func Middleware(writeHandler utils.CopyFromClientHandler) wish.Middleware { } opts, parser := rsyncreceiver.NewGetOpt() + + compress := parser.Bool("z", false) + _, _ = parser.Parse(cmdFlags[1:]) fileHandler.recursive = opts.Recurse fileHandler.ignoreTimes = opts.IgnoreTimes + if *compress { + _, _ = session.Stderr().Write([]byte("compression is currently unsupported\r\n")) + return + } + + if opts.PreserveUid { + _, _ = session.Stderr().Write([]byte("uid preservation will not work as we don't retain user information\r\n")) + return + } + + if opts.PreserveGid { + _, _ = session.Stderr().Write([]byte("gid preservation will not work as we don't retain user information\r\n")) + return + } + if _, err := rsyncreceiver.ClientRun(opts, session, fileHandler, true); err != nil { writeHandler.GetLogger().Error("error running rsync receiver:", err) }