Zbigniew Jędrzejewski-Szmek
094eecd29d
Merge pull request #12055 from poettering/save-argc-argv
...
main-func.h and systemctl argc/argv improvements
2019-03-22 16:58:18 +01:00
Lennart Poettering
a0c6f3cb66
main-func: make sure we destruct memory and stuff last
...
Let's terminate pagers and agents before releasing all memory.
2019-03-21 18:10:06 +01:00
Lennart Poettering
60ffa37a65
main-func: implicitly save argc/argv in DEFINE_MAIN_FUNCTION() functions
...
Let's remove the risk of forgetting to save argc/argv if
DEFINE_MAIN_FUNCTION() is used.
2019-03-21 18:10:06 +01:00
Yu Watanabe
c4f58deab5
network,udev: split static condition tests from net_match_config()
2019-03-21 23:37:39 +09:00
Yu Watanabe
828fa6108b
condition: introduce condition_test_list()
2019-03-21 23:37:39 +09:00
Lennart Poettering
c3d13d2ad5
Merge pull request #12058 from keszybz/oci-simplifications
...
Follow-ups for nspawn-oci review
2019-03-21 13:55:09 +01:00
Zbigniew Jędrzejewski-Szmek
19130626a0
nspawn-oci: use SYNTHETIC_ERRNO
2019-03-21 10:51:43 +01:00
David Michael
82bd4da71e
shared/install: Preserve escape characters for escaped unit names
...
Since switching to extract_first_word with no flags for parsing
unit names in 4c9565eea5 , escape
characters will be stripped from escaped unit names such as
"mnt-persistent\x2dvolume.mount" resulting in the unit not being
configured as defined. Preserve escape characters again for
compatibility with existing preset definitions.
2019-03-20 18:26:24 +01:00
Lennart Poettering
054b6be05b
ask-password: add extra paranoid overflow check
2019-03-20 10:48:33 +01:00
Lennart Poettering
e1ed99c8c8
ask-password: erase character read with _cleanup_
...
This is much nicer, since it means we erase the character regardless how
we exit the scope.
2019-03-20 10:48:33 +01:00
Zbigniew Jędrzejewski-Szmek
67fb5f338f
seccomp: allow shmat to be a separate syscall on architectures which use a multiplexer
...
After
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817 ,
those syscalls have their separate numbers and we can block them.
But glibc might still use the old ones. So let's just do a best-effort
block and not assume anything about how effective it is.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek
e55bdf9b6c
seccomp: shm{get,at,dt} now have their own numbers everywhere
...
E.g. on i686:
(previously)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmdt) = -222
(now)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmdt) = 398
The relevant commit seems to be
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817 .
2019-03-15 15:28:43 +01:00
Zbigniew Jędrzejewski-Szmek
a75fcef8fb
shared/bootspec: avoid signed-unsigned comparison
...
../src/shared/bootspec.c: In function ‘find_sections’:
../src/shared/bootspec.c:425:23: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
425 | if (n != size)
| ^~
2019-03-15 15:28:43 +01:00
Lennart Poettering
d8b4d14df4
util: split out nulstr related stuff to nulstr-util.[ch]
2019-03-14 13:25:52 +01:00
Lennart Poettering
2b2fec7db0
util: split out errno related stuff
2019-03-14 13:25:51 +01:00
Zbigniew Jędrzejewski-Szmek
94dfd646b3
Merge pull request #11985 from poettering/clean-dir
...
some rafactoring in systemctl/bus-unit-util
2019-03-14 12:21:53 +01:00
Lennart Poettering
d55e43344b
Merge pull request #11971 from keszybz/kernel-install-directory
...
Make kernel-install create entry directory
2019-03-14 10:51:55 +01:00
Lennart Poettering
1b63cc6ea9
bus-unit-procs: use empty_or_root() where appropriate
2019-03-13 17:44:11 +01:00
Lennart Poettering
25b1d72dcc
bus-unit-util: split out code that shows a unit's process tree
...
The code is complex enough to deserve its own .c file. Let's split this
out.
2019-03-13 17:41:41 +01:00
Lennart Poettering
e45c81b8bc
shared: split out code to wait for jobs to complet into its own source file
...
It's complex enough and quite a few functions. Let's hence split this
out.
No code change, just some rearranging of source files.
2019-03-13 17:39:24 +01:00
Lennart Poettering
db7091dca2
bus-unit-util: insist on full initialization
2019-03-13 17:38:43 +01:00
Lennart Poettering
2cdb2c2dc3
bus-unit-util: never call into log_job_error_with_service_result() if we are not a service
...
The call can't handle non-services, hence don't bother.
2019-03-13 17:38:43 +01:00
Lennart Poettering
61e209eb3a
bus-unit-util: move explanations array to inner scope
...
It's specific to service units, hence let's minimize the scope since it
has no validity outside of the log message generation for service units.
2019-03-13 17:38:43 +01:00
Lennart Poettering
190c22189d
bus-unit-util: use structure initialization
2019-03-13 17:38:43 +01:00
Lennart Poettering
1c070ea086
bus-unit-util: use free_and_strdup() where we can
2019-03-13 17:38:43 +01:00
Lennart Poettering
cc5957dca0
bootspec: don't log in boot_entries_load_config_auto() about no ESP
...
Let's do it in the caller instead. That way, logind can stay silent
about it.
Fixes : #11950
2019-03-13 17:06:24 +01:00
Lennart Poettering
760877e90c
util: split out sorting related calls to new sort-util.[ch]
2019-03-13 12:16:43 +01:00
Lennart Poettering
0a9707187b
util: split out memcmp()/memset() related calls into memory-util.[ch]
...
Just some source rearranging.
2019-03-13 12:16:43 +01:00
Lennart Poettering
0cb8e3d118
util: split out namespace related stuff into a new namespace-util.[ch] pair
...
Just some minor reorganiztion.
2019-03-13 12:16:38 +01:00
Lennart Poettering
3cca6cfd41
Merge pull request #11893 from yuwata/wait-online-take-operstate
...
wait-online: optionally take required minimum operational state
2019-03-13 10:10:43 +01:00
Yu Watanabe
2c65512ee7
cryptsetup: add same-cpu-crypt and submit-from-crypt-cpus options
...
Closes #11946 .
2019-03-13 09:48:50 +01:00
Lennart Poettering
05044ebff9
Merge pull request #11933 from keszybz/coverity
...
Minor tweaks to boot/efi code inspired by coverity
2019-03-13 09:36:57 +01:00
Yu Watanabe
e67ae9f5e6
network: move log_link_debug() or friends to log-link.h
2019-03-13 14:29:03 +09:00
Zbigniew Jędrzejewski-Szmek
fb6692ed33
Merge pull request #11927 from poettering/network-namespace-path
...
Add NetworkNamespacePath= to unit files
2019-03-12 14:29:14 +01:00
Zbigniew Jędrzejewski-Szmek
388d2993ec
shared/bootspec: avoid going through -1 when calculating array index
...
Coverity was complaining in CID#1399407 that config->entries might be used
while NULL. Let's add an assert to make sure it's not.
Also, let's quit early if we have no entries to loop through. The code was
not incorrect, but it's cleaner to avoid any negative indices.
2019-03-12 13:32:45 +01:00
Zbigniew Jędrzejewski-Szmek
ec637f309f
Merge pull request #11943 from yuwata/device-action-seqnum-cleanups
...
sd-device: store parsed SEQNUM and ACTION string
2019-03-12 13:17:33 +01:00
Lennart Poettering
995cbd72b2
efivars: make sure efi_loader_entry_name_valid() is always compiled in
...
The string validation should always be done correctly, and not fail just
because EFI is turned off. After all an EFI loader entry name string
remains properly formatted regardless if EFI is on or off...
Fixes : #11948
2019-03-11 21:12:23 +01:00
Yu Watanabe
a707c65b70
util: introduce device_for_action()
...
It will be used in later commits.
2019-03-12 03:49:53 +09:00
Vesa Jääskeläinen
ab212633d4
Fix compilation without EFI being enabled
...
If EFI is disabled compilation can fail with:
../src/login/logind-dbus.c: In function ‘property_get_reboot_to_boot_loader_entry’:
../src/login/logind-dbus.c:2772:29: error: implicit declaration of function ‘efi_loader_entry_name_valid’; did you mean ‘efi_loader_get_features’? [-Werror=implicit-function-declaration]
} else if (!efi_loader_entry_name_valid(v)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
efi_loader_get_features
../src/login/logind-dbus.c:2772:29: warning: nested extern declaration of ‘efi_loader_entry_name_valid’ [-Wnested-externs]
This adds stub for efi_loader_entry_name_valid() to enable compilation.
2019-03-11 10:48:49 +09:00
Lennart Poettering
4ad9fb38a9
run: make sure NetworkNamespacePath= can be used on the systemd-run cmdline
2019-03-07 17:47:29 +01:00
Zbigniew Jędrzejewski-Szmek
ea39de2f9e
systemd-analyze: support cat-config kernel/install.d
...
Extension of f1d9d36ac5 .
2019-03-07 16:34:35 +01:00
Zbigniew Jędrzejewski-Szmek
bd29f9de69
shared/bootspec: do not fail on errors when reading EFI vars
...
It seems that my EFI storage is corrupted. The kernel reports the file as present, but returns
an error when reading. Nevertheless, this shouldn't prevent me from reading the entry
list.
Fixes #11909 .
2019-03-06 22:49:52 +01:00
Zbigniew Jędrzejewski-Szmek
1f18d94215
shared/bootspec: treat empty EFI vars as missing
...
We shouldn't really make any fuss about this. Also, change 'var' to 'variable'
for consistency with systemctl.c.
2019-03-06 22:45:37 +01:00
Zbigniew Jędrzejewski-Szmek
f40999f878
shared/bootspec: minor simplification
2019-03-06 22:21:34 +01:00
Lennart Poettering
13a16a2bb3
json: log about the right line number
...
We mean the line number in the json data, not the line number in our
C source code.
Addresses: https://github.com/systemd/systemd/pull/9762#issuecomment-441183987
2019-03-05 21:10:57 +01:00
Lennart Poettering
eed7210a5c
bootspec: validate bootpsec entry ids before we use them
2019-03-05 16:50:58 +01:00
Lennart Poettering
38bd74d67e
bootspec: get rid of find_default_boot_entry() entirely
...
Now only two operations are left. Let's just move this into the caller,
since it should make things simpler, clearer and shorter, in particular
as there's only a single user for this.
2019-03-05 16:50:58 +01:00
Lennart Poettering
b1a8771996
bootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto()
...
it's pretty much the same code now, hence use it.
2019-03-05 16:50:58 +01:00
Lennart Poettering
eea4ce1ec7
bootspec: introduce new helper boot_entries_load_config_auto()
...
It's a simple wrapper around boot_entries_load_config(), but determines
the ESP/XBOOTLDR paths automatically at first. Also, it looks for a path
/run/boot-loader-entries/ and loads the entries from there if it
exists. This is supposed to be a hook for other boot loaders to make our
tools aware of their own entries.
2019-03-05 16:50:58 +01:00
Lennart Poettering
dba33c4a2c
bootspec: correct error code shown in log msg
2019-03-05 16:50:58 +01:00