Compare commits

..

11 Commits

Author SHA1 Message Date
Jouke Witteveen 1cabd2d0c5 systemctl: hide first column with --plain instead of --no-legend
Hiding the first column, which may contain bullet circles, with --no-legend
is undocumented and potentially unexpected. On the other hand, not printing
bullet circles with --plain is documented so hiding the column with that
switch is sensible.

The combination "--full --no-legend --no-pager --plain" is appropriate for
automated processing of systemctl output.
2020-04-17 19:15:49 +02:00
Lennart Poettering 75dff0f910
Merge pull request #15459 from keszybz/remove-seat_can_multi_session
Remove seat_can_multi_session
2020-04-17 19:15:28 +02:00
Marc-André Lureau affb59e6a2 network: add TUN/TAP vt-* network rule for VMs
VM typically use a TAP device, and work similarly to a veth device from the
host side.
2020-04-17 19:15:00 +02:00
Zbigniew Jędrzejewski-Szmek 0500114e2a headers: get rid of pointless /* deprecated */ comment
The _sd_deprecated_ annotation gives it all away, and the comment adds
no additional value.
2020-04-17 16:15:30 +02:00
Zbigniew Jędrzejewski-Szmek 8f8cc84ba4 sd-login: get rid of seat_can_multi_session()
Follow-up for fa2cf64a91.
Backwards-compat is retained. A short note is added in docs, in case
people see sd_seat_can_multi_session() mentioned somewhere and wonder what
happened to it.

Also see https://github.com/systemd/systemd/pull/15337#issuecomment-610369404.
2020-04-17 16:15:30 +02:00
Luca BRUNO 3db1c62d22 man/systemd-service: clarify env variable expansion
This clarifies some more aspects of `${FOO}` expansions in service
units, mostly trying to answer my own doubts about what happens when
the matching variable is not defined.
2020-04-17 15:55:40 +02:00
Sebastian Jennen f3a604e4cf Add .clang-format file
The result of automatic formatting is not perfect, but if someone uses an
editor that uses that, it's probably better than nothing.

Fixes #15415.

[zjs: I resurrected this patch from #11811 and edited the extended comment
heavily.]
2020-04-17 15:54:17 +02:00
Lennart Poettering 4444e8533f
Merge pull request #15454 from keszybz/codespell-fixes
Spelling fixes based on codespell suggestions
2020-04-17 15:53:01 +02:00
Zbigniew Jędrzejewski-Szmek f1e318f690 network: fix typo
I was worried about backwards compat, but this was only added
in af94bb24b5, and can be changed
with impunity.
2020-04-16 20:37:40 +02:00
Zbigniew Jędrzejewski-Szmek a942084057 resolved: fix typo in an unused function and add comment
Follow-up for 2615691003.
2020-04-16 20:30:50 +02:00
Zbigniew Jędrzejewski-Szmek 162392b75a tree-wide: spellcheck using codespell
Fixes #15436.
2020-04-16 18:00:40 +02:00
63 changed files with 239 additions and 106 deletions

112
.clang-format Normal file
View File

@ -0,0 +1,112 @@
# This configuration file can be used to auto-format the code base.
# Not all guidelines specified in CODING_STYLE are followed, so the
# result MUST NOT be committed indiscriminately, but each automated
# change should be reviewed and only the appropriate ones commited.
#
# To apply the coding style you can run the following command (assuming you
# installed clang-format on your system):
#
# $ git ls-files 'src/*.[ch]' 'src/*.cc' | xargs clang-format -i -style=file
# You can find more information on the different config parameters in this file here:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: Left
AlignOperands: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterEnum: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Custom
BreakInheritanceList: BeforeComma
BreakBeforeTernaryOperators: false
BreakStringLiterals: false
ColumnLimit: 109
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
ForEachMacros:
- BITMAP_FOREACH
- CMSG_FOREACH
- _DNS_ANSWER_FOREACH
- DNS_ANSWER_FOREACH
- _DNS_ANSWER_FOREACH_FLAGS
- DNS_ANSWER_FOREACH_FLAGS
- _DNS_ANSWER_FOREACH_FULL
- DNS_ANSWER_FOREACH_FULL
- _DNS_ANSWER_FOREACH_IFINDEX
- DNS_ANSWER_FOREACH_IFINDEX
- _DNS_QUESTION_FOREACH
- DNS_QUESTION_FOREACH
- FDSET_FOREACH
- FOREACH_BTRFS_IOCTL_SEARCH_HEADER
- FOREACH_DEVICE
- FOREACH_DEVICE_AND_SUBSYSTEM
- FOREACH_DEVICE_DEVLINK
- FOREACH_DEVICE_PROPERTY
- FOREACH_DEVICE_SYSATTR
- FOREACH_DEVICE_TAG
- FOREACH_DIRENT
- FOREACH_DIRENT_ALL
- FOREACH_INOTIFY_EVENT
- FOREACH_STRING
- FOREACH_SUBSYSTEM
- _FOREACH_WORD
- FOREACH_WORD
- FOREACH_WORD_SEPARATOR
- HASHMAP_FOREACH
- HASHMAP_FOREACH_IDX
- HASHMAP_FOREACH_KEY
- JOURNAL_FOREACH_DATA_RETVAL
- JSON_VARIANT_ARRAY_FOREACH
- JSON_VARIANT_OBJECT_FOREACH
- LIST_FOREACH
- LIST_FOREACH_AFTER
- LIST_FOREACH_BEFORE
- LIST_FOREACH_OTHERS
- LIST_FOREACH_SAFE
- MESSAGE_FOREACH_PART
- NULSTR_FOREACH
- NULSTR_FOREACH_PAIR
- OBJECT_PATH_FOREACH_PREFIX
- ORDERED_HASHMAP_FOREACH
- ORDERED_HASHMAP_FOREACH_KEY
- ORDERED_SET_FOREACH
- PATH_FOREACH_PREFIX
- PATH_FOREACH_PREFIX_MORE
- SD_HWDB_FOREACH_PROPERTY
- SD_JOURNAL_FOREACH
- SD_JOURNAL_FOREACH_BACKWARDS
- SD_JOURNAL_FOREACH_DATA
- SD_JOURNAL_FOREACH_FIELD
- SD_JOURNAL_FOREACH_UNIQUE
- SECCOMP_FOREACH_LOCAL_ARCH
- SET_FOREACH
- SET_FOREACH_MOVE
- STRV_FOREACH
- STRV_FOREACH_BACKWARDS
- STRV_FOREACH_PAIR
IndentPPDirectives: AfterHash
IndentWidth: 8
IndentWrappedFunctionNames: true
MaxEmptyLinesToKeep: 2
PenaltyBreakAssignment: 65
PenaltyBreakBeforeFirstCallParameter: 16
PenaltyBreakComment: 320
PenaltyBreakFirstLessLess: 50
PenaltyBreakString: 0
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 100
SpaceAfterCStyleCast: true
SpacesInAngles: true
TabWidth: 8
UseCRLF: false

