Evgeny Vereshchagin
d3cba4eaf6
coredump: really extract container cmdline ( #5167 )
...
Fixes:
```
root# systemd-nspawn -D ./cont/ --register=no /bin/sh -c '/bin/sh -c "kill -ABRT \$\$"'
...
Container cont failed with error code 134.
root# journalctl MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1 -o verbose | grep -i container_cmdline
...prints nothing...
...should be COREDUMP_CONTAINER_CMDLINE=systemd-nspawn -D ./cont/ --register=no /bin/sh -c /bin/sh -c "kill -ABRT \$\$"
```
Also, fixes CID #1368263
```
==352== 130 bytes in 1 blocks are definitely lost in loss record 1 of 2
==352== at 0x4C2ED5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==352== by 0x4ED8581: greedy_realloc (alloc-util.c:57)
==352== by 0x4ECAAD5: get_process_cmdline (process-util.c:147)
==352== by 0x10E385: get_process_container_parent_cmdline (coredump.c:645)
==352== by 0x112949: process_kernel (coredump.c:1240)
==352== by 0x113003: main (coredump.c:1297)
==352==
```
2017-01-31 11:04:20 -05:00
Zbigniew Jędrzejewski-Szmek
aa475dc227
Merge pull request #5168 from ddstreet/apply_format_helper
...
simplify udev_event_apply_format().
2017-01-31 10:56:09 -05:00
Zbigniew Jędrzejewski-Szmek
2c4c08b7e6
Merge pull request #5177 from M0Rf30/master
...
hwdb: quirk for kionix accelerometer on Asus TP500LB
2017-01-31 10:51:56 -05:00
Zbigniew Jędrzejewski-Szmek
fccdf28c86
Merge pull request #5192 from keszybz/systemctl-ignore-sigterm
...
Fix for initrd-switch-root failing and causing emergency.target to be started.
2017-01-31 10:36:30 -05:00
3chas3
877777d776
util-lib: Fix chase_symlinks() with absolute symlinks ( #5185 )
...
If chase_symlinks() encouters an absolute symlink, it resets the todo
buffer to just the newly discovered symlink and discards any of the
remaining previous symlink path. Regardless of whether or not the
symlink is absolute or relative, we need to preserve the remainder of
the path that has not yet been resolved.
2017-01-31 16:21:15 +03:00
Evgeny Vereshchagin
ef1fd941f9
basic: check strdup result in khash_dup ( #5176 )
...
Fixes CID #1368249
2017-01-31 08:27:14 +01:00
Martin Pitt
70d940ec75
Merge pull request #5175 from keszybz/hostname-fallback
...
Allow distributions to override the "localhost" fallback
2017-01-31 08:26:42 +01:00
Zbigniew Jędrzejewski-Szmek
c954f33233
man: mention ConditionFirstBoot= in systemd-firstboot(1) ( #5186 )
2017-01-31 08:25:19 +01:00
Zbigniew Jędrzejewski-Szmek
750e550eba
units: restore Before dependencies for systemd-vconsole-setup.service
...
When the service is run in the initramfs, it is possible for it to get started
and not be fast enough to exit before the root switch happens. It is started
multiple times (depending on the consoles being detected), and runs
asynchronously, so this is quite likely. It'll then get killed by killall(),
and systemd will consider the service failed. To avoid all this, just wait
for the service to terminate on it's own.
Before=initrd-switch-root.target should be good for the initramfs, and
Before=shutdown.tuarget should be good for the real system, although it's
unlikely to make any difference there.
2017-01-31 01:34:40 -05:00
Zbigniew Jędrzejewski-Szmek
8a7a9ceab2
systemctl: ignore SIGTERM after switch root
...
https://bugzilla.redhat.com/show_bug.cgi?id=1414904#c14 and #c15.
2017-01-31 01:34:40 -05:00
Zbigniew Jędrzejewski-Szmek
0af9a194ca
units: drop KillMode= from initrd-switch-root.service
...
The service already has DefaultDeps disabled, so systemd should not try to stop
it. And if it *does* get stopped, we don't want the zombie process around.
KillMode=none does not change anything in the killall() phase, and we already
use argv[0][0] = '@' to protect against that anyway. KillMode=none should not
be useful in normal operation, so let's leave it out.
2017-01-31 01:34:40 -05:00
Zbigniew Jędrzejewski-Szmek
b3ad0ff48c
systemctl: always avoid being killed when doing switch-root
...
The same logic as described in acc28e2e30 applies to any time we are
switching root, to just set the flag unconditionally.
2017-01-31 01:34:40 -05:00
Yi EungJun
3ab2feefd7
journal-gatewayd: return -EINVAL if ARG_TRUST and HAVE_GNUTLS ( #5181 )
...
This bug was introduced by 1aa1e59 .
2017-01-30 18:24:06 +03:00
Ivan Shapovalov
554597a1b2
journal-gatewayd: actually recognize -D as a synonym for --directory ( #5180 )
2017-01-29 22:33:37 +03:00
M0Rf30
e8e4f5d970
hwdb: Asus TP500LB accelerometer support
2017-01-28 23:48:55 +01:00
M0Rf30
6472f5f97f
hwdb: references added to hwdb rules format, needed to write syntax-correctly rules
2017-01-28 23:48:15 +01:00
M0Rf30
baf5e65371
hwdb: use -y option to udevadm trigger to correctly do sysname-match
2017-01-28 13:49:40 +01:00
Zbigniew Jędrzejewski-Szmek
8146c32b92
build-sys,hostnamed: allow distributions to override the "localhost" fallback
...
A configure param is added to make this easy to change if distributions want
to differentiate on that. The default remains unchanged.
https://bugzilla.redhat.com/show_bug.cgi?id=1392925#c10
2017-01-27 23:36:01 -05:00
Zbigniew Jędrzejewski-Szmek
e0afad4b64
configure: use lowercase for "nobody" and "system"
...
No reason to capitalize words which are not names. And "nobody" is
a user name, traditionally lowercase.
2017-01-27 23:18:46 -05:00
Dan Streetman
be45268352
udev-event: use in-place whitespace replacement
...
Instead of using a temp buffer to replace whitespace in variable
substitutions, just allow util_replace_whitespace to replace in-place.
Add a comment to util_replace_whitespace indicating it is used to replace
in-place, to prevent accidental future breakage.
2017-01-27 07:58:00 -05:00
Dan Streetman
0d53705b65
udev-event: refactor udev_event_apply_format
...
Move the large case statement into its own function
2017-01-27 07:58:00 -05:00
llua
644317741a
zsh-completion: _journalctl fixes ( #5165 )
...
allow _journalctl to work when the rcquotes option is set, broken in ba89f80620 .
allow the completion of --file multiple times, which ba89f80620 claims is true.
Fixes #4842
2017-01-27 09:50:40 -03:00
Dan Streetman
9cd7b1287b
tests: add tests for SYMLINK containing whitespace in variable ( #5158 )
...
add udev-test.pl tests for whitespace in a substituted variable,
to verify the variable whitespace is replaced with underscores.
Tests for the change made by commit 0a10235ed4 ("udev-rules:
perform whitespace replacement for symlink subst values")
2017-01-25 20:24:52 -05:00
clearyf
502f826999
hwdb: add Razer DeathAdder Black Edition ( #5157 )
2017-01-25 20:20:17 -05:00
Evgeny Vereshchagin
a27f0651a0
Merge pull request #5152 from keszybz/strv-free
...
Use strv_free where appropriate
2017-01-25 16:31:11 +03:00
Jan Synacek
0067c7b29a
bash-completion: add support for --now ( #5155 )
2017-01-25 07:44:04 -05:00
Zbigniew Jędrzejewski-Szmek
c6d9258220
resolve: fix strv memleak
...
sd_bus_message_read_strv() returns a normal strv...
2017-01-24 22:27:21 -05:00
Zbigniew Jędrzejewski-Szmek
06ec51d8ef
core/execute: fix strv memleak
...
compile_read_write_paths() returns a normal strv from strv_copy(), and
setup_namespace() uses it read-only, so we should use strv_free to deallocate.
2017-01-24 22:26:10 -05:00
Zbigniew Jędrzejewski-Szmek
f0c03de85a
core/dbus: fix two strv memleaks
...
job_dbus_path and unit_dbus_path both allocate new strings, so we should use
strv_free.
2017-01-24 22:21:16 -05:00
Evgeny Vereshchagin
9b531f04fb
core: fix memleak in bus_exec_context_set_transient_property ( #5143 )
...
Fixes:
```sh
systemd-run --property EnvironmentFile=/some/environment/file /bin/sleep 30
```
```
23 bytes in 1 blocks are definitely lost in loss record 1 of 7
at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
by 0x4E85488: malloc_multiply (alloc-util.h:70)
by 0x4E85F19: strjoin_real (string-util.c:252)
by 0x1AF741: bus_exec_context_set_transient_property (dbus-execute.c:1418)
by 0x1A907C: bus_service_set_property (dbus-service.c:330)
by 0x1A66DD: bus_unit_set_properties (dbus-unit.c:1456)
by 0x19CF93: transient_unit_from_message (dbus-manager.c:892)
by 0x19D388: method_start_transient_unit (dbus-manager.c:980)
by 0x4F60544: method_callbacks_run (bus-objects.c:418)
by 0x4F62D9D: object_find_and_run (bus-objects.c:1255)
by 0x4F633CE: bus_process_object (bus-objects.c:1371)
by 0x4F2CE1D: process_message (sd-bus.c:2563)
```
Closes : #5142
2017-01-24 21:53:50 -05:00
Jakub Wilk
ebc0a0b72c
po: Fix invalid date in Croatian translation ( #5147 )
2017-01-24 21:45:58 -05:00
Stefan Schweter
1a012455c2
tree-wide: remove consecutive duplicate words in comments ( #5148 )
2017-01-24 21:45:30 -05:00
Stefan Schweter
ff85f271ca
virt: update url to hypervisor top-level functional specification ( #5149 )
2017-01-24 21:44:59 -05:00
Stefan Schweter
7a84b3fde5
catalog: make support URL to show in shipped catalog entries configurable ( #5150 )
2017-01-24 21:44:19 -05:00
Franck Bui
2d058a87ff
core: don't load dropin data multiple times for the same unit ( #5139 )
...
When an alias is loaded, we resolve this alias to its final unit first to load
the dropin data.
However if the final unit was already loaded, there's no point in reloading the
dropin data a second time.
This patch optimizes this case.
Also this allows the dropin loading code to assume that only units not yet
loaded are passed down. This assumption is not yet used but might be in the
future.
[zj: invert the condition in the if]
2017-01-24 08:29:57 -05:00
peoronoob
a341dfe563
network: accept colons in network interface names, normally used for alias interfaces ( #5117 )
2017-01-23 22:26:41 -05:00
Jan Synacek
7e974e8530
core: improve error message when RefuseManualStart(Stop) is hit ( #5132 )
2017-01-23 22:06:05 -05:00
Michal Sekletar
29e6561f89
load-fragment: fix comment to reflect changes made in 43eb109 ( #5138 )
2017-01-23 21:18:40 -05:00
Lucas Werkmeister
87fe170749
README: document CONFIG_USER_NS requirement for PrivateUsers ( #5140 )
2017-01-23 21:18:07 -05:00
Evgeny Vereshchagin
0b75a95ace
sd-network: fix memleak in dhcp6_lease_set_domains ( #5113 )
...
The simplest way to reproduce:
```diff
diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c
index bd289fa..4e14d8f 100644
--- a/src/libsystemd-network/test-dhcp6-client.c
+++ b/src/libsystemd-network/test-dhcp6-client.c
@@ -286,6 +286,8 @@ static int test_advertise_option(sd_event *e) {
assert_se(optlen == 11);
assert_se(dhcp6_lease_set_domains(lease, optval,
optlen) >= 0);
+ assert_se(dhcp6_lease_set_domains(lease, optval,
+ optlen) >= 0);
break;
case SD_DHCP6_OPTION_SNTP_SERVERS:
```
Fixes:
```
==27369==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 10 byte(s) in 1 object(s) allocated from:
#0 0x7f90e7d21160 in strdup (/lib64/libasan.so.3+0x5a160)
#1 0x7f90e7467f69 in strv_extend src/basic/strv.c:552
#2 0x5612fcc19379 in dhcp6_option_parse_domainname src/libsystemd-network/dhcp6-option.c:399
#3 0x5612fcc1acdf in dhcp6_lease_set_domains src/libsystemd-network/sd-dhcp6-lease.c:225
#4 0x5612fcc06b95 in test_advertise_option src/libsystemd-network/test-dhcp6-client.c:287
#5 0x5612fcc0a987 in main src/libsystemd-network/test-dhcp6-client.c:761
#6 0x7f90e6d46400 in __libc_start_main (/lib64/libc.so.6+0x20400)
SUMMARY: AddressSanitizer: 10 byte(s) leaked in 1 allocation(s).
```
2017-01-23 21:12:58 -05:00
Evgeny Vereshchagin
419eaa8f8d
sd-network: fix memleak in dhcp6_option_parse_domainname ( #5114 )
...
The simplest way to reproduce:
```diff
diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c
index bd289fa..7b0a5ef 100644
--- a/src/libsystemd-network/test-dhcp6-client.c
+++ b/src/libsystemd-network/test-dhcp6-client.c
@@ -168,7 +168,7 @@ static uint8_t msg_advertise[198] = {
0x00, 0x17, 0x00, 0x10, 0x20, 0x01, 0x0d, 0xb8,
0xde, 0xad, 0xbe, 0xef, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x0b,
- 0x03, 0x6c, 0x61, 0x62, 0x05, 0x69, 0x6e, 0x74,
+ 0x01, 0x6c, 0x01, 0x62, 0x00, 0x0a, 0x6e, 0x74,
0x72, 0x61, 0x00, 0x00, 0x1f, 0x00, 0x10, 0x20,
0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
@@ -338,9 +338,7 @@ static int test_advertise_option(sd_event *e) {
assert_se(!memcmp(addrs, &msg_advertise[124], r * 16));
r = sd_dhcp6_lease_get_domains(lease, &domains);
- assert_se(r == 1);
- assert_se(!strcmp("lab.intra", domains[0]));
- assert_se(domains[1] == NULL);
+ assert_se(r == -ENOENT);
r = sd_dhcp6_lease_get_ntp_addrs(lease, &addrs);
assert_se(r == 1);
```
Fixes:
```
=================================================================
==15043==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x7f13c8564160 in strdup (/lib64/libasan.so.3+0x5a160)
#1 0x7f13c7caaf69 in strv_extend src/basic/strv.c:552
#2 0x55f775787230 in dhcp6_option_parse_domainname src/libsystemd-network/dhcp6-option.c:399
#3 0x55f775788b96 in dhcp6_lease_set_domains src/libsystemd-network/sd-dhcp6-lease.c:225
#4 0x55f775774b95 in test_advertise_option src/libsystemd-network/test-dhcp6-client.c:287
#5 0x55f77577883e in main src/libsystemd-network/test-dhcp6-client.c:759
#6 0x7f13c7589400 in __libc_start_main (/lib64/libc.so.6+0x20400)
Direct leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x7f13c8564160 in strdup (/lib64/libasan.so.3+0x5a160)
#1 0x7f13c7caaf69 in strv_extend src/basic/strv.c:552
#2 0x55f775787230 in dhcp6_option_parse_domainname src/libsystemd-network/dhcp6-option.c:399
#3 0x55f775788b96 in dhcp6_lease_set_domains src/libsystemd-network/sd-dhcp6-lease.c:225
#4 0x55f775781348 in client_parse_message src/libsystemd-network/sd-dhcp6-client.c:807
#5 0x55f775781ba2 in client_receive_advertise src/libsystemd-network/sd-dhcp6-client.c:895
#6 0x55f775782453 in client_receive_message src/libsystemd-network/sd-dhcp6-client.c:994
#7 0x7f13c7e447f4 in source_dispatch src/libsystemd/sd-event/sd-event.c:2268
#8 0x7f13c7e471b0 in sd_event_dispatch src/libsystemd/sd-event/sd-event.c:2627
#9 0x7f13c7e47ab3 in sd_event_run src/libsystemd/sd-event/sd-event.c:2686
#10 0x7f13c7e47c21 in sd_event_loop src/libsystemd/sd-event/sd-event.c:2706
#11 0x55f77577863c in test_client_solicit src/libsystemd-network/test-dhcp6-client.c:737
#12 0x55f77577884b in main src/libsystemd-network/test-dhcp6-client.c:760
#13 0x7f13c7589400 in __libc_start_main (/lib64/libc.so.6+0x20400)
SUMMARY: AddressSanitizer: 8 byte(s) leaked in 2 allocation(s).
```
2017-01-23 21:11:59 -05:00
Peter Hutterer
8fb35f79f2
hwdb: mark Wacom touchpads as external ( #5115 )
...
Wacom doesn't have any internal touchpads.
2017-01-23 21:10:33 -05:00
Zbigniew Jędrzejewski-Szmek
f78bada30d
Merge pull request #5112 from yuwata/fix-5105
...
core: add missing unit_add_to_load_queue() to mount_setup_new_unit()
2017-01-23 20:20:13 -05:00
Yu Watanabe
cfcd431890
core: add missing unit_add_to_load_queue() to mount_setup_new_unit()
...
unit_add_to_load_queue was present in the code before 03b8cfede9 ,
and was inadvertently dropped.
Fixes #5105
2017-01-23 14:06:43 +09:00
Yu Watanabe
a51ee72d2e
core: minor error handling fix in mount_setup_new_unit()
...
The function mount_setup_new_unit() should return -ENOMEM
if at least one of `strdup` calls are failed.
2017-01-23 13:59:21 +09:00
Александр Тихонов
88e4dbd505
Fixi caching in zsh completion ( #5122 )
...
I found several issues with zsh completion code:
1. typo in cache filename: "SYS_ALL_PROPRTIES", so cache just not loading from this file
2. cache stored in one file, despite user or system mode. So it can be loaded later in wrong mode
3. most serious problem: broken logic - it retrieves cache when _cache_invalid is true
How to reproduce: type "systemctl --user status <TAB>" and you will see user units. Then press
control+C and type "systemctl --system status <TAB>" in same session and you'll see user units again
2017-01-21 14:53:09 -05:00
Zbigniew Jędrzejewski-Szmek
2feb1c9659
Merge pull request #5126 from namhyung/journalctl-completion
...
bash_completion: Small update for journalctl completion.
2017-01-21 12:48:27 -05:00
Namhyung Kim
28b6b5de3f
bash_completion: journalctl: Complete -t option values
...
The -t or --identifier requires a syslog identifier.
2017-01-21 16:38:23 +09:00
Namhyung Kim
ed52c971bf
bash_completion: journalctl: add missing options
...
The --no-hostname and --vacuum-files were missing, add them.
2017-01-21 16:38:04 +09:00
Rike-Benjamin Schuppner
b03ec00960
man: fix flag in systemd-run ( #5107 )
2017-01-20 03:10:30 +03:00