source: postlfs/security/polkit.xml@ c884c4b

11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/soup3 xry111/xf86-video-removal
Last change on this file since c884c4b was 492cca2c, checked in by Xi Ruoyao <xry111@…>, 2 years ago

polkit: document -Dtests=true

  • Property mode set to 100644
File size: 15.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 "5687b19e9ca9a0225957b8967d8f4458">
10 <!ENTITY polkit-size "740 KB">
11 <!ENTITY polkit-buildsize "8.9 MB (with tests)">
12 <!ENTITY polkit-time "0.2 SBU (with tests, using parallelism=4)">
13]>
14
15<sect1 id="polkit" xreflabel="Polkit-&polkit-version;">
16 <?dbhtml filename="polkit.html"?>
17
18 <sect1info>
19 <date>$Date$</date>
20 </sect1info>
21
22 <title>Polkit-&polkit-version;</title>
23
24 <indexterm zone="polkit">
25 <primary sortas="a-Polkit">Polkit</primary>
26 </indexterm>
27
28 <sect2 role="package">
29 <title>Introduction to Polkit</title>
30
31 <para>
32 <application>Polkit</application> is a toolkit for defining and handling
33 authorizations. It is used for allowing unprivileged processes to
34 communicate with privileged processes.
35 </para>
36
37 &lfs111_checked;
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
42 <para>
43 Download (HTTP): <ulink url="&polkit-download-http;"/>
44 </para>
45 </listitem>
46 <listitem>
47 <para>
48 Download (FTP): <ulink url="&polkit-download-ftp;"/>
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download MD5 sum: &polkit-md5sum;
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Download size: &polkit-size;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Estimated disk space required: &polkit-buildsize;
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Estimated build time: &polkit-time;
69 </para>
70 </listitem>
71 </itemizedlist>
72
73 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
74 <itemizedlist spacing="compact">
75 <listitem>
76 <para>
77 Required patch:
78 <ulink url="&patch-root;/polkit-&polkit-version;-security_fixes-1.patch"/>
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 Required patch:
84 <ulink url="&patch-root;/polkit-&polkit-version;-js91-1.patch"/>
85 </para>
86 </listitem>
87 </itemizedlist>
88
89 <bridgehead renderas="sect3">Polkit Dependencies</bridgehead>
90
91 <bridgehead renderas="sect4">Required</bridgehead>
92 <para role="required">
93 <xref linkend="glib2"/> and
94 <xref linkend="js91"/>
95 </para>
96
97 <bridgehead renderas="sect4">Recommended</bridgehead>
98 <para role="recommended">
99 <xref linkend="gobject-introspection"/>,
100 <xref linkend="libxslt"/>,
101 <xref linkend="linux-pam"/>
102 <phrase revision="sysv">
103 and <xref role="first" linkend="elogind"/>
104 </phrase>
105 </para>
106
107 <note>
108 <para>
109 Since <phrase revision="sysv"><command>elogind</command></phrase>
110 <phrase revision="systemd"><command>systemd-logind</command></phrase>
111 uses PAM to register user sessions, it is a good idea to build
112 <application>Polkit</application> with PAM support so
113 <phrase revision="sysv"><command>elogind</command></phrase>
114 <phrase revision="systemd"><command>systemd-logind</command></phrase>
115 can track <application>Polkit</application> sessions.
116 </para>
117 </note>
118
119
120 <!-- Due to the fact that meson will not autodetect g-i and
121 has it set to required unless you pass an option, and the likelihood
122 of users ignoring a command explanation and then sending in mails
123 regarding KDE or GNOME not working after installing polkit, let's move
124 it to recommended. See #15640 for logic
125 <bridgehead renderas="sect4">Optional (Required if building GNOME)</bridgehead>
126 <para role="optional">
127 <xref linkend="gobject-introspection"/>
128 </para>
129 -->
130
131 <bridgehead renderas="sect4">Optional</bridgehead>
132 <para role="optional">
133 <!--<xref linkend="dbus-python"/> and
134 <xref linkend="python-dbusmock"/> (for tests), and - no more tests -->
135 <!--<xref linkend="DocBook"/>, (Part of libxslt's chain)
136 <xref linkend="docbook-xsl"/>,-->
137 <xref linkend="gtk-doc"/>
138 </para>
139
140 <bridgehead renderas="sect4" revision="systemd">Required Runtime Dependencies</bridgehead>
141 <para role="required" revision="systemd">
142 <xref role="runtime" linkend="systemd"/>
143 </para>
144
145 <bridgehead renderas="sect4" id="polkit-agent" xreflabel="Polkit Authentication Agent">
146 Optional Runtime Dependencies
147 </bridgehead>
148 <para role="optional">
149 One polkit authentication agent for using polkit in the graphical
150 environment:
151 <application>polkit-kde-agent</application> in
152 <xref role="runtime" linkend="plasma5-build"/> for KDE,
153 the agent built in
154 <xref role="runtime" linkend="gnome-shell"/> for GNOME3,
155 <xref role="runtime" linkend="polkit-gnome"/> for XFCE, and
156 <application>lxpolkit</application> in
157 <xref role="runtime" linkend="lxsession"/> for LXDE.
158 </para>
159
160 <note>
161 <para>
162 If <xref linkend="libxslt"/> is installed,
163 then <xref linkend="DocBook"/> and <xref linkend="docbook-xsl"/> are
164 required. If you have installed <xref linkend="libxslt"/>, but you do
165 not want to install any of the DocBook packages mentioned, you will
166 need to use <option>-Dman=false</option> in the instructions
167 below.
168 </para>
169 </note>
170
171 <para condition="html" role="usernotes">User Notes:
172 <ulink url="&blfs-wiki;/polkit"/>
173 </para>
174 </sect2>
175
176 <sect2 role="installation">
177 <title>Installation of Polkit</title>
178
179 <para>
180 There should be a dedicated user and group to take control
181 of the <command>polkitd</command> daemon after it is
182 started. Issue the following commands as the
183 <systemitem class="username">root</systemitem> user:
184 </para>
185
186<screen role="root"><userinput>groupadd -fg 27 polkitd &amp;&amp;
187useradd -c "PolicyKit Daemon Owner" -d /etc/polkit-1 -u 27 \
188 -g polkitd -s /bin/false polkitd</userinput></screen>
189
190 <para>
191 First, fix problems with setting permissions during installation and with
192 meson-0.60.0:
193 </para>
194
195<screen><userinput remap="pre">sed '/0,/s/^/#/' -i meson_post_install.py &amp;&amp;
196sed '/policy,/d' -i actions/meson.build \
197 -i src/examples/meson.build</userinput></screen>
198
199 <para>
200 Apply a patch to fix two security issues:
201 </para>
202
203<screen><userinput remap="pre">patch -Np1 -i ../polkit-&polkit-version;-security_fixes-1.patch</userinput></screen>
204
205 <para>
206 Port this package to use JS-91:
207 </para>
208
209<screen><userinput remap="pre">patch -Np1 -i ../polkit-&polkit-version;-js91-1.patch</userinput></screen>
210
211 <para>
212 Install <application>Polkit</application> by running the following
213 commands:
214 </para>
215
216<screen revision="systemd"><userinput>mkdir build &amp;&amp;
217cd build &amp;&amp;
218
219meson --prefix=/usr \
220 --buildtype=release \
221 -Dman=true \
222 -Dsession_tracking=libsystemd-login \
223 -Dtests=true \
224 .. &amp;&amp;
225ninja</userinput></screen>
226
227<screen revision="sysv"><userinput>mkdir build &amp;&amp;
228cd build &amp;&amp;
229
230meson --prefix=/usr \
231 --buildtype=release \
232 -Dman=true \
233 -Dsession_tracking=libelogind \
234 -Dsystemdsystemunitdir=/tmp \
235 -Dtests=true \
236 .. &amp;&amp;
237ninja</userinput></screen>
238
239 <!--
240 "-t3" for raising the timeout to 90s, i. e. 3x the default:
241 https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/107
242 -->
243 <para>
244 To test the results, first ensure that the system
245 <application>D-Bus</application> daemon is running.
246 Then run <command>meson test -t3</command>.
247 </para>
248
249 <para>
250 Now, as the <systemitem class="username">root</systemitem> user:
251 </para>
252
253<screen role="root" revision="systemd"><userinput>ninja install</userinput></screen>
254
255<screen role="root" revision="sysv"><userinput>ninja install &amp;&amp;
256rm -v /tmp/*.service</userinput></screen>
257
258 </sect2>
259
260 <sect2 role="commands">
261 <title>Command Explanations</title>
262
263 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
264 href="../../xincludes/meson-buildtype-release.xml"/>
265
266 <para>
267 <parameter>-Dtests=true</parameter>: This switch allows to run the
268 test suite of this package. As <application>Polkit</application> is
269 used for authorizations, its integrity can affect system security.
270 So it's recommended to run the test suite building this package.
271 </para>
272
273 <!--
274 <para revision="sysv">
275 <parameter>- -disable-libsystemd-login</parameter>: This switch forces
276 polkit to build with elogind support (if available) rather than
277 systemd-logind.
278 </para>
279
280
281 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
282 href="../../xincludes/static-libraries.xml"/>
283 -->
284
285 <para>
286 <option>-Dauthfw=shadow</option>: This switch enables the
287 package to use the <application>Shadow</application> rather than the
288 <application>Linux PAM</application> Authentication framework. Use it
289 if you have not installed <application>Linux PAM</application>.
290 </para>
291
292 <!--
293 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
294 href="../../xincludes/gtk-doc-rebuild.xml"/>
295 -->
296
297 <para>
298 <option>-Dintrospection=false</option>: Use this option if you are certain
299 that you do not need gobject-introspection files for polkit, or do not have
300 gobject-introspection installed.
301 </para>
302
303 <para>
304 <option>-Dman=false</option>: Use this option to disable generating and
305 installing manual pages. This is useful if libxslt is not installed.
306 </para>
307
308 <para>
309 <option>-Dexamples=true</option>: Use this option to build the example
310 programs.
311 </para>
312
313 <para>
314 <option>-Dgtk_doc=true</option>: Use this option to enable building and
315 installing the API documentation.
316 </para>
317
318 </sect2>
319
320 <sect2 role="configuration">
321 <title>Configuring Polkit</title>
322
323 <sect3>
324 <title>PAM Configuration</title>
325
326 <note>
327 <para>
328 If you did not build <application>Polkit</application> with
329 <application>Linux PAM</application> support, you can skip this
330 section.
331 </para>
332 </note>
333
334 <para>
335 If you have built <application>Polkit</application> with
336 <application>Linux PAM</application> support, you need to modify
337 the default PAM configuration file which was installed by default to get
338 <application>Polkit</application> to work correctly with BLFS. Issue the
339 following commands as the <systemitem class="username">root</systemitem>
340 user to create the configuration file for <application>Linux PAM</application>:
341 </para>
342
343<screen role="root"><userinput>cat &gt; /etc/pam.d/polkit-1 &lt;&lt; "EOF"
344<literal># Begin /etc/pam.d/polkit-1
345
346auth include system-auth
347account include system-account
348password include system-password
349session include system-session
350
351# End /etc/pam.d/polkit-1</literal>
352EOF</userinput></screen>
353
354 </sect3>
355
356 </sect2>
357
358 <sect2 role="content">
359 <title>Contents</title>
360
361 <segmentedlist>
362 <segtitle>Installed Programs</segtitle>
363 <segtitle>Installed Libraries</segtitle>
364 <segtitle>Installed Directories</segtitle>
365
366 <seglistitem>
367 <seg>
368 pkaction, pkcheck, <!--pk-example-frobnicate,--> pkexec,
369 pkttyagent and polkitd
370 </seg>
371 <seg>
372 libpolkit-agent-1.so and
373 libpolkit-gobject-1.so
374 </seg>
375 <seg>
376 /etc/polkit-1,
377 /usr/include/polkit-1,
378 /usr/lib/polkit-1,
379 /usr/share/gtk-doc/html/polkit-1 and
380 /usr/share/polkit-1
381 </seg>
382 </seglistitem>
383 </segmentedlist>
384
385 <variablelist>
386 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
387 <?dbfo list-presentation="list"?>
388 <?dbhtml list-presentation="table"?>
389
390 <varlistentry id="pkaction">
391 <term><command>pkaction</command></term>
392 <listitem>
393 <para>
394 is used to obtain information about registered PolicyKit actions
395 </para>
396 <indexterm zone="polkit pkaction">
397 <primary sortas="b-pkaction">pkaction</primary>
398 </indexterm>
399 </listitem>
400 </varlistentry>
401
402 <varlistentry id="pkcheck">
403 <term><command>pkcheck</command></term>
404 <listitem>
405 <para>
406 is used to check whether a process is authorized for action
407 </para>
408 <indexterm zone="polkit pkcheck">
409 <primary sortas="b-pkcheck">pkcheck</primary>
410 </indexterm>
411 </listitem>
412 </varlistentry>
413
414<!--
415 <varlistentry id="pk-example-frobnicate">
416 <term><command>pk-example-frobnicate</command></term>
417 <listitem>
418 <para>
419 is an example program to test the <command>pkexec</command>
420 command
421 </para>
422 <indexterm zone="polkit pk-example-frobnicate">
423 <primary sortas="b-pk-example-frobnicate">pk-example-frobnicate</primary>
424 </indexterm>
425 </listitem>
426 </varlistentry>
427-->
428
429 <varlistentry id="pkexec">
430 <term><command>pkexec</command></term>
431 <listitem>
432 <para>
433 allows an authorized user to execute a command as another user
434 </para>
435 <indexterm zone="polkit pkexec">
436 <primary sortas="b-pkexec">pkexec</primary>
437 </indexterm>
438 </listitem>
439 </varlistentry>
440
441 <varlistentry id="pkttyagent">
442 <term><command>pkttyagent</command></term>
443 <listitem>
444 <para>
445 is used to start a textual authentication agent for the subject
446 </para>
447 <indexterm zone="polkit pkttyagent">
448 <primary sortas="b-pkttyagent">pkttyagent</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="polkitd">
454 <term><command>polkitd</command></term>
455 <listitem>
456 <para>
457 provides the org.freedesktop.PolicyKit1 <application>D-Bus</application>
458 service on the system message bus
459 </para>
460 <indexterm zone="polkit polkitd">
461 <primary sortas="b-polkitd">polkitd</primary>
462 </indexterm>
463 </listitem>
464 </varlistentry>
465
466 <varlistentry id="libpolkit-agent-1">
467 <term><filename class="libraryfile">libpolkit-agent-1.so</filename></term>
468 <listitem>
469 <para>
470 contains the <application>Polkit</application> authentication
471 agent API functions
472 </para>
473 <indexterm zone="polkit libpolkit-agent-1">
474 <primary sortas="c-libpolkit-agent-1">libpolkit-agent-1.so</primary>
475 </indexterm>
476 </listitem>
477 </varlistentry>
478
479 <varlistentry id="libpolkit-gobject-1">
480 <term><filename class="libraryfile">libpolkit-gobject-1.so</filename></term>
481 <listitem>
482 <para>
483 contains the <application>Polkit</application> authorization API functions
484 </para>
485 <indexterm zone="polkit libpolkit-gobject-1">
486 <primary sortas="c-libpolkit-gobject-1">libpolkit-gobject-1.so</primary>
487 </indexterm>
488 </listitem>
489 </varlistentry>
490
491 </variablelist>
492
493 </sect2>
494
495</sect1>
Note: See TracBrowser for help on using the repository browser.