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
|
---
version: tip
layout: manpage_v2
title: nng_ipc_options(5)
---
<h1>nng_ipc_options(5)</h1>
<div class="sect1">
<h2 id="_name">NAME</h2>
<div class="sectionbody">
<div class="paragraph">
<p>nng_ipc_options - IPC-specific options</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span><span class="tok-w"> </span><span class="tok-cpf"><nng/nng.h></span>
<span class="tok-cp">#define NNG_OPT_IPC_PEER_GID "ipc:peer-gid"</span>
<span class="tok-cp">#define NNG_OPT_IPC_PEER_PID "ipc:peer-pid"</span>
<span class="tok-cp">#define NNG_OPT_IPC_PEER_UID "ipc:peer-uid"</span>
<span class="tok-cp">#define NNG_OPT_IPC_PEER_ZONEID "ipc:peer-zoneid"</span>
<span class="tok-cp">#define NNG_OPT_IPC_PERMISSIONS "ipc:permissions"</span>
<span class="tok-cp">#define NNG_OPT_IPC_SECURITY_DESCRIPTOR "ipc:security-descriptor"</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This page documents the various standard options that can be set or
retrieved on objects using IPC.</p>
</div>
<div class="paragraph">
<p>The option names should always be used by their symbolic definitions.</p>
</div>
<div class="paragraph">
<p>In the following list of options, the name of the option is supplied,
along with the data type of the underlying value.</p>
</div>
<div class="paragraph">
<p>Some options are only meaningful or supported in certain contexts, or may
have other access restrictions.
An attempt has been made to include details about such restrictions in the
description of the option.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The availability of the following options is platform-specific,
as the implementations of IPC are quite different on Windows and POSIX systems.
</td>
</tr>
</table>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><a id="NNG_OPT_IPC_PERMISSIONS"></a><code>NNG_OPT_IPC_PERMISSIONS</code></dt>
<dd>
<p>(<code>int</code>)
This write-only option may be applied to a listener to configure the
permissions that are used on the UNIX domain socket created by that listener.
This property is only supported on POSIX systems.
The value is of type <code>int</code>, representing the normal permission bits
on a file, such as <code>0600</code> (typically meaning read-write to the owner, and
no permissions for anyone else.)
The default is system-specific, most often <code>0644</code>.</p>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
Not all systems validate these permissions.
In particular, illumos and Solaris are known to ignore these permission
settings when connecting.
</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Normally both read and write permission will be necessary for a
peer dialer to connect.
See your system documentation for UNIX domain sockets for more information.
</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The <em>umask</em> of the process is <strong>not</strong> applied to these bits.
</td>
</tr>
</table>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
The best practice for limiting access is to place the socket in a
directory writable only by the server, and only readable and searchable
by clients.
All mainstream POSIX systems will fail to permit a client to connect
to a socket located in a directory for which the client lacks search (execute)
permission.
</td>
</tr>
</table>
</div>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_IPC_SECURITY_DESCRIPTOR"></a><code>NNG_OPT_IPC_SECURITY_DESCRIPTOR</code></dt>
<dd>
<p>(<code>PSECURITY_DESCRIPTOR</code>)
This write-only option may be used on listeners on Windows platforms to
configure the <code>SECURITY_DESCRIPTOR</code> that is used when creating the underlying
named pipe.
The value is a pointer, <code>PSECURITY_DESCRIPTOR</code>, and may only be
applied to listeners that have not been started yet.</p>
</dd>
</dl>
</div>
<div class="sect2">
<h3 id="_common_platform_specific_options">Common Platform Specific Options</h3>
<div class="paragraph">
<p>The following options are supported by this transport when the underlying platform supports them:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_GID"><code>NNG_OPT_PEER_GID</code></a> (also available as <code>NNG_OPT_IPC_PEER_GID</code>)</p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_PID"><code>NNG_OPT_PEER_PID</code></a> (also available as <code>NNG_OPT_IPC_PEER_PID</code>)</p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_UID"><code>NNG_OPT_PEER_UID</code></a> (also available as <code>NNG_OPT_IPC_PEER_UID</code>)</p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_PEER_ZONEID"><code>NNG_OPT_PEER_ZONEID</code></a> (also available as <code>NNG_OPT_IPC_PEER_ZONEID</code>)</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_inherited_options">Inherited Options</h3>
<div class="paragraph">
<p>Generally, the following option values are also available when appropriate for the context:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="nng_options.5.html#NNG_OPT_LOCADDR"><code>NNG_OPT_LOCADDR</code></a></p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_REMADDR"><code>NNG_OPT_REMADDR</code></a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph text-left">
<p><a href="nng_dialer_get.3.html">nng_dialer_get(3)</a>,
<a href="nng_dialer_set.3.html">nng_dialer_set(3)</a>,
<a href="nng_listener_get.3.html">nng_listener_get(3)</a>,
<a href="nng_listener_set.3.html">nng_listener_set(3)</a>,
<a href="nng_pipe_get.3.html">nng_pipe_get(3)</a>,
<a href="nng_options.5.html">nng_options(5)</a>
<a href="nng.7.html">nng(7)</a>,
<a href="nng_ipc.7.html">nng_ipc(7)</a></p>
</div>
</div>
</div>
|