Compare commits

..

No commits in common. "e06d7d0fb0f1851e2464e2497c8c634fc34537c3" and "af06ddf51a8aeff452a13f597e46a9198c977158" have entirely different histories.

47 changed files with 124 additions and 624 deletions

50
NEWS
View File

@ -49,45 +49,6 @@ CHANGES WITH 245 in spe:
https://systemd.io/GROUP_RECORD https://systemd.io/GROUP_RECORD
https://systemd.io/USER_GROUP_API https://systemd.io/USER_GROUP_API
* A small new service systemd-homed.service has been added, that may be
used to securely manage home directories, with built-in encryption
and unifying the user's own home directory data together with
complete user record data in a single place, thus making home
directories naturally migratable. Its primary back-end is based on
LUKS volumes, but it also supports fscrypt, plain directories and
more. It solves a couple of problems we saw with traditional ways to
manage home directories, in particular when it comes to
encryption. For further discussion of this, see the video of
Lennart's talk at AllSystemsGo! 2019:
https://media.ccc.de/v/ASG2019-164-reinventing-home-directories
For further details about the format and expectations on home
directories this new daemon makes, see:
https://systemd.io/HOME_DIRECTORY
* systemd-journald is now multi-instantiable. In addition to the main
instance systemd-journald.service there's now a template unit
systemd-journald@.service that can be instantiated multiple times,
each time defining a new named log 'namespace' (whose name is
specified via the instance part of the instance unit name). A new
unit file setting LogNamespace= has been added, taking such a
namespace name, that allows assigning services to such log
namespaces. As each log namespace is serviced by its own, independent
journal daemon this functionality may be use to improve performance
and increase isolation of applications, at the price of losing global
message ordering. Each daemon may have a separate set of
configuration files, with possibly different disk space settings and
such. journalctl has been updated to take a new option --namespace=
which allows viewing logs from a specific log namespace. The
sd-journal.h API gained sd_journal_open_namespace() for opening the
log stream of a specific log namespace. systemd-journald also gained
the ability to exit on idle, which is useful in the context of log
namespaces, as this means log daemons for log namespaces can be
activated automatically on demand and stop automatically when no
longer used, minimizing resource usage.
* When systemd-tmpfiles copies a file tree using the 'C' line type it * When systemd-tmpfiles copies a file tree using the 'C' line type it
will now implicitly label every copied file matching the SELinux will now implicitly label every copied file matching the SELinux
database. database.
@ -151,10 +112,6 @@ CHANGES WITH 245 in spe:
support for a special new value "dhcp". If set the configured static support for a special new value "dhcp". If set the configured static
route uses the gateway host configured via DHCP. route uses the gateway host configured via DHCP.
* A new User= setting has been implemented for the [RoutingPolicyRule]
section of .network files for configuring source routing based on UID
ranges.
* sd-bus gained a new API call sd_bus_message_sensitive() for marking a * sd-bus gained a new API call sd_bus_message_sensitive() for marking a
D-Bus message object as "sensitive". Objects that are marked that way D-Bus message object as "sensitive". Objects that are marked that way
are erased from memory when they are freed. This concept is intended are erased from memory when they are freed. This concept is intended
@ -164,13 +121,6 @@ CHANGES WITH 245 in spe:
vtables like this, so that this new message flag is implicitly set vtables like this, so that this new message flag is implicitly set
for incoming and outgoing messages of specific methods. for incoming and outgoing messages of specific methods.
* sd-bus gained a new API call sd_bus_message_dump() for dumping the
contents of a message (or parts thereof) onto standard output, for
debugging purposes.
* systemd-sysusers gained support for creating users with primary
groups named differently than the user itself.
* systemd-resolved's DNS-over-TLS support gained SNI validation. * systemd-resolved's DNS-over-TLS support gained SNI validation.
* systemd-growfs (i.e. the x-systemd.growfs mount option in /etc/fstab) * systemd-growfs (i.e. the x-systemd.growfs mount option in /etc/fstab)

View File

@ -233,7 +233,6 @@ manpages = [
''], ''],
['sd_bus_message_append_strv', '3', [], ''], ['sd_bus_message_append_strv', '3', [], ''],
['sd_bus_message_copy', '3', [], ''], ['sd_bus_message_copy', '3', [], ''],
['sd_bus_message_dump', '3', [], ''],
['sd_bus_message_get_cookie', '3', ['sd_bus_message_get_reply_cookie'], ''], ['sd_bus_message_get_cookie', '3', ['sd_bus_message_get_reply_cookie'], ''],
['sd_bus_message_get_monotonic_usec', ['sd_bus_message_get_monotonic_usec',
'3', '3',

View File

@ -58,7 +58,6 @@
<citerefentry><refentrytitle>sd_bus_message_append_string_memfd</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd_bus_message_append_string_memfd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append_strv</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd_bus_message_append_strv</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_copy</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd_bus_message_copy</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_dump</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_cookie</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd_bus_message_get_cookie</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd_bus_message_get_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_signature</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd_bus_message_get_signature</refentrytitle><manvolnum>3</manvolnum></citerefentry>,

View File

@ -1,107 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="sd_bus_message_dump"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_bus_message_dump</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>sd_bus_message_dump</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_bus_message_dump</refname>
<refpurpose>Produce a string representation of a message for debugging purposes</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int sd_bus_message_dump</funcdef>
<paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
<paramdef>FILE *<parameter>f</parameter></paramdef>
<paramdef>uint64_t <parameter>flags</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
<constant>SD_BUS_MESSAGE_DUMP_WITH_HEADER</constant>,
<constant>SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY</constant>
</para>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>The <function>sd_bus_message_dump()</function> function writes a textual representation of the
message <parameter>m</parameter> to the stream <parameter>f</parameter>. This function is intended to be
used for debugging purposes, and the output is neither stable nor designed to be machine readable.
</para>
<para>The <parameter>flags</parameter> parameter may be used to modify the output. With
<constant>SD_BUS_MESSAGE_DUMP_WITH_HEADER</constant>, a header that specifies the message type and flags
and some additional metadata is printed. When <constant>SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY</constant> is
not passed, the contents of the whole message are printed. When it <emphasis>is</emphasis> passed,
only the current container in printed.</para>
<para>Note that this function moves the read pointer of the message. It may be necessary to reset the
position afterwards, for example with
<citerefentry><refentrytitle>sd_bus_message_rewind</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>Output for a signal message (with <constant>SD_BUS_MESSAGE_DUMP_WITH_HEADER</constant>):
<programlisting>
‣ Type=signal Endian=l Flags=1 Version=1 Priority=0 Cookie=22
Path=/value/a Interface=org.freedesktop.DBus.Properties Member=PropertiesChanged
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.systemd.ValueTest";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "Value";
VARIANT "s" {
STRING "object 0x1e, path /value/a";
};
};
};
ARRAY "s" {
STRING "Value2";
STRING "AnExplicitProperty";
};
};
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, this function returns 0 or a positive integer. On failure, it returns a negative
errno-style error code. No error codes are currently defined.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -1084,13 +1084,6 @@
<literal>ipv4</literal>.</para> <literal>ipv4</literal>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>User=</varname></term>
<listitem>
<para>Takes a username, a user ID, or a range of user IDs separated by a dash. Defaults to
unset.</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@ -101,8 +101,8 @@ u root 0 "Superuser" /root /bin/zsh</pro
<term><varname>u</varname></term> <term><varname>u</varname></term>
<listitem><para>Create a system user and group of the specified name should <listitem><para>Create a system user and group of the specified name should
they not exist yet. The user's primary group will be set to the group they not exist yet. The user's primary group will be set to the group
bearing the same name unless the ID field specifies it. The account will be bearing the same name. The account will be created disabled, so that logins
created disabled, so that logins are not allowed.</para></listitem> are not allowed.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -166,10 +166,9 @@ u root 0 "Superuser" /root /bin/zsh</pro
path's owner/group. This is useful to create users whose UID/GID path's owner/group. This is useful to create users whose UID/GID
match the owners of pre-existing files (such as SUID or SGID match the owners of pre-existing files (such as SUID or SGID
binaries). binaries).
The syntaxes <literal><replaceable>uid</replaceable>:<replaceable>gid</replaceable></literal> and The syntax <literal><replaceable>uid</replaceable>:<replaceable>gid</replaceable></literal> is also supported to
<literal><replaceable>uid</replaceable>:<replaceable>groupname</replaceable></literal> are supported to allow creating user and group pairs with different numeric UID and GID values. The group with the indicated GID must get created explicitly before or it must already exist. Specifying <literal>-</literal> for the UID in this syntax
allow creating users with specific primary groups. The given group must be created explicitly, or it is also supported.
must already exist. Specifying <literal>-</literal> for the UID in these syntaxes is also supported.
</para> </para>
<para>For <varname>m</varname> lines, this field should contain <para>For <varname>m</varname> lines, this field should contain

