Yu Watanabe
25e12db5e4
Merge pull request #26650 from yuwata/udev-trigger
...
test: generate debugging logs for udevd after restart
2023-03-06 16:36:34 +09:00
Yu Watanabe
ae9f36397f
Revert "hwdb: fix swapped buttons for Logitech Lift left"
...
This reverts commit 81cfea95e5 .
The modalias seems to match a generic Logitech USB receiver even the
connected mouce is not for left hand.
Fixes #26671 and #26676 .
2023-03-05 14:21:22 +01:00
Yu Watanabe
561f17a1e4
Merge pull request #26668 from yuwata/man-link-rename
...
man: add/update example in systemd.link
2023-03-04 22:14:22 +09:00
Yu Watanabe
181d719542
man: add an example to (re-)apply new settings to a network interface
...
Closes #26601 .
2023-03-04 20:07:56 +09:00
Yu Watanabe
9b7f499ff1
man: sync the default .link file in example
2023-03-04 14:35:01 +09:00
Yu Watanabe
f482e22484
Merge pull request #26653 from poettering/tmpfile-linkable-replace
...
teach link_tmpfile() to optionally replace files
2023-03-04 02:53:59 +09:00
Yu Watanabe
af766bb844
test: trigger new events after all currently queued events are processed
...
Otherwise, udevd may be busy and udevadm may not receive the reply
for the control packet within the time limit.
2023-03-03 23:25:01 +09:00
Yu Watanabe
ff0a9199d4
man: fix doubled word
2023-03-03 23:13:23 +09:00
Yu Watanabe
9f819781ca
time-util: refuse non-zero gmtoff with non-UTC timezone
...
Also this moves the range check for gmtoff to parse_timestamp_impl(), to
address the post-merge comment:
https://github.com/systemd/systemd/pull/26409#discussion_r1118650190
2023-03-03 20:39:19 +09:00
Yu Watanabe
87e0fd575e
time-util: extend comment a bit
2023-03-03 20:39:19 +09:00
Yu Watanabe
8beb47c824
time-util: rename len -> tz_offset
...
And merge parse_timestamp_with_tz() with parse_timestamp_impl().
Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/26409#discussion_r1118647440
2023-03-03 20:39:19 +09:00
Yu Watanabe
ca9c9d8d8e
time-util: fix typo
...
Follow-up for 7a9afae604 .
2023-03-03 20:39:19 +09:00
Yu Watanabe
b66b3c4099
meson: extend timeout for test-time-util
...
The test forks so many child processes, and may hit the default time
limit on slow environment or running with sanitizers.
2023-03-03 20:39:19 +09:00
Yu Watanabe
d8f3ad627c
test: test parse_timestamp() in various timezone
2023-03-03 20:39:10 +09:00
Yu Watanabe
695253466b
meson: show options about tests in the summary
2023-03-03 20:27:44 +09:00
Yu Watanabe
e3b2f7c056
tools: explicitly specify "setup" subcommand
...
As invoking meson without subcommand is deprecated since 0.64.0.
2023-03-03 20:06:30 +09:00
Yu Watanabe
d2ec38e2b2
meson: rename conflicting target names
...
The update-man-rules and update-dbus-docs targets are both declared in the
main meson.build and man/meson.build, so we cannot build the target with
'meson compile' command:
====
$ meson compile update-man-rules
INFO: autodetecting backend as ninja
ERROR: Can't invoke target `update-man-rules`: ambiguous name.Add target type and/or path:
- ./man/update-man-rules:custom
- ./update-man-rules:run
====
Let's rename the targets declared in man/meson.build.
2023-03-03 19:56:38 +09:00
Yu Watanabe
26ab5ea69d
tools: fix the file name that "meson setup" generates
2023-03-03 19:54:38 +09:00
Yu Watanabe
b6b5135e66
test: generate debugging logs for udevd after restart
2023-03-03 19:48:40 +09:00
Yu Watanabe
8677fdc78b
test: clear tzname[] after timezone is changed
...
Fixes the issue reported in fe56f21ae3 .
2023-03-03 19:45:32 +09:00
Yu Watanabe
0b20d70d1c
test: use get_timezones() to iterate all known timezones
2023-03-03 19:45:32 +09:00
Yu Watanabe
11fa81bf77
meson: add missing man rules for new sd-login functions
...
Follow-up for d71f5b1217 ,
c4ef14dc2a , and
d622fefc00 .
2023-03-03 14:38:13 +09:00
Yu Watanabe
e6faa55878
Merge pull request #26578 from thkukuk/main
...
sd-login: add sd_uid_get_login_time interface #26574
2023-02-26 07:54:11 +09:00
Yu Watanabe
9cddd36707
Merge pull request #26574 from YHNdnzj/sd-login-new-interface
...
sd-login: add two interfaces for retriving session info
2023-02-24 09:20:52 +09:00
Yu Watanabe
8b51c41fd0
test: add tests for format_timestamp() and parse_timestamp() with various timezone
2023-02-24 08:55:28 +09:00
Yu Watanabe
7a9afae604
time-util: make parse_timestamp() use the RFC-822/ISO 8601 standard timezone spec
...
If the timezone is specified with a number e.g. +0900 or so, then
let's parse the time as a UTC, and adjust it with the specified time
shift.
Otherwise, if an area has timezone change, e.g.
---
Africa/Casablanca Sun Jun 17 01:59:59 2018 UT = Sun Jun 17 01:59:59 2018 +00 isdst=0 gmtoff=0
Africa/Casablanca Sun Jun 17 02:00:00 2018 UT = Sun Jun 17 03:00:00 2018 +01 isdst=1 gmtoff=3600
Africa/Casablanca Sun Oct 28 01:59:59 2018 UT = Sun Oct 28 02:59:59 2018 +01 isdst=1 gmtoff=3600
Africa/Casablanca Sun Oct 28 02:00:00 2018 UT = Sun Oct 28 03:00:00 2018 +01 isdst=0 gmtoff=3600
---
then we could not determine isdst from the timezone (+01 in the above)
and mktime() will provide wrong results.
Fixes #26370 .
2023-02-24 08:55:27 +09:00
Yu Watanabe
97c5f7ba1f
time-util: drop unnecessary assignment of timezone name
...
As mktime() does not use timezone neme.
2023-02-24 08:55:27 +09:00
Yu Watanabe
a83c1baaeb
time-util: rename variables
...
No functional changes, just refactoring.
2023-02-24 08:55:27 +09:00
Yu Watanabe
1d2c42c5dc
time-util: shorten code a bit
...
No functional change, just refactoring.
2023-02-24 08:55:27 +09:00
Yu Watanabe
db43717e98
time-util: use usec_add() and usec_sub_unsigned()
...
And move the check with USEC_TIMESTAMP_FORMATTABLE_MAX at the end,
as usec_add() can handle overflow correctly.
2023-02-24 08:55:27 +09:00
Yu Watanabe
f2ecfd8bc1
time-util: use result from startswith_no_case()
...
No functional change, just refactoring.
2023-02-24 08:55:27 +09:00
Yu Watanabe
804537bdc4
time-util: do not use strdupa()
...
The input string may come from command line, config files.
2023-02-24 08:55:27 +09:00
Yu Watanabe
17d1ebfc43
time-util: drop redundant else
2023-02-24 08:55:27 +09:00
Yu Watanabe
dff3bddc54
time-util: add assertions
2023-02-24 08:55:27 +09:00
Yu Watanabe
cf98b66d1a
time-util: rename variables
2023-02-24 08:55:27 +09:00
Yu Watanabe
e01a8fdd26
time-util: align string table
2023-02-24 08:55:27 +09:00
Yu Watanabe
d227a42aad
time-util: use DEFINE_STRING_TABLE_LOOKUP_TO_STRING() macro
2023-02-24 08:55:27 +09:00
Yu Watanabe
7464953f33
time-util: drop redundant space
2023-02-24 08:55:27 +09:00
Yu Watanabe
6b04af6072
time-util: drop unused definition of FORMAT_TIMESTAMP_WIDTH
2023-02-24 08:55:27 +09:00
Yu Watanabe
c73676dcbb
man,catalog: fix typo
...
Follow-up for #26448 .
2023-02-24 08:52:42 +09:00
Yu Watanabe
43823dfefd
systemctl: use bus_message_hash_ops
2023-02-23 19:10:00 +00:00
Yu Watanabe
500ecfd513
Merge pull request #26535 from yuwata/systemctl-list-cleanups
...
systemctl-list: several cleanups
2023-02-23 21:38:13 +09:00
Yu Watanabe
e47c426b5c
Merge pull request #26560 from yuwata/journal-send-fix-memleak-and-cleanups
...
sd-journal: several fixlets and cleanups for sd_journal_send()
2023-02-23 21:37:20 +09:00
Yu Watanabe
4de2b47bde
core/dbus-socket: check the socket path is absolute
...
In config_parse_socket_listen(), we have checked the path is absolute,
however we have not in the dbus method.
2023-02-23 21:34:16 +09:00
Yu Watanabe
1b7b956a9b
systemctl: cleanups for list-paths
...
- Rename struct path_info -> PathInfo,
- Drop struct path_infos,
- Use CLEANUP_ARRAY(),
No functional change, just refactoring.
2023-02-23 18:00:38 +09:00
Yu Watanabe
032b3f518c
systemctl: cleanups for list-automounts
...
- Rename struct automount_info -> AutomountInfo,
- use CLEANUP_ARRAY(), and etc.
No functional change, just refactoring.
2023-02-23 18:00:38 +09:00
Yu Watanabe
0e351e9a27
systemctl: cleanups for list-timers
...
- Rename struct timer_info -> TimerInfo,
- use CLEANUP_ARRAY().
No functional change, just refactoring.
2023-02-23 18:00:38 +09:00
Yu Watanabe
1b87606639
systemctl: cleanups for list-sockets
...
- Rename struct socket_info -> SocketInfo.
- Drop own_triggered field, and always copy the triggered field.
- Use CLEANUP_ARRAY().
No functional changes, just refactoring.
2023-02-23 18:00:24 +09:00
Yu Watanabe
1912f790fe
sd-event: fix error handling
...
Follow-up for 6d2326e036 .
2023-02-23 09:27:48 +01:00
Yu Watanabe
f2ccc0d3e1
systemctl-list-units: drop unused return value
2023-02-23 15:13:05 +09:00
Yu Watanabe
eef96911e1
systemctl-list-units: fix memleak on error
2023-02-23 15:13:05 +09:00
Yu Watanabe
5648ebaf40
sd-journal: fix memleak and freeing invalid pointers
...
This also makes
- use GREEDY_REALLOC() or GREEDY_REALLOC0(),
- use CLEANUP_ARRAY() macro.
2023-02-23 15:09:59 +09:00
Yu Watanabe
de5cc016b5
io-util: drop double evaluation in IOVEC_INIT_STRING()
...
This also makes IOVEC_INIT_STRING() and IOVEC_MAKE_STRING() identical.
2023-02-23 15:09:59 +09:00
Yu Watanabe
65e7d565e4
io-util: introduce IOVEC_NULL
2023-02-23 15:09:59 +09:00
Yu Watanabe
752e92615d
test-execute: add test for PrivateNetwork= with/without mount namespacing
2023-02-23 15:09:13 +09:00
Yu Watanabe
c2da3bf237
core/namespace: mount new sysfs when new network namespace is requested
...
Even when a mount namespace is created, previously host's sysfs is used,
especially with RootDirectory= or RootImage=, thus service processes can
still access the properties of the network interfaces in the main network
namespace through sysfs.
This makes, sysfs is remounted with the new network namespace tag, except
when PrivateMounts= is explicitly disabled. Hence, the properties of the
network interfaces in the main network namespace cannot be accessed by
service processes through sysfs.
Fixes #26422 .
2023-02-23 15:09:13 +09:00
Yu Watanabe
277b269e25
core/namespace: introduce a new namespace mount mode PRIVATE_SYSFS
...
This is useful when a service running with a new network namespace.
The mount mode is not used yet, but will be used in a later commit.
2023-02-23 15:09:13 +09:00
Yu Watanabe
10028263fd
core/namespace: rename SYSFS -> BIND_SYSFS
...
No functional change, just preparation for later commits.
2023-02-23 15:09:13 +09:00
Yu Watanabe
f63a2c4821
mount-util: introduce remount_sysfs()
...
This is useful when creating a new network namespace. Unlike procfs,
we need to remount sysfs, otherwise properties of the network interfaces
in the main network namespace are still accessible through the old sysfs,
e.g. /sys/class/net/eth0. All sub-mounts previously mounted on the sysfs
are moved onto the new sysfs mount.
The function will be used in later commits.
2023-02-23 15:09:13 +09:00
Yu Watanabe
2400212128
core/execute: make PrivateMounts= tristate
...
No functional change, just preparation for later commits.
2023-02-23 15:09:13 +09:00
Yu Watanabe
faac56d5d2
core/dbus-util: introduce bus_set_transient_tristate()
...
This will be used in later commits.
2023-02-23 15:09:13 +09:00
Yu Watanabe
ec1b4be82e
bus-util: introduce bus_property_get_tristate()
...
This will be used in later commits.
2023-02-23 15:09:13 +09:00
Yu Watanabe
fde36d2581
core/execute: introduce exec_needs_ipc_namespace() helper function
...
This also fixes a missing condition in exec_runtime_make().
2023-02-23 15:09:13 +09:00
Yu Watanabe
fbbb9697b6
core/execute: introduce exec_needs_network_namespace() helper function
2023-02-23 15:09:13 +09:00
Yu Watanabe
06b3a2f6f0
core/namespace: drop unused field in NamespaceInfo
2023-02-23 15:09:13 +09:00
Yu Watanabe
dcef5e293f
Merge pull request #26555 from poettering/cleanup-array
...
add gcc cleanup attribute based logic to destroy arrays
2023-02-23 15:08:56 +09:00
Yu Watanabe
63b1e67ed9
sd-event: fix error handling
...
Follow-up for 158fe190af .
2023-02-23 11:05:59 +09:00
Yu Watanabe
40c5d5d2a1
sd-event: fix use of uninitialized variable
...
Follow-up for 158fe190af .
Fixes CID#1505670.
2023-02-23 11:05:49 +09:00
Yu Watanabe
c7d941c527
Merge pull request #26557 from poettering/more-cap-utils
...
new helper for cap-list.[ch] + capability-util.[ch]
2023-02-23 10:44:53 +09:00
Yu Watanabe
2457a36d30
Merge pull request #26542 from medhefgo/boot-device-path
...
boot: Misc device path improvements
2023-02-23 10:26:40 +09:00
Yu Watanabe
6d2326e036
sd-event: always initialize sd_event.perturb
...
If the boot ID cannot be obtained, let's first fallback to the machine
ID, and if still cannot, then let's use 0.
Otherwise, no timer event source cannot be triggered.
Fixes #26549 .
2023-02-23 10:11:45 +09:00
Yu Watanabe
b59052be26
systemctl: show "Until:" field only for service and scope units
...
Only service and scope units have RuntimeMaxUSec bus property.
To suppress the "Until:" field for other unit types, the entry must be
initialized with USEC_INFINITY.
Fixes #26473 .
2023-02-22 23:04:43 +09:00
Yu Watanabe
58fbf167d7
Merge pull request #26528 from keszybz/valgrind-simplification
...
Drop the -Dvalgrind configuration option
2023-02-22 23:04:12 +09:00
Yu Watanabe
a2e41b817b
test: add another stress test for devlink creation
2023-02-22 19:08:26 +09:00
Yu Watanabe
60c5bd7759
tree-wide: fix typo
2023-02-22 14:46:19 +09:00
Yu Watanabe
4788f635e3
Merge pull request #26203 from medhefgo/meson
...
meson: Use dicts for test/fuzzer definitions
2023-02-22 10:27:16 +09:00
Yu Watanabe
b5eba967a9
Merge pull request #26529 from medhefgo/boot-misc
...
boot: Misc changes
2023-02-22 10:16:23 +09:00
Yu Watanabe
086234e39b
Merge pull request #26491 from dtardon/list-paths
...
Add systemctl list-paths
2023-02-22 09:29:54 +09:00
Yu Watanabe
a06f85a073
Merge pull request #26527 from mrc0mmand/more-tests
...
test: provide coverage for #26467 and #26483
2023-02-22 08:01:07 +09:00
Yu Watanabe
a2275dcb9d
core/manager: falling back to execute generators without sandboxing
...
When running in a container, like podman, docker or so, creating new mount
namespace may be disabled.
Fixes #26474 .
Fixes RHBZ#2165004 (https://bugzilla.redhat.com/show_bug.cgi?id=2165004 ).
2023-02-21 11:11:03 +01:00
Yu Watanabe
0c2aedb451
tree-wide: use FORK_REARRANGE_STDIO and FORK_CLOSE_ALL_FDS
2023-02-21 07:39:18 +09:00
Yu Watanabe
911f8f0183
process-util: rename FORK_NULL_STDIO -> FORK_REARRANGE_STDIO
...
And make safe_fork_full() takes fds to be assigned to stdio.
2023-02-21 07:37:51 +09:00
Yu Watanabe
e814f8b246
Merge pull request #26506 from keszybz/tiny-cleanups
...
Various trivial cleanups and follow-ups
2023-02-21 06:41:01 +09:00
Yu Watanabe
53b3512f9c
Merge pull request #26499 from mrc0mmand/assorted-tweaks
...
A couple of test tweaks for recent CI fails
2023-02-21 05:55:37 +09:00
Yu Watanabe
135e5a201a
udev-node: make stack_directory_read_one() accept NULL for devnode
...
No functional change, as currently the function is always called with
non-NULL argument. Just a preparation for #26048 or #25839 .
2023-02-20 19:40:31 +09:00
Yu Watanabe
c207a57227
udev-node: drop unnecessary initialization
...
The priority of device node symlink can be negative. So the
initialization is confusing.
Fortunately, this changes no functionality, as we only compare the
priorities of symlinks only when we parsed at least one device node and
its priority.
2023-02-20 10:54:48 +01:00
Yu Watanabe
ced30d69fa
exec-util: use TAKE_FD()
2023-02-19 12:17:52 +09:00
Yu Watanabe
65cd9c7251
exec-util: propagate error in wait_for_terminate_and_check()
...
Then, the two error handlings becomes consistent with the one in
execute_directories().
2023-02-19 12:17:52 +09:00
Yu Watanabe
b9fadf2e2c
process-util: show requested process name in the log
...
This is useful for debugging issues like #26474 .
2023-02-19 12:17:52 +09:00
Yu Watanabe
2421dd7267
loop-util: fix error condition and return value
...
Fixes a bug introduced by da4fd28871 .
2023-02-19 05:20:53 +09:00
Yu Watanabe
ebc19b154c
hashmap: fix build with valgrind
...
Follow-up for a2b052b29f .
2023-02-17 22:56:37 +00:00
Yu Watanabe
d51e31ac41
test-execute: also mount tmpfs on /dev/shm
...
Otherwise, if /dev/shm has a directory that cannot be accessible by
unprivileged user, then we cannot pick a dynamic user, and test service
may fail with unexpected error code:
---
Failed to enter shared memory directory /dev/shm/systemd-watch-bind-BqAGlN: Permission denied
exec-dynamicuser-supplementarygroups.service: Failed to update dynamic user credentials: Device or resource busy
exec-dynamicuser-supplementarygroups.service: Failed at step USER spawning /bin/sh: Device or resource busy
src/test/test-execute.c:885:test_exec_dynamicuser: exec-dynamicuser-supplementarygroups.service: can_unshare=no: exit status 217, expected 216
---
Follow-up for 4e032f654b .
2023-02-17 09:55:05 +01:00
Yu Watanabe
8c2264abb9
cryptsetup: check the existence of salt by salt_size > 0
...
Follow-up for 504d0acf61 .
The function may be called with non-NULL salt and salt_size == 0.
2023-02-17 09:46:25 +01:00
Yu Watanabe
d7e32d0558
test: add tests for xsetxattr()
2023-02-17 11:42:14 +09:00
Yu Watanabe
c56c26c906
test: use mkdtemp_open()
2023-02-17 11:18:49 +09:00
Yu Watanabe
9c9e1ceecc
activate: use _cleanup_close_ attribute
2023-02-17 09:49:51 +09:00
Yu Watanabe
a723521fd2
activate: use log_set_open_when_needed()
...
Otherwise, several error logs may not be shown.
2023-02-17 09:49:51 +09:00
Yu Watanabe
a601e702d5
activate: fix typo
2023-02-17 09:49:51 +09:00
Yu Watanabe
8f3d186549
activate: use DEFINE_MAIN_FUNC() macro
2023-02-17 09:49:51 +09:00
Yu Watanabe
d6467dc604
journalctl: fix fd leak
2023-02-17 09:13:22 +09:00