4
NEWS
View File

@ -6,6 +6,10 @@ CHANGES WITH 246 in spe:
the core file, systemd-coredump will use the effective uid and gid of
the process that faulted.
* "systemctl list-units" and "systemctl list-machines" no longer hide
their first output column with --no-legend. To hide the first column,
use --plain.
CHANGES WITH 245:
* A new tool "systemd-repart" has been added, that operates as an

View File

@ -665,10 +665,7 @@ manpages = [
'HAVE_PAM'],
['sd_seat_get_active',
'3',
['sd_seat_can_graphical',
'sd_seat_can_multi_session',
'sd_seat_can_tty',
'sd_seat_get_sessions'],
['sd_seat_can_graphical', 'sd_seat_can_tty', 'sd_seat_get_sessions'],
'HAVE_PAM'],
['sd_session_is_active',
'3',

View File

@ -19,7 +19,6 @@
<refnamediv>
<refname>sd_seat_get_active</refname>
<refname>sd_seat_get_sessions</refname>
<refname>sd_seat_can_multi_session</refname>
<refname>sd_seat_can_tty</refname>
<refname>sd_seat_can_graphical</refname>
<refpurpose>Determine state of a specific seat</refpurpose>
@ -44,11 +43,6 @@
<paramdef>unsigned int *<parameter>n_uids</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_seat_can_multi_session</function></funcdef>
<paramdef>const char *<parameter>seat</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_seat_can_tty</function></funcdef>
<paramdef>const char *<parameter>seat</parameter></paramdef>
@ -90,11 +84,6 @@
<constant>NULL</constant> may be returned and should be considered
equivalent to an empty array.</para>
<para><function>sd_seat_can_multi_session()</function> may be used
to determine whether a specific seat is capable of multi-session,
i.e. allows multiple login sessions in parallel (with only one
being active at a time).</para>
<para><function>sd_seat_can_tty()</function> may be used to
determine whether a specific seat provides TTY functionality, i.e.
is useful as a text console.</para>
@ -114,7 +103,7 @@
<para> On success, <function>sd_seat_get_active()</function> returns 0 or a positive integer. On success,
<function>sd_seat_get_sessions()</function> returns the number of entries in the session identifier
array. If the test succeeds, <function>sd_seat_can_multi_session</function>,
array. If the test succeeds,
<function>sd_seat_can_tty</function> and <function>sd_seat_can_graphical</function> return a positive
integer, if it fails 0. On failure, these calls return a negative errno-style error code.</para>
@ -157,6 +146,14 @@
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>History</title>
<para>In the past, <function>sd_seat_can_multi_session()</function> was used to check whether the seat
supports multiple sessions. All seats support that now, so that function has been deprecated and always
returns true.</para>
</refsect1>
<refsect1>
<title>See Also</title>

View File

@ -1106,10 +1106,10 @@
<para>Basic environment variable substitution is supported. Use
<literal>${FOO}</literal> as part of a word, or as a word of its
own, on the command line, in which case it will be replaced by the
value of the environment variable including all whitespace it
contains, resulting in a single argument. Use
<literal>$FOO</literal> as a separate word on the command line, in
own, on the command line, in which case it will be erased and replaced
by the exact value of the environment variable (if any) including all
whitespace it contains, always resulting in exactly a single argument.
Use <literal>$FOO</literal> as a separate word on the command line, in
which case it will be replaced by the value of the environment
variable split at whitespace, resulting in zero or more arguments.
For this type of expansion, quotes are respected when splitting

24
network/80-vm-vt.network Normal file
View File

@ -0,0 +1,24 @@
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# 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.
# This network file matches vt-* TUN/TAP devices and applies a similar
# configuration as ve-* to provide NAT/DHCP to VMs.
[Match]
Name=vt-*
Driver=tun
[Network]
# Default to using a /28 prefix, giving up to 13 addresses per VM.
Address=0.0.0.0/28
LinkLocalAddressing=yes
DHCPServer=yes
IPMasquerade=yes
LLDP=yes
EmitLLDP=customer-bridge

View File

@ -4,6 +4,7 @@ if conf.get('ENABLE_NETWORKD') == 1
install_data('80-container-host0.network',
'80-container-ve.network',
'80-container-vz.network',
'80-vm-vt.network',
'80-wifi-adhoc.network',
'80-wifi-ap.network.example',
'80-wifi-station.network.example',

View File

@ -7,7 +7,7 @@
__systemctl() {
local mode=$1; shift 1
systemctl $mode --full --no-legend --no-pager "$@" 2>/dev/null
systemctl $mode --full --no-legend --no-pager --plain "$@" 2>/dev/null
}
__systemd_properties() {

View File

@ -31,7 +31,7 @@ __get_machines() {
}
__get_services() {
systemctl list-units --no-legend --no-pager -t service --all $1 | \
systemctl list-units --no-legend --no-pager --plain -t service --all $1 | \
{ while read -r a b c; do [[ $b == "loaded" ]]; echo " $a"; done }
}

View File

@ -29,7 +29,7 @@ __get_machines() {
}
__get_units_have_cgroup() {
systemctl $1 list-units | {
systemctl $1 --full --no-legend --no-pager --plain list-units | {
while read -r a b c d; do
[[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a"
done

View File

@ -30,7 +30,7 @@ __get_users() {
__get_slices() {
local a b
systemctl list-units -t slice --no-legend --no-pager | { while read a b; do echo " $a"; done; };
systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; };
}
__get_machines() {

View File

@ -18,7 +18,7 @@
__systemctl() {
local mode=$1; shift 1
systemctl $mode --full --no-legend "$@"
systemctl $mode --full --no-legend --no-pager --plain "$@"
}
__get_slice_units () { __systemctl $1 list-units --all -t slice \

View File

@ -38,7 +38,7 @@ __get_all_devs() {
}
__get_all_device_units() {
systemctl list-units -t device --full --no-legend --no-pager 2>/dev/null | \
systemctl list-units -t device --full --no-legend --no-pager --plain 2>/dev/null | \
{ while read -r a b; do echo "$a"; done; }
}

View File

@ -145,7 +145,7 @@
# @todo _systemd-run has a helper with the same name, so we must redefine
__systemctl()
{
systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2>/dev/null
systemctl $_sys_service_mgr --full --no-legend --no-pager --plain "$@" 2>/dev/null
}

View File

@ -5,7 +5,7 @@
__systemctl() {
local -a _modes
_modes=("--user" "--system")
systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null
systemctl ${words:*_modes} --full --no-legend --no-pager --plain "$@" 2>/dev/null
}
(( $+functions[__systemd-run_get_slices] )) ||

View File

@ -82,7 +82,7 @@ enum {
CHASE_SAFE = 1 << 3, /* Return EPERM if we ever traverse from unprivileged to privileged files or directories */
CHASE_TRAIL_SLASH = 1 << 4, /* Any trailing slash will be preserved */
CHASE_STEP = 1 << 5, /* Just execute a single step of the normalization */
CHASE_NOFOLLOW = 1 << 6, /* Do not follow the path's right-most compontent. With ret_fd, when the path's
CHASE_NOFOLLOW = 1 << 6, /* Do not follow the path's right-most component. With ret_fd, when the path's
* right-most component refers to symlink, return O_PATH fd of the symlink. */
CHASE_WARN = 1 << 7, /* Emit an appropriate warning when an error is encountered */
};

View File

@ -7,7 +7,7 @@
/* The enum order is used to order unit jobs in the job queue
* when other criteria (cpu weight, nice level) are identical.
* In this case service units have the hightest priority. */
* In this case service units have the highest priority. */
typedef enum UnitType {
UNIT_SERVICE = 0,
UNIT_MOUNT,

View File

@ -1435,7 +1435,7 @@ static int install_random_seed(const char *esp) {
* the EFI variable space we can make sure that even though the random seeds on disk
* are all the same they will be different on each system under the assumption that
* the EFI variable space is maintained separate from the random seed storage. That
* is generally the case on physical systems, as the ESP is stored on persistant
* is generally the case on physical systems, as the ESP is stored on persistent
* storage, and the EFI variables in NVRAM. However in virtualized environments this
* is generally not true: the EFI variable set is typically stored along with the
* disk image itself. For example, using the OVMF EFI firmware the EFI variables are

View File

@ -1054,7 +1054,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr
* aren't active. This is when the verify-active job merges with a
* satisfying job type, and then loses it's invalidation effect, as the
* result there is JOB_DONE for the start job we merged into, while we
* should be failing the depending job if the said unit isn't infact
* should be failing the depending job if the said unit isn't in fact
* active. Oneshots are an example of this, where going directly from
* activating to inactive is success.
*

View File

@ -95,7 +95,7 @@ static enum {
ACTION_DUMP_BUS_PROPERTIES,
} arg_action = ACTION_RUN;
/* Those variables are initalized to 0 automatically, so we avoid uninitialized memory access.
/* Those variables are initialized to 0 automatically, so we avoid uninitialized memory access.
* Real defaults are assigned in reset_arguments() below. */
static char *arg_default_unit;
static bool arg_system;
@ -479,7 +479,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
r = parse_cpu_set(value, &arg_cpu_affinity);
if (r < 0)
log_warning_errno(r, "Faile to parse CPU affinity mask '%s', ignoring: %m", value);
log_warning_errno(r, "Failed to parse CPU affinity mask '%s', ignoring: %m", value);
} else if (proc_cmdline_key_streq(key, "systemd.watchdog_device")) {

View File

@ -655,7 +655,7 @@ static void service_fix_stdio(Service *s) {
/* Note that EXEC_INPUT_NULL and EXEC_OUTPUT_INHERIT play a special role here: they are both the
* default value that is subject to automatic overriding triggered by other settings and an explicit
* choice the user can make. We don't distuingish between these cases currently. */
* choice the user can make. We don't distinguish between these cases currently. */
if (s->exec_context.std_input == EXEC_INPUT_NULL &&
s->exec_context.stdin_data_size > 0)

View File

@ -7,7 +7,7 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# Names with prefixes are prefered, and the run-together names should be
# Names with prefixes are preferred, and the run-together names should be
# considered deprecated (though there is no plan to remove them). New names
# shall have underscores.

View File

@ -2170,7 +2170,7 @@ static int unit_log_resources(Unit *u) {
struct iovec iovec[1 + _CGROUP_IP_ACCOUNTING_METRIC_MAX + _CGROUP_IO_ACCOUNTING_METRIC_MAX + 4];
bool any_traffic = false, have_ip_accounting = false, any_io = false, have_io_accounting = false;
_cleanup_free_ char *igress = NULL, *egress = NULL, *rr = NULL, *wr = NULL;
int log_level = LOG_DEBUG; /* May be raised if resources consumed over a treshold */
int log_level = LOG_DEBUG; /* May be raised if resources consumed over a threshold */
size_t n_message_parts = 0, n_iovec = 0;
char* message_parts[1 + 2 + 2 + 1], *t;
nsec_t nsec = NSEC_INFINITY;

View File

@ -202,7 +202,7 @@ static int print_dependencies(FILE *f, const char* device_path) {
return 0;
if (path_startswith(udev_node, "/dev/")) {
/* We are dealing with a block device, add dependency for correspoding unit */
/* We are dealing with a block device, add dependency for corresponding unit */
_cleanup_free_ char *unit = NULL;
r = unit_name_from_path(udev_node, ".device", &unit);

View File

@ -2767,7 +2767,7 @@ static int parse_argv(int argc, char *argv[]) {
r = json_variant_set_field(&arg_identity_extra, "environment", ne);
if (r < 0)
return log_error_errno(r, "Failed to set environent list: %m");
return log_error_errno(r, "Failed to set environment list: %m");
break;
}

View File

@ -436,9 +436,9 @@ static int convert_worker_errno(Home *h, int e, sd_bus_error *error) {
switch (e) {
case -EMSGSIZE:
return sd_bus_error_setf(error, BUS_ERROR_BAD_HOME_SIZE, "File systems of this type cannot be shrinked");
return sd_bus_error_setf(error, BUS_ERROR_BAD_HOME_SIZE, "File systems of this type cannot be shrunk");
case -ETXTBSY:
return sd_bus_error_setf(error, BUS_ERROR_BAD_HOME_SIZE, "File systems of this type can only be shrinked offline");
return sd_bus_error_setf(error, BUS_ERROR_BAD_HOME_SIZE, "File systems of this type can only be shrunk offline");
case -ERANGE:
return sd_bus_error_setf(error, BUS_ERROR_BAD_HOME_SIZE, "File system size too small");
case -ENOLINK:
@ -1748,7 +1748,7 @@ void home_process_notify(Home *h, char **l) {
r = safe_atoi(e, &error);
if (r < 0) {
log_debug_errno(r, "Failed to parse receieved error number, ignoring: %s", e);
log_debug_errno(r, "Failed to parse received error number, ignoring: %s", e);
return;
}
if (error <= 0) {

View File

@ -611,7 +611,7 @@ const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD("GetUserRecordByUID", "u", "sbo", method_get_user_record_by_uid, SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD("ListHomes", NULL, "a(susussso)", method_list_homes, SD_BUS_VTABLE_UNPRIVILEGED),
/* The following methods directly execute an operation on a home area, without ref-counting, queing
/* The following methods directly execute an operation on a home area, without ref-counting, queueing
* or anything, and are accessible through homectl. */
SD_BUS_METHOD("ActivateHome", "ss", NULL, method_activate_home, SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD("DeactivateHome", "s", NULL, method_deactivate_home, 0),

View File

@ -367,7 +367,7 @@ static int manager_add_home_by_record(
/* If we acquired a record now for a previously unallocated entry, then reset the state. This
* makes sure home_get_state() will check for the availability of the image file dynamically
* in order to detect to distuingish HOME_INACTIVE and HOME_ABSENT. */
* in order to detect to distinguish HOME_INACTIVE and HOME_ABSENT. */
if (h->state == HOME_UNFIXATED)
h->state = _HOME_STATE_INVALID;
} else {
@ -1042,7 +1042,7 @@ static int on_notify_socket(sd_event_source *s, int fd, uint32_t revents, void *
h = hashmap_get(m->homes_by_worker_pid, PID_TO_PTR(sender.pid));
if (!h) {
log_warning("Recieved notify datagram of unknown process, ignoring.");
log_warning("Received notify datagram of unknown process, ignoring.");
return 0;
}
@ -1656,7 +1656,7 @@ int manager_enqueue_gc(Manager *m, Home *focus) {
return 0;
} else
m->gc_focus = focus; /* start focussed */
m->gc_focus = focus; /* start focused */
r = sd_event_add_defer(m->event, &m->deferred_gc_event_source, on_deferred_gc, m);
if (r < 0)

View File

@ -31,7 +31,7 @@ struct Manager {
sd_event_source *inotify_event_source;
/* An even source we receieve sd_notify() messages from our worker from */
/* An event source we receive sd_notify() messages from our worker from */
sd_event_source *notify_socket_event_source;
sd_device_monitor *device_monitor;

View File

@ -1401,8 +1401,8 @@ static int run(int argc, char *argv[]) {
/* Well known return values of these operations, that systemd-homed knows and converts to proper D-Bus errors:
*
* EMSGSIZE file systems of this type cannnot be shrinked
* ETXTBSY file systems of this type can only be shrinked offline
* EMSGSIZE file systems of this type cannot be shrunk
* ETXTBSY file systems of this type can only be shrunk offline
* ERANGE file system size too small
* ENOLINK system does not support selected storage backend
* EPROTONOSUPPORT system does not support selected file system

View File

@ -460,7 +460,7 @@ int user_record_test_image_path(UserRecord *h) {
if (S_ISBLK(st.st_mode)) {
/* For block devices we can't really be sure if the device referenced actually is the
* fs we look for or some other file system (think: what does /dev/sdb1 refer
* to?). Hence, let's return USER_TEST_MAYBE as an ambigious return value for these
* to?). Hence, let's return USER_TEST_MAYBE as an ambiguous return value for these
* case, except if the device path used is one of the paths that is based on a
* filesystem or partition UUID or label, because in those cases we can be sure we
* are referring to the right device. */

View File

@ -423,7 +423,7 @@ int server_open_kernel_seqnum(Server *s) {
assert(s);
/* We store the seqnum we last read in an mmaped file. That way we can just use it like a variable,
/* We store the seqnum we last read in an mmapped file. That way we can just use it like a variable,
* but it is persistent and automatically flushed at reboot. */
if (!s->read_kmsg)

View File

@ -1950,7 +1950,7 @@ static int vl_method_synchronize(Varlink *link, JsonVariant *parameters, Varlink
if (r < 0)
return log_error_errno(r, "Failed to set event source destroy callback: %m");
varlink_ref(link); /* The varlink object is now left to the destroy callack to unref */
varlink_ref(link); /* The varlink object is now left to the destroy callback to unref */
r = sd_event_source_set_priority(event_source, SD_EVENT_PRIORITY_NORMAL+15);
if (r < 0)

View File

@ -46,7 +46,7 @@ static void message_free_part(sd_bus_message *m, struct bus_body_part *part) {
assert(part);
if (part->memfd >= 0) {
/* erase if requested, but ony if the memfd is not sealed yet, i.e. is writable */
/* erase if requested, but only if the memfd is not sealed yet, i.e. is writable */
if (m->sensitive && !m->sealed)
explicit_bzero_safe(part->data, part->size);

View File

@ -774,7 +774,7 @@ static int vtable_append_all_properties(
if (v->flags & SD_BUS_VTABLE_HIDDEN)
continue;
/* Let's not include properties marked as "explicit" in any message that contians a generic
/* Let's not include properties marked as "explicit" in any message that contains a generic
* dump of properties, but only in those generated as a response to an explicit request. */
if (v->flags & SD_BUS_VTABLE_PROPERTY_EXPLICIT)
continue;

View File

@ -746,7 +746,7 @@ static int seat_get_can(const char *seat, const char *variable) {
}
_public_ int sd_seat_can_multi_session(const char *seat) {
return seat_get_can(seat, "CAN_MULTI_SESSION");
return true;
}
_public_ int sd_seat_can_tty(const char *seat) {

View File

@ -142,8 +142,11 @@ static void test_login(void) {
log_info("sd_session_get_seat(\"%s\") → \"%s\"", session, seat);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
r = sd_seat_can_multi_session(seat);
assert_se(r >= 0);
#pragma GCC diagnostic pop
assert_se(r == 1);
log_info("sd_session_can_multi_seat(\"%s\") → %s", seat, yes_no(r));
r = sd_seat_can_tty(seat);

View File

@ -17,7 +17,7 @@
#include "user-util.h"
#include "util.h"
static BUS_DEFINE_PROPERTY_GET(property_get_can_multi_session, "b", Seat, seat_can_multi_session);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_const_true, "b", true);
static BUS_DEFINE_PROPERTY_GET(property_get_can_tty, "b", Seat, seat_can_tty);
static BUS_DEFINE_PROPERTY_GET(property_get_can_graphical, "b", Seat, seat_can_graphical);
@ -296,7 +296,7 @@ const sd_bus_vtable seat_vtable[] = {
SD_BUS_PROPERTY("Id", "s", NULL, offsetof(Seat, id), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("ActiveSession", "(so)", property_get_active_session, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanMultiSession", "b", property_get_can_multi_session, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("CanMultiSession", "b", property_get_const_true, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),
SD_BUS_PROPERTY("CanTTY", "b", property_get_can_tty, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("CanGraphical", "b", property_get_can_graphical, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Sessions", "a(so)", property_get_sessions, 0, 0),

View File

@ -104,11 +104,10 @@ int seat_save(Seat *s) {
fprintf(f,
"# This is private data. Do not parse.\n"
"IS_SEAT0=%i\n"
"CAN_MULTI_SESSION=%i\n"
"CAN_MULTI_SESSION=1\n"
"CAN_TTY=%i\n"
"CAN_GRAPHICAL=%i\n",
seat_is_seat0(s),
seat_can_multi_session(s),
seat_can_tty(s),
seat_can_graphical(s));
@ -558,13 +557,6 @@ bool seat_is_seat0(Seat *s) {
return s->manager->seat0 == s;
}
bool seat_can_multi_session(Seat *s) {
assert(s);
/* multiple sessions are supported on all seats now */
return true;
}
bool seat_can_tty(Seat *s) {
assert(s);

View File

@ -51,7 +51,6 @@ void seat_claim_position(Seat *s, Session *session, unsigned pos);
bool seat_has_vts(Seat *s);
bool seat_is_seat0(Seat *s);
bool seat_can_multi_session(Seat *s);
bool seat_can_tty(Seat *s);
bool seat_has_master_device(Seat *s);
bool seat_can_graphical(Seat *s);

View File

@ -4930,7 +4930,7 @@ static int run(int argc, char *argv[]) {
}
/* We take an exclusive lock on this image, since it's our private, ephemeral copy
* only owned by us and noone else. */
* only owned by us and no one else. */
r = image_path_lock(np, LOCK_EX|LOCK_NB, &tree_global_lock, &tree_local_lock);
if (r < 0) {
log_error_errno(r, "Failed to lock %s: %m", np);

View File

@ -329,7 +329,7 @@ enum nss_status userdb_getgrgid(
return NSS_STATUS_UNAVAIL;
}
/* If we acquired the record via NSS then there's no reason to respond unless we have to agument the
/* If we acquired the record via NSS then there's no reason to respond unless we have to augment the
* list of members of the group */
if (from_nss && strv_isempty(members))
return NSS_STATUS_NOTFOUND;

View File

@ -386,7 +386,7 @@ static uint64_t free_area_available_for_new_partitions(const FreeArea *a) {
uint64_t avail;
/* Similar to free_area_available(), but takes into account that the required size and padding of the
* preceeding partition is honoured. */
* preceding partition is honoured. */
avail = free_area_available(a);
if (a->after) {
@ -553,7 +553,7 @@ static int context_grow_partitions_phase(
LIST_FOREACH(partitions, p, context->partitions) {
/* Look only at partitions associated with this free area, i.e. immediately
* preceeding it, or allocated into it */
* preceding it, or allocated into it */
if (p->allocated_to_area != a && p->padding_area != a)
continue;
@ -682,7 +682,7 @@ static int context_grow_partitions_on_free_area(Context *context, FreeArea *a) {
break;
}
/* We still have space left over? Donate to preceeding partition if we have one */
/* We still have space left over? Donate to preceding partition if we have one */
if (span > 0 && a->after && !PARTITION_IS_FOREIGN(a->after)) {
uint64_t m, xsz;
@ -697,7 +697,7 @@ static int context_grow_partitions_on_free_area(Context *context, FreeArea *a) {
a->after->new_size = m;
}
/* What? Even still some space left (maybe because there was no preceeding partition, or it had a
/* What? Even still some space left (maybe because there was no preceding partition, or it had a
* size limit), then let's donate it to whoever wants it. */
if (span > 0) {
Partition *p;
@ -726,7 +726,7 @@ static int context_grow_partitions_on_free_area(Context *context, FreeArea *a) {
}
}
/* Yuck, still noone? Then make it padding */
/* Yuck, still no one? Then make it padding */
if (span > 0 && a->after) {
assert(a->after->new_padding != UINT64_MAX);
a->after->new_padding += span;
@ -2864,7 +2864,7 @@ static int acquire_root_devno(const char *p, int mode, char **ret) {
/* From partition to whole disk containing it */
r = block_get_whole_disk(devno, &devno);
if (r < 0)
log_debug_errno(r, "Failed to find whole disk block device for '%s', ingoring: %m", p);
log_debug_errno(r, "Failed to find whole disk block device for '%s', ignoring: %m", p);
return device_path_make_canonical(S_IFBLK, devno, ret);
}

View File

@ -678,6 +678,9 @@ int dns_answer_reserve_or_clone(DnsAnswer **a, size_t n_free) {
return 0;
}
/*
* This function is not used in the code base, but is useful when debugging. Do not delete.
*/
void dns_answer_dump(DnsAnswer *answer, FILE *f) {
DnsResourceRecord *rr;
DnsAnswerFlags flags;
@ -707,7 +710,7 @@ void dns_answer_dump(DnsAnswer *answer, FILE *f) {
if (flags & DNS_ANSWER_AUTHENTICATED)
fputs(" authenticated", f);
if (flags & DNS_ANSWER_CACHEABLE)
fputs(" cachable", f);
fputs(" cacheable", f);
if (flags & DNS_ANSWER_SHARED_OWNER)
fputs(" shared-owner", f);

View File

@ -7,7 +7,7 @@ static const char* const bridge_state_table[_NETDEV_BRIDGE_STATE_MAX] = {
[NETDEV_BRIDGE_STATE_DISABLED] = "disabled",
[NETDEV_BRIDGE_STATE_LISTENING] = "listening",
[NETDEV_BRIDGE_STATE_LEARNING] = "learning",
[NETDEV_BRIDGE_STATE_FORWARDING] = "forwading",
[NETDEV_BRIDGE_STATE_FORWARDING] = "forwarding",
};
DEFINE_STRING_TABLE_LOOKUP(bridge_state, BridgeState);

View File

@ -150,7 +150,7 @@ int fd_chown_recursive(
struct stat st;
/* Note that the slightly different order of fstat() and the checks here and in
* path_chown_recursive(). That's because when we open the dirctory ourselves we can specify
* path_chown_recursive(). That's because when we open the directory ourselves we can specify
* O_DIRECTORY and we always want to ensure we are operating on a directory before deciding whether
* the operation is otherwise redundant. */

View File

@ -2001,7 +2001,7 @@ int table_print(Table *t, FILE *f) {
_cleanup_free_ char *padded = NULL;
/* We truncated more lines of this cell, let's add an
* ellipsis. We first append it, but thta might make our
* ellipsis. We first append it, but that might make our
* string grow above what we have space for, hence ellipsize
* right after. This will truncate the ellipsis and add a new
* one. */

View File

@ -1711,7 +1711,7 @@ int unit_file_verify_alias(const UnitFileInstallInfo *i, const char *dst, char *
*
* ret_dst is set in cases where "instance propagation" happens, i.e. when the instance part is
* inserted into dst. It is not normally set, even on success, so that the caller can easily
* distinguish the case where instance propagation occured.
* distinguish the case where instance propagation occurred.
*/
const char *path_alias = strrchr(dst, '/');

View File

@ -1381,7 +1381,7 @@ void json_variant_sensitive(JsonVariant *v) {
/* Marks a variant as "sensitive", so that it is erased from memory when it is destroyed. This is a
* one-way operation: as soon as it is marked this way it remains marked this way until it's
* destoryed. A magic variant is never sensitive though, even when asked, since it's too
* destroyed. A magic variant is never sensitive though, even when asked, since it's too
* basic. Similar, const string variant are never sensitive either, after all they are included in
* the source code as they are, which is not suitable for inclusion of secrets.
*

View File

@ -190,7 +190,7 @@ int pkcs11_token_login(
return log_error_errno(SYNTHETIC_ERRNO(EIO),
"Failed to log into security token '%s': %s", token_label, p11_kit_strerror(rv));
log_info("Successully logged into security token '%s' via protected authentication path.", token_label);
log_info("Successfully logged into security token '%s' via protected authentication path.", token_label);
*ret_used_pin = NULL;
return 0;
}

View File

@ -208,7 +208,7 @@ static int swap_device_to_device_id(const SwapEntry *swap, dev_t *ret_dev) {
}
/*
* Attempt to calculate the swap file offset on supported filesystems. On unsuported
* Attempt to calculate the swap file offset on supported filesystems. On unsupported
* filesystems, a debug message is logged and ret_offset is set to UINT64_MAX.
*/
static int calculate_swap_file_offset(const SwapEntry *swap, uint64_t *ret_offset) {

View File

@ -11,7 +11,7 @@
char *sysctl_normalize(char *s);
int sysctl_read(const char *property, char **value);
int sysctl_write(const char *property, const char *value);
int sysctl_writef(const char *propery, const char *format, ...) _printf_(2, 3);
int sysctl_writef(const char *property, const char *format, ...) _printf_(2, 3);
int sysctl_read_ip_property(int af, const char *ifname, const char *property, char **ret);
int sysctl_write_ip_property(int af, const char *ifname, const char *property, const char *value);

View File

@ -69,7 +69,7 @@ int get_testdata_dir(const char *suffix, char **ret) {
if (!dir)
dir = SYSTEMD_TEST_DATA;
if (access(dir, F_OK) < 0)
return log_error_errno(errno, "ERROR: $SYSTEMD_TEST_DATA directory [%s] not accesible: %m", dir);
return log_error_errno(errno, "ERROR: $SYSTEMD_TEST_DATA directory [%s] not accessible: %m", dir);
p = path_join(dir, suffix);
if (!p)

View File

@ -1071,7 +1071,7 @@ static int user_record_augment(UserRecord *h, JsonDispatchFlags json_flags) {
return json_log_oom(h->json, json_flags);
}
/* Let's add in the following automatisms only for regular users, they dont make sense for any others */
/* Let's add in the following automatisms only for regular users, they don't make sense for any others */
if (user_record_disposition(h) != USER_REGULAR)
return 0;
@ -1802,7 +1802,7 @@ int user_record_test_password_change_required(UserRecord *h) {
0: No password change required, but permitted
*/
/* If a pasword change request has been set explicitly, it overrides everything */
/* If a password change request has been set explicitly, it overrides everything */
if (h->password_change_now > 0)
return -EKEYREVOKED;

View File

@ -401,8 +401,8 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
return log_oom();
table_set_header(table, !arg_no_legend);
if (arg_no_legend) {
/* Hide the 'glyph' column when --no-legend is requested */
if (arg_plain) {
/* Hide the 'glyph' column when --plain is requested */
r = table_hide_column_from_display(table, 0);
if (r < 0)
return log_error_errno(r, "Failed to hide column: %m");
@ -1987,8 +1987,8 @@ static int output_machines_list(struct machine_info *machine_infos, unsigned n)
return log_oom();
table_set_header(table, !arg_no_legend);
if (arg_no_legend) {
/* Hide the 'glyph' column when --no-legend is requested */
if (arg_plain) {
/* Hide the 'glyph' column when --plain is requested */
r = table_hide_column_from_display(table, 0);
if (r < 0)
return log_error_errno(r, "Failed to hide column: %m");

View File

@ -177,7 +177,7 @@ int sd_bus_get_sender(sd_bus *bus, const char **ret);
int sd_bus_start(sd_bus *bus);
int sd_bus_try_close(sd_bus *bus) _sd_deprecated_; /* deprecated */
int sd_bus_try_close(sd_bus *bus) _sd_deprecated_;
void sd_bus_close(sd_bus *bus);
sd_bus* sd_bus_ref(sd_bus *bus);
@ -204,7 +204,7 @@ int sd_bus_get_fd(sd_bus *bus);
int sd_bus_get_events(sd_bus *bus);
int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec);
int sd_bus_process(sd_bus *bus, sd_bus_message **r);
int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r) _sd_deprecated_; /* deprecated */
int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r) _sd_deprecated_;
int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec);
int sd_bus_flush(sd_bus *bus);
int sd_bus_enqueue_for_read(sd_bus *bus, sd_bus_message *m);
@ -272,7 +272,7 @@ int sd_bus_message_seal(sd_bus_message *m, uint64_t cookie, uint64_t timeout_use
int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type);
int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie);
int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie);
int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) _sd_deprecated_; /* deprecated */
int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) _sd_deprecated_;
int sd_bus_message_get_expect_reply(sd_bus_message *m);
int sd_bus_message_get_auto_start(sd_bus_message *m);
@ -306,7 +306,7 @@ int sd_bus_message_set_allow_interactive_authorization(sd_bus_message *m, int b)
int sd_bus_message_set_destination(sd_bus_message *m, const char *destination);
int sd_bus_message_set_sender(sd_bus_message *m, const char *sender);
int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) _sd_deprecated_; /* deprecated */
int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) _sd_deprecated_;
int sd_bus_message_append(sd_bus_message *m, const char *types, ...);
int sd_bus_message_appendv(sd_bus_message *m, const char *types, va_list ap);

View File

@ -72,7 +72,7 @@ enum {
SD_JOURNAL_ALL_NAMESPACES = 1 << 5, /* Show all namespaces, not just the default or specified one */
SD_JOURNAL_INCLUDE_DEFAULT_NAMESPACE = 1 << 6, /* Show default namespace in addition to specified one */
SD_JOURNAL_SYSTEM_ONLY _sd_deprecated_ = SD_JOURNAL_SYSTEM /* deprecated name */
SD_JOURNAL_SYSTEM_ONLY _sd_deprecated_ = SD_JOURNAL_SYSTEM /* old name */
};
/* Wakeup event types */
@ -88,7 +88,7 @@ int sd_journal_open_directory(sd_journal **ret, const char *path, int flags);
int sd_journal_open_directory_fd(sd_journal **ret, int fd, int flags);
int sd_journal_open_files(sd_journal **ret, const char **paths, int flags);
int sd_journal_open_files_fd(sd_journal **ret, int fds[], unsigned n_fds, int flags);
int sd_journal_open_container(sd_journal **ret, const char *machine, int flags) _sd_deprecated_; /* deprecated */
int sd_journal_open_container(sd_journal **ret, const char *machine, int flags) _sd_deprecated_;
void sd_journal_close(sd_journal *j);
int sd_journal_previous(sd_journal *j);

View File

@ -183,7 +183,7 @@ int sd_seat_get_active(const char *seat, char **session, uid_t *uid);
int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **uid, unsigned *n_uids);
/* Return whether the seat is multi-session capable */
int sd_seat_can_multi_session(const char *seat);
int sd_seat_can_multi_session(const char *seat) _sd_deprecated_;
/* Return whether the seat is TTY capable, i.e. suitable for showing console UIs */
int sd_seat_can_tty(const char *seat);

View File

@ -1105,8 +1105,8 @@ static void test_verify_alias(void) {
verify_one(&bare_template, "foo.target.wants/plain.service", -EXDEV, NULL);
verify_one(&bare_template, "foo.target.wants/plain.socket", -EXDEV, NULL);
verify_one(&bare_template, "foo.target.wants/plain@.service", -EXDEV, NULL);
/* Name mistmatch: we cannot allow this, because plain@foo.service would be pulled in by foo.taget,
* but would not be resolvable on its own, since systemd doesn't know how to load the fragment. */
/* Name mismatch: we cannot allow this, because plain@foo.service would be pulled in by foo.target,
* but would not be resolveable on its own, since systemd doesn't know how to load the fragment. */
verify_one(&bare_template, "foo.target.wants/plain@foo.service", -EXDEV, NULL);
verify_one(&bare_template, "foo.target.wants/template1@foo.service", 0, NULL);
verify_one(&bare_template, "foo.target.wants/service", -EXDEV, NULL);
@ -1116,7 +1116,7 @@ static void test_verify_alias(void) {
verify_one(&bare_template, "foo.target.requires/template1@inst.service", 0, NULL);
verify_one(&bare_template, "foo.target.requires/service", -EXDEV, NULL);
verify_one(&bare_template, "foo.target.conf/plain.service", -EXDEV, NULL);
verify_one(&bare_template, "FOO@.target.requires/plain@.service", -EXDEV, NULL); /* template name mistatch */
verify_one(&bare_template, "FOO@.target.requires/plain@.service", -EXDEV, NULL); /* template name mismatch */
verify_one(&bare_template, "FOO@inst.target.requires/plain@.service", -EXDEV, NULL);
verify_one(&bare_template, "FOO@inst.target.requires/plain@inst.service", -EXDEV, NULL);
verify_one(&bare_template, "FOO@.target.requires/template1@.service", 0, NULL); /* instance propagated */
@ -1170,7 +1170,7 @@ static void test_verify_alias(void) {
verify_one(&inst_template, "bar.target.requires/template3@inst.service", 0, NULL);
verify_one(&inst_template, "bar.target.requires/service", -EXDEV, NULL);
verify_one(&inst_template, "bar.target.conf/plain.service", -EXDEV, NULL);
verify_one(&inst_template, "BAR@.target.requires/plain@.service", -EXDEV, NULL); /* template name mistatch */
verify_one(&inst_template, "BAR@.target.requires/plain@.service", -EXDEV, NULL); /* template name mismatch */
verify_one(&inst_template, "BAR@inst.target.requires/plain@.service", -EXDEV, NULL);
verify_one(&inst_template, "BAR@inst.target.requires/plain@inst.service", -EXDEV, NULL);
verify_one(&inst_template, "BAR@.target.requires/template3@.service", -EXDEV, NULL); /* instance missing */

View File

@ -78,7 +78,7 @@ typedef enum {
TK_M_ATTR, /* string, takes filename through attribute, sd_device_get_sysattr_value(), util_resolve_subsys_kernel(), etc. */
TK_M_SYSCTL, /* string, takes kernel parameter through attribute */
/* matches parent paramters */
/* matches parent parameters */
TK_M_PARENTS_KERNEL, /* string */
TK_M_PARENTS_SUBSYSTEM, /* string */
TK_M_PARENTS_DRIVER, /* string */

View File

@ -239,7 +239,7 @@ static int show_group(GroupRecord *gr, Table *table) {
break;
default:
assert_not_reached("Unexpected disply mode");
assert_not_reached("Unexpected display mode");
}
return 0;

View File

@ -1,6 +1,6 @@
/* Detailed project version that includes git commit when not built from a release.
* Use this in preference to PROJECT_VERSION, with the following exceptions:
* - where a simplified form is expected for compatiblity, for example
* - where a simplified form is expected for compatibility, for example
* 'udevadm version',
* - where a simplified machine-parsable form is more useful, for example
* pkgconfig files and version information written to binary files.

View File

@ -11,6 +11,7 @@ deprecated="
-e sd_bus_process_priority
-e sd_bus_message_get_priority
-e sd_bus_message_set_priority
-e sd_seat_can_multi_session
"
for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv $deprecated | sort -u` ; do