View File

@ -449,6 +449,9 @@ conf.set('_GNU_SOURCE', true)
conf.set('__SANE_USERSPACE_TYPES__', true) conf.set('__SANE_USERSPACE_TYPES__', true)
conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation) conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation)
conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>')) conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>')) conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>')) conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
@ -3382,7 +3385,7 @@ foreach tuple : [
['libcryptsetup'], ['libcryptsetup'],
['PAM'], ['PAM'],
['pwquality'], ['pwquality'],
['libfdisk'], ['fdisk'],
['p11kit'], ['p11kit'],
['AUDIT'], ['AUDIT'],
['IMA'], ['IMA'],

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: systemd\n" "Project-Id-Version: systemd\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-02 23:20+0900\n" "POT-Creation-Date: 2019-09-21 20:13+0900\n"
"PO-Revision-Date: 2018-10-27 07:41+0900\n" "PO-Revision-Date: 2018-10-27 07:41+0900\n"
"Last-Translator: Yu Watanabe <watanabe.yu+github@gmail.com>\n" "Last-Translator: Yu Watanabe <watanabe.yu+github@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -60,55 +60,6 @@ msgstr "systemdの状態の再読込"
msgid "Authentication is required to reload the systemd state." msgid "Authentication is required to reload the systemd state."
msgstr "systemdの状態を再読込するには認証が必要です。" msgstr "systemdの状態を再読込するには認証が必要です。"
#: src/home/org.freedesktop.home1.policy:13
msgid "Create a home"
msgstr "ホームディレクトリの作成"
#: src/home/org.freedesktop.home1.policy:14
msgid "Authentication is required for creating a user's home."
msgstr "ユーザのホームディレクトリを作成するには認証が必要です。"
#: src/home/org.freedesktop.home1.policy:23
msgid "Remove a home"
msgstr "ホームディレクトリの削除"
#: src/home/org.freedesktop.home1.policy:24
msgid "Authentication is required for removing a user's home."
msgstr "ユーザのホームディレクトリの削除には認証が必要です。"
#: src/home/org.freedesktop.home1.policy:33
msgid "Check credentials of a home"
msgstr "ホームディレクトリの認証情報の確認"
#: src/home/org.freedesktop.home1.policy:34
msgid ""
"Authentication is required for checking credentials against a user's home."
msgstr "ユーザのホームディレクトリに対する認証情報の確認には認証が必要です。"
#: src/home/org.freedesktop.home1.policy:43
msgid "Update a home"
msgstr "ホームディレクトリの更新"
#: src/home/org.freedesktop.home1.policy:44
msgid "Authentication is required for updating a user's home."
msgstr "ユーザのホームディレクトリの更新には認証が必要です。"
#: src/home/org.freedesktop.home1.policy:53
msgid "Resize a home"
msgstr "ホームディレクトリのサイズ変更"
#: src/home/org.freedesktop.home1.policy:54
msgid "Authentication is required for resizing a user's home."
msgstr "ユーザのホームディレクトリのサイズ変更には認証が必要です。"
#: src/home/org.freedesktop.home1.policy:63
msgid "Change password of a home"
msgstr "ホームディレクトリのパスワード変更"
#: src/home/org.freedesktop.home1.policy:64
msgid "Authentication is required for changing the password of a user's home."
msgstr "ユーザのホームディレクトリのパスワードを変更するには認証が必要です。"
#: src/hostname/org.freedesktop.hostname1.policy:20 #: src/hostname/org.freedesktop.hostname1.policy:20
msgid "Set host name" msgid "Set host name"
msgstr "ホスト名の設定" msgstr "ホスト名の設定"
@ -530,14 +481,6 @@ msgstr "全ユーザへのメッセージの設定"
msgid "Authentication is required to set a wall message" msgid "Authentication is required to set a wall message"
msgstr "全ユーザへのメッセージを設定するには認証が必要です。" msgstr "全ユーザへのメッセージを設定するには認証が必要です。"
#: src/login/org.freedesktop.login1.policy:395
msgid "Change Session"
msgstr "セッションの変更"
#: src/login/org.freedesktop.login1.policy:396
msgid "Authentication is required to change the virtual terminal."
msgstr "仮想ターミナルを変更するには認証が必要です。"
#: src/machine/org.freedesktop.machine1.policy:22 #: src/machine/org.freedesktop.machine1.policy:22
msgid "Log into a local container" msgid "Log into a local container"
msgstr "ローカルなコンテナへログイン" msgstr "ローカルなコンテナへログイン"
@ -710,30 +653,6 @@ msgstr "DNSの設定を破棄"
msgid "Authentication is required to reset DNS settings." msgid "Authentication is required to reset DNS settings."
msgstr "DNSの設定を破棄するには認証が必要です。" msgstr "DNSの設定を破棄するには認証が必要です。"
#: src/network/org.freedesktop.network1.policy:143
msgid "Renew dynamic addresses"
msgstr "動的アドレスの更新"
#: src/network/org.freedesktop.network1.policy:144
msgid "Authentication is required to renew dynamic addresses."
msgstr "動的アドレスの更新には認証が必要です。"
#: src/network/org.freedesktop.network1.policy:154
msgid "Reload network settings"
msgstr "ネットワークの設定の再読み込み"
#: src/network/org.freedesktop.network1.policy:155
msgid "Authentication is required to reload network settings."
msgstr "ネットワークの設定を再読み込みするには認証が必要です。"
#: src/network/org.freedesktop.network1.policy:165
msgid "Reconfigure network interface"
msgstr "ネットワークインターフェイスの再設定"
#: src/network/org.freedesktop.network1.policy:166
msgid "Authentication is required to reconfigure network interface."
msgstr "ネットワークインターフェイスの再設定には認証が必要です。"
#: src/portable/org.freedesktop.portable1.policy:13 #: src/portable/org.freedesktop.portable1.policy:13
msgid "Inspect a portable service image" msgid "Inspect a portable service image"
msgstr "ポータブルサービスイメージの読み込み" msgstr "ポータブルサービスイメージの読み込み"
@ -822,37 +741,37 @@ msgid ""
"shall be enabled." "shall be enabled."
msgstr "ネットワーク経由の時刻同期を有効もしくは無効にするには認証が必要です。" msgstr "ネットワーク経由の時刻同期を有効もしくは無効にするには認証が必要です。"
#: src/core/dbus-unit.c:355 #: src/core/dbus-unit.c:354
msgid "Authentication is required to start '$(unit)'." msgid "Authentication is required to start '$(unit)'."
msgstr "'$(unit)'を開始するには認証が必要です。" msgstr "'$(unit)'を開始するには認証が必要です。"
#: src/core/dbus-unit.c:356 #: src/core/dbus-unit.c:355
msgid "Authentication is required to stop '$(unit)'." msgid "Authentication is required to stop '$(unit)'."
msgstr "'$(unit)'を停止するには認証が必要です。" msgstr "'$(unit)'を停止するには認証が必要です。"
#: src/core/dbus-unit.c:357 #: src/core/dbus-unit.c:356
msgid "Authentication is required to reload '$(unit)'." msgid "Authentication is required to reload '$(unit)'."
msgstr "'$(unit)'を再読込するには認証が必要です。" msgstr "'$(unit)'を再読込するには認証が必要です。"
#: src/core/dbus-unit.c:358 src/core/dbus-unit.c:359 #: src/core/dbus-unit.c:357 src/core/dbus-unit.c:358
msgid "Authentication is required to restart '$(unit)'." msgid "Authentication is required to restart '$(unit)'."
msgstr "'$(unit)'を再起動するには認証が必要です。" msgstr "'$(unit)'を再起動するには認証が必要です。"
#: src/core/dbus-unit.c:531 #: src/core/dbus-unit.c:530
msgid "" msgid ""
"Authentication is required to send a UNIX signal to the processes of " "Authentication is required to send a UNIX signal to the processes of "
"'$(unit)'." "'$(unit)'."
msgstr "'$(unit)'のプロセスにUNIXシグナルを送るには認証が必要です。" msgstr "'$(unit)'のプロセスにUNIXシグナルを送るには認証が必要です。"
#: src/core/dbus-unit.c:562 #: src/core/dbus-unit.c:561
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'." msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
msgstr "'$(unit)'の「失敗」状態をリセットするには認証が必要です。" msgstr "'$(unit)'の「失敗」状態をリセットするには認証が必要です。"
#: src/core/dbus-unit.c:595 #: src/core/dbus-unit.c:594
msgid "Authentication is required to set properties on '$(unit)'." msgid "Authentication is required to set properties on '$(unit)'."
msgstr "'$(unit)'のプロパティを設定するには認証が必要です。" msgstr "'$(unit)'のプロパティを設定するには認証が必要です。"
#: src/core/dbus-unit.c:704 #: src/core/dbus-unit.c:703
msgid "" msgid ""
"Authentication is required to delete files and directories associated with " "Authentication is required to delete files and directories associated with "
"'$(unit)'." "'$(unit)'."

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: systemd\n" "Project-Id-Version: systemd\n"
"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n" "Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
"POT-Creation-Date: 2020-01-30 15:31+0000\n" "POT-Creation-Date: 2020-01-29 16:25+0000\n"
"PO-Revision-Date: 2020-02-02 13:20+0100\n" "PO-Revision-Date: 2020-01-29 17:28+0100\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n" "Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <trans-pl@lists.fedoraproject.org>\n" "Language-Team: Polish <trans-pl@lists.fedoraproject.org>\n"
"Language: pl\n" "Language: pl\n"
@ -69,63 +69,6 @@ msgstr "Ponowne wczytanie stanu systemd"
msgid "Authentication is required to reload the systemd state." msgid "Authentication is required to reload the systemd state."
msgstr "Wymagane jest uwierzytelnienie, aby ponownie wczytać stan systemd." msgstr "Wymagane jest uwierzytelnienie, aby ponownie wczytać stan systemd."
#: src/home/org.freedesktop.home1.policy:13
msgid "Create a home"
msgstr "Utworzenie katalogu domowego"
#: src/home/org.freedesktop.home1.policy:14
msgid "Authentication is required for creating a user's home."
msgstr ""
"Wymagane jest uwierzytelnienie, aby utworzyć katalog domowy użytkownika."
#: src/home/org.freedesktop.home1.policy:23
msgid "Remove a home"
msgstr "Usunięcie katalogu domowego"
#: src/home/org.freedesktop.home1.policy:24
msgid "Authentication is required for removing a user's home."
msgstr "Wymagane jest uwierzytelnienie, aby usunąć katalog domowy użytkownika."
#: src/home/org.freedesktop.home1.policy:33
msgid "Check credentials of a home"
msgstr "Sprawdzenie danych uwierzytelniających katalogu domowego"
#: src/home/org.freedesktop.home1.policy:34
msgid ""
"Authentication is required for checking credentials against a user's home."
msgstr ""
"Wymagane jest uwierzytelnienie, aby sprawdzić dane uwierzytelniające "
"katalogu domowego użytkownika."
#: src/home/org.freedesktop.home1.policy:43
msgid "Update a home"
msgstr "Aktualizacja katalogu domowego"
#: src/home/org.freedesktop.home1.policy:44
msgid "Authentication is required for updating a user's home."
msgstr ""
"Wymagane jest uwierzytelnienie, aby zaktualizować katalog domowy użytkownika."
#: src/home/org.freedesktop.home1.policy:53
msgid "Resize a home"
msgstr "Zmiana rozmiaru katalogu domowego"
#: src/home/org.freedesktop.home1.policy:54
msgid "Authentication is required for resizing a user's home."
msgstr ""
"Wymagane jest uwierzytelnienie, aby zmienić rozmiar katalogu domowego "
"użytkownika."
#: src/home/org.freedesktop.home1.policy:63
msgid "Change password of a home"
msgstr "Zmiana hasła katalogu domowego"
#: src/home/org.freedesktop.home1.policy:64
msgid "Authentication is required for changing the password of a user's home."
msgstr ""
"Wymagane jest uwierzytelnienie, aby zmienić hasło katalogu domowego "
"użytkownika."
#: src/hostname/org.freedesktop.hostname1.policy:20 #: src/hostname/org.freedesktop.hostname1.policy:20
msgid "Set host name" msgid "Set host name"
msgstr "Ustawienie nazwy komputera" msgstr "Ustawienie nazwy komputera"

View File

@ -5,17 +5,30 @@
#include <net/if.h> #include <net/if.h>
#include <stdbool.h> #include <stdbool.h>
#include "macro.h" #if SIZEOF_PID_T == 4
# define PID_PRI PRIi32
assert_cc(sizeof(pid_t) == sizeof(int32_t)); #elif SIZEOF_PID_T == 2
#define PID_PRI PRIi32 # define PID_PRI PRIi16
#else
# error Unknown pid_t size
#endif
#define PID_FMT "%" PID_PRI #define PID_FMT "%" PID_PRI
assert_cc(sizeof(uid_t) == sizeof(uint32_t)); #if SIZEOF_UID_T == 4
#define UID_FMT "%" PRIu32 # define UID_FMT "%" PRIu32
#elif SIZEOF_UID_T == 2
# define UID_FMT "%" PRIu16
#else
# error Unknown uid_t size
#endif
assert_cc(sizeof(gid_t) == sizeof(uint32_t)); #if SIZEOF_GID_T == 4
#define GID_FMT "%" PRIu32 # define GID_FMT "%" PRIu32
#elif SIZEOF_GID_T == 2
# define GID_FMT "%" PRIu16
#else
# error Unknown gid_t size
#endif
#if SIZEOF_TIME_T == 8 #if SIZEOF_TIME_T == 8
# define PRI_TIME PRIi64 # define PRI_TIME PRIi64

View File

@ -172,6 +172,7 @@ int fork_agent(const char *name, const int except[], size_t n_except, pid_t *pid
int set_oom_score_adjust(int value); int set_oom_score_adjust(int value);
#if SIZEOF_PID_T == 4
/* The highest possibly (theoretic) pid_t value on this architecture. */ /* The highest possibly (theoretic) pid_t value on this architecture. */
#define PID_T_MAX ((pid_t) INT32_MAX) #define PID_T_MAX ((pid_t) INT32_MAX)
/* The maximum number of concurrent processes Linux allows on this architecture, as well as the highest valid PID value /* The maximum number of concurrent processes Linux allows on this architecture, as well as the highest valid PID value
@ -181,6 +182,12 @@ int set_oom_score_adjust(int value);
* these values are documented in proc(5) we feel quite confident that they are stable enough for the near future at * these values are documented in proc(5) we feel quite confident that they are stable enough for the near future at
* least to define them here too. */ * least to define them here too. */
#define TASKS_MAX 4194303U #define TASKS_MAX 4194303U
#elif SIZEOF_PID_T == 2
#define PID_T_MAX ((pid_t) INT16_MAX)
#define TASKS_MAX 32767U
#else
#error "Unknown pid_t size"
#endif
assert_cc(TASKS_MAX <= (unsigned long) PID_T_MAX); assert_cc(TASKS_MAX <= (unsigned long) PID_T_MAX);

View File

@ -62,29 +62,6 @@ int parse_uid(const char *s, uid_t *ret) {
return 0; return 0;
} }
int parse_uid_range(const char *s, uid_t *ret_lower, uid_t *ret_upper) {
uint32_t u, l;
int r;
assert(s);
assert(ret_lower);
assert(ret_upper);
r = parse_range(s, &l, &u);
if (r < 0)
return r;
if (l > u)
return -EINVAL;
if (!uid_is_valid(l) || !uid_is_valid(u))
return -ENXIO;
*ret_lower = l;
*ret_upper = u;
return 0;
}
char* getlogname_malloc(void) { char* getlogname_malloc(void) {
uid_t uid; uid_t uid;
struct stat st; struct stat st;

View File

@ -19,7 +19,6 @@ static inline bool gid_is_valid(gid_t gid) {
} }
int parse_uid(const char *s, uid_t* ret_uid); int parse_uid(const char *s, uid_t* ret_uid);
int parse_uid_range(const char *s, uid_t *ret_lower, uid_t *ret_upper);
static inline int parse_gid(const char *s, gid_t *ret_gid) { static inline int parse_gid(const char *s, gid_t *ret_gid) {
return parse_uid(s, (uid_t*) ret_gid); return parse_uid(s, (uid_t*) ret_gid);

View File

@ -1893,8 +1893,8 @@ static VOID config_entry_add_linux(
UINTN bufsize = sizeof buf; UINTN bufsize = sizeof buf;
EFI_FILE_INFO *f; EFI_FILE_INFO *f;
CHAR8 *sections[] = { CHAR8 *sections[] = {
(CHAR8 *)".osrel", (UINT8 *)".osrel",
(CHAR8 *)".cmdline", (UINT8 *)".cmdline",
NULL NULL
}; };
UINTN offs[ELEMENTSOF(sections)-1] = {}; UINTN offs[ELEMENTSOF(sections)-1] = {};

View File

@ -22,10 +22,10 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
UINTN size; UINTN size;
BOOLEAN secure = FALSE; BOOLEAN secure = FALSE;
CHAR8 *sections[] = { CHAR8 *sections[] = {
(CHAR8 *)".cmdline", (UINT8 *)".cmdline",
(CHAR8 *)".linux", (UINT8 *)".linux",
(CHAR8 *)".initrd", (UINT8 *)".initrd",
(CHAR8 *)".splash", (UINT8 *)".splash",
NULL NULL
}; };
UINTN addrs[ELEMENTSOF(sections)-1] = {}; UINTN addrs[ELEMENTSOF(sections)-1] = {};

View File

@ -189,7 +189,7 @@ static INTN utf8_to_16(CHAR8 *stra, CHAR16 *c) {
UINTN len; UINTN len;
UINTN i; UINTN i;
if (!(stra[0] & 0x80)) if (stra[0] < 0x80)
len = 1; len = 1;
else if ((stra[0] & 0xe0) == 0xc0) else if ((stra[0] & 0xe0) == 0xc0)
len = 2; len = 2;

View File

@ -1158,7 +1158,7 @@ static int introspect(int argc, char **argv, void *userdata) {
} }
static int message_dump(sd_bus_message *m, FILE *f) { static int message_dump(sd_bus_message *m, FILE *f) {
return sd_bus_message_dump(m, f, SD_BUS_MESSAGE_DUMP_WITH_HEADER); return bus_message_dump(m, f, BUS_MESSAGE_DUMP_WITH_HEADER);
} }
static int message_pcap(sd_bus_message *m, FILE *f) { static int message_pcap(sd_bus_message *m, FILE *f) {
@ -2052,7 +2052,7 @@ static int call(int argc, char **argv, void *userdata) {
} else if (arg_verbose) { } else if (arg_verbose) {
(void) pager_open(arg_pager_flags); (void) pager_open(arg_pager_flags);
r = sd_bus_message_dump(reply, stdout, 0); r = bus_message_dump(reply, stdout, 0);
if (r < 0) if (r < 0)
return r; return r;
} else { } else {
@ -2158,7 +2158,7 @@ static int get_property(int argc, char **argv, void *userdata) {
} else if (arg_verbose) { } else if (arg_verbose) {
(void) pager_open(arg_pager_flags); (void) pager_open(arg_pager_flags);
r = sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY); r = bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_SUBTREE_ONLY);
if (r < 0) if (r < 0)
return r; return r;
} else { } else {

View File

@ -1663,7 +1663,7 @@ static int method_lookup_dynamic_user_by_uid(sd_bus_message *message, void *user
assert(message); assert(message);
assert(m); assert(m);
assert_cc(sizeof(uid_t) == sizeof(uint32_t)); assert_cc(sizeof(uid) == sizeof(uint32_t));
r = sd_bus_message_read_basic(message, 'u', &uid); r = sd_bus_message_read_basic(message, 'u', &uid);
if (r < 0) if (r < 0)
return r; return r;

View File

@ -36,7 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (getenv_bool("SYSTEMD_FUZZ_OUTPUT") <= 0) if (getenv_bool("SYSTEMD_FUZZ_OUTPUT") <= 0)
assert_se(g = open_memstream_unlocked(&out, &out_size)); assert_se(g = open_memstream_unlocked(&out, &out_size));
sd_bus_message_dump(m, g ?: stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(m, g ?: stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
r = sd_bus_message_rewind(m, true); r = sd_bus_message_rewind(m, true);
assert_se(r >= 0); assert_se(r >= 0);

View File

@ -675,7 +675,8 @@ static int client_timeout_resend_expire(sd_event_source *s, uint64_t usec, void
} }
static usec_t client_timeout_compute_random(usec_t val) { static usec_t client_timeout_compute_random(usec_t val) {
return val - (random_u32() % USEC_PER_SEC) * val / 10 / USEC_PER_SEC; return val - val / 10 +
(random_u32() % (2 * USEC_PER_SEC)) * val / 10 / USEC_PER_SEC;
} }
static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userdata) { static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userdata) {
@ -685,6 +686,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda
usec_t max_retransmit_duration = 0; usec_t max_retransmit_duration = 0;
uint8_t max_retransmit_count = 0; uint8_t max_retransmit_count = 0;
char time_string[FORMAT_TIMESPAN_MAX]; char time_string[FORMAT_TIMESPAN_MAX];
uint32_t expire = 0;
assert(s); assert(s);
assert(client); assert(client);
@ -733,9 +735,8 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda
max_retransmit_time = DHCP6_REB_MAX_RT; max_retransmit_time = DHCP6_REB_MAX_RT;
if (event_source_is_enabled(client->timeout_resend_expire) <= 0) { if (event_source_is_enabled(client->timeout_resend_expire) <= 0) {
uint32_t expire = 0; r = dhcp6_lease_ia_rebind_expire(&client->lease->ia,
&expire);
r = dhcp6_lease_ia_rebind_expire(&client->lease->ia, &expire);
if (r < 0) { if (r < 0) {
client_stop(client, r); client_stop(client, r);
return 0; return 0;
@ -750,7 +751,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda
return 0; return 0;
} }
if (max_retransmit_count > 0 && if (max_retransmit_count &&
client->retransmit_count >= max_retransmit_count) { client->retransmit_count >= max_retransmit_count) {
client_stop(client, SD_DHCP6_CLIENT_EVENT_RETRANS_MAX); client_stop(client, SD_DHCP6_CLIENT_EVENT_RETRANS_MAX);
return 0; return 0;
@ -764,7 +765,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda
if (r >= 0) if (r >= 0)
client->retransmit_count++; client->retransmit_count++;
if (client->retransmit_time == 0) { if (!client->retransmit_time) {
client->retransmit_time = client->retransmit_time =
client_timeout_compute_random(init_retransmit_time); client_timeout_compute_random(init_retransmit_time);
@ -772,7 +773,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda
client->retransmit_time += init_retransmit_time / 10; client->retransmit_time += init_retransmit_time / 10;
} else { } else {
if (max_retransmit_time > 0 && if (max_retransmit_time &&
client->retransmit_time > max_retransmit_time / 2) client->retransmit_time > max_retransmit_time / 2)
client->retransmit_time = client_timeout_compute_random(max_retransmit_time); client->retransmit_time = client_timeout_compute_random(max_retransmit_time);
else else
@ -790,7 +791,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userda
if (r < 0) if (r < 0)
goto error; goto error;
if (max_retransmit_duration > 0 && event_source_is_enabled(client->timeout_resend_expire) <= 0) { if (max_retransmit_duration && event_source_is_enabled(client->timeout_resend_expire) <= 0) {
log_dhcp6_client(client, "Max retransmission duration %"PRIu64" secs", log_dhcp6_client(client, "Max retransmission duration %"PRIu64" secs",
max_retransmit_duration / USEC_PER_SEC); max_retransmit_duration / USEC_PER_SEC);

View File

@ -685,7 +685,6 @@ global:
LIBSYSTEMD_245 { LIBSYSTEMD_245 {
global: global:
sd_bus_message_dump;
sd_bus_message_sensitive; sd_bus_message_sensitive;
sd_event_add_child_pidfd; sd_event_add_child_pidfd;
sd_event_source_get_child_pidfd; sd_event_source_get_child_pidfd;

View File

@ -18,23 +18,23 @@
#include "terminal-util.h" #include "terminal-util.h"
#include "util.h" #include "util.h"
static char *indent(unsigned level, uint64_t flags) { static char *indent(unsigned level, unsigned flags) {
char *p; char *p;
unsigned n, i = 0; unsigned n, i = 0;
n = 0; n = 0;
if (flags & SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY && level > 0) if (flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY && level > 0)
level -= 1; level -= 1;
if (flags & SD_BUS_MESSAGE_DUMP_WITH_HEADER) if (flags & BUS_MESSAGE_DUMP_WITH_HEADER)
n += 2; n += 2;
p = new(char, n + level*8 + 1); p = new(char, n + level*8 + 1);
if (!p) if (!p)
return NULL; return NULL;
if (flags & SD_BUS_MESSAGE_DUMP_WITH_HEADER) { if (flags & BUS_MESSAGE_DUMP_WITH_HEADER) {
p[i++] = ' '; p[i++] = ' ';
p[i++] = ' '; p[i++] = ' ';
} }
@ -45,7 +45,7 @@ static char *indent(unsigned level, uint64_t flags) {
return p; return p;
} }
_public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) { int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags) {
unsigned level = 1; unsigned level = 1;
int r; int r;
@ -54,7 +54,7 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) {
if (!f) if (!f)
f = stdout; f = stdout;
if (flags & SD_BUS_MESSAGE_DUMP_WITH_HEADER) { if (flags & BUS_MESSAGE_DUMP_WITH_HEADER) {
fprintf(f, fprintf(f,
"%s%s%s Type=%s%s%s Endian=%c Flags=%u Version=%u Priority=%"PRIi64, "%s%s%s Type=%s%s%s Endian=%c Flags=%u Version=%u Priority=%"PRIi64,
m->header->type == SD_BUS_MESSAGE_METHOD_ERROR ? ansi_highlight_red() : m->header->type == SD_BUS_MESSAGE_METHOD_ERROR ? ansi_highlight_red() :
@ -118,11 +118,11 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) {
bus_creds_dump(&m->creds, f, true); bus_creds_dump(&m->creds, f, true);
} }
r = sd_bus_message_rewind(m, !(flags & SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY)); r = sd_bus_message_rewind(m, !(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY));
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to rewind: %m"); return log_error_errno(r, "Failed to rewind: %m");
if (!(flags & SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY)) { if (!(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY)) {
_cleanup_free_ char *prefix = NULL; _cleanup_free_ char *prefix = NULL;
prefix = indent(0, flags); prefix = indent(0, flags);
@ -259,7 +259,7 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) {
} }
} }
if (!(flags & SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY)) { if (!(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY)) {
_cleanup_free_ char *prefix = NULL; _cleanup_free_ char *prefix = NULL;
prefix = indent(0, flags); prefix = indent(0, flags);

View File

@ -6,6 +6,13 @@
#include "sd-bus.h" #include "sd-bus.h"
enum {
BUS_MESSAGE_DUMP_WITH_HEADER = 1 << 0,
BUS_MESSAGE_DUMP_SUBTREE_ONLY = 1 << 1,
};
int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags);
int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse); int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse);
int bus_pcap_header(size_t snaplen, FILE *f); int bus_pcap_header(size_t snaplen, FILE *f);

View File

@ -145,7 +145,7 @@ static int server(sd_bus *bus) {
strna(sd_bus_message_get_member(m)), strna(sd_bus_message_get_member(m)),
pid, pid,
strna(label)); strna(label));
/* sd_bus_message_dump(m); */ /* bus_message_dump(m); */
/* sd_bus_message_rewind(m, true); */ /* sd_bus_message_rewind(m, true); */
if (sd_bus_message_is_method_call(m, "org.freedesktop.systemd.test", "LowerCase")) { if (sd_bus_message_is_method_call(m, "org.freedesktop.systemd.test", "LowerCase")) {

View File

@ -175,7 +175,7 @@ static int test_marshal(void) {
} }
#endif #endif
assert_se(sd_bus_message_dump(m, NULL, SD_BUS_MESSAGE_DUMP_WITH_HEADER) >= 0); assert_se(bus_message_dump(m, NULL, BUS_MESSAGE_DUMP_WITH_HEADER) >= 0);
assert_se(bus_message_get_blob(m, &blob, &sz) >= 0); assert_se(bus_message_get_blob(m, &blob, &sz) >= 0);
@ -196,7 +196,7 @@ static int test_marshal(void) {
assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, &n) >= 0); assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, &n) >= 0);
blob = NULL; blob = NULL;
assert_se(sd_bus_message_dump(n, NULL, SD_BUS_MESSAGE_DUMP_WITH_HEADER) >= 0); assert_se(bus_message_dump(n, NULL, BUS_MESSAGE_DUMP_WITH_HEADER) >= 0);
m = sd_bus_message_unref(m); m = sd_bus_message_unref(m);
@ -205,7 +205,7 @@ static int test_marshal(void) {
assert_se(sd_bus_message_append(m, "as", 0) >= 0); assert_se(sd_bus_message_append(m, "as", 0) >= 0);
assert_se(sd_bus_message_seal(m, 4712, 0) >= 0); assert_se(sd_bus_message_seal(m, 4712, 0) >= 0);
assert_se(sd_bus_message_dump(m, NULL, SD_BUS_MESSAGE_DUMP_WITH_HEADER) >= 0); assert_se(bus_message_dump(m, NULL, BUS_MESSAGE_DUMP_WITH_HEADER) >= 0);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -188,10 +188,10 @@ int main(int argc, char *argv[]) {
r = sd_bus_message_seal(m, 4711, 0); r = sd_bus_message_seal(m, 4711, 0);
assert_se(r >= 0); assert_se(r >= 0);
sd_bus_message_dump(m, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
ms = open_memstream_unlocked(&first, &first_size); ms = open_memstream_unlocked(&first, &first_size);
sd_bus_message_dump(m, ms, 0); bus_message_dump(m, ms, 0);
fflush(ms); fflush(ms);
assert_se(!ferror(ms)); assert_se(!ferror(ms));
@ -244,11 +244,11 @@ int main(int argc, char *argv[]) {
r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, &m); r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, &m);
assert_se(r >= 0); assert_se(r >= 0);
sd_bus_message_dump(m, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
fclose(ms); fclose(ms);
ms = open_memstream_unlocked(&second, &second_size); ms = open_memstream_unlocked(&second, &second_size);
sd_bus_message_dump(m, ms, 0); bus_message_dump(m, ms, 0);
fflush(ms); fflush(ms);
assert_se(!ferror(ms)); assert_se(!ferror(ms));
assert_se(first_size == second_size); assert_se(first_size == second_size);
@ -354,7 +354,7 @@ int main(int argc, char *argv[]) {
fclose(ms); fclose(ms);
ms = open_memstream_unlocked(&third, &third_size); ms = open_memstream_unlocked(&third, &third_size);
sd_bus_message_dump(copy, ms, 0); bus_message_dump(copy, ms, 0);
fflush(ms); fflush(ms);
assert_se(!ferror(ms)); assert_se(!ferror(ms));

View File

@ -399,7 +399,7 @@ static int client(struct context *c) {
r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.DBus.Properties", "GetAll", &error, &reply, "s", ""); r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.DBus.Properties", "GetAll", &error, &reply, "s", "");
assert_se(r >= 0); assert_se(r >= 0);
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -417,7 +417,7 @@ static int client(struct context *c) {
r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/value", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects", &error, &reply, ""); r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/value", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects", &error, &reply, "");
assert_se(r >= 0); assert_se(r >= 0);
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -429,7 +429,7 @@ static int client(struct context *c) {
assert_se(r > 0); assert_se(r > 0);
assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.Properties", "PropertiesChanged")); assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.Properties", "PropertiesChanged"));
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -441,7 +441,7 @@ static int client(struct context *c) {
assert_se(r > 0); assert_se(r > 0);
assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.Properties", "PropertiesChanged")); assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.Properties", "PropertiesChanged"));
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -453,7 +453,7 @@ static int client(struct context *c) {
assert_se(r > 0); assert_se(r > 0);
assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesAdded")); assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesAdded"));
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -465,7 +465,7 @@ static int client(struct context *c) {
assert_se(r > 0); assert_se(r > 0);
assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved")); assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved"));
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -477,7 +477,7 @@ static int client(struct context *c) {
assert_se(r > 0); assert_se(r > 0);
assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesAdded")); assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesAdded"));
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;
@ -489,7 +489,7 @@ static int client(struct context *c) {
assert_se(r > 0); assert_se(r > 0);
assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved")); assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved"));
sd_bus_message_dump(reply, stdout, SD_BUS_MESSAGE_DUMP_WITH_HEADER); bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
sd_bus_message_unref(reply); sd_bus_message_unref(reply);
reply = NULL; reply = NULL;

View File

@ -1138,12 +1138,6 @@ int manager_rtnl_process_rule(sd_netlink *rtnl, sd_netlink_message *message, voi
return 0; return 0;
} }
r = sd_netlink_message_read(message, FRA_UID_RANGE, sizeof(tmp->uid_range), &tmp->uid_range);
if (r < 0 && r != -ENODATA) {
log_warning_errno(r, "rtnl: could not get FRA_UID_RANGE attribute, ignoring: %m");
return 0;
}
(void) routing_policy_rule_get(m, tmp, &rule); (void) routing_policy_rule_get(m, tmp, &rule);
if (DEBUG_LOGGING) { if (DEBUG_LOGGING) {

View File

@ -130,7 +130,6 @@ RoutingPolicyRule.SourcePort, config_parse_routing_policy_rule_port_ra
RoutingPolicyRule.DestinationPort, config_parse_routing_policy_rule_port_range, 0, 0 RoutingPolicyRule.DestinationPort, config_parse_routing_policy_rule_port_range, 0, 0
RoutingPolicyRule.InvertRule, config_parse_routing_policy_rule_invert, 0, 0 RoutingPolicyRule.InvertRule, config_parse_routing_policy_rule_invert, 0, 0
RoutingPolicyRule.Family, config_parse_routing_policy_rule_family, 0, 0 RoutingPolicyRule.Family, config_parse_routing_policy_rule_family, 0, 0
RoutingPolicyRule.User, config_parse_routing_policy_rule_uid_range, 0, 0
Route.Gateway, config_parse_gateway, 0, 0 Route.Gateway, config_parse_gateway, 0, 0
Route.Destination, config_parse_destination, 0, 0 Route.Destination, config_parse_destination, 0, 0
Route.Source, config_parse_destination, 0, 0 Route.Source, config_parse_destination, 0, 0

View File

@ -7,7 +7,6 @@
#include "alloc-util.h" #include "alloc-util.h"
#include "conf-parser.h" #include "conf-parser.h"
#include "fileio.h" #include "fileio.h"
#include "format-util.h"
#include "ip-protocol-list.h" #include "ip-protocol-list.h"
#include "networkd-routing-policy-rule.h" #include "networkd-routing-policy-rule.h"
#include "netlink-util.h" #include "netlink-util.h"
@ -17,7 +16,6 @@
#include "socket-util.h" #include "socket-util.h"
#include "string-util.h" #include "string-util.h"
#include "strv.h" #include "strv.h"
#include "user-util.h"
int routing_policy_rule_new(RoutingPolicyRule **ret) { int routing_policy_rule_new(RoutingPolicyRule **ret) {
RoutingPolicyRule *rule; RoutingPolicyRule *rule;
@ -28,8 +26,6 @@ int routing_policy_rule_new(RoutingPolicyRule **ret) {
*rule = (RoutingPolicyRule) { *rule = (RoutingPolicyRule) {
.table = RT_TABLE_MAIN, .table = RT_TABLE_MAIN,
.uid_range.start = UID_INVALID,
.uid_range.end = UID_INVALID,
}; };
*ret = rule; *ret = rule;
@ -97,7 +93,6 @@ static int routing_policy_rule_copy(RoutingPolicyRule *dest, RoutingPolicyRule *
dest->protocol = src->protocol; dest->protocol = src->protocol;
dest->sport = src->sport; dest->sport = src->sport;
dest->dport = src->dport; dest->dport = src->dport;
dest->uid_range = src->uid_range;
return 0; return 0;
} }
@ -127,7 +122,6 @@ static void routing_policy_rule_hash_func(const RoutingPolicyRule *rule, struct
siphash24_compress(&rule->protocol, sizeof(rule->protocol), state); siphash24_compress(&rule->protocol, sizeof(rule->protocol), state);
siphash24_compress(&rule->sport, sizeof(rule->sport), state); siphash24_compress(&rule->sport, sizeof(rule->sport), state);
siphash24_compress(&rule->dport, sizeof(rule->dport), state); siphash24_compress(&rule->dport, sizeof(rule->dport), state);
siphash24_compress(&rule->uid_range, sizeof(rule->uid_range), state);
if (rule->iif) if (rule->iif)
siphash24_compress(rule->iif, strlen(rule->iif), state); siphash24_compress(rule->iif, strlen(rule->iif), state);
@ -204,10 +198,6 @@ static int routing_policy_rule_compare_func(const RoutingPolicyRule *a, const Ro
if (r != 0) if (r != 0)
return r; return r;
r = memcmp(&a->uid_range, &b->uid_range, sizeof(a->uid_range));
if (r != 0)
return r;
r = strcmp_ptr(a->iif, b->iif); r = strcmp_ptr(a->iif, b->iif);
if (r != 0) if (r != 0)
return r; return r;
@ -564,12 +554,6 @@ int routing_policy_rule_configure(RoutingPolicyRule *rule, Link *link, link_netl
return log_link_error_errno(link, r, "Could not append FRA_DPORT_RANGE attribute: %m"); return log_link_error_errno(link, r, "Could not append FRA_DPORT_RANGE attribute: %m");
} }
if (rule->uid_range.start != UID_INVALID && rule->uid_range.end != UID_INVALID) {
r = sd_netlink_message_append_data(m, FRA_UID_RANGE, &rule->uid_range, sizeof(rule->uid_range));
if (r < 0)
return log_link_error_errno(link, r, "Could not append FRA_UID_RANGE attribute: %m");
}
if (rule->invert_rule) { if (rule->invert_rule) {
r = sd_rtnl_message_routing_policy_rule_set_flags(m, FIB_RULE_INVERT); r = sd_rtnl_message_routing_policy_rule_set_flags(m, FIB_RULE_INVERT);
if (r < 0) if (r < 0)
@ -1072,51 +1056,6 @@ int config_parse_routing_policy_rule_family(
return 0; return 0;
} }
int config_parse_routing_policy_rule_uid_range(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
_cleanup_(routing_policy_rule_free_or_set_invalidp) RoutingPolicyRule *n = NULL;
Network *network = userdata;
uid_t start, end;
int r;
assert(filename);
assert(section);
assert(lvalue);
assert(rvalue);
assert(data);
r = routing_policy_rule_new_static(network, filename, section_line, &n);
if (r < 0)
return r;
r = get_user_creds(&rvalue, &start, NULL, NULL, NULL, 0);
if (r >= 0)
end = start;
else {
r = parse_uid_range(rvalue, &start, &end);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r,
"Invalid uid or uid range '%s', ignoring: %m", rvalue);
return 0;
}
}
n->uid_range.start = start;
n->uid_range.end = end;
n = NULL;
return 0;
}
static int routing_policy_rule_read_full_file(const char *state_file, char **ret) { static int routing_policy_rule_read_full_file(const char *state_file, char **ret) {
_cleanup_free_ char *s = NULL; _cleanup_free_ char *s = NULL;
size_t size; size_t size;
@ -1231,14 +1170,6 @@ int routing_policy_serialize_rules(Set *rules, FILE *f) {
space = true; space = true;
} }
if (rule->uid_range.start != UID_INVALID && rule->uid_range.end != UID_INVALID) {
assert_cc(sizeof(uid_t) == sizeof(uint32_t));
fprintf(f, "%suidrange="UID_FMT"-"UID_FMT,
space ? " " : "",
rule->uid_range.start, rule->uid_range.end);
space = true;
}
fprintf(f, "%stable=%"PRIu32 "\n", fprintf(f, "%stable=%"PRIu32 "\n",
space ? " " : "", space ? " " : "",
rule->table); rule->table);
@ -1363,7 +1294,7 @@ int routing_policy_load_rules(const char *state_file, Set **rules) {
r = parse_ip_port_range(b, &low, &high); r = parse_ip_port_range(b, &low, &high);
if (r < 0) { if (r < 0) {
log_error_errno(r, "Invalid routing policy rule source port range, ignoring assignment: '%s'", b); log_error_errno(r, "Invalid routing policy rule source port range, ignoring assignment:'%s'", b);
continue; continue;
} }
@ -1374,24 +1305,12 @@ int routing_policy_load_rules(const char *state_file, Set **rules) {
r = parse_ip_port_range(b, &low, &high); r = parse_ip_port_range(b, &low, &high);
if (r < 0) { if (r < 0) {
log_error_errno(r, "Invalid routing policy rule destination port range, ignoring assignment: '%s'", b); log_error_errno(r, "Invalid routing policy rule destination port range, ignoring assignment:'%s'", b);
continue; continue;
} }
rule->dport.start = low; rule->dport.start = low;
rule->dport.end = high; rule->dport.end = high;
} else if (streq(a, "uidrange")) {
uid_t lower, upper;
r = parse_uid_range(b, &lower, &upper);
if (r < 0) {
log_error_errno(r, "Invalid routing policy rule uid range, ignoring assignment: '%s'", b);
continue;
}
rule->uid_range.start = lower;
rule->uid_range.end = upper;
} }
} }

View File

@ -49,7 +49,6 @@ struct RoutingPolicyRule {
struct fib_rule_port_range sport; struct fib_rule_port_range sport;
struct fib_rule_port_range dport; struct fib_rule_port_range dport;
struct fib_rule_uid_range uid_range;
LIST_FIELDS(RoutingPolicyRule, rules); LIST_FIELDS(RoutingPolicyRule, rules);
}; };
@ -80,4 +79,3 @@ CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_port_range);
CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_ip_protocol); CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_ip_protocol);
CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_invert); CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_invert);
CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_family); CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_family);
CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_uid_range);

View File

@ -19,7 +19,6 @@
#include <inttypes.h> #include <inttypes.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
@ -106,11 +105,6 @@ enum {
SD_BUS_NAME_QUEUE = 1ULL << 2 SD_BUS_NAME_QUEUE = 1ULL << 2
}; };
enum {
SD_BUS_MESSAGE_DUMP_WITH_HEADER = 1ULL << 0,
SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY = 1ULL << 1,
};
/* Callbacks */ /* Callbacks */
typedef int (*sd_bus_message_handler_t)(sd_bus_message *m, void *userdata, sd_bus_error *ret_error); typedef int (*sd_bus_message_handler_t)(sd_bus_message *m, void *userdata, sd_bus_error *ret_error);
@ -336,8 +330,6 @@ int sd_bus_message_at_end(sd_bus_message *m, int complete);
int sd_bus_message_rewind(sd_bus_message *m, int complete); int sd_bus_message_rewind(sd_bus_message *m, int complete);
int sd_bus_message_sensitive(sd_bus_message *m); int sd_bus_message_sensitive(sd_bus_message *m);
int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags);
/* Bus management */ /* Bus management */
int sd_bus_get_unique_name(sd_bus *bus, const char **unique); int sd_bus_get_unique_name(sd_bus *bus, const char **unique);

View File

@ -39,7 +39,6 @@ typedef struct Item {
ItemType type; ItemType type;
char *name; char *name;
char *group_name;
char *uid_path; char *uid_path;
char *gid_path; char *gid_path;
char *description; char *description;
@ -1086,15 +1085,18 @@ static int gid_is_ok(gid_t gid) {
return 1; return 1;
} }
static int get_gid_by_name(const char *name, gid_t *gid) { static int add_group(Item *i) {
void *z; void *z;
int r;
assert(gid); assert(i);
/* Check the database directly */ /* Check the database directly */
z = hashmap_get(database_by_groupname, name); z = hashmap_get(database_by_groupname, i->name);
if (z) { if (z) {
*gid = PTR_TO_GID(z); log_debug("Group %s already exists.", i->name);
i->gid = PTR_TO_GID(z);
i->gid_set = true;
return 0; return 0;
} }
@ -1103,30 +1105,15 @@ static int get_gid_by_name(const char *name, gid_t *gid) {
struct group *g; struct group *g;
errno = 0; errno = 0;
g = getgrnam(name); g = getgrnam(i->name);
if (g) { if (g) {
*gid = g->gr_gid; log_debug("Group %s already exists.", i->name);
i->gid = g->gr_gid;
i->gid_set = true;
return 0; return 0;
} }
if (!IN_SET(errno, 0, ENOENT)) if (!IN_SET(errno, 0, ENOENT))
return log_error_errno(errno, "Failed to check if group %s already exists: %m", name); return log_error_errno(errno, "Failed to check if group %s already exists: %m", i->name);
}
return -ENOENT;
}
static int add_group(Item *i) {
int r;
assert(i);
r = get_gid_by_name(i->name, &i->gid);
if (r != -ENOENT) {
if (r < 0)
return r;
log_debug("Group %s already exists.", i->name);
i->gid_set = true;
return 0;
} }
/* Try to use the suggested numeric gid */ /* Try to use the suggested numeric gid */
@ -1227,22 +1214,14 @@ static int process_item(Item *i) {
case ADD_USER: { case ADD_USER: {
Item *j; Item *j;
j = ordered_hashmap_get(groups, i->group_name ?: i->name); j = ordered_hashmap_get(groups, i->name);
if (j && j->todo_group) { if (j && j->todo_group) {
/* When a group with the target name is already in queue, /* When the group with the same name is already in queue,
* use the information about the group and do not create * use the information about the group and do not create
* duplicated group entry. */ * duplicated group entry. */
i->gid_set = j->gid_set; i->gid_set = j->gid_set;
i->gid = j->gid; i->gid = j->gid;
i->id_set_strict = true; i->id_set_strict = true;
} else if (i->group_name) {
/* When a group name was given instead of a GID and it's
* not in queue, then it must already exist. */
r = get_gid_by_name(i->group_name, &i->gid);
if (r < 0)
return log_error_errno(r, "Group %s not found.", i->group_name);
i->gid_set = true;
i->id_set_strict = true;
} else { } else {
r = add_group(i); r = add_group(i);
if (r < 0) if (r < 0)
@ -1265,7 +1244,6 @@ static Item* item_free(Item *i) {
return NULL; return NULL;
free(i->name); free(i->name);
free(i->group_name);
free(i->uid_path); free(i->uid_path);
free(i->gid_path); free(i->gid_path);
free(i->description); free(i->description);
@ -1582,15 +1560,10 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
_cleanup_free_ char *uid = NULL, *gid = NULL; _cleanup_free_ char *uid = NULL, *gid = NULL;
if (split_pair(resolved_id, ":", &uid, &gid) == 0) { if (split_pair(resolved_id, ":", &uid, &gid) == 0) {
r = parse_gid(gid, &i->gid); r = parse_gid(gid, &i->gid);
if (r < 0) { if (r < 0)
if (valid_user_group_name(gid)) return log_error_errno(r, "Failed to parse GID: '%s': %m", id);
i->group_name = TAKE_PTR(gid); i->gid_set = true;
else i->id_set_strict = true;
return log_error_errno(r, "Failed to parse GID: '%s': %m", id);
} else {
i->gid_set = true;
i->id_set_strict = true;
}
free_and_replace(resolved_id, uid); free_and_replace(resolved_id, uid);
} }
if (!streq(resolved_id, "-")) { if (!streq(resolved_id, "-")) {

View File

@ -572,8 +572,10 @@ static void test_pid_to_ptr(void) {
assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MAX)) == INT16_MAX); assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MAX)) == INT16_MAX);
assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MIN)) == INT16_MIN); assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MIN)) == INT16_MIN);
#if SIZEOF_PID_T >= 4
assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MAX)) == INT32_MAX); assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MAX)) == INT32_MAX);
assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MIN)) == INT32_MIN); assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MIN)) == INT32_MIN);
#endif
} }
static void test_ioprio_class_from_to_string_one(const char *val, int expected) { static void test_ioprio_class_from_to_string_one(const char *val, int expected) {

View File

@ -1,5 +0,0 @@
hoge:x:300:
baz:x:302:
yyy:x:SYSTEM_GID_MAX:
foo:x:301:
ccc:x:305:

View File

@ -1,5 +0,0 @@
foo:x:301:301::/:NOLOGIN
aaa:x:303:302::/:NOLOGIN
bbb:x:304:302::/:NOLOGIN
ccc:x:305:305::/:NOLOGIN
zzz:x:306:SYSTEM_GID_MAX::/:NOLOGIN

View File

@ -1,13 +0,0 @@
# Ensure that the semantic for the uid:groupname syntax is correct
#
#Type Name ID GECOS HOMEDIR
g hoge 300 - -
u foo 301 - -
g baz 302 - -
u aaa 303:baz - -
u bbb 304:baz - -
u ccc 305 - -
g yyy -
u zzz 306:yyy

View File

@ -1 +0,0 @@
pre:x:987:

View File

@ -1 +0,0 @@
aaa:x:SYSTEM_UID_MAX:987::/:NOLOGIN

View File

@ -1 +0,0 @@
pre:x:987:

View File

@ -1,4 +0,0 @@
# Ensure that a preexisting system group can be used as primary
#
#Type Name ID GECOS HOMEDIR
u aaa -:pre

View File

@ -23,7 +23,6 @@ preprocess() {
# get this value from config.h, however the autopkgtest fails with # get this value from config.h, however the autopkgtest fails with
# it # it
SYSTEM_UID_MAX=$(awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs) SYSTEM_UID_MAX=$(awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs)
SYSTEM_GID_MAX=$(awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs)
# we can't rely on config.h to get the nologin path, as autopkgtest # we can't rely on config.h to get the nologin path, as autopkgtest
# uses pre-compiled binaries, so extract it from the systemd-sysusers # uses pre-compiled binaries, so extract it from the systemd-sysusers
@ -31,7 +30,6 @@ preprocess() {
NOLOGIN=$(strings $(type -p systemd-sysusers) | grep nologin) NOLOGIN=$(strings $(type -p systemd-sysusers) | grep nologin)
sed -e "s/SYSTEM_UID_MAX/${SYSTEM_UID_MAX}/g" \ sed -e "s/SYSTEM_UID_MAX/${SYSTEM_UID_MAX}/g" \
-e "s/SYSTEM_GID_MAX/${SYSTEM_GID_MAX}/g" \
-e "s#NOLOGIN#${NOLOGIN}#g" "$in" -e "s#NOLOGIN#${NOLOGIN}#g" "$in"
} }

View File

@ -1 +0,0 @@
Group g1 not found.

View File

@ -1,4 +0,0 @@
# Ensure it is not allowed to create groups implicitly in the uid:groupname syntax
#
#Type Name ID GECOS HOMEDIR
u u1 100:g1 -

View File

@ -225,7 +225,6 @@ DestinationPort=
IPProtocol= IPProtocol=
InvertRule= InvertRule=
Family= Family=
User=
[IPv6PrefixDelegation] [IPv6PrefixDelegation]
RouterPreference= RouterPreference=
DNSLifetimeSec= DNSLifetimeSec=

View File

@ -1,9 +0,0 @@
[Match]
Name=test1
[RoutingPolicyRule]
TypeOfService=0x08
Table=7
From= 192.168.100.18
Priority=111
User=100-200

View File

@ -100,23 +100,6 @@ def expectedFailureIfRoutingPolicyIPProtoIsNotAvailable():
return f return f
def expectedFailureIfRoutingPolicyUIDRangeIsNotAvailable():
def f(func):
support = False
rc = call('ip rule add from 192.168.100.19 table 7 uidrange 200-300', stderr=subprocess.DEVNULL)
if rc == 0:
ret = run('ip rule list from 192.168.100.19 table 7', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if ret.returncode == 0 and 'uidrange 200-300' in ret.stdout.rstrip():
support = True
call('ip rule del from 192.168.100.19 table 7 uidrange 200-300')
if support:
return func
else:
return unittest.expectedFailure(func)
return f
def expectedFailureIfLinkFileFieldIsNotSet(): def expectedFailureIfLinkFileFieldIsNotSet():
def f(func): def f(func):
support = False support = False
@ -1589,7 +1572,6 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'25-bond-active-backup-slave.netdev', '25-bond-active-backup-slave.netdev',
'25-fibrule-invert.network', '25-fibrule-invert.network',
'25-fibrule-port-range.network', '25-fibrule-port-range.network',
'25-fibrule-uidrange.network',
'25-gre-tunnel-remote-any.netdev', '25-gre-tunnel-remote-any.netdev',
'25-ip6gre-tunnel-remote-any.netdev', '25-ip6gre-tunnel-remote-any.netdev',
'25-ipv6-address-label-section.network', '25-ipv6-address-label-section.network',
@ -1794,19 +1776,6 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'tcp') self.assertRegex(output, 'tcp')
self.assertRegex(output, 'lookup 7') self.assertRegex(output, 'lookup 7')
@expectedFailureIfRoutingPolicyUIDRangeIsNotAvailable()
def test_routing_policy_rule_uidrange(self):
copy_unit_to_networkd_unit_path('25-fibrule-uidrange.network', '11-dummy.netdev')
start_networkd()
self.wait_online(['test1:degraded'])
output = check_output('ip rule')
print(output)
self.assertRegex(output, '111')
self.assertRegex(output, 'from 192.168.100.18')
self.assertRegex(output, 'lookup 7')
self.assertRegex(output, 'uidrange 100-200')
def test_route_static(self): def test_route_static(self):
copy_unit_to_networkd_unit_path('25-route-static.network', '12-dummy.netdev') copy_unit_to_networkd_unit_path('25-route-static.network', '12-dummy.netdev')
start_networkd() start_networkd()