Skip to content

Commit

Permalink
Report same issues on receive
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika committed Nov 10, 2023
1 parent 0168f72 commit 3781df8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions wish/send/rsync/rsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 3781df8

Please sign in to comment.