Home

Awesome

Wire-compatible rsync client in Rust

crates.io docs.rs Tests

rsyn reimplements part of the rsync network protocol in pure Rust. (It's "rsync with no C.")

NOTE: rsyn is an incomplete and inactive experiment. It's not currently a useful replacement for rsync.

rsyn supports protocol version 27, which is supported by rsync versions from 2.6.0 (released in 2004) onwards, and by openrsync.

Install

  1. Install Rust.

  2. Run

    cargo install rsyn
    

To run the interoperability tests (with cargo test) you'll need a copy of rsync installed.

Usage

rsyn DIR prints a recursive listing of the given local directory, by launching an rsync subprocess and controlling it over a pair of pipes.

rsyn USER@HOST:DIR or rsyn HOST:DIR lists a remote directory, connecting to the rsync server over SSH.

Roadmap

Progress so far:

Intended next steps are:

Below this point the ordering is less certain but some options are:

Why do this?

rsync does by-hand parsing of a complicated binary network protocol in C. Although that was a reasonble option in the 90s, today it looks dangerous. Fuzzers find cases where a malicious peer can crash rsync, and worse may be possible.

The rsync C code is quite convoluted, with many interacting options and parameters stored in global variables affecting many different parts of the control flow, including how structures are encoded and decoded.

rsync is still fairly widely deployed, and does a good job. A safer interoperable implementation could be useful.

And, personally: I contributed to rsync many years ago, and it's interesting to revisit the space with better tools, and with more experience, and see if I can do better.

Goals

Non-goals

More docs

Acknowledgements

Thanks to Tridge for his brilliant and generous mentorship and contributions to open source.

This project would have been far harder without Kristaps Dzonsons's documentation of the rsync protocol in the openrsync project.

License

Apache 2.0.

Contributing

I'd love to accept patches to this project. Please read the contribution guidelines and code of conduct.

Disclaimer

This is not an official Google project. It is not supported by Google, and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.