This file is indexed.

/usr/share/doc/monotone/html/Netsync-Transport-Hooks.html is in monotone-doc 1.0-12.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: Netsync Transport Hooks</title>

<meta name="description" content="monotone documentation: Netsync Transport Hooks">
<meta name="keywords" content="monotone documentation: Netsync Transport Hooks">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="General-Index.html#General-Index" rel="index" title="General Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Hooks.html#Hooks" rel="up" title="Hooks">
<link href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks" rel="next" title="Trust Evaluation Hooks">
<link href="Netsync-Permission-Hooks.html#Netsync-Permission-Hooks" rel="prev" title="Netsync Permission Hooks">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="texinfo.css">


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Netsync-Transport-Hooks"></a>
<div class="header">
<p>
Next: <a href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks" accesskey="n" rel="next">Trust Evaluation Hooks</a>, Previous: <a href="Netsync-Permission-Hooks.html#Netsync-Permission-Hooks" accesskey="p" rel="prev">Netsync Permission Hooks</a>, Up: <a href="Hooks.html#Hooks" accesskey="u" rel="up">Hooks</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Netsync-Transport-Hooks-1"></a>
<h4 class="subsection">6.1.5 Netsync Transport Hooks</h4>

<p>When a monotone client initiates a netsync connection, these hooks are
called to attempt to parse the host argument provided on the command
line. If the hooks fail or return nil, monotone will interpret the
host argument as a network name (possibly with a port number) and open
a TCP socket.
</p>
<dl compact="compact">
<dd><a name="get_005fnetsync_005fconnect_005fcommand"></a></dd>
<dt><code>get_netsync_connect_command (<var>uri</var>, <var>args</var>)</code>
<a name="index-get_005fnetsync_005fconnect_005fcommand-_0028uri_002c-args_0029"></a>
</dt>
<dd>
<p>Returns a table describing a command to run to connect to the
specified host. The <var>uri</var> argument is a table containing
between 0 and 7 components:
</p>
<ul>
<li> <code>uri[&quot;scheme&quot;]</code>, such as <code>&quot;ssh&quot;</code> or <code>&quot;file&quot;</code>
</li><li> <code>uri[&quot;user&quot;]</code>, the name of a remote user
</li><li> <code>uri[&quot;host&quot;]</code>, the name or address of a remote host
</li><li> <code>uri[&quot;port&quot;]</code>, a network port number
</li><li> <code>uri[&quot;path&quot;]</code>, a filesystem path
</li><li> <code>uri[&quot;query&quot;]</code>, for additional parameters
</li><li> <code>uri[&quot;fragment&quot;]</code>, to describe a sub-location within the remote resource
</li></ul>

<p>The <var>args</var> argument is a table containing between 0 and 3
components:
</p>
<ul>
<li> <code>args[&quot;include&quot;]</code>, the branch pattern to include
</li><li> <code>args[&quot;exclude&quot;]</code>, the branch pattern to exclude
</li><li> <code>args[&quot;debug&quot;]</code>, whether to run the connection in debug mode
</li></ul>

<p>The default definition of this hook follows:
</p>
<div class="smallexample">
<pre class="smallexample">function get_netsync_connect_command(uri, args)

        local argv = nil

        if uri[&quot;scheme&quot;] == &quot;ssh&quot;
                and uri[&quot;host&quot;]
                and uri[&quot;path&quot;] then

                argv = { &quot;ssh&quot; }
                if uri[&quot;user&quot;] then
                        table.insert(argv, &quot;-l&quot;)
                        table.insert(argv, uri[&quot;user&quot;])
                end
                if uri[&quot;port&quot;] then
                        table.insert(argv, &quot;-p&quot;)
                        table.insert(argv, uri[&quot;port&quot;])
                end

                table.insert(argv, uri[&quot;host&quot;])
        end

        if uri[&quot;scheme&quot;] == &quot;file&quot; and uri[&quot;path&quot;] then
                argv = { }
        end

        if argv then

                table.insert(argv, get_mtn_command(uri[&quot;host&quot;]))

                if args[&quot;debug&quot;] then
                        table.insert(argv, &quot;--debug&quot;)
                else
                        table.insert(argv, &quot;--quiet&quot;)
                end

                table.insert(argv, &quot;--db&quot;)
                table.insert(argv, uri[&quot;path&quot;])
                table.insert(argv, &quot;serve&quot;)
                table.insert(argv, &quot;--stdio&quot;)
                table.insert(argv, &quot;--no-transport-auth&quot;)

                if args[&quot;include&quot;] then
                        table.insert(argv, args[&quot;include&quot;])
                end

                if args[&quot;exclude&quot;] then
                        table.insert(argv, &quot;--exclude&quot;)
                        table.insert(argv, args[&quot;exclude&quot;])
                end
        end
        return argv
end
</pre></div>


</dd>
<dt><code>use_transport_auth (<var>uri</var>)</code>
<a name="index-use_005ftransport_005fauth-_0028uri_0029"></a>
</dt>
<dd>
<p>Returns a boolean indicating whether monotone should use transport
authentication mechanisms when communicating with <var>uri</var>. If this
hook fails, the return value is assumed to be <code>true</code>. The form of
the <var>uri</var> argument is a table, identical to the table provided as
an argument to <code>get_netsync_connect_command</code>.
</p>
<p>Note that the return value of this hook must &quot;match&quot; the semantics of
the command returned by <code>get_netsync_connect_command</code>. In
particular, if this hook returns <code>false</code>, the <code>serve</code>
command line arguments passed to the remote end of the connection
should include the <samp>--no-transport-auth</samp> option. A mismatch
between this hook&rsquo;s return value and the command line returned by
<code>get_netsync_connect_command</code> will cause a communication failure,
as the local and remote monotone processes will have mismatched
authentication assumptions.
</p>

<div class="smallexample">
<pre class="smallexample">function use_transport_auth(uri)
        if uri[&quot;scheme&quot;] == &quot;ssh&quot;
        or uri[&quot;scheme&quot;] == &quot;file&quot; then
                return false
        else
                return true
        end
end
</pre></div>

</dd>
<dt><code>get_mtn_command(<var>host</var>)</code>
<a name="index-get_005fmtn_005fcommand_0028host_0029"></a>
</dt>
<dd>
<p>Returns a string containing the monotone command to be executed on
<var>host</var> when communicating over <code>ssh</code>.  The <var>host</var>
argument is a string containing the name of the host to which
<code>ssh</code> is connecting, from the server URI.  This is useful when
there are multiple monotone binaries on the remote host, or the
monotone binary is not in the default path.
</p>
<div class="smallexample">
<pre class="smallexample">function get_mtn_command(host)
    return &quot;mtn&quot;
end
</pre></div>

</dd>
</dl>


<hr>
<div class="header">
<p>
Next: <a href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks" accesskey="n" rel="next">Trust Evaluation Hooks</a>, Previous: <a href="Netsync-Permission-Hooks.html#Netsync-Permission-Hooks" accesskey="p" rel="prev">Netsync Permission Hooks</a>, Up: <a href="Hooks.html#Hooks" accesskey="u" rel="up">Hooks</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>