source: postlfs/security/polkit.xml

trunk
Last change on this file was cd85943, checked in by Xi Ruoyao <xry111@…>, 2 weeks ago

polkit: Adapt for GCC 14

  • Property mode set to 100644
File size: 14.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY polkit-download-http "https://gitlab.freedesktop.org/polkit/polkit/-/archive/&polkit-version;/polkit-&polkit-version;.tar.gz">
8 <!ENTITY polkit-download-ftp " ">
9 <!ENTITY polkit-md5sum "97db655618e1483706fbc764787c7d6e">
10 <!ENTITY polkit-size "744 KB">
11 <!ENTITY polkit-buildsize "7.2 MB (with tests)">
12 <!ENTITY polkit-time "0.3 SBU (with tests; using parallelism=4)">
13]>
14
15<sect1 id="polkit" xreflabel="Polkit-&polkit-version;">
16 <?dbhtml filename="polkit.html"?>
17
18
19 <title>Polkit-&polkit-version;</title>
20
21 <indexterm zone="polkit">
22 <primary sortas="a-Polkit">Polkit</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to Polkit</title>
27
28 <para>
29 <application>Polkit</application> is a toolkit for defining and handling
30 authorizations. It is used for allowing unprivileged processes to
31 communicate with privileged processes.
32 </para>
33
34 &lfs121_checked;
35
36 <bridgehead renderas="sect3">Package Information</bridgehead>
37 <itemizedlist spacing="compact">
38 <listitem>
39 <para>
40 Download (HTTP): <ulink url="&polkit-download-http;"/>
41 </para>
42 </listitem>
43 <listitem>
44 <para>
45 Download (FTP): <ulink url="&polkit-download-ftp;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download MD5 sum: &polkit-md5sum;
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download size: &polkit-size;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Estimated disk space required: &polkit-buildsize;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated build time: &polkit-time;
66 </para>
67 </listitem>
68 </itemizedlist>
69
70<!--
71 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
72 <itemizedlist spacing="compact">
73 <listitem>
74 <para>
75 Required patch:
76 <ulink url="&patch-root;/polkit-&polkit-version;-security_fixes-1.patch"/>
77 </para>
78 </listitem>
79 <listitem>
80 <para>
81 Required patch:
82 <ulink url="&patch-root;/polkit-&polkit-version;-js91-1.patch"/>
83 </para>
84 </listitem>
85 </itemizedlist>
86-->
87
88 <bridgehead renderas="sect3">Polkit Dependencies</bridgehead>
89
90 <bridgehead renderas="sect4">Required</bridgehead>
91 <para role="required">
92 <xref linkend="glib2"/> (GObject Introspection recommended)
93 </para>
94
95 <bridgehead renderas="sect4">Recommended</bridgehead>
96 <para role="recommended">
97 <!-- For jhalfs just make it required to avoid over-complexity. -->
98 <xref role="required" linkend="duktape"/>,
99 <xref linkend="libxslt"/>,<phrase revision="systemd"> and</phrase>
100 <xref linkend="linux-pam"/><phrase revision="sysv">, and
101 <xref linkend="elogind"/>
102 </phrase>
103 </para>
104
105 <note>
106 <para>
107 Since <phrase revision="sysv"><command>elogind</command></phrase>
108 <phrase revision="systemd"><command>systemd-logind</command></phrase>
109 uses PAM to register user sessions, it is a good idea to build
110 <application>Polkit</application> with PAM support so
111 <phrase revision="sysv"><command>elogind</command></phrase>
112 <phrase revision="systemd"><command>systemd-logind</command></phrase>
113 can track <application>Polkit</application> sessions.
114 </para>
115 </note>
116
117 <bridgehead renderas="sect4">Optional</bridgehead>
118 <para role="optional">
119 <xref linkend="gtk-doc"/>,
120 <xref linkend="python-dbusmock"/>, and
121 <xref linkend="spidermonkey"/> (can be used in place of duktape)
122 </para>
123
124 <bridgehead renderas="sect4" revision="systemd">Required Runtime Dependencies</bridgehead>
125 <para role="required" revision="systemd">
126 <xref role="runtime" linkend="systemd"/>
127 </para>
128
129 <bridgehead renderas="sect4" id="polkit-agent" xreflabel="Polkit Authentication Agent">
130 Optional Runtime Dependencies
131 </bridgehead>
132 <para role="optional">
133 One polkit authentication agent for using polkit in the graphical
134 environment:
135 <application>polkit-kde-agent</application> in
136 <xref role="runtime" linkend="plasma-build"/> for KDE,
137 the agent built in
138 <xref role="runtime" linkend="gnome-shell"/> for GNOME3,
139 <xref role="runtime" linkend="polkit-gnome"/> for XFCE, and
140 <xref role="runtime" linkend="lxqt-policykit"/> for LXQt
141 </para>
142
143 <note>
144 <para>
145 If <xref linkend="libxslt"/> is installed,
146 then <xref linkend="DocBook"/> and <xref linkend="docbook-xsl"/> are
147 required. If you have installed <xref linkend="libxslt"/>, but you do
148 not want to install any of the DocBook packages mentioned, you will
149 need to use <option>-Dman=false</option> in the instructions
150 below.
151 </para>
152 </note>
153
154 </sect2>
155
156 <sect2 role="installation">
157 <title>Installation of Polkit</title>
158
159 <para>
160 There should be a dedicated user and group to take control
161 of the <command>polkitd</command> daemon after it is
162 started. Issue the following commands as the
163 <systemitem class="username">root</systemitem> user:
164 </para>
165
166<screen role="root"><userinput>groupadd -fg 27 polkitd &amp;&amp;
167useradd -c "PolicyKit Daemon Owner" -d /etc/polkit-1 -u 27 \
168 -g polkitd -s /bin/false polkitd</userinput></screen>
169
170 <para revision='sysv'>
171 First fix a build problem for sysV based systems:
172 </para>
173
174<screen revision="sysv"><userinput>sed -i '/systemd_sysusers_dir/s/^/#/' meson.build</userinput></screen>
175
176 <para>
177 Install <application>Polkit</application> by running the following
178 commands:
179 </para>
180
181<screen revision="systemd"><userinput>mkdir build &amp;&amp;
182cd build &amp;&amp;
183
184meson setup .. \
185 --prefix=/usr \
186 --buildtype=release \
187 -Dman=true \
188 -Dsession_tracking=libsystemd-login \
189 -Dtests=true</userinput></screen>
190
191<screen revision="sysv"><userinput>mkdir build &amp;&amp;
192cd build &amp;&amp;
193
194meson setup .. \
195 --prefix=/usr \
196 --buildtype=release \
197 -Dman=true \
198 -Dsession_tracking=libelogind \
199 -Dtests=true</userinput></screen>
200
201 <!-- We have to do this after meson setup because mocklibc is extracted
202 from a tarball by the meson setup command. Also note that
203 test/mocklibc is useless and patching it won't work. -->
204 <para>
205 Now adapt the shipped mocklibc copy to allow building the test suite
206 with GCC 14 or later:
207 </para>
208
209<screen><userinput>grep 'print_indent' ../subprojects/mocklibc-1.0/src/netgroup.c \
210 | sed 's/ {/;/' >> ../subprojects/mocklibc-1.0/src/netgroup.h &amp;&amp;
211sed -i '1i#include &lt;stdio.h&gt;' \
212 ../subprojects/mocklibc-1.0/src/netgroup.h</userinput></screen>
213
214 <para>
215 Build the package:
216 </para>
217
218<screen><userinput>ninja</userinput></screen>
219
220 <para>
221 To test the results, first ensure that the system
222 <application>D-Bus</application> daemon is running,
223 and both <xref linkend='dbus-python'/> and
224 <xref linkend='python-dbusmock'/> are installed.
225 Then run <command>ninja test</command>.
226 </para>
227
228 <para>
229 Now, as the <systemitem class="username">root</systemitem> user:
230 </para>
231
232<screen role="root"><userinput>ninja install</userinput></screen>
233
234 </sect2>
235
236 <sect2 role="commands">
237 <title>Command Explanations</title>
238
239 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
240 href="../../xincludes/meson-buildtype-release.xml"/>
241
242 <para>
243 <parameter>-Dtests=true</parameter>: This switch allows to run the
244 test suite of this package. As <application>Polkit</application> is
245 used for authorizations, its integrity can affect system security.
246 So it's recommended to run the test suite building this package.
247 </para>
248
249 <para>
250 <option>-Djs_engine=mozjs</option>: This switch allows using the
251 <xref linkend="spidermonkey"/> JavaScript engine instead of the
252 <xref linkend='duktape'/> JavaScript engine.
253 </para>
254
255 <!--
256 <para revision="sysv">
257 <parameter>- -disable-libsystemd-login</parameter>: This switch forces
258 polkit to build with elogind support (if available) rather than
259 systemd-logind.
260 </para>
261
262
263 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
264 href="../../xincludes/static-libraries.xml"/>
265 -->
266
267 <para>
268 <option>-Dos_type=lfs</option>: Use this switch if you did not create
269 the <filename>/etc/lfs-release</filename> file or distribution auto
270 detection will fail and you will be unable to use
271 <application>Polkit</application>.
272 </para>
273
274 <para>
275 <option>-Dauthfw=shadow</option>: This switch enables the
276 package to use the <application>Shadow</application> rather than the
277 <application>Linux PAM</application> Authentication framework. Use it
278 if you have not installed <application>Linux PAM</application>.
279 </para>
280
281 <!--
282 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
283 href="../../xincludes/gtk-doc-rebuild.xml"/>
284 -->
285
286 <para>
287 <option>-Dintrospection=false</option>: Use this option if you are certain
288 that you do not need gobject-introspection files for polkit, or do not have
289 installed <xref linkend='glib2'/> with GObject Introspection.
290 </para>
291
292 <para>
293 <option>-Dman=false</option>: Use this option to disable generating and
294 installing manual pages. This is useful if libxslt is not installed.
295 </para>
296
297 <para>
298 <option>-Dexamples=true</option>: Use this option to build the example
299 programs.
300 </para>
301
302 <para>
303 <option>-Dgtk_doc=true</option>: Use this option to enable building and
304 installing the API documentation.
305 </para>
306
307 </sect2>
308
309 <sect2 role="content">
310 <title>Contents</title>
311
312 <segmentedlist>
313 <segtitle>Installed Programs</segtitle>
314 <segtitle>Installed Libraries</segtitle>
315 <segtitle>Installed Directories</segtitle>
316
317 <seglistitem>
318 <seg>
319 pkaction, pkcheck, <!--pk-example-frobnicate,--> pkexec,
320 pkttyagent, and polkitd
321 </seg>
322 <seg>
323 libpolkit-agent-1.so and
324 libpolkit-gobject-1.so
325 </seg>
326 <seg>
327 /etc/polkit-1,
328 /usr/include/polkit-1,
329 /usr/lib/polkit-1,
330 /usr/share/gtk-doc/html/polkit-1, and
331 /usr/share/polkit-1
332 </seg>
333 </seglistitem>
334 </segmentedlist>
335
336 <variablelist>
337 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
338 <?dbfo list-presentation="list"?>
339 <?dbhtml list-presentation="table"?>
340
341 <varlistentry id="pkaction">
342 <term><command>pkaction</command></term>
343 <listitem>
344 <para>
345 is used to obtain information about registered PolicyKit actions
346 </para>
347 <indexterm zone="polkit pkaction">
348 <primary sortas="b-pkaction">pkaction</primary>
349 </indexterm>
350 </listitem>
351 </varlistentry>
352
353 <varlistentry id="pkcheck">
354 <term><command>pkcheck</command></term>
355 <listitem>
356 <para>
357 is used to check whether a process is authorized for action
358 </para>
359 <indexterm zone="polkit pkcheck">
360 <primary sortas="b-pkcheck">pkcheck</primary>
361 </indexterm>
362 </listitem>
363 </varlistentry>
364
365<!--
366 <varlistentry id="pk-example-frobnicate">
367 <term><command>pk-example-frobnicate</command></term>
368 <listitem>
369 <para>
370 is an example program to test the <command>pkexec</command>
371 command
372 </para>
373 <indexterm zone="polkit pk-example-frobnicate">
374 <primary sortas="b-pk-example-frobnicate">pk-example-frobnicate</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378-->
379
380 <varlistentry id="pkexec">
381 <term><command>pkexec</command></term>
382 <listitem>
383 <para>
384 allows an authorized user to execute a command as another user
385 </para>
386 <indexterm zone="polkit pkexec">
387 <primary sortas="b-pkexec">pkexec</primary>
388 </indexterm>
389 </listitem>
390 </varlistentry>
391
392 <varlistentry id="pkttyagent">
393 <term><command>pkttyagent</command></term>
394 <listitem>
395 <para>
396 is used to start a textual authentication agent for the subject
397 </para>
398 <indexterm zone="polkit pkttyagent">
399 <primary sortas="b-pkttyagent">pkttyagent</primary>
400 </indexterm>
401 </listitem>
402 </varlistentry>
403
404 <varlistentry id="polkitd">
405 <term><command>polkitd</command></term>
406 <listitem>
407 <para>
408 provides the org.freedesktop.PolicyKit1 <application>D-Bus</application>
409 service on the system message bus
410 </para>
411 <indexterm zone="polkit polkitd">
412 <primary sortas="b-polkitd">polkitd</primary>
413 </indexterm>
414 </listitem>
415 </varlistentry>
416
417 <varlistentry id="libpolkit-agent-1">
418 <term><filename class="libraryfile">libpolkit-agent-1.so</filename></term>
419 <listitem>
420 <para>
421 contains the <application>Polkit</application> authentication
422 agent API functions
423 </para>
424 <indexterm zone="polkit libpolkit-agent-1">
425 <primary sortas="c-libpolkit-agent-1">libpolkit-agent-1.so</primary>
426 </indexterm>
427 </listitem>
428 </varlistentry>
429
430 <varlistentry id="libpolkit-gobject-1">
431 <term><filename class="libraryfile">libpolkit-gobject-1.so</filename></term>
432 <listitem>
433 <para>
434 contains the <application>Polkit</application> authorization API functions
435 </para>
436 <indexterm zone="polkit libpolkit-gobject-1">
437 <primary sortas="c-libpolkit-gobject-1">libpolkit-gobject-1.so</primary>
438 </indexterm>
439 </listitem>
440 </varlistentry>
441
442 </variablelist>
443
444 </sect2>
445
446</sect1>
Note: See TracBrowser for help on using the repository browser.