1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
.\" $OpenBSD: rsyncd.5,v 1.3 2019/02/18 21:34:54 benno Exp $
.\"
.\" Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: February 18 2019 $
.Dt RSYNCD 5
.Os
.Sh NAME
.Nm rsyncd
.Nd rsyncd wire protocol
.Sh DESCRIPTION
The
.Nm
protocol described in this relates to the BSD-licensed
.Xr openrsync 1 ,
a re-implementation of the GPL-licensed reference utility
.Xr rsync 1 .
It is compatible with version 27 of the reference.
.Pp
The
.Nm
protocol is an envelope protocol for
.Xr rsync 5
between a client and an rsync://-capable server.
It provides a means to exchange capabilities information prior to file
transfer.
.Pp
In this document,
.Qq client
refers to the
.Xr openrsync 1
utility making the request.
It follows that
.Qq server
refers to the daemon servicing the request.
.Pp
A connection between a client and server consists of host, a module, and
zero or more paths.
.Pp
.Dl openrsync rsync://host/module/path1 rsync://host/path2... dest
.Pp
At this time, operating in sender mode (with the rsync:// host receiving
information) is not described in this document.
.Ss Data types
These are the same as in
.Xr rsync 5 .
A newline is always a standalone \en.
.Ss Client process
After initialising a connection, the client and server exchange the
following information, in order.
This portion of the process is
.Em not
multiplexed.
.Pp
.Bl -enum -compact
.It
client sends requested module followed by newline
.It
server responds with preamble followed by standalone newline
.El
.Pp
The requested module must have non-zero length.
The preamble consists in a sequence of lines.
Each line either contains free-form text sent by the server as a
.Qq motd
.Pq message of the day
or a command:
.Pp
.Dl @RSYNCD: command\en
.Pp
The only supported command is the server protocol specification:
.Pp
.Dl @RSYNCD: xx[.yy]\en
.Pp
The optional component is the submodule, which may be discarded.
The version may only be specified once.
Both the motd and commands end in the special termination command:
.Pp
.Dl @RSYNCD: OK\en
.Pp
Following that, the client must send the command-line arguments that
would otherwise be used to start a
.Xr openrsync 1
server.
Each argument must be specified on its own line, e.g.,
.Pp
.Dl --server\en--sender\en-r\en-t\en.\enpath1\enpath2
.Pp
This must be followed by a standalone newline.
.Pp
If the server does not understand or accept any of the command-line
arguments, it will exit at this point.
.Pp
Following this, the client must read the integer-length session checksum
seed.
Multiplexing is subsequently enabled.
.Pp
The sequence that follows is stipulated in
.Xr rsync 5
following the handshake.
.\" The following requests should be uncommented and used where appropriate.
.\" .Sh CONTEXT
.\" For section 9 functions only.
.\" .Sh RETURN VALUES
.\" For sections 2, 3, and 9 function return values only.
.\" .Sh ENVIRONMENT
.\" For sections 1, 6, 7, and 8 only.
.\" .Sh FILES
.\" .Sh EXIT STATUS
.\" For sections 1, 6, and 8 only.
.\" .Sh EXAMPLES
.\" .Sh DIAGNOSTICS
.\" For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
.\" .Sh ERRORS
.\" For sections 2, 3, 4, and 9 errno settings only.
.Sh SEE ALSO
.Xr openrsync 1 ,
.Xr rsync 5
.\" .Sh STANDARDS
.\" .Sh HISTORY
.\" .Sh AUTHORS
.\" .Sh CAVEATS
.\" .Sh BUGS
|