[systemd-commits] 5 commits - Makefile-man.am TODO man/localectl.xml man/sd_bus_creds_get_pid.xml man/sd_machine_get_class.xml man/sd_pid_get_session.xml
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Oct 20 10:23:21 PDT 2014
Makefile-man.am | 12 ++++
TODO | 2
man/localectl.xml | 2
man/sd_bus_creds_get_pid.xml | 78 +++++++++++++++-----------
man/sd_machine_get_class.xml | 126 +++++++++++++++++++++++++++++++++++++++++++
man/sd_pid_get_session.xml | 3 -
6 files changed, 189 insertions(+), 34 deletions(-)
New commits:
commit cd4c6fb12598435fe24431f1dd616f9582f0e3bd
Author: Jan Synacek <jsynacek at redhat.com>
Date: Mon Oct 20 12:43:39 2014 +0200
man: fix localectl set-x11-keymap syntax description
diff --git a/man/localectl.xml b/man/localectl.xml
index 38e73c7..c332027 100644
--- a/man/localectl.xml
+++ b/man/localectl.xml
@@ -178,7 +178,7 @@
</varlistentry>
<varlistentry>
- <term><command>set-x11-keymap LAYOUT [MODEL] [VARIANT] [OPTIONS]</command></term>
+ <term><command>set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]</command></term>
<listitem><para>Set the system default
keyboard mapping for X11. This takes a
commit 78366f6ee043a99b837945d9ac39997d4fc92fdf
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 18 16:20:48 2014 +0200
update TODO
diff --git a/TODO b/TODO
index 6c0e3fe..15223fb 100644
--- a/TODO
+++ b/TODO
@@ -41,6 +41,8 @@ External:
Features:
+* kdbus: maybe rename "connection name" concept to something that doesn't reuse the word "name"?
+
* PID 1 doesn't apply nspawns devices cgroup policy
* rework journal-send.c to use memfds for large blobs if they are available instead of unlinked files in /tmp. Also, if we detect that the kernel knows memfds, refuse anything but sealed memfds.
commit 5c20a8bca1dd16d64b2dd959a2552f6452448932
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 18 16:20:36 2014 +0200
man: document sd_bus_creds_get_connection_name()
diff --git a/Makefile-man.am b/Makefile-man.am
index 6a74abd..bdbc54f 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -750,6 +750,7 @@ MANPAGES_ALIAS += \
man/sd_bus_creds_get_cgroup.3 \
man/sd_bus_creds_get_cmdline.3 \
man/sd_bus_creds_get_comm.3 \
+ man/sd_bus_creds_get_connection_name.3 \
man/sd_bus_creds_get_exe.3 \
man/sd_bus_creds_get_gid.3 \
man/sd_bus_creds_get_mask.3 \
@@ -818,6 +819,7 @@ man/sd_bus_creds_get_audit_session_id.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_get_cgroup.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_get_cmdline.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_get_comm.3: man/sd_bus_creds_get_pid.3
+man/sd_bus_creds_get_connection_name.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_get_exe.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_get_gid.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_get_mask.3: man/sd_bus_creds_new_from_pid.3
@@ -896,6 +898,9 @@ man/sd_bus_creds_get_cmdline.html: man/sd_bus_creds_get_pid.html
man/sd_bus_creds_get_comm.html: man/sd_bus_creds_get_pid.html
$(html-alias)
+man/sd_bus_creds_get_connection_name.html: man/sd_bus_creds_get_pid.html
+ $(html-alias)
+
man/sd_bus_creds_get_exe.html: man/sd_bus_creds_get_pid.html
$(html-alias)
diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml
index fcc5557..cc8603c 100644
--- a/man/sd_bus_creds_get_pid.xml
+++ b/man/sd_bus_creds_get_pid.xml
@@ -67,6 +67,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<refname>sd_bus_creds_get_audit_login_uid</refname>
<refname>sd_bus_creds_get_unique_name</refname>
<refname>sd_bus_creds_get_well_known_names</refname>
+ <refname>sd_bus_creds_get_connection_name</refname>
<refpurpose>Retrieve fields from a credentials object</refpurpose>
</refnamediv>
@@ -219,6 +220,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<paramdef>char ***<parameter>name</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>int <function>sd_bus_creds_get_connection_name</function></funcdef>
+ <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
+ <paramdef>const char **<parameter>name</parameter></paramdef>
+ </funcprototype>
+
</funcsynopsis>
</refsynopsisdiv>
@@ -352,6 +359,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
D-Bus specification</ulink>.</para>
+ <para><function>sd_bus_creds_get_connection_name()</function> will
+ retrieve a descriptive name of the bus connection of the
+ peer. This name is useful to discern multiple bus connections by
+ the same peer, and may be altered by the peer with the
+ <citerefentry><refentrytitle>sd_bus_set_name()</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call.</para>
+
<para>All functions that take a <parameter>const
char**</parameter> parameter will store the answer there as an
address of a NUL-terminated string. It will be valid as long as
commit b7ea3f3ed6204dca31f8f2a84b667c1783259c5b
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 18 16:20:24 2014 +0200
man: suffix C functions with ()
diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml
index 6358762..fcc5557 100644
--- a/man/sd_bus_creds_get_pid.xml
+++ b/man/sd_bus_creds_get_pid.xml
@@ -235,72 +235,72 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
of a connection.
</para>
- <para><function>sd_bus_creds_get_pid</function> will retrieve the
+ <para><function>sd_bus_creds_get_pid()</function> will retrieve the
PID (process identifier).</para>
- <para><function>sd_bus_creds_get_pid_starttime</function> will
+ <para><function>sd_bus_creds_get_pid_starttime()</function> will
retrieve the time since the start of the epoch in microseconds
since the process was started.</para>
- <para><function>sd_bus_creds_get_tid</function> will retrieve the
+ <para><function>sd_bus_creds_get_tid()</function> will retrieve the
TID (thread identifier).</para>
- <para><function>sd_bus_creds_get_uid</function> will retrieve the
+ <para><function>sd_bus_creds_get_uid()</function> will retrieve the
numeric UID (user identifier).</para>
- <para><function>sd_bus_creds_get_gid</function> will retrieve the
+ <para><function>sd_bus_creds_get_gid()</function> will retrieve the
numeric GID (group identifier).</para>
- <para><function>sd_bus_creds_get_comm</function> will retrieve the
+ <para><function>sd_bus_creds_get_comm()</function> will retrieve the
comm field (truncated name of the executable, as stored in
<filename>/proc/<replaceable>pid</replaceable>/comm</filename>).
</para>
- <para><function>sd_bus_creds_get_tid_comm</function> will retrieve
+ <para><function>sd_bus_creds_get_tid_comm()</function> will retrieve
the comm field of the thread (as stored in
<filename>/proc/<replaceable>pid</replaceable>/task/<replaceable>tid</replaceable>/comm</filename>).
</para>
- <para><function>sd_bus_creds_get_exe</function> will retrieve the
+ <para><function>sd_bus_creds_get_exe()</function> will retrieve the
path to the program (as stored in the
<filename>/proc/<replaceable>pid</replaceable>/exe</filename>
link, but with <literal> (deleted)</literal> suffix removed).
</para>
- <para><function>sd_bus_creds_get_cmdline</function> will retrieve
+ <para><function>sd_bus_creds_get_cmdline()</function> will retrieve
an array of command-line arguments (as stored in
<filename>/proc/<replaceable>pid</replaceable>/cmdline</filename>).
</para>
- <para><function>sd_bus_creds_get_cgroup</function> will retrieve
+ <para><function>sd_bus_creds_get_cgroup()</function> will retrieve
the cgroup path. See <ulink
url="https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>.
</para>
- <para><function>sd_bus_creds_get_unit</function> will retrieve the
+ <para><function>sd_bus_creds_get_unit()</function> will retrieve the
systemd unit name (in the system instance of systemd) that the
process is part of. See
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
- <para><function>sd_bus_creds_get_user_unit</function> will
+ <para><function>sd_bus_creds_get_user_unit()</function> will
retrieve the systemd unit name (in the user instance of systemd)
that the process is part of. See
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
- <para><function>sd_bus_creds_get_slice</function> will retrieve
+ <para><function>sd_bus_creds_get_slice()</function> will retrieve
the systemd slice (a unit in the system instance of systemd) that
the process is part of. See
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
- <para><function>sd_bus_creds_get_session</function> will retrieve
+ <para><function>sd_bus_creds_get_session()</function> will retrieve
the logind session that the process is part of. See
<citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
- <para><function>sd_bus_creds_get_owner_uid</function> will retrieve
+ <para><function>sd_bus_creds_get_owner_uid()</function> will retrieve
the numeric UID (user identifier) of the user who owns the slice
that the process is part of. See
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>
@@ -308,7 +308,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>systemd-user-sessions.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> -->.
</para>
- <para><function>sd_bus_creds_has_effective_cap</function> will
+ <para><function>sd_bus_creds_has_effective_cap()</function> will
check whether the capability specified by
<parameter>capability</parameter> was set in the effective
capabilities mask. A positive return value means that is was
@@ -320,34 +320,34 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
- <para><function>sd_bus_creds_has_permitted_cap</function> is
- similar to <function>sd_bus_creds_has_effective_cap</function>,
+ <para><function>sd_bus_creds_has_permitted_cap()</function> is
+ similar to <function>sd_bus_creds_has_effective_cap()</function>,
but will check the permitted capabilities mask.</para>
- <para><function>sd_bus_creds_has_inheritable_cap</function> is
- similar to <function>sd_bus_creds_has_effective_cap</function>,
+ <para><function>sd_bus_creds_has_inheritable_cap()</function> is
+ similar to <function>sd_bus_creds_has_effective_cap()</function>,
but will check the inheritable capabilities mask.</para>
- <para><function>sd_bus_creds_has_bounding_cap</function> is
- similar to <function>sd_bus_creds_has_effective_cap</function>,
+ <para><function>sd_bus_creds_has_bounding_cap()</function> is
+ similar to <function>sd_bus_creds_has_effective_cap()</function>,
but will check the bounding capabilities mask.</para>
- <para><function>sd_bus_creds_get_selinux_context</function> will
+ <para><function>sd_bus_creds_get_selinux_context()</function> will
retrieve the SELinux security context (label) of the process.</para>
- <para><function>sd_bus_creds_get_audit_session_id</function> will
+ <para><function>sd_bus_creds_get_audit_session_id()</function> will
retrieve the audit session identifier of the process.</para>
- <para><function>sd_bus_creds_get_audit_login_uid</function> will
+ <para><function>sd_bus_creds_get_audit_login_uid()</function> will
retrieve the audit user login identifier (the identifier of the
user who is "responsible" for the session).</para>
- <para><function>sd_bus_creds_get_unique_name</function> will
+ <para><function>sd_bus_creds_get_unique_name()</function> will
retrieve the D-Bus unique name. See <ulink
url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
D-Bus specification</ulink>.</para>
- <para><function>sd_bus_creds_get_well_known_names</function> will
+ <para><function>sd_bus_creds_get_well_known_names()</function> will
retrieve the set of D-Bus well-known names. See <ulink
url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
D-Bus specification</ulink>.</para>
@@ -392,11 +392,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<term><constant>-ENOENT</constant></term>
<listitem><para>Given field is not specified for the sender.
- This will be returned by <function>sd_bus_get_unit</function>,
- <function>sd_bus_get_user_unit</function>,
- <function>sd_bus_get_slice</function>,
- <function>sd_bus_get_session</function>, and
- <function>sd_bus_get_owner_uid</function> if the sender is not
+ This will be returned by <function>sd_bus_get_unit()</function>,
+ <function>sd_bus_get_user_unit()</function>,
+ <function>sd_bus_get_slice()</function>,
+ <function>sd_bus_get_session()</function>, and
+ <function>sd_bus_get_owner_uid()</function> if the sender is not
part of a systemd system unit, systemd user unit, systemd
slice, logind session, or a systemd user session.</para>
</listitem>
commit 5c8da64734d7dbf4058b3f9f89268f1e093a47b6
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 18 16:06:21 2014 +0200
man: document sd_machine_get_class() and sd_machine_get_ifindices()
diff --git a/Makefile-man.am b/Makefile-man.am
index a13e948..6a74abd 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -46,6 +46,7 @@ MANPAGES += \
man/sd_journal_seek_head.3 \
man/sd_journal_stream_fd.3 \
man/sd_listen_fds.3 \
+ man/sd_machine_get_class.3 \
man/sd_notify.3 \
man/sd_watchdog_enabled.3 \
man/shutdown.8 \
@@ -192,6 +193,7 @@ MANPAGES_ALIAS += \
man/sd_journal_set_data_threshold.3 \
man/sd_journal_test_cursor.3 \
man/sd_journal_wait.3 \
+ man/sd_machine_get_ifindices.3 \
man/sd_notifyf.3 \
man/systemd-ask-password-console.path.8 \
man/systemd-ask-password-wall.path.8 \
@@ -297,6 +299,7 @@ man/sd_journal_sendv.3: man/sd_journal_print.3
man/sd_journal_set_data_threshold.3: man/sd_journal_get_data.3
man/sd_journal_test_cursor.3: man/sd_journal_get_cursor.3
man/sd_journal_wait.3: man/sd_journal_get_fd.3
+man/sd_machine_get_ifindices.3: man/sd_machine_get_class.3
man/sd_notifyf.3: man/sd_notify.3
man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8
man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8
@@ -544,6 +547,9 @@ man/sd_journal_test_cursor.html: man/sd_journal_get_cursor.html
man/sd_journal_wait.html: man/sd_journal_get_fd.html
$(html-alias)
+man/sd_machine_get_ifindices.html: man/sd_machine_get_class.html
+ $(html-alias)
+
man/sd_notifyf.html: man/sd_notify.html
$(html-alias)
@@ -1605,6 +1611,7 @@ EXTRA_DIST += \
man/sd_journal_stream_fd.xml \
man/sd_listen_fds.xml \
man/sd_login_monitor_new.xml \
+ man/sd_machine_get_class.xml \
man/sd_notify.xml \
man/sd_pid_get_session.xml \
man/sd_seat_get_active.xml \
diff --git a/man/sd_machine_get_class.xml b/man/sd_machine_get_class.xml
new file mode 100644
index 0000000..d06b752
--- /dev/null
+++ b/man/sd_machine_get_class.xml
@@ -0,0 +1,126 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+ This file is part of systemd.
+
+ Copyright 2014 Lennart Poettering
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="sd_machine_get_class">
+
+ <refentryinfo>
+ <title>sd_machine_get_class</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>Developer</contrib>
+ <firstname>Lennart</firstname>
+ <surname>Poettering</surname>
+ <email>lennart at poettering.net</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>sd_machine_get_class</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>sd_machine_get_class</refname>
+ <refname>sd_machine_get_ifindices</refname>
+ <refpurpose>Determine the class and network interface
+ indices of a locally running virtual machine or
+ container.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcsynopsisinfo>#include <systemd/sd-login.h></funcsynopsisinfo>
+
+ <funcprototype>
+ <funcdef>int <function>sd_machine_get_class</function></funcdef>
+ <paramdef>const char* <parameter>machine</parameter></paramdef>
+ <paramdef>char *<parameter>class</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_machine_get_ifindices</function></funcdef>
+ <paramdef>const char* <parameter>machine</parameter></paramdef>
+ <paramdef>int **<parameter>ifindices</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><function>sd_machine_get_class()</function> may
+ be used to determine the class of a locally running
+ virtual machine or container that is registered with
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
+ string returned is either <literal>vm</literal> or
+ <literal>container</literal>. The returned string
+ needs to be freed with the libc <citerefentry
+ project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call after use.</para>
+
+ <para><function>sd_machine_get_ifindices()</function>
+ may be used to determine the numeric indices of the
+ network interfaces on the host that are pointing
+ towards the specified locally running virtual machine
+ or container that is registered with
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
+ returned array needs to be freed with the libc
+ <citerefentry
+ project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call after use.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Return Value</title>
+
+ <para>On success, these calls return 0 or a positive
+ integer. On failure, these calls return a negative
+ errno-style error code.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Notes</title>
+
+ <para>The <function>sd_machine_get_class()</function> and
+ <function>sd_machine_get_ifindices()</function> interfaces are
+ available as a shared library, which can be compiled
+ and linked to with the
+ <constant>libsystemd</constant>Â <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ file.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_pid_get_machine_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
diff --git a/man/sd_pid_get_session.xml b/man/sd_pid_get_session.xml
index 4b79603..050f701 100644
--- a/man/sd_pid_get_session.xml
+++ b/man/sd_pid_get_session.xml
@@ -264,7 +264,8 @@
<citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_session_is_active</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>getsid</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>
</refsect1>
More information about the systemd-commits
mailing list