Yu Watanabe [Sun, 9 May 2021 05:36:19 +0000 (14:36 +0900)]
tree-wide: fix typo
Yu Watanabe [Sun, 9 May 2021 05:33:20 +0000 (14:33 +0900)]
userdb: shorten code a bit
Hopefully fixes CID#
1452937.
Yu Watanabe [Sun, 9 May 2021 05:16:11 +0000 (14:16 +0900)]
test: add one more assertion to make Coverty happy
Fixes CID#
1452934.
Jörg Deckert [Sat, 8 May 2021 12:39:32 +0000 (14:39 +0200)]
networkd: correct batman-adv setting name (GatewayBandwidth) (#19539)
Co-authored-by: Jörg Deckert <jdeckert@unitas-network.de>
Yu Watanabe [Sat, 8 May 2021 05:56:31 +0000 (14:56 +0900)]
string-util: explicitly cast character to unsigned
This also adds comment why we cast to unsigned.
Follow-up for
7971f9030ae4bebe0d4a6845ed31584f8ab18103.
Addresses the comment https://github.com/systemd/systemd/pull/19544#discussion_r628472794.
Yegor Alexeyev [Wed, 21 Apr 2021 03:51:07 +0000 (06:51 +0300)]
rfc3046 implementation
Lennart Poettering [Fri, 7 May 2021 22:12:20 +0000 (00:12 +0200)]
Merge pull request #19438 from poettering/nspawn-uidmap
nspawn: add support for kernel 5.12 ID mapping mounts
Lennart Poettering [Fri, 7 May 2021 22:12:01 +0000 (00:12 +0200)]
Merge pull request #19538 from poettering/userdbd-simplify-nss-listing
userdbd: refactoring to simplify NSS user listing
Lennart Poettering [Tue, 27 Apr 2021 16:33:23 +0000 (18:33 +0200)]
update TODO
Lennart Poettering [Tue, 27 Apr 2021 16:33:27 +0000 (18:33 +0200)]
bash: update shell completion for new nspawn option
Lennart Poettering [Tue, 27 Apr 2021 16:31:24 +0000 (18:31 +0200)]
man: document new nspawn ID mapping mounts features
Lennart Poettering [Tue, 27 Apr 2021 16:03:31 +0000 (18:03 +0200)]
nspawn: introduce --private-users-ownership=map|auto
This adds a two new values to --private-users-ownership=: "map" and
"auto".
"map" exposes the kernel 5.12 idmap feature pretty much 1:1. It fails if
the kernel or used file system doesn't support ID mapping.
"auto" is a bit smarter: if we can make ID mapping work, we'll use it,
otherwise revert back to classic chown()ing. We'll also use chown()ing
if we detect that an image is already ID shifted, both to increase
compatibility with the status quo ante, and to simplify our codepaths,
since the mappings become a lot simpler if we only have to map from zero
to something else, instead of from anything to anything else.
The short -U switch, and --private-users=pick will now imply
--private-users-ownership=auto instead of
--private-users-ownership=chown, since the new logic should be the much
better choice.
Lennart Poettering [Wed, 28 Apr 2021 15:24:34 +0000 (17:24 +0200)]
nspawn: drop an unnecessary local variable
Lennart Poettering [Wed, 28 Apr 2021 15:23:29 +0000 (17:23 +0200)]
dissect-image: add support for optionally mounting images with idmapping on
Lennart Poettering [Tue, 27 Apr 2021 15:27:45 +0000 (17:27 +0200)]
mount-util: add a helper that can add an idmap to an existing mount
This makes use of the new kernel 5.12 APIs to add an idmap to a mount
point. It does so by cloning the mountpoint, changing it, and then
unmounting the old mountpoint, replacing it later with the new one.
Lennart Poettering [Tue, 27 Apr 2021 15:25:51 +0000 (17:25 +0200)]
nspawn: tighten userns UID shift/range checks
Let's add a helper that ensures the UID shift/range parameters actually
fit together.
Lennart Poettering [Tue, 27 Apr 2021 15:00:07 +0000 (17:00 +0200)]
process-util: add option for cloning with CLONE_NEWUSER
This is useful for allocating a userns fd later on for use in idmapped
mounts.
Lennart Poettering [Tue, 27 Apr 2021 14:13:51 +0000 (16:13 +0200)]
mount-util: add helper that ensures something is a mount point
Lennart Poettering [Tue, 27 Apr 2021 13:26:26 +0000 (15:26 +0200)]
nspawn: replace boolean --private-user-chown by enum
This replaces --private-user-chown by an enum value
--private-user-ownership=off|chown. Changes otherwise very little.
This is mostly preparation for a follow-up commit adding a new "map"
mode, using kernel 5.12 UID mapping mounts.
Note that this does alter codeflow a bit: the new enum already knows
three different values instead of the old true/false pair. Besides "off"
and "chown" it knows -EINVAL, i.e. whenever the value wsn't set
explicitly. This value is changed to "off" or "chown" before use, thus
retaining compat to the status quo before, except it won't override
explicit configuration anymore. Thus, if you explicitly request
--private-user=pick you can now combine it wiht an explicit
--private-user-ownership=off if you like, which will give you a
container that runs under its own UID set, but the files will be owned
by the original image. Makes not much sense besids maybe debugging, but
if requested explicitly I think it's OK to implement.
Lennart Poettering [Tue, 27 Apr 2021 12:37:19 +0000 (14:37 +0200)]
nspawn: add high-level option for identity userns mapping
userns identity 1:1 mapping is a pretty useful concept since it isolates
capability sets between containers and hosts, even if it doesn't map
any uid ranges. Let's support it with an explicit concept.
(Note that this is identical to --private-users=0:65536 (which in turn
is identical to --private-users=0), but I think it makes to emphasize
this concept as a high-level one that makes sense to support.)
Lennart Poettering [Thu, 6 May 2021 14:01:44 +0000 (16:01 +0200)]
userdbd: simplify logic for generating NSS listings
So far we basically had two ways to iterate through NSS records: one via
the varlink IPC and one via the userdb.[ch] infra, with slightly
different implementations.
Let's clean this up, and always use userdb.[ch] also when resolving via
userdbd. The different codepaths for the NameServiceSwitch and the
Multiplexer varlink service now differ only in the different flags
passed to the userdb lookup.
Behaviour shouldn't change by this. This is mostly refactoring, reducing
redundant codepaths.
Lennart Poettering [Thu, 6 May 2021 13:51:30 +0000 (15:51 +0200)]
userdb: add new flag for excluding varlink data in lookups
This is useful to later-on use the userdb infra for only some sources.
Lennart Poettering [Thu, 6 May 2021 13:46:30 +0000 (15:46 +0200)]
userdb: rename userdb lookup flags a bit
Let's use "exclude" for flags that really exclude records from our
lookup. Let's use "avoid" referring to concepts that when flag is set
we'll not use but we have a fallback path for that should yield the same
result. Let' use "suppress" for suppressing partial info, even if we
return the record otherwise.
So far we used "avoid" for all these cases, which was confusing.
Whiel we are at it, let's reassign the bits a bit, leaving some space
for bits follow-up commits are going to add.
Marco Antonio Mauro [Fri, 7 May 2021 20:17:25 +0000 (22:17 +0200)]
Added Teclast X4 ACCEL_MOUNT_MATRIX (#19540)
Yu Watanabe [Fri, 7 May 2021 19:13:12 +0000 (04:13 +0900)]
string-util: fix build error on aarch64
This fixes the following error:
```
In file included from ../src/basic/af-list.h:6,
from ../src/basic/af-list.c:7:
../src/basic/string-util.h: In function 'char_is_cc':
../src/basic/string-util.h:133:19: error: comparison is always true due to limited range of data type [-Werror=type-limits]
133 | return (p >= 0 && p < ' ') || p == 127;
| ^~
cc1: all warnings being treated as errors
```
Fixes #19543.
Frantisek Sumsal [Fri, 7 May 2021 15:42:14 +0000 (17:42 +0200)]
test: fix partition check in TEST-58-REPART
Follow-up to
1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd.
Lennart Poettering [Fri, 7 May 2021 15:29:39 +0000 (17:29 +0200)]
Merge pull request #18863 from keszybz/cmdline-escaping
Escape command lines properly
Zbigniew Jędrzejewski-Szmek [Fri, 7 May 2021 15:15:22 +0000 (17:15 +0200)]
Merge pull request #19134 from poettering/outbound-special-hostname
introduce a new synthetic hostname "_outbound" that maps to "the" local IP address
Lennart Poettering [Wed, 5 May 2021 14:06:56 +0000 (16:06 +0200)]
nss-systemd: make llvm work-around for used _cleanup_ explicit
Lennart Poettering [Thu, 6 May 2021 14:41:05 +0000 (16:41 +0200)]
userdbd: reverse which path is a socket and which a symlink
userdbd listens on "two" sockets, that are actually the same: one is a
real AF_UNIX socket in the fs, and the other is a symlink to it.
So far, when userdbd was started from the command line it would make one
a symlink and the other a real socket, but when invoked via unit files
they'd be swapped, i.e. the other would be a symlink and the one a real
socket.
Let's bring this in line.
Since the "io.systemd.Multiplexer" is our main interface, let's make it
the one exposed as socket, and then make "io.systemd.NameServiceSwitch"
a symlink to it. Or in other words, let's adjust the C code to match the
unit file.
Lennart Poettering [Mon, 3 May 2021 16:18:09 +0000 (18:18 +0200)]
fileio: optionally, return discovered path of file in search_and_fopen()
Zbigniew Jędrzejewski-Szmek [Fri, 7 May 2021 13:04:55 +0000 (15:04 +0200)]
Merge pull request #19391 from poettering/dissect-grow
optionally, grow file systems to partition size when mounting them via GPT auto-discovery
Lennart Poettering [Fri, 7 May 2021 09:15:53 +0000 (11:15 +0200)]
Merge pull request #19531 from poettering/nss-systemd-fixes
nss-systemd: two minor fixes
Lennart Poettering [Wed, 5 May 2021 16:57:30 +0000 (18:57 +0200)]
nss-systemd: properly handle empty membership lists
When we are queried for membership lists on a system that has exactly
zero, then we'll return ESRCH immediately instead of at EOF. Which is
OK, but we need to handle this in various places, and not get confused
by it.
Lennart Poettering [Wed, 5 May 2021 07:56:46 +0000 (09:56 +0200)]
string-util: add strextendf() helper, that allows extending some allocated string via a format string
It's not going to be efficient if called in inner loops, but it's oh so
handy, and we have some code that does this:
asprintf(&p, "%s…", b, …);
free(b);
b = TAKE_PTR(p);
which can now be replaced by the quicker and easier to read:
strextendf(&p, "…", …);
Lennart Poettering [Wed, 5 May 2021 12:13:40 +0000 (14:13 +0200)]
nspawn: fix the sections .nspawn settings are placed in
The actual section names are quite different from what the comment so
far suggested. Fix that.
Lennart Poettering [Wed, 5 May 2021 14:05:43 +0000 (16:05 +0200)]
nss-systemd: reset the right field
Lennart Poettering [Thu, 6 May 2021 20:34:53 +0000 (22:34 +0200)]
Merge pull request #19523 from bluca/coredump_meta_fixes
docs/COREDUMP_PACKAGE_METADATA.md: Add debuginfod key
Lennart Poettering [Wed, 5 May 2021 13:32:43 +0000 (15:32 +0200)]
user-util: add generic definition for special password hash values in /etc/passwd + /etc/shadow
Let's add three defines for the 3 special cases of passwords.
Some of our tools used different values for the "locked"/"invalid" case,
let's settle on using "!*" which means the password is both locked *and*
invalid.
Other tools like to use "!!" for this case, which however is less than
ideal I think, since the this could also be a considered an entry with
an empty password, that can be enabled again by unlocking it twice.
Mike Kazantsev [Thu, 6 May 2021 14:15:04 +0000 (19:15 +0500)]
Fix indent prefix being used as a suffix in systemd-analyze dump for some properties
Lennart Poettering [Thu, 6 May 2021 19:54:42 +0000 (21:54 +0200)]
Merge pull request #19527 from poettering/userdb-fixes
various minor userdb fixes
Lennart Poettering [Mon, 3 May 2021 18:06:15 +0000 (20:06 +0200)]
userdb: honour USERDB_AVOID_SHADOW flag also when iterating
Lennart Poettering [Fri, 30 Apr 2021 21:10:10 +0000 (23:10 +0200)]
userdb: fix typo in comment
Lennart Poettering [Fri, 30 Apr 2021 21:09:35 +0000 (23:09 +0200)]
userdb: add missing 'else'
Lennart Poettering [Fri, 30 Apr 2021 21:08:55 +0000 (23:08 +0200)]
userdb: remove unnecesary repeated if check
Lennart Poettering [Fri, 30 Apr 2021 21:08:21 +0000 (23:08 +0200)]
userdb: count NSS records too
Luca Boccassi [Thu, 6 May 2021 13:38:47 +0000 (14:38 +0100)]
docs/COREDUMP_PACKAGE_METADATA.md: add table with well-known keys and their definition
Dimitri John Ledkov [Tue, 4 May 2021 18:15:00 +0000 (19:15 +0100)]
boot/efi: add ARM (THUMB) and RISCV64 machine types
Also drop defines from shared/pe-header.h, appear to be unused.
Mark Wielaard [Thu, 6 May 2021 01:05:02 +0000 (03:05 +0200)]
docs/COREDUMP_PACKAGE_METADATA.md: Add debuginfod key
Signed-off-by: Mark Wielaard <mark@klomp.org>
Yu Watanabe [Thu, 6 May 2021 06:47:01 +0000 (15:47 +0900)]
test: drop default ACL from $TESTDIR
This fixes an issue introduced by the commit
954c77c2510c0328fd98354a59f380945752c38c.
For some reasons, setting default ACL on $TESTDIR makes TEST-29-PORTABLE
fail. Let's drop the default ACL, and set ACL on saved results instead.
Fixes #19519.
Yu Watanabe [Thu, 6 May 2021 04:28:19 +0000 (13:28 +0900)]
test: increase image size when static library or standalone binaries are installed
howl [Tue, 4 May 2021 09:20:23 +0000 (11:20 +0200)]
Unify pn81H3 and cvrLenovoideapadD330-10IGM
D330-10IGM has been added due the fact that 81H3 and 81MD product name belongs to the same product version. So the fact is that now that we know 81MD has the same transformation matrix that the 81H3 we can just use the product version and get rid the product name.
Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Phaedrus Leeds [Thu, 6 May 2021 03:59:29 +0000 (22:59 -0500)]
docs: Fix typos in PORTABLE_SERVICES.md
Yu Watanabe [Wed, 5 May 2021 18:47:58 +0000 (03:47 +0900)]
test: drop log_trace() in test-random-util
It provides almost no inoformation. Moreover, it massively increases
logs, and firefox cannot show the results of Ubuntu CIs due to this.
Yu Watanabe [Thu, 6 May 2021 03:46:13 +0000 (12:46 +0900)]
Merge pull request #19515 from keszybz/config-parser-crash-fix
Fix crashes in config parsing
Yu Watanabe [Thu, 6 May 2021 03:46:00 +0000 (12:46 +0900)]
Merge pull request #19514 from keszybz/return-UnitNameFlags-more
Return UnitNameFlags from unit_name_to_instance()
Yu Watanabe [Thu, 6 May 2021 03:45:05 +0000 (12:45 +0900)]
Merge pull request #19513 from takaswie/topic/ieee1394-hwdb-entries-for-video
hwdb: ieee1394-unit-function: add entries to obsolete existent udev rules for video function
Yu Watanabe [Thu, 6 May 2021 03:44:21 +0000 (12:44 +0900)]
Merge pull request #19507 from nabijaczleweli/bootctlpsko-lite
bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
Frantisek Sumsal [Wed, 5 May 2021 19:07:36 +0000 (21:07 +0200)]
ci: cover standalone/static binaries in build test
Luca Boccassi [Wed, 5 May 2021 21:00:49 +0000 (22:00 +0100)]
Merge pull request #19498 from poettering/mallinfo2
selinux: use mallocinfo2() if it exists
Alyssa Ross [Tue, 4 May 2021 22:05:55 +0000 (22:05 +0000)]
udev: make /dev/vfio/vfio 0666
Quoting Documentation/driver-api/vfio.rst in Linux:
> note that /dev/vfio/vfio provides no capabilities on its own and is therefore
> expected to be set to mode 0666 by the system
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 15:02:49 +0000 (17:02 +0200)]
sd-device: reject empty driver name
If ":" was the last char in the string, we would call access() on ".../drivers/", which
would pass. It probably doesn't matter, but let's reject this anyway.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 14:57:39 +0000 (16:57 +0200)]
sd-device: use memdupa_suffix0() where appropriate
No functional change intended.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 14:49:41 +0000 (16:49 +0200)]
sd-device: do no allocate strings of unknown length on the stack
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33881.
Not only we would duplicate unknown input on the stack, we would do it
over and over. So let's first check that the input has reasonable length,
but also allocate just one fixed size buffer.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 14:44:52 +0000 (16:44 +0200)]
fuzz-journald-kmsg: silence output as usual
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 14:04:29 +0000 (16:04 +0200)]
core: fix crash in BPFProgram parsing
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33270.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 13:51:41 +0000 (15:51 +0200)]
basic/log: use SYNTHETIC_ERRNO in one more place
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 13:41:06 +0000 (15:41 +0200)]
core: use the same pattern for extract_first_word() checks
No functional change, but there is no reason to write it too verbosely
or in different orders.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 13:39:55 +0000 (15:39 +0200)]
core: fix potential crash in BPFProgram=
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 13:38:33 +0000 (15:38 +0200)]
core: fix crash in parsing of SocketBind{Allow,Deny}=
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33876.
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
udev: uaccess: remove ID_FFADO entry
The ID_FFADO environment variable comes from external FFADO project.
Now we have comprehensive and self-contained rules instead of it.
Let's remove it.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: add entry for AV/C device with vendor unique command set
In IEC 61883-1:1998, we can see some values for AV/C device with vendor
unique command set in IEC 61883-1:1998. Current udev rule handles it
for video. However it brings an issue that the functions in AV/C device
are not distinguished just by the content of configuration ROM.
In former commit, hardware database was added to describe function type
of unit in the node, then udev rules are added to utilize the database.
However, we have an request to obsolete existent udev rules by putting
enough entries to the database. It should be done carefully.
This commit adds entry into hardware database just for backward
compatibility. The entry can match to some node and unit unexpectedly.
Therefore this commit modifies existent entries to invalidate the effect
from added entry.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: add entry for AV/C device with generic AV/C command set
Typical node of AV/C device has standard content of configuration ROM.
This is defined in documentation of 1394 Trading Association.
* Configuration ROM for AV/C Devices 1.0 (Dec. 12, 2000, 1394 Trading
Association, TA Document
1999027)
However, it brings an issue that the functions in AV/C device are not
distinguished just by the content of configuration ROM.
In former commit, hardware database was added to describe function type
of unit in the node, then udev rules are added to utilize the database.
However, we have an request to obsolete existent udev rules by putting
enough entries to the database. It should be done carefully.
This commit adds entry into hardware database just for backward
compatibility. The entry can match to some node and unit unexpectedly.
Therefore this commit modifies existent entries to invalidate the effect
from added entry.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: remove entry for Cool Stream iSweet
IIDC specification describes configuration ROM without model field, thus
it's not possible to match any entry with vendor ID and model ID.
Current entry for Cool Stream iSweet can match any node and unit of
IIDC.
This commit removes the entry. I note that this model uses Texus
Instruments MC680-DCC as all-in-one chipset for video function in
IEEE 1394 bus.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: add entries for Point Grey cameras
Point Grey Research, inc. shipped cameras to support IIDC, however some
of them are necessarily compliant to IIDC specification in terms of the
value of software version field in unit directory of configuration ROM.
This commit adds entries for them.
Reviewed-by: Damien Douxchamps <damien@douxchamps.net>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: add IIDC generic entries
Instrumentation & Industrial Digital Camera (IIDC) specifications are
defined by 1394 Trading Association for camera device in IEEE 1394 bus.
IIDC2 specifications are defined by joint working group between Japan
Industrial Imaging Association (JIIA) and 1394 Trade Association as
bus-independent specification.
This commit adds entries for the specifications to remove existent udev
rules. Supported specifications are listed below:
* 1394-based Digital Camera Specification Version 1.04 (Aug. 9, 1996,
1394 Trading Association)
* 1394-based Digital Camera Specification Version 1.20 (Jul. 23, 1998,
1394 Trading Association)
* IIDC Digital Camera Control Specification Ver.1.30 (Jul. 25, 2000,
1394 Trading Association)
* IIDC Digital Camera Control Specification Ver.1.31 (Feb. 2, 2004,
1394 Trading Association, TA Document
2003017)
* IIDC Digital Camera Control Specification Ver.1.32 (Jul. 24, 2008,
1394 Trading Association, Document number
2007009)
* IIDC2 Digital Camera Control Specification Ver.1.0.0 (Jan 26th, 2012,
1394 Trading Association, TS2011001)
* IIDC2 Digital Camera Control Specification Ver.1.1.0 (May 19th, 2015,
1394 Trading Association, TS2015001)
Reviewed-by: Damien Douxchamps <damien@douxchamps.net>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: add entries for Digital Everywhere FloppyDTV and FireDTV
Linux kernel has firedtv kernel module as driver for Digital Everywhere
FloppyDTV and FireDTV. Although this driver works without any help of
userspace application, it's better to add entries to hardware database
for developer's convenience.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: ieee1394-unit-function: fix indentation
Zbigniew Jędrzejewski-Szmek points that current entries are against the
convention of indentation. It should be indented by one space instead of
two.
This commit fixes current entries according to it.
Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fixes:
1b6d9a05b14a ("hwdb: add database entries for models with ASICs in BeBoB solution")
Fixes:
0db0564e957f ("hwdb: add database entries for models with Fireworks board module")
Fixes:
38338b302cb0 ("hwdb: add database entries for models with OXFW970/971 ASICs")
Fixes:
c0d8b61f9385 ("hwdb: add database entries for models based on DICE ASICs with TCAT specification")
Fixes:
a774b5099bce ("hwdb: add database entries for models based on DICE ASICs specialized to M-Audio")
Fixes:
ff1cb7b9393a ("hwdb: add database entries for models based on DICE ASICs specialized to Weiss Engineering")
Fixes:
6f44dddbe20a ("hwdb: add database entries for models based on DICE ASICs specialized by Loud Technologies")
Fixes:
49ed0aad525b ("hwdb: add database entries for models based on DICE ASICs specialized by Harman Music Group")
Fixes:
effbb4024b8b ("hwdb: add database entries for models based on DICE ASICs specialized by Solid State Logic")
Fixes:
4aaa093b5fb6 ("hwdb: add database entries for models of Digidesign Digi 00x family")
Fixes:
c489e7f9d3c4 ("hwdb: add database entries for Tascam FireWire series")
Fixes:
650b8967a57b ("hwdb: add database entries for MOTU FireWire series")
Fixes:
51e9242b9b91 ("hwdb: add database entries for RME Fireface series")
Fixes:
a90a6a9ae9f8 ("hwdb: add database entries for Yamaha mLAN 2nd generation")
Fixes:
41f2d0d393a4 ("hwdb: add database entries for Yamaha mLAN 3rd generation")
Fixes:
1d2ee962922f ("hwdb: add database entries for Focusrite Liquid Mix series")
Fixes:
0c20543835d6 ("hwdb: add database entries for TC Electronic PowerCore FireWire series")
Fixes:
8b4b76dc5021 ("hwdb: add database entry for node with single unit with video function")
Fixes:
12dd2404bee8 ("hwdb: add database entries for node with multiple units")
Fixes:
dece0357e1c8 ("hwdb: add database entries for node with single unit for multiple functions")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Takashi Sakamoto [Wed, 5 May 2021 14:10:29 +0000 (23:10 +0900)]
hwdb: fix parser to execute test for ieee1394-unit-function with no argument
When given no arguments, hwdb parser script seeks test target files by
glob pattern. Although I added a new file for IEEE 1394 unit functions,
the file is excluded as test target due to the pattern.
This commit fixes it.
Fixes:
7713f3fc6a2 ("hwdb: add parser grammar for IEEE 1394 unit function list")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Zbigniew Jędrzejewski-Szmek [Tue, 4 May 2021 17:10:15 +0000 (19:10 +0200)]
basic/time-util: use _cleanup_ in one more place
Zbigniew Jędrzejewski-Szmek [Tue, 4 May 2021 16:40:02 +0000 (18:40 +0200)]
Make unit_name_to_instance() return UnitNameFlags
The function returns non-negative UnitNameFlags on success, and negative
errno on error. In the past we kept the return type as int because of those
negative return values. But nowadays _UNIT_NAME_INVALID == -EINVAL. And if
we tried to actually return something that doesn't fit in the return type,
the compiler would throw an error. By changing to the "real" return type,
we allow the debugger to use symbolic representation for the variables.
наб [Wed, 17 Mar 2021 17:58:07 +0000 (18:58 +0100)]
bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
auto resolves to yes if /etc/machine-id resides on non-tmpfs
This effectively reverts commit
31e57550b552e113bd3d44355b237c41e42beb58
Zbigniew Jędrzejewski-Szmek [Fri, 2 Apr 2021 12:11:10 +0000 (14:11 +0200)]
core,journald: use quoted commandlines
I think quoting is more useful than not quoting. Without, arguments with
whitespace cannot be split correctly.
Unlike in coredump, "normal" quoting is used in those two cases. This output is
mostly for informational purposes, so the more readable quoting seems apropriate.
dbus GetProcesses:
$ busctl --user call org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/run_2dr4450e1ae73944194bb6593fcfd255fbe_2eservice org.freedesktop.systemd1.Service GetProcesses
a(sus) 2
"/user.slice/user-1000.slice/user@1000.service/app.slice/run-r4450e1ae73944194bb6593fcfd255fbe.service" 131494 "/usr/bin/bash -c \"sleep 100; sleep 20\""
"/user.slice/user-1000.slice/user@1000.service/app.slice/run-r4450e1ae73944194bb6593fcfd255fbe.service" 131496 "sleep 100"
Zbigniew Jędrzejewski-Szmek [Fri, 2 Apr 2021 11:52:56 +0000 (13:52 +0200)]
coredump: use "POSIX quotes" for cmdline
$ coredumpctl info |grep Command
Command Line: bash -c kill -SEGV $$ (before)
Command Line: bash -c "kill -SEGV \$\$" (road not taken, C quotes)
Command Line: bash -c $'kill -SEGV $$' (now, POSIX quotes)
Before we wouldn't use any quoting, making it impossible to figure how the
command line was split into arguments. We could use "normal" quotes, but this
has the disadvantage that the commandline *looks* like it could be pasted into
the terminal and executed, but this is not true: various non-printable
characters cannot be expressed in this quoting style. (This is not visible in
this example). Thus, "POSIX quotes" are used, which should allow any command
line to be expressed acurrately and pasted directly into a shell prompt to
reexecute.
I wonder if we should another field in the coredump entry that simply shows the
original cmdline with embedded NULs, in the original /proc/*/cmdline
format. This would allow clients to format the data as they see fit. But I
think we'd want to keep the serialized form anyway, for backwards compatibility.
Zbigniew Jędrzejewski-Szmek [Wed, 3 Mar 2021 14:30:04 +0000 (15:30 +0100)]
man: add an example of coredumpctl output
People like examples. Also shows off the new quoted command line.
Zbigniew Jędrzejewski-Szmek [Thu, 1 Apr 2021 14:46:01 +0000 (16:46 +0200)]
test-process-util: add test that prints all cmdlines
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 23:10:02 +0000 (00:10 +0100)]
basic/process-util: add mode where posix shell escape is used for quoting
The new flag is not used, except in tests, so no functional change yet.
This way, the command as shown can be copied-and-pasted into the shell
in more cases. For simple cases, shell quoting with "" is enough. But
$'' is needed when there are control characters in the command.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Apr 2021 09:44:48 +0000 (11:44 +0200)]
test-process-util: run fewer getpid() tests
Significant time was spent in the getpid() measurement code, which is not very
important. So let's optimize this a bit by running the slower version less
times, and only running both tests a lesser amount of times unless slow tests
are enabled.
This gives the better accuracy then before in slow mode, and still reasonable
accuracy in fast mode without a noticable slowdown.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Apr 2021 09:35:23 +0000 (11:35 +0200)]
test-process-util: add more debug logging but hide most of it by default
It makes little sense to always print the stuff that is fully deterministic
and verified by asserts. It can be opted-in with $SYSTEMD_LOG_LEVEL when
developing the tests or debugging a failure.
Zbigniew Jędrzejewski-Szmek [Tue, 30 Mar 2021 17:42:36 +0000 (19:42 +0200)]
basic/process-util: allow quoting of commandlines
Since the new functionality is controlled by an option, this causes no change
in output yet, except tests.
The login in the old branch of !(flags & PROCESS_CMDLINE_QUOTE) is essentially
unmodified. But there is an important difference in behaviour: instead of
unconditionally reading the whole virtual file, we now read only 'max_columns'
bytes. This makes out code to write process lists quite a bit more efficient
when there are processes with long command lines.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Apr 2021 09:09:09 +0000 (11:09 +0200)]
test-utf8: hide most output by default
Unless one is working on the code, there is little reason to write most
of the output. So let's hide it unless requested with SYSTEMD_LOG_LEVEL=debug.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 10:53:53 +0000 (12:53 +0200)]
basic/escape: allow truncation mode where "…" is always appended
So far we would append "…" or "..." when the string was wider than the specified
output width. But let's add a mode where the caller knows that the string being
passed is already truncated.
The condition for jumping back in utf8_escape_non_printable_full() was
off-by-one. But we only jumped to that label after doing a check with a
stronger condition, so I think it didn't matter. Now it matters because we'd
output the forced ellipsis one column too early.
Zbigniew Jędrzejewski-Szmek [Wed, 5 May 2021 10:41:25 +0000 (12:41 +0200)]
basic/escape: flagsify xescape_full()
Zbigniew Jędrzejewski-Szmek [Thu, 1 Apr 2021 13:23:15 +0000 (15:23 +0200)]
test-fileio: modernization
Zbigniew Jędrzejewski-Szmek [Thu, 1 Apr 2021 13:23:02 +0000 (15:23 +0200)]
basic/fileio: add a mode to read_full_virtual_file() where not the whole file is read
Luca Boccassi [Wed, 5 May 2021 10:38:28 +0000 (11:38 +0100)]
Merge pull request #19505 from jwrdegoede/hwdb-2-accel-quirks
hwdb: Add 2 new accel quirks
Zbigniew Jędrzejewski-Szmek [Wed, 3 Mar 2021 13:56:23 +0000 (14:56 +0100)]
basic/escape: escape control characters, but not utf-8, in shell quoting
The comment in the code said that so far this didn't matter, but I want to use
shell quoting in more places where this will make a difference. So control
characters are now escaped. Normal utf-8 characters are passed through, it
is 2021 after all and pretty much everyone is (or should be) using utf-8.
While touching the code, change 'char *r' → 'char *buf', in line with modern
style.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 10:40:57 +0000 (11:40 +0100)]
basic/string-util: simplify how str_realloc() is used
All callers ignore failure anyway, so let's do that internally.
Zbigniew Jędrzejewski-Szmek [Wed, 3 Mar 2021 13:36:24 +0000 (14:36 +0100)]
basic/string-util: inline iterator variable declarations
Zbigniew Jędrzejewski-Szmek [Wed, 3 Mar 2021 13:35:55 +0000 (14:35 +0100)]
basic/string-util: split out helper function